Memory space allocation method and device, computer equipment, storage medium and computer program product
By acquiring workload characteristics and using a performance prediction model to dynamically adjust the allocation of data in different memory spaces, the problem of low memory allocation efficiency in existing technologies is solved, achieving efficient utilization of memory resources and optimization of system performance.
Patent Information
- Application Number
- CN202511246776.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2026-01-02
AI Technical Summary
Existing memory allocation strategies cannot be dynamically adjusted according to real-time workloads, resulting in low resource utilization. In particular, the increased system complexity after the introduction of CXL memory makes it impossible to efficiently allocate data in different memory spaces.
By acquiring the workload characteristics of the system to be allocated, the performance prediction model is called for processing. Based on the prediction results, the allocation of data in high-efficiency memory and low-efficiency memory space is dynamically adjusted. Hot and cold data are identified by prediction algorithms and heat decay factors, and migration is performed according to preset thresholds. The model is updated in combination with real-time load information.
It achieves precise matching between memory resources and data requirements, improves memory allocation efficiency, reduces waste of high-speed memory resources, and optimizes system performance and cost.
Smart Images

Figure CN121255419A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular to a memory space allocation method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] As data volumes grow, memory costs have become a key factor limiting data center performance. CXL (ComputeExpress Link), as an emerging memory expansion technology, offers a new approach to solving the memory cost problem by providing high-speed, low-latency memory access.
[0003] However, current memory allocation strategies are often based on static configuration and cannot be dynamically adjusted according to real-time workloads, resulting in low resource utilization. The introduction of CXL memory increases system complexity. Current memory allocation methods only consider the layout of data in CXL or DRAM (Dynamic Random Access Memory), and cannot dynamically adjust the allocation of data in different memory spaces according to real-time workloads, thus affecting resource utilization. Therefore, there is currently a problem of low memory space allocation efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide a memory space allocation method, apparatus, computer device, computer-readable storage medium, and computer program product to address the aforementioned technical problem of low memory space allocation efficiency.
[0005] Firstly, this application provides a memory space allocation method, including:
[0006] Obtain the workload characteristics of the first and second memory spaces of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space.
[0007] The performance prediction model is invoked to process the workload characteristics to obtain workload performance prediction results for the first memory space and the second memory space;
[0008] Based on the workload performance prediction results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result.
[0009] In one embodiment, the step of allocating the data to be allocated in the first memory space and the second memory space based on the workload performance prediction result to obtain a memory space allocation result includes: matching a prediction algorithm based on the workload performance prediction result and obtaining the transition matrix and heat decay factor of the prediction algorithm; obtaining the hot and cold calculation results of the data to be allocated based on the transition matrix and the heat decay factor; the hot and cold calculation results are used to characterize the usage frequency of the data to be allocated; and allocating the data to be allocated in the first memory space and the second memory space based on the hot and cold calculation results to obtain the memory space allocation result.
[0010] In one embodiment, the step of allocating the data to be allocated in the first memory space and the second memory space based on the cold and hot calculation results to obtain the memory space allocation result includes: if the cold and hot calculation result is greater than or equal to a preset threshold, migrating the data in the system to be allocated to the first memory space as the memory space allocation result; and if the cold and hot calculation result is less than the preset threshold, migrating the data in the system to be allocated to the second memory space as the memory space allocation result.
[0011] In one embodiment, after the performance prediction model is invoked to process the workload characteristics and obtain the workload performance prediction results for the first memory space and the second memory space, the method further includes: obtaining the workload performance prediction results, and optimizing the layout of the data to be allocated in the first memory space and the second memory space in conjunction with the layout hints of the data to be allocated, to obtain a layout optimization result; the layout hints include at least the attributes of the data to be allocated, the bandwidth of the first memory space, and the bandwidth of the second memory space.
[0012] In one embodiment, after optimizing the layout of the data to be allocated in the first memory space and the second memory space to obtain the layout optimization result, the method further includes: determining the memory space allocation result of the data to be allocated based on the layout optimization result, the workload performance prediction result, and the cost constraint of the data to be allocated.
[0013] In one embodiment, after allocating the data to be allocated in the first memory space and the second memory space based on the workload performance prediction result to obtain the memory space allocation result, the method further includes: collecting real-time workload information of the system to be allocated; and updating the performance prediction model based on the real-time workload information.
[0014] Secondly, this application also provides a memory space allocation device, comprising:
[0015] The data acquisition module is used to acquire the workload characteristics of the first memory space and the second memory space of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space.
[0016] The prediction result acquisition module is used to call the performance prediction model to process the workload characteristics and obtain the workload performance prediction results for the first memory space and the second memory space.
[0017] The allocation result acquisition module is used to allocate the data to be allocated in the first memory space and the second memory space based on the workload performance prediction result, so as to obtain the memory space allocation result.
[0018] Thirdly, this application also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0019] Obtain the workload characteristics of the first and second memory spaces of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space.
[0020] The performance prediction model is invoked to process the workload characteristics to obtain workload performance prediction results for the first memory space and the second memory space;
[0021] Based on the workload performance prediction results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result.
[0022] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0023] Obtain the workload characteristics of the first and second memory spaces of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space.
[0024] The performance prediction model is invoked to process the workload characteristics to obtain workload performance prediction results for the first memory space and the second memory space;
[0025] Based on the workload performance prediction results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result.
[0026] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, performs the following steps:
[0027] Obtain the workload characteristics of the first and second memory spaces of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space.
[0028] The performance prediction model is invoked to process the workload characteristics to obtain workload performance prediction results for the first memory space and the second memory space;
[0029] Based on the workload performance prediction results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result.
[0030] The aforementioned memory space allocation method, apparatus, computer equipment, storage medium, and computer program product, in the memory space allocation process, firstly acquires the workload characteristics of the first and second memory spaces of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space; then, a performance prediction model is invoked to process the workload characteristics, obtaining workload performance prediction results for the first and second memory spaces; finally, based on the workload performance prediction results, the data to be allocated is allocated within the first and second memory spaces to obtain the memory space allocation result. In this process, by acquiring the workload characteristics of two types of memory spaces with different allocation speeds, obtaining performance prediction results based on the performance prediction model, and finally allocating the data to be allocated, the high efficiency advantage of the first memory space can be fully utilized, while the second memory space can be rationally utilized, achieving precise matching between memory resources and data requirements, and effectively improving the efficiency of memory allocation. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a flowchart illustrating a memory space allocation method in one embodiment;
[0033] Figure 2 This is a flowchart illustrating the memory space allocation steps in one embodiment;
[0034] Figure 3This is a flowchart illustrating a memory space allocation method in another embodiment;
[0035] Figure 4 This is a schematic diagram of the architecture of the system to be allocated in one embodiment;
[0036] Figure 5 This is a schematic diagram of a performance prediction model for a memory space allocation method in one embodiment.
[0037] Figure 6 This is a structural block diagram of a memory space allocation device in one embodiment;
[0038] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0040] In data centers, cloud computing platforms, and high-performance computing environments, memory cost, system performance, and resource utilization are key indicators for measuring system efficiency. The explosive growth of data has prompted a breakthrough in the computing industry's architectural transformation, fundamentally changing the performance, efficiency, and cost of data centers. To continue improving performance, servers are increasingly shifting to heterogeneous computing architectures. Data centers face serious memory problems; for example, while the number of cores is rapidly increasing, the memory bandwidth and capacity per core have not increased accordingly, and memory bandwidth has actually decreased, a trend that continues. Simultaneously, expensive memory resources in data centers are often underutilized, especially in cloud computing scenarios where the performance and utilization of virtual machines are crucial. However, research has found that nearly 25% of memory is not allocated, and among virtual machines with allocated memory, the memory vacancy rate reaches 50%, posing a significant challenge to data center costs.
[0041] With the explosive growth of data volume, memory cost has become a key factor restricting the performance and economics of data centers. CXL (Compute Express Link), as an emerging memory expansion technology, offers a new approach to solving the memory cost problem by providing high-speed, low-latency memory access. However, how to perform efficient memory scheduling using CXL-based memory in cloud scenarios has become crucial.
[0042] To address the technical problem of inefficient memory scheduling inherent in CXL-based memory, in an exemplary embodiment, such as... Figure 1As shown, a memory space allocation method is provided, including the following steps S102 to S106. Wherein:
[0043] Step S102: Obtain the workload characteristics of the first memory space and the second memory space of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space.
[0044] Among them, the system to be allocated can be a system that needs to manage data allocation in its internal memory space. It is the object of operation in the entire memory allocation process, and the memory allocation process is completed within this system.
[0045] Optionally, the first memory space is one of two types of memory spaces in the system to be allocated. Compared to the second memory space, it has a faster data allocation speed and is usually a high-performance memory area, such as cache or DRAM (Dynamic Random Access Memory). It can be used to handle tasks or data with high data access speed requirements. The second memory space is another type of memory space in the system to be allocated, which is slower than the first memory space. It is usually a memory area with larger capacity but lower speed, such as CXL (Compute Express Link) or traditional hard disk cache. It can be used to store data with lower access speed requirements but larger storage capacity. Workload characteristics are key attributes used to reflect the working status of the first and second memory spaces, including but not limited to memory utilization, data read / write frequency, and task response latency requirements.
[0046] Step S104: Call the performance prediction model to process the workload characteristics and obtain the workload performance prediction results for the first memory space and the second memory space.
[0047] Among them, the performance prediction model is a data-based analytical model that can take the workload characteristics of the first memory space or the second memory space as input, then perform calculations on the characteristics, and output the workload performance prediction results for the first memory space or the second memory space. The workload performance prediction results are the output of the performance prediction model, which can refer to the performance prediction of the first memory space or the second memory space under future workloads, such as predicting the response speed, throughput, and resource utilization of the first memory space and the second memory space when carrying different amounts of data.
[0048] Step S106: Based on the workload performance prediction results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation results.
[0049] The data to be allocated is the data in the system to be allocated to the first memory space or the second memory space. It can come from task requests within the system or external data inputs. The memory space allocation result is the output of the memory allocation process, which clarifies whether the data to be allocated is specifically allocated to the first memory space or the second memory space, as well as the specific data amount, storage location, and other information allocated to the first and second memory spaces.
[0050] In the above memory space allocation method, the workload characteristics of the first and second memory spaces of the system to be allocated are first obtained; the data allocation speed of the first memory space is greater than that of the second memory space. Then, a performance prediction model is called to process the workload characteristics, obtaining workload performance prediction results for the first and second memory spaces. Finally, based on the workload performance prediction results, the data to be allocated is allocated within the first and second memory spaces to obtain the memory space allocation result. In the above process, by obtaining the workload characteristics of two types of memory spaces with different allocation speeds, obtaining performance prediction results based on the performance prediction model, and finally allocating the data to be allocated, the high efficiency advantage of the first memory space can be fully utilized, while the second memory space can be rationally utilized, achieving a precise match between memory resources and data requirements, and effectively improving the efficiency of memory allocation.
[0051] In one exemplary embodiment, such as Figure 2 As shown, based on the workload performance prediction results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result, including: step S202, matching the prediction algorithm based on the workload performance prediction results, and obtaining the transition matrix and heat decay factor of the prediction algorithm; step S204, obtaining the cold and hot calculation results of the data to be allocated based on the transition matrix and heat decay factor; the cold and hot calculation results are used to characterize the usage frequency of the data to be allocated; step S206, based on the cold and hot calculation results, allocating the data to be allocated in the first memory space and the second memory space to obtain the memory space allocation result.
[0052] Among them, the prediction algorithm is a specific algorithm selected based on the workload performance prediction results, which can be used to accurately calculate the attributes of the data to be assigned; the transition matrix is the core parameter matrix in the prediction algorithm, which can be used to quantify the transition probability of the data to be assigned between different states; the heat decay factor is a parameter in the prediction algorithm used to measure the degree of decay of the data "heat" over time; the hot and cold calculation results are the final quantitative results obtained by combining the prediction of the data state transition based on the transition matrix with the dynamic adjustment of the data heat by the heat decay factor, where hot data corresponds to data with high usage frequency and cold data corresponds to data with low usage frequency.
[0053] In this embodiment, the compatibility between the data attribute calculation tool and the actual memory performance characteristics is ensured by matching the workload performance prediction results with the prediction algorithm; by using the transition matrix and the heat decay factor to generate the hot and cold calculation results of the data to be allocated, the usage frequency of the data to be allocated can be dynamically and quantitatively identified; and then, based on the hot and cold results, the data is matched to different memory spaces, which can improve the efficiency of data allocation and memory space utilization.
[0054] In one embodiment, based on the cold / hot calculation results, the data to be allocated is allocated within a first memory space and a second memory space to obtain a memory space allocation result, including:
[0055] If the cold / hot calculation result is greater than or equal to a preset threshold, the data in the system to be allocated is migrated to the first memory space as the memory space allocation result; if the cold / hot calculation result is less than the preset threshold, the data in the system to be allocated is migrated to the second memory space as the memory space allocation result.
[0056] The numerical values of the hot and cold calculation results can represent cold and hot data respectively. The higher the value, the more frequently the data to be allocated is accessed, indicating that it is hot data; the lower the value, the less frequently the data is accessed, indicating that it is cold data. The preset threshold is a pre-set critical value used to classify the hot and cold attributes of data. Data migration is the process of moving the data to be allocated from its current storage location to the target memory space based on the comparison between the hot and cold calculation results and the preset threshold. This includes the process of moving the data to be allocated from the current storage location to the target memory space, including the first memory space and the second memory space. The memory space allocation result refers to the final result after the data migration is completed, which determines whether the data to be allocated is stored in the first memory space or the second memory space. This result may include the correspondence between the data to be allocated and the target memory space, the actual occupancy of each memory space, and other information.
[0057] In this embodiment, the hot and cold attributes of the data to be allocated are divided by a preset threshold. Hot data is migrated to a high-speed first memory space and cold data is migrated to a suitable second memory space. This not only ensures efficient access to hot data but also avoids waste of high-speed memory resources, achieving a precise match between memory space and data requirements.
[0058] Furthermore, in one embodiment, after processing the workload characteristics using the performance prediction model to obtain the workload performance prediction results for the first memory space and the second memory space, the method further includes:
[0059] Obtain the workload performance prediction results, and combine them with the layout hints of the data to be allocated to optimize the layout of the data to be allocated in the first memory space and the second memory space to obtain the layout optimization results; the layout hints include at least the attributes of the data to be allocated, the bandwidth of the first memory space, and the bandwidth of the second memory space.
[0060] The workload performance prediction result refers to the performance prediction result of the two types of memory spaces obtained after processing the workload characteristics of the first and second memory spaces through the performance prediction model; the layout hints for the data to be allocated can be a set of key information to guide the reasonable layout of the data to be allocated in the two types of memory spaces; the attributes of the data to be allocated are the core components of the layout hints, which can be the key characteristics of the data to be allocated itself, including but not limited to data size and data type; the bandwidth of the first memory space is an indicator reflecting the hardware capability of the first memory space, referring to the amount of data that the first memory space can transmit per unit time; the bandwidth of the second memory space is an indicator reflecting the hardware capability of the second memory space, referring to the amount of data that the second memory space can transmit per unit time.
[0061] More specifically, the layout optimization of the data to be allocated is a process of optimizing the initial layout scheme of the data to be allocated (e.g., allocating only according to the performance prediction results) by combining the workload performance prediction results with the layout hints of the data to be allocated; the layout optimization result is the output of the layout optimization process, which clarifies the specific layout scheme of the data to be allocated in the first memory space and the second memory space.
[0062] In this embodiment, by combining the workload performance prediction results with layout hints including data attributes and two types of memory bandwidth, the data layout is optimized. This ensures that data requirements and memory performance are accurately matched, avoids the waste of memory resources, and improves the rationality of the data storage space to be allocated and the efficiency of memory allocation.
[0063] In an exemplary embodiment, after optimizing the layout of the data to be allocated in the first memory space and the second memory space to obtain the layout optimization result, the method further includes:
[0064] Based on the layout optimization results, workload performance prediction results, and cost constraints of the data to be allocated, the memory space allocation results of the data to be allocated are determined.
[0065] The cost constraint of the data to be allocated can refer to the restrictions on cost expenditures during the storage of the data to be allocated, including but not limited to the hardware procurement cost and maintenance cost of the memory space corresponding to the data to be allocated.
[0066] In this embodiment, a data allocation scheme is determined by comprehensively optimizing the layout, predicting performance, and constraining costs. This ensures both the performance adaptability and reasonable layout of data storage, while controlling cost expenditures, thus achieving multiple objectives such as efficient utilization of memory resources, stable system performance, and controllable economic costs.
[0067] More specifically, in one embodiment, after allocating the data to be allocated within the first and second memory spaces based on workload performance prediction results to obtain memory space allocation results, the method further includes:
[0068] Collect real-time workload information of the systems to be assigned; update the performance prediction model based on the real-time workload information.
[0069] The real-time workload information of the system to be allocated can be dynamic data collected in real time during the operation of the system to be allocated, reflecting the current working status of the memory space, including but not limited to the real-time utilization rate, response latency and bandwidth utilization of the first memory space and the second memory space; updating the performance prediction model can be the process of adjusting and optimizing the parameters, algorithm logic or training data of the original performance prediction model using the collected real-time workload information.
[0070] In this embodiment, by collecting the workload information of the system to be allocated in real time and updating the performance prediction model, the performance prediction model can dynamically adapt to the changes of the system to be allocated, while also ensuring the accuracy of the performance prediction results, providing a reliable basis for continuously optimizing the memory allocation strategy.
[0071] This application provides a memory space allocation method. To better understand the process of the above memory space allocation method, combined with... Figure 3 As shown, the following details the specific process of a memory space allocation method in this application, including the following steps:
[0072] Step S302: Input workload characteristics. Receive workload characteristics input by the user, including information such as data structure, access frequency, and computational load.
[0073] Step S304: Construct a performance prediction model. Based on the input workload characteristics, construct a white-box performance prediction model.
[0074] Specifically, by analyzing the hardware performance characteristics of CXL memory and DRAM, an accurate performance prediction model is constructed as shown below. This model can take into account factors such as memory access frequency, data structure size and cache hit rate to achieve accurate prediction of workload performance.
[0075]
[0076] in, Total memory access time. and DRAM and CXL access latency; R is the ratio of DRAM to CXL access.
[0077]
[0078] in, cycles per instruction For CPI under cache hit, (where MP and BF are the LLC miss rate, and MP and BF are the delay penalties after a miss).
[0079]
[0080] in, Freq represents the execution time of each instruction, and Freq represents the CPU clock frequency.
[0081] Step S306, data layout optimization: Based on the performance prediction results and combined with data layout hints, optimize the layout of data between CXL and DRAM.
[0082] Data layout cues guide the rational allocation of data between CXL and DRAM. By optimizing data layout, unnecessary memory accesses are reduced, lowering performance overhead.
[0083] An access pattern prediction algorithm based on Markov chains is proposed, wherein the Markov memory state transition matrix is:
[0084]
[0085] The heat decay factor is:
[0086]
[0087] The formula for calculating the hot and cold data blocks is:
[0088] Hotness= Σ [P i → j *α t j - t i * size j ]
[0089] Through the above process, the memory ratio of CXL to DRAM can be dynamically adjusted according to real-time workload requirements and cost constraints, thereby achieving optimal resource allocation.
[0090] More specifically, the migration decision formula is as follows: migrate to DRAM when Hotness > θ_hot; degrade to CXL when Coldness = 1 - Hotness > θ_cold; the threshold θ is dynamically adjusted through online learning: Δθ = η * (Perf_pred - Perf_actual).
[0091] Step S308: Dynamic resource configuration. Based on performance prediction and data layout optimization results, dynamically adjust the memory ratio of CXL and DRAM to achieve optimized resource configuration.
[0092] Specifically, by combining data layout hints, intelligent layout of data to be allocated between CXL and DRAM is achieved. The layout optimization algorithm considers factors such as data structure characteristics, access patterns, and memory hierarchy. By adjusting the distribution of data in memory, unnecessary memory accesses are reduced, thereby lowering performance overhead. In addition, based on the performance prediction model and data layout optimization results, dynamic optimization configuration of CXL and DRAM resources is also achieved. The resource allocation strategy can be expressed as:
[0093]
[0094] in, P represents the resource allocation result, L represents the performance prediction result, C represents the optimized data layout, and C represents the cost constraint.
[0095] Step S310: Monitor system performance and continuously optimize the performance prediction model. Monitor the system's operating status in real time, collect performance data for training and validation of the performance prediction model; based on the monitoring data, continuously optimize the performance prediction model to improve prediction accuracy and system performance.
[0096] Through the above embodiments, the hardware performance characteristics of CXL memory and DRAM are analyzed in depth, and an accurate performance prediction model is constructed. This model considers factors such as memory access frequency, data structure size, and cache hit rate to achieve accurate workload performance prediction. Combined with data layout hints, it guides the rational allocation of data between CXL and DRAM. By optimizing the data layout, unnecessary memory accesses are reduced, lowering performance overhead. Based on the performance prediction model, dynamic optimization of resource allocation is achieved, automatically adjusting the memory ratio of CXL and DRAM according to real-time workload requirements to achieve the optimal balance between cost and performance.
[0097] Furthermore, such as Figure 4The diagram illustrates the system architecture of the system to be allocated in one embodiment, including: a performance prediction module responsible for building a performance prediction model and performing performance prediction based on the input workload characteristics (Profiling); a memory placement optimization module that guides the optimization of data placement between CXL and DRAM based on the performance prediction results; a memory configuration module that dynamically optimizes the configuration of CXL and DRAM resources based on the performance prediction and memory placement optimization results; and a monitoring and feedback module that monitors the system's operating status in real time, collects performance data, provides training and validation data for the performance prediction model, and enables continuous optimization of the model.
[0098] More, such as Figure 5 The figure shows a performance prediction model that includes LLC cache misses (when the CPU cannot find the required data or instruction in the last level cache (LLC), and therefore needs to read the data from main memory, which increases the CPU wait time), data structure access frequency, and memory-level parallelism.
[0099] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0100] Based on the same inventive concept, this application also provides a memory space allocation apparatus for implementing the memory space allocation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more memory space allocation apparatus embodiments provided below can be found in the limitations of the memory space allocation method described above, and will not be repeated here.
[0101] In one exemplary embodiment, such as Figure 6 As shown, a memory space allocation device is provided, including: a data acquisition module 601, a prediction result acquisition module 602, and an allocation result acquisition module 603, wherein:
[0102] The data acquisition module 601 is used to acquire the workload characteristics of the first memory space and the second memory space of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space.
[0103] The prediction result acquisition module 602 is used to call the performance prediction model to process the workload characteristics and obtain the workload performance prediction results for the first memory space and the second memory space.
[0104] The allocation result acquisition module 603 is used to allocate the data to be allocated in the first memory space and the second memory space based on the workload performance prediction result, so as to obtain the memory space allocation result.
[0105] Furthermore, in one embodiment, the allocation result acquisition module 603 is also used to match the prediction algorithm based on the workload performance prediction result and obtain the transition matrix and heat decay factor of the prediction algorithm; obtain the hot and cold calculation results of the data to be allocated based on the transition matrix and heat decay factor; the hot and cold calculation results are used to characterize the usage frequency of the data to be allocated; based on the hot and cold calculation results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result.
[0106] Furthermore, in one embodiment, the allocation result acquisition module 603 is also used to migrate the data in the system to be allocated to the first memory space as the memory space allocation result when the cold and hot calculation result is greater than or equal to a preset threshold; and to migrate the data in the system to be allocated to the second memory space as the memory space allocation result when the cold and hot calculation result is less than the preset threshold.
[0107] Furthermore, in one embodiment, the prediction result acquisition module 602 is also used to acquire the workload performance prediction result, and optimize the layout of the data to be allocated in the first memory space and the second memory space in combination with the layout hints of the data to be allocated, to obtain the layout optimization result; the layout hints include at least the attributes of the data to be allocated, the bandwidth of the first memory space and the bandwidth of the second memory space.
[0108] Furthermore, in one embodiment, the prediction result acquisition module 602 is also used to determine the memory space allocation result of the data to be allocated based on the layout optimization result, the workload performance prediction result, and the cost constraint of the data to be allocated.
[0109] Furthermore, in one embodiment, the allocation result acquisition module 603 is also used to collect real-time workload information of the system to be allocated; and update the performance prediction model based on the real-time workload information.
[0110] Each module in the aforementioned memory space allocation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0111] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores memory space allocation data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a memory space allocation method.
[0112] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0113] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0114] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0115] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0116] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0117] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0118] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A memory space allocation method, characterized in that, The method includes: Obtain the workload characteristics of the first and second memory spaces of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space. The performance prediction model is invoked to process the workload characteristics to obtain workload performance prediction results for the first memory space and the second memory space; Based on the workload performance prediction results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result.
2. The method according to claim 1, characterized in that, Based on the workload performance prediction result, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result, including: The prediction algorithm is matched based on the workload performance prediction results, and the transition matrix and heat decay factor of the prediction algorithm are obtained. Based on the transition matrix and the heat decay factor, the cold and hot calculation results of the data to be allocated are obtained; the cold and hot calculation results are used to characterize the usage frequency of the data to be allocated. Based on the cold and hot calculation results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result.
3. The method according to claim 2, characterized in that, Based on the cold and hot calculation results, the data to be allocated is allocated in the first memory space and the second memory space to obtain the memory space allocation result, including: If the cold and hot calculation result is greater than or equal to a preset threshold, the data in the system to be allocated is migrated to the first memory space as the memory space allocation result; If the cold / hot calculation result is less than a preset threshold, the data in the system to be allocated is migrated to the second memory space as the memory space allocation result.
4. The method according to claim 1, characterized in that, After processing the workload characteristics using the invoking performance prediction model to obtain workload performance prediction results for the first memory space and the second memory space, the method further includes: The workload performance prediction result is obtained, and the layout of the data to be allocated in the first memory space and the second memory space is optimized in combination with the layout hint of the data to be allocated, so as to obtain the layout optimization result; the layout hint includes at least the attributes of the data to be allocated, the bandwidth of the first memory space and the bandwidth of the second memory space.
5. The method according to claim 4, characterized in that, After optimizing the layout of the data to be allocated in the first memory space and the second memory space to obtain the layout optimization result, the method further includes: Based on the layout optimization results, the workload performance prediction results, and the cost constraints of the data to be allocated, the memory space allocation results of the data to be allocated are determined.
6. The method according to claim 1, characterized in that, After allocating the data to be allocated in the first memory space and the second memory space based on the workload performance prediction result, and obtaining the memory space allocation result, the method further includes: Collect real-time workload information of the systems to be assigned; The performance prediction model is updated based on the real-time workload information.
7. A memory space allocation device, characterized in that, The device includes: The data acquisition module is used to acquire the workload characteristics of the first memory space and the second memory space of the system to be allocated; the data allocation speed of the first memory space is greater than that of the second memory space. The prediction result acquisition module is used to call the performance prediction model to process the workload characteristics and obtain the workload performance prediction results for the first memory space and the second memory space. The allocation result acquisition module is used to allocate the data to be allocated in the first memory space and the second memory space based on the workload performance prediction result, so as to obtain the memory space allocation result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.