Method and device for managing multi-layer memory, storage medium and electronic device

CN121957911BActive Publication Date: 2026-06-26JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-06-26

Smart Images

  • Figure CN121957911B_ABST
    Figure CN121957911B_ABST
Patent Text Reader

Abstract

The application discloses a kind of management methods and devices of multilayer memory, storage medium and electronic equipment, it is related to memory management technical field, comprising: the reference information set corresponding to storage device is used to predict the predicted frequency set of storage device, storage device includes first memory and second memory, the first delay of first memory is less than the second delay of second memory;Determine the multiple target sub data that target data of storage device contains, and determine the predicted access frequency corresponding to each target sub data based on the predicted frequency set;In the case where the predicted access frequency corresponding to each target sub data meets preset splitting condition, target data is split into multiple target sub data;The target sub data of predicted access frequency greater than frequency threshold is stored to first memory, and the target sub data of predicted access frequency less than frequency threshold is stored to second memory.The technical problem that resource utilization rate is lower in the memory management method in related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of memory management, and more particularly to a multi-layer memory management method and apparatus, storage medium and electronic device. Background Technology

[0002] With the development of hardware technology, modern computer architectures have introduced multi-level memory designs, including CPU-local DRAM, remote node DRAM, persistent memory (PMEM), and memory resources connected via high-speed interconnect technologies such as CXL (Compute Express Link). This hierarchical memory system aims to balance data access speed and storage cost, where fast memory (such as CPU-local DRAM) provides high-speed access, while slower memory (such as persistent memory or remote DRAM) provides larger capacity and lower cost.

[0003] Predicting and managing memory access patterns is crucial for optimizing memory usage and improving system performance. Related technologies utilize larger memory pages (e.g., 2MB pages) to reduce address translation overhead and improve TLB hit rate, thereby accelerating data access. However, because large pages cover more smaller pages, a single large page may contain multiple sets of hot and cold data. When using large page mapping, the system struggles to distinguish which parts are truly active "hot data" and which are infrequently accessed "cold data." This ambiguous hotspot identification limits the system's ability to accurately migrate hot data to fast memory and cold data to slow memory. In other words, memory management methods in related technologies suffer from low resource utilization. Summary of the Invention

[0004] This application provides a multi-layer memory management method and apparatus, storage medium and electronic device, to at least solve the problem of low resource utilization in memory management methods in related technologies.

[0005] This application provides a multi-layer memory management method, comprising: predicting a set of predicted frequencies for the storage device using a set of reference information corresponding to the storage device, wherein the storage device includes a first memory and a second memory, and the first latency of the first memory is less than the second latency of the second memory; determining multiple target sub-data contained in the target data of the storage device, and determining the predicted access frequency corresponding to each of the multiple target sub-data based on the set of predicted frequencies; splitting the target data into multiple target sub-data when the predicted access frequencies corresponding to each of the multiple target sub-data satisfy a preset splitting condition; storing the target sub-data with a predicted access frequency greater than a frequency threshold in the first memory, and storing the target sub-data with a predicted access frequency less than a frequency threshold in the second memory.

[0006] This application also provides a multi-layer memory management device, comprising: a prediction frequency module, configured to predict a set of predicted frequencies for the storage device using a set of reference information corresponding to the storage device, wherein the storage device includes a first memory and a second memory, and the first latency of the first memory is less than the second latency of the second memory; a frequency determination module, configured to determine multiple target sub-data contained in the target data of the storage device, and determine the predicted access frequency corresponding to each of the multiple target sub-data based on the prediction frequency set; a data splitting module, configured to split the target data into multiple target sub-data when the predicted access frequencies corresponding to each of the multiple target sub-data satisfy a preset splitting condition; and a tiered storage module, configured to store the target sub-data with a predicted access frequency greater than a frequency threshold in the first memory, and store the target sub-data with a predicted access frequency less than a frequency threshold in the second memory.

[0007] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing any of the above-described multi-level memory management methods when executing the computer program.

[0008] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described multi-level memory management methods.

[0009] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described multi-level memory management methods.

[0010] This application utilizes a reference information set corresponding to the storage device to predict the predicted frequency set of the storage device. The storage device includes a first memory and a second memory, where the first memory has a lower latency than the second memory. The application identifies multiple target sub-data items contained in the target data of the storage device and determines the predicted access frequency of each sub-data item based on the predicted frequency set. If the predicted access frequencies of the sub-data items meet preset splitting conditions, the target data is split into multiple sub-data items. Target sub-data items with predicted access frequencies greater than a frequency threshold are stored in the first memory, while those with predicted access frequencies less than the frequency threshold are stored in the second memory. By using the reference information set corresponding to the storage device to predict the predicted frequency set, the application can dynamically assess changes in data access demands. This method allows the system to adjust the distribution of data between the first and second memory in real time based on the prediction results, ensuring that hot data (high access frequency) is located in fast memory, while cold data (low access frequency) is allocated to slow memory. This dynamic optimization helps maintain system performance stability and resource utilization efficiency under different loads. The system can more intelligently identify which data is worth migrating. This avoids blindly migrating all large pages of data to fast memory, reduces unnecessary page table updates, and thus lowers memory management overhead. Therefore, it can solve the problem of low resource utilization in memory management methods in related technologies. Attached Figure Description

[0011] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the 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.

[0012] Figure 1 This is a schematic diagram of the hardware environment for an optional multi-level memory management method according to an embodiment of this application;

[0013] Figure 2 This is a flowchart of an optional multi-level memory management method according to an embodiment of this application;

[0014] Figure 3 This is a schematic diagram of an optional multi-level memory management method according to an embodiment of this application;

[0015] Figure 4 This is a schematic diagram of another optional multi-level memory management method according to an embodiment of this application;

[0016] Figure 5 This is a structural block diagram of an optional multi-level memory management device according to an embodiment of this application. Detailed Implementation

[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0018] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0019] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] According to one aspect of the embodiments of this application, a multi-level memory management method is provided. As an optional implementation, the above-described multi-level memory management method can be applied to, but is not limited to, [examples of other methods]. Figure 1 The illustrated hardware environment includes a multi-layered memory management system. This multi-layered memory management system may include, but is not limited to, terminal device 102, network 110, server 112, and database 114. Terminal device 102 runs a target client (e.g., ...). Figure 1 As shown, taking the target client as an example of a client that can access the server. The terminal device 102 includes a display 108, a processor 106, and a memory 104. The display 108 can be used to display the system interface, and also to provide a human-computer interaction interface to receive human-computer interaction operations on the interface and touch operations on different controls. The processor is used to generate interaction instructions in response to the above-mentioned human-computer interaction operations and send the interaction instructions to the server. The memory is used to store system files.

[0021] In addition, server 112 includes a processing engine 116, which is used to perform store or read operations on database 114. Specifically, processing engine 116 reads data from database 114.

[0022] Assumption Figure 1The terminal device 102 runs a client for accessing the server. The specific process of this embodiment is as follows: As in step S102, the terminal device 102 receives a reference information set from the server 112 through the network 110. The server 112 executes steps S104-S110, using the reference information set corresponding to the storage device to predict the predicted frequency set of the storage device, wherein the storage device includes a first memory and a second memory, and the first latency of the first memory is less than the second latency of the second memory; it determines that the target data of the storage device contains multiple target sub-data, and determines the predicted access frequency corresponding to each of the multiple target sub-data based on the predicted frequency set; if the predicted access frequency corresponding to each of the multiple target sub-data satisfies the preset splitting condition, it splits the target data into multiple target sub-data; it stores the target sub-data with a predicted access frequency greater than the frequency threshold in the first memory, and stores the target sub-data with a predicted access frequency less than the frequency threshold in the second memory.

[0023] Terminal device 102 may execute the aforementioned multi-tiered memory management method via a central processing unit (CPU) or operating system. Servers are typically equipped with various types of memory resources, including fast but expensive DRAM, persistent NVM, and remote memory connected via CXL or similar protocols.

[0024] Optionally, in this embodiment, the terminal device 102 can be a terminal device configured with a target client, which may include, but is not limited to, at least one of the following: mobile phone (such as Android phone, iOS phone, etc.), laptop computer, tablet computer, PDA, MID (Mobile Internet Devices), PAD, desktop computer, smart TV, etc. The target client can be a client that supports generating text responses. The network may include, but is not limited to, wired networks and wireless networks, wherein the wired network includes: local area network, metropolitan area network, and wide area network, and the wireless network includes: Bluetooth, WIFI, and other networks that enable wireless communication. The server may be a single server, a server cluster composed of multiple servers, or a cloud server. The above is merely an example, and no limitation is made in this embodiment.

[0025] The application scenarios of the solution in this application are not limited to the above examples. The method of this application can be used in any dialogue system or question-and-answer system.

[0026] The embodiments of this application provide a multi-level memory management method. Figure 2 This is a flowchart of an optional multi-level memory management method according to an embodiment of this application; as follows: Figure 2 As shown, this multi-level memory management method includes:

[0027] Step S202: The predicted frequency set of the storage device is obtained by using the reference information set corresponding to the storage device. The storage device includes a first memory and a second memory. The first delay of the first memory is less than the second delay of the second memory.

[0028] It's important to note that in a computing system, storage devices refer to any hardware device capable of storing data. In this scenario, it primarily refers to different levels of memory, such as primary memory (fast memory, like DRAM) and secondary memory (slow memory, such as NVM, remote DRAM, or memory connected via CXL). The reference information set refers to collected historical data and statistical information used to analyze and predict data access patterns on the storage device. This includes data such as access frequency, recent access time, and access interval. The predicted frequency set is a set of predictions about the future access frequency of data on the storage device, obtained by analyzing the reference information set and using predictive algorithms. These predictions reflect the likelihood of data becoming a hotspot or a coldspot. Primary memory access latency is typically shorter, indicating faster data read / write speeds. Secondary memory access latency is typically longer, indicating slower data read / write speeds.

[0029] In an optional implementation, in memory management, the prediction of data access is crucial for determining resource allocation and optimization. The core of this step (S202) lies in using historical access data (such as access frequency, access time interval, access timestamp, etc.) of each storage device to construct a reference information set as input to the prediction model.

[0030] Using operating system kernel interfaces, performance monitoring tools (such as eBPF, perf), or memory management software, data access information on storage devices is periodically collected, including but not limited to access frequency, access interval, and whether it has been modified, forming time series data. The collected raw data is cleaned and preprocessed, such as removing outliers and filling in missing data, to ensure the accuracy and reliability of the data used for prediction. Based on the processed data, a suitable time series prediction model is selected. After the model predicts the future access frequency set, the results are analyzed to determine which data or pages will become hotspots (high access frequency prediction) and which will become coldspots (low access frequency prediction). Based on the prediction results and considering the latency characteristics of different memory levels, a data migration strategy is formulated. That is, data predicted to be hotspots should be migrated to the first memory (fast memory), while data predicted to be coldspots should be retained in the second memory (slow memory) to achieve efficient resource allocation and utilization.

[0031] The multi-tiered memory of the storage device may include:

[0032] DRAM (Dynamic Random Access Memory) is a volatile memory technology, meaning it loses information when power is off. Due to its ability to provide high-speed data access, it is a common type of main memory (RAM) in modern computer systems. DRAM access latency is typically around 120 ns (nanoseconds), indicating a very short time from sending an access request to data being retrieved and ready for processing. This extremely low latency is because DRAM is directly connected to the CPU and is usually located in the core of the computer system, making it the fastest data read / write channel for the CPU when executing programs. Therefore, DRAM is the best choice for handling frequent read / write operations, especially suitable for applications requiring fast response and high data transfer rates.

[0033] CXL (Compute Express Link) memory is a high-speed interconnect protocol designed for data centers and high-performance computing environments to enable high-speed data transfer between CPUs, accelerators, memory, and storage devices. CXL memory access latency is around 250ns, slightly slower than DRAM, but significantly lower than most other peripheral storage solutions such as NVMe. CXL memory allows memory resources to be shared across different devices, improving the performance of data-intensive applications while reducing data transfer bottlenecks between the CPU and memory. Although its latency is higher than DRAM, in complex systems with multiple interconnected devices, CXL provides the ability to perform large-scale data exchange and processing while maintaining relatively low latency, making it ideal for scenarios such as big data analytics, machine learning, and cloud computing.

[0034] NVMe (Non-Volatile Memory Express) is an optimized storage interface designed specifically for non-volatile memory such as solid-state drives (SSDs) to improve data transfer speeds and reduce latency. However, the access latency of NVMe devices is typically around 100µs (microseconds), which is significantly higher than DRAM and CXL memory. Nevertheless, NVMe SSDs still offer much faster read and write speeds than traditional hard drives (HDDs), making them a highly efficient choice for scenarios involving large amounts of data storage and long-term preservation. Despite its higher latency, the high-speed data transfer capabilities and large-capacity storage of NVMe devices make them a key component of the storage layer in big data storage, database management, and high-performance computing applications.

[0035] DRAM offers the fastest access speeds but is limited in capacity and expensive, making it suitable for storing frequently accessed "hot data." CXL memory strikes a balance between speed and interconnectivity; although its access latency is slightly higher than DRAM, it facilitates memory resource sharing between different devices, making it suitable for scenarios requiring cross-device data exchange. NVMe devices offer large-capacity storage and high data transfer speeds; despite relatively higher access latency, their advantages at the storage layer make them ideal for persistent data storage and high-throughput data processing.

[0036] Step S204: Determine multiple target sub-data contained in the target data of the storage device, and determine the predicted access frequency corresponding to each of the multiple target sub-data based on the predicted frequency set;

[0037] It should be noted that target data refers to a large block of data stored on a storage device (such as first memory or second memory), which is composed of multiple smaller data units (i.e., target sub-data). In memory management, target data is typically a large page of memory, which can be divided into multiple smaller pages. Target sub-data refers to the smaller, independent data units that make up the target data, such as the individual 4KB pages contained within a large page of memory. Each target sub-data has its own access frequency, and the differences in these frequencies are the core focus of step S204.

[0038] The predicted access frequency represents the number or frequency at which the target sub-data will be accessed within a future time period, as predicted by the algorithm. This is a key output of step S204, used to determine which sub-data should be migrated to fast memory and which should remain in slow memory.

[0039] In an optional implementation, the system periodically scans the pages of the storage device, identifies large blocks of target data, and divides them into a series of target sub-data. These sub-data are typically the smallest address units in page management, such as 4KB pages in modern systems. For accurate prediction, the system needs to maintain a historical access database, recording information such as the access frequency and access time interval for each target sub-data. This data can come from page table access flags, hardware performance monitoring unit (PMU) events, or access records tracked by software (such as eBPF, perf tools). Appropriate time series analysis methods (such as moving average, exponentially weighted moving average, or simple linear regression models) are used to analyze the historical access data to calculate the predicted access frequency for each target sub-data. The choice of algorithm depends on the system's requirements for accuracy and real-time performance. The prediction results are then aggregated to form a predicted frequency set, which is essentially a mapping table where the key is the target sub-data identifier and the value is the corresponding predicted access frequency.

[0040] The sampling period needs to be short enough to capture rapid changes in data access, but also long enough to reduce the system overhead of oversampling. A sampling period of 10ms to 100ms is generally recommended. The predictive model may need periodic training or parameter tuning based on actual system operation to adapt to changes in workload and access patterns. The prediction process should consider the physical layout information of storage devices (such as the latency and bandwidth characteristics of NUMA nodes and CXL channels) to more accurately assess the performance impact of data migration between different storage tiers. To avoid excessively frequent page splits and migrations, a cooling-off window can be introduced. After a data migration operation, a period of disabling is set for the relevant page, during which no new splits or migrations are allowed until the cooling-off period ends before evaluation.

[0041] Step S206: If the predicted access frequency corresponding to each of the multiple target sub-data satisfies the preset splitting conditions, the target data is split into multiple target sub-data.

[0042] It should be noted that the preset splitting conditions are a set of rules or thresholds used to determine when data should be split. These may include conditions such as access frequency exceeding a certain threshold, data access skewness reaching or exceeding a specific value, and future access trend predictions showing continued skewness.

[0043] In an optional implementation, during memory management, when the system detects a significant access skew within a large data page—that is, the access frequency of some subpages (target sub-data) is much higher than that of other subpages, and trend predictions indicate that this access pattern will continue for some time—the system will proceed to step S206. At this stage, the system evaluates whether each subpage meets preset splitting conditions based on its predicted access frequency. If the predicted access frequency of a subpage exceeds a specific threshold, indicating that it will be frequently accessed and may become a performance bottleneck or a key point of resource waste, the system will decide to split it from the large data page and store it independently in fast memory (such as CPU local DRAM), while retaining subpages with lower predicted access frequencies in slow memory (such as PMEM, remote DRAM, or CXL memory).

[0044] In optional implementations, access frequency data for all subpages within a large data page is collected periodically or on demand and stored in a system database. Time series analysis methods, such as moving average, exponentially weighted moving average, or linear regression, are applied to predict the access frequency data for each subpage, yielding an estimate of its future access frequency. The degree of subpage access skew within the large data page is quantified by calculating metrics such as Top-k coverage, Gini coefficient, or access entropy. The predicted access frequency and skewness of the subpages are checked to ensure they meet preset splitting conditions, which may include predicted access frequency exceeding a threshold, skewness exceeding a standard, and the current fast memory pressure on the system. For subpages that meet the splitting conditions, a function or instruction provided by the operating system kernel (such as `split_huge_page()`) is invoked to split the large page. The split subpages are then independently marked and managed. Based on the predicted access frequency of the subpages, high-frequency access subpages are migrated to fast memory, while low-frequency access subpages remain in slow memory. This step may involve scheduling strategies for NUMA nodes, CXL channels, or NVMe devices to ensure efficient data access. To prevent frequent page migrations from causing system instability, the split timestamp and cooling window of each subpage are recorded to ensure that the same subpage is not split or aggregated again within the preset cooling time.

[0045] Step S208: Store the target sub-data whose predicted access frequency is greater than the frequency threshold in the first memory, and store the target sub-data whose predicted access frequency is less than the frequency threshold in the second memory.

[0046] In an optional implementation, the predicted frequency set obtained in step S202 is used to compare the predicted access frequency of each target sub-data with a set frequency threshold. Sub-data with frequencies above the threshold is marked as objects to be stored in the first memory (fast memory), while sub-data with frequencies below the threshold is marked as objects to be stored in the second memory (slow memory). Based on the marking results, the system automatically or manually adjusts the storage location of the target sub-data. For sub-data marked as fast memory, the system migrates them from their current location in slow memory (such as persistent memory or other remote memory) to fast memory (such as CPU local DRAM); conversely, for sub-data marked as slow memory, it considers releasing them from fast memory and migrating them to slow memory to free up more fast memory space for hot data. The physical movement of data between different memory levels is achieved using page migration interfaces provided by the operating system kernel, such as migrate_pages or memmove in Linux. When the target is the first memory, sufficient free space is ensured to receive the sub-data to be migrated in, and space can be freed up through compression, cache cleanup, or other resource reclamation methods if necessary. In the case of secondary memory, ensure data integrity during migration, and optimize data transfer strategies considering potential latency and bandwidth limitations in slower memory. In heterogeneous memory environments, such as NUMA architectures or CXL interconnect systems, apply affinity rules to minimize additional latency caused by data migration. Prioritize migrating data to memory nodes geographically close to the CPU, or to storage devices with higher bandwidth and lower latency.

[0047] Example 1:

[0048] Suppose a computing system is equipped with multiple tiers of memory, including CPU-local DRAM (first-level memory) and persistent memory (second-level memory). The system runs a series of data analysis tasks, some of which frequently access specific datasets, while others have sparser access patterns.

[0049] S202, the system periodically collects access frequency information for each page and uses time series prediction models (such as moving average and exponentially weighted moving average) to predict future access trends.

[0050] S204 calculates the access skewness of each large page and analyzes the access popularity distribution using metrics such as Top-k coverage, Gini coefficient, and access entropy.

[0051] S206, based on skewness and access trends, determines whether large page splitting or small page aggregation is necessary, while also evaluating the cost and benefits of the operation.

[0052] S208, for target sub-data whose predicted access frequency is greater than the frequency threshold (e.g., the predicted access frequency is very high and it is expected to continue to be a hot spot), the system migrates it from slow memory (e.g., NVM) to fast memory (e.g., DRAM); conversely, for sub-data whose predicted access frequency is less than the frequency threshold (the access is expected to decrease or become a cold spot), the system considers releasing it from fast memory and migrating it to slow memory for storage, in order to free up more fast memory space.

[0053] Specifically, in S208, assuming a large page memory dataset, predictions show that 10% of its subpages will become hot data in the future, while access to the remaining 90% of subpages will gradually decrease. Based on this, the system will perform the following operations: migrate these 10% hot subpages from persistent memory or other slow storage devices to CPU-local DRAM to ensure they can be accessed quickly and improve processing speed. Release the remaining 90% cold subpages from CPU-local DRAM and migrate them to persistent memory or remote memory to free up fast memory resources, while reducing unnecessary resource consumption and management overhead.

[0054] This application utilizes a reference information set corresponding to the storage device to predict the predicted frequency set of the storage device. The storage device includes a first memory and a second memory, where the first memory has a lower latency than the second memory. The application identifies multiple target sub-data items contained in the target data of the storage device and determines the predicted access frequency of each sub-data item based on the predicted frequency set. If the predicted access frequencies of the sub-data items meet preset splitting conditions, the target data is split into multiple sub-data items. Target sub-data items with predicted access frequencies greater than a frequency threshold are stored in the first memory, while those with predicted access frequencies less than the frequency threshold are stored in the second memory. By using the reference information set corresponding to the storage device to predict the predicted frequency set, the application can dynamically assess changes in data access demands. This method allows the system to adjust the distribution of data between the first and second memory in real time based on the prediction results, ensuring that hot data (high access frequency) is located in fast memory, while cold data (low access frequency) is allocated to slow memory. This dynamic optimization helps maintain system performance stability and resource utilization efficiency under different loads. The system can more intelligently identify which data is worth migrating. This avoids blindly migrating all large pages of data to fast memory, reduces unnecessary page table updates, and thus lowers memory management overhead. Therefore, it can solve the problem of low resource utilization in memory management methods in related technologies.

[0055] In an optional implementation, if the predicted access frequency corresponding to each of the multiple target sub-data satisfies the preset splitting condition, the target data is split into multiple target sub-data, including: calculating the skewness based on the predicted access frequency corresponding to each of the multiple target sub-data, wherein the skewness is used to indicate the access popularity distribution of the multiple target sub-data contained in the target data; if the skewness is greater than the preset skewness value, the target data is split into multiple target sub-data.

[0056] It's important to note that skewness is a statistical concept used to describe the asymmetry of data distribution, particularly in memory management. It measures whether the access frequency of subpages within a large page is evenly distributed. High skewness typically means that access is highly concentrated on a subset of subpages, while other subpages are rarely accessed.

[0057] In an optional implementation, the predicted access frequency of all subpages (e.g., 512 4KB subpages) within the large page memory is obtained. This step is typically completed in step S202, using a time series prediction model to obtain future access patterns. The predicted access frequency values ​​for each subpage are organized into a vector for subsequent mathematical operations and statistical analysis. The access frequency vector is analyzed using various skewness metrics (e.g., Top-k coverage, Gini coefficient, access entropy, etc.) to quantify the unevenness of subpage access popularity. Higher skewness indicates that access popularity is more concentrated on a subset of subpages. The calculated skewness is compared with a preset skewness value set by the system. If the skewness exceeds the preset value, it means the access pattern has reached a level of unevenness requiring splitting. When the skewness meets the splitting condition, the system decides to perform a splitting operation, dividing the large page memory into multiple independent smaller pages based on the access popularity of the subpages. This process can be implemented by calling kernel interfaces (e.g., split_huge_page()).

[0058] In an optional implementation, predicting a set of predicted frequencies for the storage device using a set of reference information corresponding to the storage device includes: determining reference sub-data contained in at least one reference data of the storage device, wherein the at least one reference data includes target data; accessing a data information table corresponding to the storage device to obtain a set of reference information, wherein the set of reference information includes reference information indicating the reference sub-data contained in each of the at least one reference data; and predicting a set of predicted frequencies using the reference information of the reference sub-data contained in each of the at least one reference data, wherein the set of predicted frequencies includes at least one predicted access frequency, and the predicted access frequency is obtained by predicting the reference sub-data based on the reference information of the reference sub-data.

[0059] It should be noted that reference sub-data constitutes a smaller unit of reference data. For example, in large page memory management, a 2MB reference data may consist of 512 4KB reference sub-data. The data information table is a database or data structure maintained by the system to store information such as access history, access patterns, and access time intervals of data (including reference data and target data) on the storage device. The reference information set can be a series of data extracted from the data information table, including but not limited to the number of times each reference sub-data was accessed, the access time, and whether it was modified, used as the input dataset for building the predictive model.

[0060] In an optional implementation, the system periodically scans all data pages on the storage device, identifies large pages marked as reference data, and breaks them down into multiple reference sub-data, typically in the form of small pages, such as 512 4KB pages. This step ensures that the access behavior of each sub-page can be analyzed independently. Access history information for each reference sub-data is read from the system database or data structure, including access count, most recent access time, and whether it has been modified. This data constitutes a reference information set, which is an important input to the predictive model. A suitable time series analysis method or machine learning model (such as moving average, exponentially weighted moving average, Long Short-Term Memory network LSTM, etc.) is selected, and the model is trained using the reference information set to predict the future access frequency of each reference sub-data. After model training, the model is applied to the current reference information set to generate a predicted frequency set, where each reference sub-data is associated with a predicted access frequency value. The predicted frequency set is analyzed to identify reference sub-data with increasing access activity; this data may need to be migrated to faster memory (such as DRAM) to accelerate access. At the same time, identify sub-data with decreasing access activity and consider migrating them to slower memory (such as NVM or remote DRAM) to free up fast memory space.

[0061] Predictive models require regular training to adapt to changing access patterns. Online learning mechanisms can be employed to continuously update model parameters, ensuring predictive accuracy and effectiveness. To mitigate the performance impact of frequent page migrations, a cooling-off window can be implemented, where the relevant pages are disabled for a period after each migration operation, during which no new migration decisions are made. The prediction process should consider the access latency, bandwidth, and cost characteristics of different memory tiers (such as DRAM, NVM, remote DRAM, or CXL memory) to formulate optimal data migration decisions.

[0062] Through the above-described embodiments of this application, the system can intelligently predict and respond to changes in data access patterns, dynamically optimize the layout of data across different storage tiers, improve data processing speed, reduce system latency, and effectively manage memory resources to avoid resource waste and performance bottlenecks.

[0063] In an optional implementation, a set of predicted frequencies is predicted using reference information from reference sub-data contained in at least one set of reference data, including one of the following:

[0064] 1) Calculate the mean of the reference information corresponding to the reference sub-data to obtain the average value of the reference sub-data, and determine the average value as the predicted access frequency of the reference sub-data;

[0065] 2) Weight the reference information corresponding to the reference sub-data according to the time series, and calculate the mean of the weighted reference information to obtain the weighted average value corresponding to the reference sub-data; determine the weighted average value as the predicted access frequency of the reference sub-data;

[0066] 3) Establish a linear prediction model based on the reference data corresponding to the reference sub-data, and obtain the predicted access frequency of the reference sub-data based on the linear prediction model.

[0067] In an optional implementation, access information for each subpage, including access count and recent access time, is collected periodically (e.g., every 10ms to 100ms) and stored in a circular buffer for subsequent analysis. Before predicting the access frequency for the next observation window (e.g., the next 3 sampling periods), reference information from at least one sampling window is selected as the basis for the prediction.

[0068] Application of prediction methods:

[0069] Simple mean: Calculate the simple average number of visits to each subpage over a number of past periods (such as the last 3 sampling periods) as a prediction of its future visit frequency.

[0070] Weighted average: Considering that access patterns change over time, more recent access data is given higher weight, and the weighted average access frequency of each subpage is calculated using the exponentially weighted moving average (EWMA).

[0071] Linear prediction model: Based on historical access information, a prediction model is built using linear regression to estimate the access trend of each subpage in the coming period.

[0072] The prediction results of any of the above methods are compiled into a set, where each element corresponds to a reference sub-data and its predicted access frequency.

[0073] The choice of forecasting method (simple mean, weighted average, or linear forecasting) depends on the specific needs of the system and the required forecast accuracy. For example, if the system needs to respond quickly to recent changes, a weighted average may be more suitable; if long-term trends need to be predicted, a linear forecasting model may be more valuable. For weighted averages and linear forecasting models, it may be necessary to adjust the weighting factors or model parameters to achieve the best forecasting results. This usually requires feedback based on system performance and machine learning techniques. When dealing with different types of data, the forecasting method should be adjusted according to the data attributes. For example, for sudden access patterns, a more dynamic adjustment strategy may be needed; while for stable access patterns, a more static forecasting model can be used.

[0074] Through the above-described embodiments of this application, computing nodes can dynamically adjust memory resource allocation according to the access patterns of actual applications. This not only improves the access speed of hot data and reduces access latency, but also effectively utilizes the large capacity characteristics of PMEM, avoiding unnecessary waste of DRAM resources, thereby improving the overall operating efficiency and economy of the cluster.

[0075] In an optional implementation, if the skewness is greater than a preset skewness value, the target data is split into multiple target sub-data, including: determining the duration for which the predicted access frequency is greater than a frequency threshold; and if the duration is greater than a preset time and the skewness is greater than a preset skewness value, the target data is split into multiple target sub-data.

[0076] In an optional implementation, the system uses time series analysis methods (such as moving average, exponentially weighted moving average, or linear regression models) to predict the future access frequency of each sub-data based on historical access data. The prediction results are stored as a set of access frequencies. The skewness of access heat for sub-data within the large page memory is calculated using metrics such as Top-K coverage, Gini coefficient, or access entropy, and compared with a preset skewness value. If the skewness is significantly higher than the preset value, it indicates a severely uneven access distribution, a potential signal for splitting the large page. The system also needs to monitor the duration for which the predicted access frequency of a specific sub-data exceeds a frequency threshold, which helps determine the persistence of hotspot states. The duration statistics should cover at least several sampling periods to ensure the reliability of the results. When the predicted access frequency of a sub-data exceeds the frequency threshold for a duration longer than a preset time, and the overall skewness also exceeds the preset skewness value, the system decides to split the target large page into multiple target sub-data. This step is implemented by calling a kernel interface (such as split_huge_page()), and the split timestamp is recorded for subsequent aggregation reference.

[0077] The settings for these two parameters should be based on system resource availability, performance requirements, and application access characteristics. The preset time may be set between tens of milliseconds and seconds to balance system stability and response speed. The frequency threshold needs to be adjusted according to the actual application's access frequency distribution. To avoid frequent page splits caused by short-term access surges, a cooling window mechanism can be introduced. This involves setting a period after a split operation to prevent further splitting of the large page unless its access pattern fundamentally changes. When splitting, the topology and access characteristics of heterogeneous memory should be considered to ensure that hot data is preferentially scheduled to low-latency, high-bandwidth storage devices (such as CPU-local DRAM).

[0078] Through the above-described embodiments of this application, computing nodes can dynamically adjust the distribution of data across different storage tiers, placing hot data in the fastest-access DRAM, thereby improving data access speed and system response efficiency, while reducing unnecessary occupation of fast memory resources. Furthermore, by introducing cooling windows and heterogeneous memory scheduling, system jitter caused by excessive partitioning is avoided, ensuring the stability and efficiency of memory management, and improving overall system performance and resource utilization.

[0079] In an optional implementation, the skewness is calculated based on the predicted access frequency corresponding to each of the multiple target sub-data, including: sorting the multiple target sub-data according to the predicted access frequency corresponding to each of the target sub-data; and determining the skewness as the ratio of the predicted access frequency corresponding to the multiple target sub-data within a preset range to the total predicted access frequency of the target data.

[0080] In an optional implementation, the predicted access frequency data of all subpages within the large page memory is collected; this step is typically completed in step S202. The subpages are sorted in descending order according to their predicted access frequency, and the top k% of subpages are selected as the high-frequency subpage set. The value of k should be determined based on system performance goals and resource management strategies; for example, k=10%. The ratio of the sum of predicted access frequencies of the high-frequency subpage set to the sum of predicted access frequencies of all subpages is calculated. If the goal is to calculate Top-k coverage, the above calculation result is used as the skewness index. For example, if the total access volume of the Top-10% of subpages accounts for 80% of the total access volume, then the skewness is 80%. If the calculated skewness is higher than a preset threshold, the system determines that there is a significant access skew, which may trigger a large page splitting operation to separate the high-frequency subpages from the large page for independent management, thereby optimizing memory resource utilization and improving access efficiency.

[0081] Predicted access frequency can be calculated using methods such as moving averages, exponentially weighted moving averages, or linear regression. These models are adjusted and predicted based on actual access records over a past period. The preset range (k%) should be reasonably adjusted based on system memory capacity, application access patterns, and performance requirements. For computationally intensive applications, a lower k value may be needed to more accurately capture access skew. To avoid frequent splits caused by short-term access spikes, a cooling window can be introduced, where a split operation is performed only after a certain period, even if the skewness meets the criteria.

[0082] Through the above-described embodiments of this application, the system can intelligently identify and respond to hot and cold spots in the access pattern, dynamically adjust the data layout, optimize memory usage efficiency and system performance, and significantly reduce latency and improve overall response speed, especially when processing data-intensive tasks.

[0083] In an optional implementation, the ratio of the predicted access frequency corresponding to multiple target sub-data within a preset range to the total predicted access frequency of the target data is determined as the skewness, including: determining the ratio of the predicted access frequency corresponding to multiple target sub-data within a preset range to the total predicted access frequency of the target data as a first skewness; calculating the degree of dispersion of the predicted access frequency corresponding to each of the multiple target sub-data, and determining the degree of dispersion as a second skewness; calculating the degree of disorder of the predicted access frequency corresponding to each of the multiple target sub-data, and determining the degree of disorder as a third skewness; and determining the weighted sum of the first skewness, the second skewness, and the third skewness as the skewness.

[0084] In an optional implementation, the predicted access frequencies of all sub-data within the target data (mass memory) are sorted in descending order to form a predicted access frequency array. Sub-data within a preset range (e.g., the top 10% of sub-data with the highest access frequency) are identified, and the ratio of the sum of the predicted access frequencies of these sub-data to the total predicted access frequencies of the entire mass memory is calculated. This ratio is the first skewness. The distribution dispersion of the predicted access frequencies of the target sub-data is measured using statistical methods such as standard deviation or variance. High dispersion indicates a wide distribution of access activity, while low dispersion indicates that access is concentrated on a few sub-data. The degree of disorder in the distribution of the predicted access frequencies of the target sub-data is quantified using Shannon entropy calculation.

[0085] The first, second, and third skewnesses are assigned appropriate weights, and a final comprehensive skewness value is generated through a weighted summation. The weight allocation should be based on system performance goals and application characteristics to balance different levels of concern regarding access concentration, distribution width, and orderliness. Once the comprehensive skewness is calculated, the system compares it to a set threshold. If the skewness exceeds the threshold, and trend predictions indicate that this access pattern will continue, the target data will be marked as a split candidate for further decision analysis to determine whether to implement large-page splitting or small-page aggregation.

[0086] The second skewness can be determined by:

[0087] , x i This represents the number of times the page has been viewed.

[0088] The third skewness can be achieved by:

[0089] , , , where x i This represents the number of times the page has been viewed.

[0090] Through the above-described embodiments of this application, computing nodes can intelligently identify hot spots in memory access and dynamically adjust the distribution of data across different memory levels, placing frequently accessed data into the faster-access DRAM, thereby improving data access speed and system response efficiency. Simultaneously, through cooling windows and a multi-dimensional skewness evaluation mechanism, unnecessary page operations are avoided, reducing page table pressure and system overhead, ensuring the stability and efficiency of memory management, and thus enhancing the overall system performance and resource utilization.

[0091] In an optional implementation, when the skewness is greater than a preset skewness value, the target data is split into multiple target sub-data, including: determining a first data volume of target sub-data whose predicted access frequency is less than a frequency threshold; calculating the ratio of the first data volume to the target data volume of the target data to obtain a first proportion; and when the first proportion is greater than a preset ratio and the skewness is greater than a preset skewness value, the target data is split into multiple target sub-data.

[0092] In an optional implementation, historical access data and a predictive model (such as moving average, exponentially weighted moving average, or linear regression) are used to predict the future access frequency of each subpage in the large page memory, resulting in a predicted access frequency. A frequency threshold is set, and subpages with predicted access frequencies below this threshold are marked as cold data. Then, the total space size of these cold data is calculated, yielding the first data volume. The first data volume is compared with the total capacity of the target data to calculate the proportion of low-intensity subpages, i.e., the first percentage. The skewness of the access frequency distribution of all subpages in the large page memory is calculated using metrics such as Top-K coverage, Gini coefficient, or access entropy. If the first percentage is greater than a preset reclamation ratio threshold (e.g., 40% to 60%), and the access skewness also exceeds a preset skewness threshold, the system determines that the target data is suitable for splitting. The kernel function `split_huge_page()` is called or page table entries are updated to split the target large page into multiple independent small pages, while simultaneously releasing the fast memory space occupied by the cold data for space reclamation.

[0093] In an optional implementation, the system periodically (e.g., every 100ms) collects access frequency information for all subpages in the large page memory and uses an exponentially weighted moving average method to predict access activity over the next 300ms. A frequency threshold of 30% of the average access frequency is set, and the system identifies all subpages with predicted access frequencies below this threshold as a cold data set. The total space occupied by the cold data set is calculated; for example, if it's a 4KB small page, the total number of bytes occupied by these cold data points is calculated to obtain the first data volume. The first data volume is compared with the total capacity of the target large page to calculate the proportion of cold data, i.e., the first percentage. The access frequency distribution of all subpages in the large page memory is analyzed, using the Gini coefficient as an evaluation metric. Assuming a Gini coefficient of 0.8 indicates a highly uneven distribution of access activity. If the first percentage is greater than a preset recycling ratio threshold (e.g., 50%), and the Gini coefficient is higher than a preset skewness threshold (e.g., 0.6), the system decides to split the target data (large page) into multiple target sub-data (small pages). The kernel function split_huge_page() is called to perform a splitting operation, releasing subpages with low estimated access frequency back to fast memory, freeing up space for more frequently accessed data, and optimizing memory resource layout.

[0094] Through the above-described embodiments of this application, computing nodes can dynamically adjust the allocation of memory resources, separating cold data from fast memory. This reduces the invalidation of fast memory and ensures that hot data can be accessed faster, thereby improving overall system performance and resource utilization. This dynamic partitioning strategy based on access frequency and space reclamation ratio is particularly effective in scenarios involving large amounts of data and complex computing tasks, contributing to both high efficiency and economy in memory access.

[0095] In an optional implementation, when the skewness is greater than a preset skewness value, the target data is split into multiple target sub-data, including: determining the utilization rate and remaining space of the first memory; when the first proportion is greater than a preset ratio, the utilization rate is greater than the first utilization rate, the remaining space is less than the preset space, the hit rate of the second memory needs to be improved, and the skewness is greater than the preset skewness value, the target data is split into multiple target sub-data.

[0096] It should be noted that utilization rate refers to the ratio of the currently used space of the first memory (fast memory) to its total capacity. Remaining space represents the amount of unallocated space in the first memory, used to assess the available resources of the fast memory. Hit rate specifically refers to the access hit rate of the second memory (such as remote DRAM or NVM), that is, the proportion of access requests that directly find the required data at that level.

[0097] In an optional implementation, the usage of the first memory (fast memory) and the second memory (slow memory) is monitored periodically, including key indicators such as utilization rate, remaining space, and hit rate. The access frequency trend of each sub-data (small page) within the target data is predicted based on historical access records. The access skewness of the target data is calculated, including the first proportion (Top-k coverage), Gini coefficient, and access entropy. The first proportion, the utilization rate and remaining space of the first memory, and the hit rate demand and access skewness of the second memory are analyzed. If all of the following conditions are met:

[0098] If the first percentage is higher than the preset ratio (e.g., 80%), the first memory utilization rate is higher than the preset utilization rate threshold (e.g., 85%), the first memory remaining space is lower than the preset remaining space threshold (e.g., 10%), there is a need to improve the second memory hit rate, or the target data access skewness exceeds the preset skewness value (e.g., 0.6), then the system will decide to split the target data.

[0099] The target data is split into multiple target sub-data by calling the kernel function split_huge_page() or modifying the page table entries, and the split timestamp is recorded for use in subsequent aggregation.

[0100] In optional implementations, the preset ratio, utilization threshold, remaining space threshold, and skew value need to be reasonably adjusted based on system resources and application characteristics to ensure the effectiveness and adaptability of the strategy. To avoid system jitter caused by frequent splitting, a cooling window can be set after the splitting operation to prohibit the same sub-data from being split again within a certain period of time, unless the access pattern changes significantly. During the splitting operation, the system should intelligently schedule data migration based on the predicted access frequency of the sub-data and the heterogeneous memory topology, ensuring that high-frequency sub-data is moved to fast memory first, while low-frequency sub-data remains in slow memory or remote memory to optimize overall performance.

[0101] The system checks DRAM utilization (currently 90%) and remaining space (<5GB remaining) every 10 minutes. Simultaneously, it monitors the hit rates of remote DRAM and NVM (currently 30% and 25% respectively). Using the latest access records (e.g., sampling data every 100ms), it predicts the access frequency of each subpage in the target large page memory within the next 300ms. It calculates the access skewness index of the target large page memory. If the top-10% of subpages account for 85% of the total access volume, with a Gini coefficient of 0.7 and low access entropy, it indicates highly concentrated access. Given high DRAM utilization, limited remaining space, the need to improve remote DRAM and NVM hit rates, and high access skewness, the system decides to perform a large page split. It calls the kernel function `split_huge_page()` to migrate hot data (e.g., the top 10% of accessed subpages) from NVM or remote DRAM to fast memory (DRAM), while retaining cold data on the original slow storage layer.

[0102] Through the above-described implementation methods of this application, the system successfully alleviates the problem of tight fast memory resources while improving the access efficiency and hit rate of slow memory. Specifically, after migrating hot data to DRAM, data access latency is significantly reduced, accelerating data processing and model training; while cold data is retained in NVM and remote DRAM, saving fast memory space and avoiding unnecessary resource waste, thus optimizing the overall allocation of memory resources. In addition, by setting a reasonable cooling window, the system avoids frequent page migrations caused by short-term access peaks, ensuring the stability and efficiency of memory management, thereby improving the application performance and user experience of the entire cluster.

[0103] In an optional implementation, if the skewness is greater than a preset skewness value, after splitting the target data into multiple target sub-data, the following steps are taken: determining a lookup table for the storage device; determining a first product by multiplying the capacity change of the first memory by the access benefit of the first memory; determining a second product by multiplying the page table increment cost of the lookup table by the page table access cost; and if the difference between the first product and the second product is less than a preset benefit, aggregating the target sub-data to obtain the target data.

[0104] It should be noted that the lookup table of a storage device refers to the page table, which is used to map virtual addresses to physical addresses and is a core data structure for the operating system to manage memory.

[0105] In an optional implementation, ensure that the system has collected sufficient historical access information, including access frequency, access timestamps, and whether the target data (large page) was modified before and after the split. Based on the prediction model, calculate the product of the change in fast memory (e.g., DRAM) capacity released after the large page split and the fast memory access benefit. For example, if 2MB of DRAM is released after the split, and the system access latency decreases by 10ns for every 1MB of DRAM released, then the first product is 20ns. Evaluate the product of the increase in page table entries (page table increment cost) and the cost of accessing each page table entry (page table access cost) after the large page is split into multiple smaller pages. For example, if the number of page table entries increases from 100 to 200, and the cost of accessing each page table entry is 1ns, then the second product is 100ns. Compare whether the difference between the first and second products is less than a preset benefit threshold. For example, if the preset gain is 30ns, and the first product is 20ns and the second product is 100ns, then the difference is -80ns, which is less than -30ns. In this case, the system decides to aggregate the target sub-data back to the big page, which is achieved by calling the kernel function collapse_huge_page() or updating the page table entries.

[0106] The difference between the first product and the second product is the splitting benefit: Splitting benefit = Released fast memory capacity × Fast memory access benefit - Page table increment overhead after splitting × Page table access cost;

[0107] In alternative implementations, access costs (such as page table access costs) are typically determined by the hardware architecture, while access benefits (such as fast memory access benefits) are closely related to application load and memory access patterns. These values ​​need to be determined through experimental measurements and system configuration information to ensure they accurately reflect actual performance changes. Preset benefits should be dynamically adjusted based on system resource availability, application load changes, and real-time performance monitoring data to adapt to the benefit-cost ratio in different scenarios. In aggregation decisions, the access characteristics of different memory tiers (such as DRAM, NVM, and remote DRAM) should also be considered to ensure that the aggregated large pages are located at the optimal memory tier, balancing access performance and storage costs.

[0108] Example 2:

[0109] In a heterogeneous computing environment that combines DRMA, NVM, and remote DRAM, database querying and machine learning model evaluation tasks are running. The system has already implemented a dynamic large-page splitting strategy based on access popularity prediction. Now, a cost-benefit analysis is introduced to determine the feasibility of small-page aggregation.

[0110] The system detected a significant skew in the subpage access distribution within a large 2MB memory page and decided to split it into 512 4KB smaller pages, with 100 of these smaller pages located in hotspot areas of fast memory (such as DRAM). After the split, the system estimated that approximately 200MB of DRAM space was freed up. According to experimental data, for every 1MB of DRAM freed, the system access latency decreased by 10ns, therefore the first product is 2000ns. The split operation increased the number of page table entries from 100 to 612 (original page table entries + 512 new smaller pages). Assuming the cost of each page table entry access is 2ns, the second product is 1024ns (612 - 100 = 512, 512...). (2ns). The difference between the first product (2000ns) and the second product (1024ns) is 976ns. If the system's preset benefit threshold is 1000ns, then the net benefit from the split is less than the preset value. Since the net benefit of the split operation is less than the preset benefit threshold, the system decides to aggregate the target sub-data (small pages) back into a large page. The kernel function collapse_huge_page() is called to recombine 100 hot sub-pages and the remaining cold sub-pages into a large page and optimize its layout in heterogeneous memory.

[0111] Through the above-described implementation methods of this application, the system can intelligently assess the actual performance impact of large page splitting, avoiding increased page table pressure and access latency caused by excessive splitting. Simultaneously, through small page aggregation, the system automatically reclaims page table fragments when access patterns stabilize, reducing page table access costs and improving overall system performance. This aggregation decision mechanism based on cost-benefit analysis not only improves memory resource utilization but also reduces unnecessary management overhead, enhancing the efficiency and flexibility of memory management in heterogeneous computing environments.

[0112] In an optional implementation, after storing target sub-data with a predicted access frequency greater than a frequency threshold in a first memory and storing target sub-data with a predicted access frequency less than a frequency threshold in a second memory, the process includes: determining the predicted access frequency corresponding to each of at least one candidate sub-data that has been split in the storage device; and aggregating the multiple candidate sub-data with consecutive addresses to obtain reference data when the predicted access frequencies of multiple candidate sub-data with consecutive addresses show a consistent trend.

[0113] It's important to note that candidate sub-data sets are collections of data that have already been split from larger pages but may be re-aggregated due to consistent trends in access frequency. These sub-data sets are typically located in contiguous memory addresses. Predicting access frequency trends involves analyzing historical access data to forecast the future increase or decrease in access frequency for each sub-data set. If multiple consecutive smaller pages are predicted to have access frequencies changing in the same direction—either increasing or decreasing—they are likely candidates for re-aggregation.

[0114] In an optional implementation, the system collects access records for all sub-data (small pages) and predicts their future access frequencies through time series analysis. The prediction results are compared with frequency thresholds to distinguish between hot and cold sub-data. Based on the predicted access frequency, the sub-data is categorized and stored in either first memory (hot sub-data) or second memory (cold sub-data). In the first memory, sub-data with consecutive addresses exhibiting consistent predicted access frequency trends are identified as aggregation candidates. Consistent trends mean that the access popularity of multiple consecutive sub-data either increases or decreases together. The aggregation criteria are primarily determined by whether the access trends of these candidate sub-data are indeed consistent and whether this trend is expected to continue for a certain period. For example, if the predicted access frequency of candidate sub-data consistently increases or decreases in the last three sampling periods, the system considers them suitable for aggregation. Kernel interfaces (such as `collapse_huge_page()`) are called or page table entries are updated to re-aggregate the eligible consecutive address candidate sub-data into large pages, i.e., generate one or more reference data sets, while releasing some entries of the merged sub-data in the page table to reduce the page table size and improve TLB hit rate.

[0115] Through the above-described embodiments of this application, the data center server can reduce memory management overhead while maintaining high-efficiency memory access, including reducing page table size and improving TLB hit rate, thereby effectively improving the overall system performance and response speed. Furthermore, the cooling window mechanism avoids unnecessary frequent page operations, maintaining stable system operation. This strategy is particularly suitable for application scenarios where data access patterns dynamically change, such as large-scale data analysis and real-time stream processing tasks, enabling flexible optimization and configuration of memory resources.

[0116] In an optional implementation, when the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, the multiple candidate sub-data with consecutive addresses are aggregated to obtain reference data, including: calculating the access variance between the predicted access frequencies of multiple candidate sub-data with consecutive addresses; and when the access variance is less than the variance threshold, the multiple candidate sub-data with consecutive addresses are aggregated to obtain reference data.

[0117] In an optional implementation, based on access frequency trend prediction, the system filters out small pages with stable or declining access frequency as candidate sub-data for aggregation. For multiple candidate sub-data with contiguous addresses, their predicted access frequency change trends are analyzed. If the trend shows that the access frequency of all candidate sub-data is statistically consistent, such as similar growth or decrease rates, then they meet the potential conditions for aggregation. The variance between the predicted access frequencies of the candidate sub-data with contiguous addresses is calculated to quantify the uniformity of the access frequency distribution. The calculated access variance is compared with a system-preset variance threshold. If the access variance is less than the variance threshold, it means that the access patterns of these candidate sub-data are similar and meet the aggregation conditions. Under the above conditions, the system calls a kernel interface (such as the collapse_huge_page() or MADV_HUGEPAGE mechanism) to merge multiple candidate sub-data with contiguous addresses into a large page, i.e., generate new reference data. After the aggregation operation is completed, the system should update the memory management data information table to reflect the newly generated large page and the latest access information of each sub-data in it, providing accurate data support for subsequent analysis and decision-making.

[0118] In an optional implementation, the system collects memory access information every 100ms, predicts the access frequency of each subpage within the next 300ms, and identifies multiple consecutive subpages with stable access frequency as candidate subdata. A set of consecutive candidate subdata is selected, and the variance between the predicted access frequencies of these subdata is calculated. Assume the system's preset variance threshold is 100 access times^2. If the calculated access variance is less than 100 access times^2, it indicates a consistent and evenly distributed access trend, and the candidate subdata set meets the aggregation condition. The system kernel interface `collapse_huge_page()` is called to merge the multiple consecutive candidate subdata into a single large page, generating new reference data. After the aggregation operation, the system adjusts the distribution of data across different memory levels (such as DRMA, NVM, remote DRAM, etc.) according to the new large page structure, optimizing memory access paths and improving TLB hit rate.

[0119] Through the above-described embodiments of this application, the system can intelligently identify and respond to the plateau period in the access pattern, and aggregate small pages with contiguous addresses and consistent access trends into large pages. This not only reduces page table entries and improves memory access efficiency, but also optimizes the utilization of memory resources. Especially when processing large-scale datasets and performing data-intensive operations, it can significantly reduce memory management overhead and improve the overall performance of the system.

[0120] In an optional implementation, when the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, the multiple candidate sub-data with consecutive addresses are aggregated to obtain reference data, including: determining the lookup table corresponding to the storage device; when the page table entry increase rate of the lookup table is greater than the preset growth rate, and the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, the multiple candidate sub-data with consecutive addresses are aggregated to obtain reference data.

[0121] It's important to note that the page table entry increment rate describes the proportion by which the number of page table entries increases relative to the original number. It's a crucial indicator for evaluating system memory management efficiency, reflecting an increase in memory fragmentation. The preset growth rate is a system-defined threshold used to monitor the page table entry increment rate. Exceeding this threshold indicates that memory management mechanisms (such as massive page splitting) may be causing excessive page table fragmentation, requiring optimization measures.

[0122] In an optional implementation, the system periodically collects access information for all sub-data (small pages) and uses time series analysis to predict the access frequency trend of each sub-data over a future period. If a group of sub-data with contiguous addresses is found to have consistent access trends (such as increases or decreases in access frequency), this group of sub-data becomes an aggregation candidate. Simultaneously, the system monitors changes in the number of page table entries and calculates the page table entry increase rate. If the increase rate exceeds a preset threshold (e.g., the number of page table entries increases by more than 10% compared to a historical baseline), it indicates that the current memory management mechanism may cause high page table fragmentation, affecting memory access efficiency and system performance. Based on trend consistency judgment and page table fragmentation assessment, the system comprehensively considers both factors. If a group of contiguous aggregation candidate sub-data has consistent access trends and the page table fragmentation exceeds a preset threshold, the system determines that aggregation is necessary because it can significantly reduce the number of page table entries, lower page table access costs, and improve memory access efficiency. The system calls the kernel-provided aggregation function or updates page table entries to merge the contiguous candidate sub-data into a single large page. This step is typically performed periodically in the system background and does not interrupt the main application's operation. After aggregation is complete, the system updates the page table information, adding the newly formed large page information to the page table while clearing the original small page entries. Furthermore, the system should continuously monitor the page table fragmentation level and other performance metrics as a basis for subsequent decisions. For example, if system performance does not improve after aggregation, it may be necessary to adjust the aggregation strategy or re-evaluate the preset parameters.

[0123] In an optional implementation, the system initially consists of multiple 2MB large pages, some of which are split into multiple 4KB smaller pages to respond to local peaks in access frequency. The system predicts the access frequency of each smaller page within the next 150ms using a moving average algorithm through periodic data sampling (e.g., every 50ms). Assuming a group of 16 consecutive smaller pages, the predicted access frequency shows a gradual stabilization. The system simultaneously monitors the number of page table entries and finds that due to the large page splitting operation, the number of page table entries increased from the baseline of 1000 to 1100, an increase of 10%, meeting the preset condition. Since the access trends of the aforementioned 16 smaller pages are consistent, and the page table fragmentation reaches the preset threshold, the system determines that the aggregation operation is beneficial to improving memory management efficiency and system performance. Therefore, the system calls the kernel interface to re-aggregate these 16 smaller pages into a single 2MB large page, generating a "reference data". After the aggregation operation is completed, the system updates the page table information, reducing the number of page table entries, thereby optimizing memory access paths and improving TLB hit rate. In addition, the system continuously monitors page table fragmentation rate and other performance metrics to respond to potential future workload changes and adjust aggregation strategies accordingly.

[0124] Through the above-described embodiments of this application, the system can effectively control page table fragmentation during memory management while ensuring memory access efficiency, reducing the overhead of page table access and improving overall system performance. Especially when handling data-intensive tasks, this strategy, by dynamically adjusting the memory layout, optimizes access paths and reduces management costs, making it an important optimization measure for the system. Furthermore, through the cooling window mechanism and dynamically adjusting preset thresholds, the system can better adapt to constantly changing workloads and resource demands, ensuring the flexibility and effectiveness of the memory management strategy.

[0125] In an optional implementation, when the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, the multiple candidate sub-data with consecutive addresses are aggregated to obtain reference data, including: when the storage device does not include reference data, the utilization rate of the first memory is less than the second utilization value, the page table entry increase rate of the lookup table is greater than the preset growth rate, and the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, the multiple candidate sub-data with consecutive addresses are aggregated to obtain reference data.

[0126] In an optional implementation, memory usage is continuously monitored, including the utilization rate of fast memory, the number and growth of page table entries, and the access frequency trend of candidate sub-data. The system checks for duplicate reference data instances, assesses whether the fast memory utilization rate is lower than a preset second utilization value, analyzes whether the page table entry increase rate exceeds a preset growth rate threshold, and confirms whether the access trends of candidate sub-data are consistent. If all the above conditions are met, the system considers the aggregation operation reasonable, which can improve memory management efficiency, reduce page table fragmentation, and improve system performance. The kernel function `collapse_huge_page()` is called or the `MADV_HUGEPAGE` flag is used to merge candidate sub-data with contiguous addresses into a large page (reference data). After aggregation, the system should update the memory management data structure to reflect the latest large page information and optimize the distribution of data in different memory levels to ensure that hot data resides preferentially in fast memory.

[0127] In an optional implementation, the system continuously monitors memory usage and finds that the utilization rate of fast memory (first memory, such as DRAM) is 75%, lower than the preset 80% (second usage value), and the page table entry increase rate reaches 15%, exceeding the preset 10% growth rate threshold. Simultaneously, through access heat prediction, 16 consecutive small pages are identified, whose access trends are consistent, with access frequencies gradually transitioning smoothly from high to low, meeting the aggregation conditions. The system determines that there are currently no reference data instances corresponding to these 16 small pages, and all aggregation conditions are met. Therefore, it decides to execute the aggregation operation, merging these 16 consecutive small pages into one large page, i.e., generating a new reference data. The kernel function `collapse_huge_page()` is called to compress the 16 small pages into a 2MB large page and update the page table information. Subsequently, based on the latency characteristics of the NUMA architecture and CXL channel, the system schedules the generated reference data to the fast memory region to ensure its access performance.

[0128] Through the above-described implementation methods of this application, the system successfully reduces page table fragmentation, alleviates page table pressure, optimizes memory layout, and improves access efficiency for hot data and overall system performance. This dynamic memory management mechanism is particularly suitable for workloads handling large amounts of random access and frequently changing data access patterns, and can improve resource utilization efficiency while ensuring stable system operation.

[0129] In an optional implementation, when the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, after aggregating multiple candidate sub-data with consecutive addresses to obtain reference data, the following steps are taken: calculating the product of the number of table entries decreasing in the lookup table and the increase in the lookup table hit rate as a third product; subtracting the probability of performance degradation of the storage device from the third product to obtain the aggregation benefit; and splitting the reference data into multiple candidate sub-data if the aggregation benefit is less than the second benefit.

[0130] In an optional implementation, based on the consistency of access popularity trends, the system aggregates multiple small pages with contiguous addresses into a large page (reference data) and updates the page table entries. The number of page table entries reduced after aggregation is counted; this number reflects the simplification of the page table structure, i.e., the number of page table entries reduced. Based on the current size of the system's page table entries, the TLB hit rate improvement after the reduction in page table entries is predicted; this can be the actual reduction in access latency, measured in nanoseconds (ns). Considering the risk of access pattern mismatch that aggregation may bring, the probability of performance degradation on storage devices (such as slow NVM) after aggregation is estimated; this probability is typically derived from historical data and current memory access pattern analysis. The potential benefit of the split operation is obtained by subtracting the performance degradation risk from the third product (number of page table entries reduced × lookup table hit rate improvement). The aggregation benefit is compared with the second benefit (the benefit threshold before aggregation or the benefit at other decision points). If the aggregation benefit is less than the second benefit, it indicates that splitting is more beneficial to system performance, and the split operation is performed.

[0131] Aggregate benefit: Aggregate benefit = reduction in page table entries × improvement in page table hit rate - potential risk of decreased access performance;

[0132] Example 3:

[0133] In the high-performance computing cluster, nodes are equipped with a hybrid type of memory resources, including fast DRAM and persistent NVM. The system employs a dynamic aggregation / splitting strategy for large pages based on access frequency prediction, designed to optimize memory access efficiency and resource management.

[0134] The system detects that 16 consecutive small pages within a large memory page exhibit a consistent access trend. It decides to aggregate these small pages into a single large page and updates the page table structure. After aggregation, the system finds that the number of page table entries decreases from 1000 to 984. Based on historical data, reducing the number of page table entries by 16 improves the average access latency by 10ns, hence the third product is 160ns. Analyzing the data access patterns after aggregation reveals a 20ns probability of increased access latency on the local node, representing the performance degradation risk from aggregation. Subtracting the performance degradation risk (20ns) from the third product (160ns) yields an aggregation benefit of 140ns. Assuming the system's second benefit (the benefit threshold before aggregation) is set at 150ns, since the aggregation benefit (140ns) is less than the second benefit, the system decides to reverse-split the large page into smaller pages. This involves calling the kernel function `split_huge_page()` or updating page table entries to reverse-split the reference data (the aggregated large page) back into multiple smaller pages, restoring finer-grained memory management to adapt to subtle changes in access patterns and optimize system performance.

[0135] Through the above-described embodiments of this application, the system can dynamically adjust the memory management strategy and intelligently perform aggregation and splitting operations according to the evolution of the actual access pattern, ensuring efficient utilization of memory resources and continuous optimization of access performance. It is especially suitable for processing data-intensive tasks and high-concurrency access environments, demonstrating the flexibility and performance potential of advanced memory management mechanisms in heterogeneous computing platforms.

[0136] In an optional implementation, when the predicted access frequencies corresponding to the multiple target sub-data satisfy a preset splitting condition, after splitting the target data into multiple target sub-data, the following steps are taken: when the target data is stored in the first memory, the target sub-data with a predicted access frequency less than a frequency threshold is stored in the second memory; when the target data is stored in the second memory, the target sub-data with a predicted access frequency less than a frequency threshold is stored in the third memory, wherein the third delay of the third memory is greater than the second delay.

[0137] In an optional implementation, the system periodically samples and collects access frequency information of subpages under the target data, predicting future access frequencies using time series analysis methods (such as moving average and exponentially weighted moving average). Based on the predicted access frequency distribution, skewness indicators, such as Top-k coverage, Gini coefficient, and access entropy, are calculated to determine whether preset splitting conditions are met. If met, the system decides to split the target data into multiple target sub-data. All target sub-data obtained after splitting are classified into "hot data" and "cold data" based on a comparison of the predicted access frequency with a frequency threshold. Depending on the original storage location of the target data (first memory or second memory), the target sub-data marked as "cold data" is migrated to a slower memory level (second memory or third memory). Simultaneously, "hot data" is retained in fast memory to maintain access efficiency.

[0138] Example 4:

[0139] Suppose a server equipped with DRAM, NVM, and remote DRAM is running a mixed-load application, such as web services, database queries, and machine learning model training. The server's operating system and memory management modules have implemented a dynamic bigpage memory splitting strategy based on access popularity prediction.

[0140] The system stores several 2MB large pages in DRMA (first memory) to accelerate the response time of web services and database queries. Every 50ms, the system collects access information for the smaller pages (4KB) under the large pages using the eBPF tool and uses an exponentially weighted moving average model to predict the access frequency in the next 150ms. By calculating access skewness indicators such as Top-k coverage, Gini coefficient, and access entropy, the system identifies that the access activity of some smaller pages within the large pages has significantly decreased, predicting that their access frequency will fall below a frequency threshold. The system decides to split the target data (large pages) into multiple target sub-data (small pages). For those small pages whose predicted access frequency is below the frequency threshold (originally located in DRMA), the system migrates them to NVM (second memory), while retaining the small pages with high access frequency in DRMA. The system continuously monitors the access activity of the migrated sub-data. If it finds that the access frequency of sub-data in NVM further decreases and meets preset conditions, the system further migrates these sub-data to remote DRAM (third memory) to reduce the storage pressure on NVM and make full use of the storage space of remote DRAM.

[0141] Figure 3 This is a schematic diagram of an optional multi-level memory management method according to an embodiment of this application; as shown... Figure 3 As shown, the first memory can be DRAM, the second memory can be NVMe, and the third memory can be CXL. DRAM access latency is around 120ns, CXL memory access latency is around 250ns, and NVMe device access latency is around 100us. The process of splitting the target data can be performed in the first and third memory. After splitting, cold data can be placed in the second memory. Because the purpose of splitting is to prevent cold data from wasting the resources of fast memory, hot data is retained, and cold data is transferred to slower memory (relatively speaking).

[0142] Figure 4 This is a schematic diagram of another optional multi-level memory management method according to an embodiment of this application; as shown Figure 4 As shown, the latency of the third memory is between that of the first and second memory. Therefore, after the large page data is split, the hot data can be kept in the third memory, or the hot data can be put into the first memory if the first memory resources are not tight.

[0143] Through the above-described embodiments of this application, the system can intelligently adjust the distribution of data across different memory levels, retaining hot data in the fastest-accessing DRMA and migrating cold data to the higher-latency NVM and remote DRAM. This mechanism not only reduces the waste of fast memory resources but also effectively utilizes the storage space of slow memory, optimizing the overall memory resource utilization efficiency. When handling applications with mixed workloads, it can significantly improve system performance while ensuring system stability and flexibility in resource utilization.

[0144] It should be noted that NUMA topology information, Non-Uniform Memory Access topology, describes the location, capacity, and access latency characteristics of memory nodes (usually corresponding to the CPU's local DRAM) in a multiprocessor system, reflecting the affinity relationship of memory access.

[0145] CXL / Remote Memory: Compute Express Link is a high-speed interconnect protocol used to connect CPUs, GPUs, accelerators, and memory devices, providing low-latency, high-bandwidth access. Remote memory typically refers to DRAM or NVM resources on other nodes accessed via a network or CXL link.

[0146] Low-latency CXL channel: refers to a memory channel with relatively low access latency connected via the CXL protocol. Compared to traditional PCIe or NVMe interfaces, the CXL channel can provide more efficient memory access.

[0147] In an optional implementation, when the system determines that a subpage (e.g., a 4KB page) has become hot data and needs to be migrated from a slow or remote memory tier to fast memory (i.e., the DRAM of the local NUMA node), the topology-aware scheduler will directly select the memory node closest to the current CPU node as the migration destination. This is because the memory access latency of the local NUMA node is the lowest, maximizing data access efficiency. If the fast memory resources of the local NUMA node are saturated and cannot accommodate more hot data, the scheduler will dynamically migrate the hot data to other nodes interconnected via CXL, but will select high-bandwidth, low-latency CXL channels for transmission to ensure high access performance even in cross-node access scenarios. The "no-decision algorithm" mentioned here does not mean that the scheduler does not use any algorithm, but rather emphasizes that the scheduler does not need complex algorithms to make a decision on the selection of the local NUMA node, because the access latency characteristics of local memory are inherent. However, the selection of low-latency CXL channels involves more complex performance evaluation and resource allocation strategies.

[0148] In an optional implementation, the system identifies frequently accessed subpages and marks them as hot data through periodic sampling and trend prediction. For marked hot data, the topology-aware scheduler prioritizes checking the fast memory (e.g., DRAM) resource status of the local NUMA node. If resources are sufficient, a data migration operation is immediately performed to migrate the hot data to the local memory node and update the page table to reflect the new physical address mapping. If local memory resources are scarce, the scheduler will evaluate the performance of remote memory nodes connected via CXL, including parameters such as bandwidth and latency. It compares the performance metrics of each CXL channel and selects the best channel for data migration. During the data migration process, the scheduler continuously monitors system performance and memory resource usage, dynamically adjusts the migration strategy, and ensures that the data layout is always optimized to avoid performance bottlenecks caused by improper data layout. The system should establish a feedback loop to continuously collect post-migration performance data to verify the effectiveness of scheduling decisions and adjust future decisions accordingly, such as adjusting preset thresholds and optimizing scheduling algorithms.

[0149] Transparent Huge Pages (THP) is a mechanism in the Linux kernel used to optimize memory access and management. By using larger pages (such as 2MB or 4MB) to reduce page table entries, it improves the TLB (Translation Lookaside Buffer) hit rate and reduces the overhead of page table access.

[0150] In an optional implementation, the system administrator configures the periodic background access popularity sampling interval (e.g., 10ms~100ms), as well as the thresholds and parameters of the prediction and strategy module, such as skewness thresholds, access popularity trend prediction methods, and benefit-cost models. The system collects page access information within preset time intervals, including access counts, access times, and access pattern skewness, caching the data in a circular buffer for subsequent time series analysis and trend prediction. Based on the collected access information, the prediction and strategy module analyzes access popularity trends and distribution skewness, evaluating the benefits and costs of splitting or aggregating operations. If the benefits outweigh the costs and a specific threshold is met, the system decides to execute the corresponding operation. The system calls the kernel-provided `split_huge_page()` or `collapse_huge_page()` functions to split the page structure from large pages into smaller pages, or aggregate small pages into large pages. Simultaneously, the system records the timestamp and status of the operation for subsequent decision-making reference. The system continuously monitors page access and memory resource status, adjusts the parameters of the strategy module based on actual operating results, optimizes the memory management mechanism, reduces page oscillation and page table pressure, and improves the overall system performance.

[0151] It should be noted that, based on the original large-page dynamic splitting and aggregation method based on access popularity prediction, this method further integrates hardware performance monitoring unit (PMU) events, TLB miss tracking, and a lightweight machine learning model, aiming to improve the accuracy of access prediction and optimize memory management decisions to adapt to complex workloads and high-performance computing environments.

[0152] The Performance Monitoring Unit (PMU) provides detailed hardware-level performance metrics, such as CPU cache access and instruction execution time. By monitoring PMU events, the system can more accurately capture subtle changes in memory access patterns, such as the formation of hot data and fluctuations in data access frequency, thereby improving the accuracy of access frequency prediction. By tracking TLB miss events, the system can understand in real time which pages are not cached by the TLB, which is often closely related to changes in page access frequency. Using TLB miss traces, pages that need to be resized or migrated can be quickly identified to reduce future TLB misses and improve memory access efficiency.

[0153] Lightweight machine learning models, such as time-series based LSTM (Long Short-Term Memory), LightGBM, or XGBoost, are used to process historical access data and predict future access patterns. These lightweight models provide more accurate predictions without significantly increasing system overhead. The models continuously learn from the latest PMU events and TLB miss traces through online learning algorithms, dynamically adjusting model parameters to better adapt to changing workloads and access patterns, thus achieving self-optimization of memory management strategies.

[0154] In an optional implementation, the system continuously monitors PMU events and TLB miss traces, converting these hardware events into access frequency sampling data, which is cached in a circular buffer along with the existing access frequency information. Using an integrated lightweight learning model, combined with historical access frequency data and hardware event information, deep learning of access patterns is performed. The model outputs a prediction of the access frequency trend for each page over a future period, guiding page splitting and aggregation decisions. Based on the prediction results, the calculation formula of the benefit evaluator is further optimized, comprehensively considering factors such as improved access efficiency, reduced page table pressure, and reduced system overhead, ensuring the comprehensiveness and accuracy of the decision. When the prediction and comprehensive benefit evaluation indicate that splitting or aggregation will bring performance improvements, the system calls `split_huge_page()` or `collapse_huge_page()` to execute the relevant operations. Simultaneously, a topology-aware scheduler is used for data migration to ensure maximum operational effectiveness. The system establishes a feedback mechanism to continuously monitor performance changes after operations, feeding new data back to the learning model for parameter adjustment, achieving a self-optimizing learning loop and continuously improving the intelligence level of memory management.

[0155] Through the above-mentioned extension scheme, the system can more accurately predict access popularity based on hardware events and lightweight machine learning models, intelligently adjust the splitting and aggregation strategies of large page memory, improve memory access efficiency, reduce page table fragmentation, and ensure dynamic optimization and autonomous adaptation of memory management decisions. It is particularly suitable for high-performance computing and complex data processing environments, achieving efficient utilization of memory resources and significant improvement in system performance.

[0156] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0157] Embodiments of this application also provide a multi-level memory management device. Figure 5 This is a structural block diagram of an optional multi-level memory management device according to an embodiment of this application, such as... Figure 5 As shown, the device includes:

[0158] The prediction frequency module 502 is used to predict the prediction frequency set of the storage device using the reference information set corresponding to the storage device, wherein the storage device includes a first memory and a second memory, and the first delay of the first memory is less than the second delay of the second memory.

[0159] The frequency determination module 504 is used to determine multiple target sub-data contained in the target data of the storage device, and to determine the predicted access frequency corresponding to each of the multiple target sub-data based on the predicted frequency set.

[0160] The data splitting module 506 is used to split target data into multiple target sub-data when the predicted access frequency corresponding to each of the multiple target sub-data satisfies the preset splitting conditions.

[0161] The hierarchical storage module 508 is used to store target sub-data with a predicted access frequency greater than a frequency threshold in the first memory and store target sub-data with a predicted access frequency less than a frequency threshold in the second memory.

[0162] Optionally, the data splitting module 506 is further configured to: calculate the skewness based on the predicted access frequency corresponding to each of the multiple target sub-data, wherein the skewness is used to indicate the access popularity distribution of the multiple target sub-data contained in the target data; and split the target data into multiple target sub-data if the skewness is greater than a preset skewness value.

[0163] Optionally, the prediction frequency module 502 is further configured to: determine reference sub-data contained in at least one reference data of the storage device, wherein the at least one reference data includes target data; access the data information table corresponding to the storage device to obtain a reference information set, wherein the reference information set includes reference information indicating the reference sub-data contained in each of the at least one reference data; and predict a prediction frequency set using the reference information of the reference sub-data contained in each of the at least one reference data, wherein the prediction frequency set includes at least one prediction access frequency, and the prediction access frequency is obtained by predicting the reference sub-data based on the reference information of the reference sub-data.

[0164] Optionally, the aforementioned prediction frequency module 502 is further configured to: calculate the mean of the reference information corresponding to the reference sub-data to obtain the average value corresponding to the reference sub-data, and determine the average value as the predicted access frequency of the reference sub-data; weight the reference information corresponding to the reference sub-data according to the time series, and calculate the mean of the weighted reference information to obtain the weighted average value corresponding to the reference sub-data; determine the weighted average value as the predicted access frequency of the reference sub-data; establish a linear prediction model based on the reference data corresponding to the reference sub-data, and obtain the predicted access frequency of the reference sub-data based on the linear prediction model.

[0165] Optionally, the data splitting module 506 is further configured to: determine the duration during which the predicted access frequency is greater than the frequency threshold; and split the target data into multiple target sub-data if the duration is greater than a preset time and the skewness is greater than a preset skewness value.

[0166] Optionally, the data splitting module 506 is further configured to: sort multiple target sub-data according to the predicted access frequency corresponding to each target sub-data; and determine the skewness as the ratio of the predicted access frequency corresponding to multiple target sub-data within a preset range to the total predicted access frequency of the target data.

[0167] Optionally, the data splitting module 506 is further configured to: determine the ratio of the predicted access frequency corresponding to multiple target sub-data within a preset range to the total predicted access frequency of the target data as a first skewness; calculate the distribution dispersion of the predicted access frequency corresponding to each of the multiple target sub-data, and determine the distribution dispersion as a second skewness; calculate the disorder of the predicted access frequency corresponding to each of the multiple target sub-data, and determine the disorder as a third skewness; and determine the weighted sum of the first skewness, the second skewness, and the third skewness as the skewness.

[0168] Optionally, the data splitting module 506 is further configured to: determine the first data volume of the target sub-data whose predicted access frequency is less than the frequency threshold; calculate the ratio of the first data volume to the target data volume of the target data to obtain a first proportion; and split the target data into multiple target sub-data if the first proportion is greater than a preset ratio and the skewness is greater than a preset skewness.

[0169] Optionally, the data splitting module 506 is further configured to: determine the utilization rate and remaining space of the first memory; and split the target data into multiple target sub-data when the first proportion is greater than a preset ratio, the utilization rate is greater than the first utilization rate, the remaining space is less than the preset space, the hit rate of the second memory needs to be improved and the skewness is greater than a preset skewness value.

[0170] Optionally, the data splitting module 506 described above is further configured to: determine the lookup table of the storage device; determine the product of the capacity change of the first memory and the access benefit of the first memory as the first product; determine the product of the page table increment cost of the lookup table and the page table access cost as the second product; and, if the difference between the first product and the second product is less than the preset benefit, aggregate the target sub-data to obtain the target data.

[0171] Optionally, the hierarchical storage module 508 is further configured to: determine the predicted access frequency corresponding to each of at least one candidate sub-data that has been split in the storage device; and, when the predicted access frequency of multiple candidate sub-data with consecutive addresses has the same trend, aggregate the multiple candidate sub-data with consecutive addresses to obtain reference data.

[0172] Optionally, the above-mentioned multi-layer memory management device further includes: a data aggregation module, used to calculate the access variance between the predicted access frequencies of multiple candidate sub-data with consecutive addresses; and to aggregate the multiple candidate sub-data with consecutive addresses to obtain reference data when the access variance is less than the variance threshold.

[0173] Optionally, the data aggregation module described above is further configured to: determine the lookup table corresponding to the storage device; and aggregate multiple candidate sub-data with consecutive addresses to obtain reference data when the increase rate of page entries in the lookup table is greater than the preset growth rate and the predicted access frequency change trend of multiple candidate sub-data with consecutive addresses is consistent.

[0174] Optionally, the data aggregation module described above is further configured to: aggregate multiple candidate sub-data with consecutive addresses to obtain reference data when the storage device does not include reference data, the utilization rate of the first memory is less than the second utilization value, the increase rate of page table entries in the lookup table is greater than the preset growth rate, and the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent.

[0175] Optionally, the data aggregation module described above is further configured to: calculate the product of the number of table entries decreasing in the lookup table and the increase in the lookup table hit rate as a third product; subtract the probability of performance degradation of the storage device from the third product to obtain the aggregation benefit; and split the reference data into multiple candidate sub-data if the aggregation benefit is less than the second benefit.

[0176] Optionally, the aforementioned tiered storage module 508 is further configured to: store target sub-data with a predicted access frequency less than a frequency threshold in the second memory when the target data is stored in the first memory; and store target sub-data with a predicted access frequency less than a frequency threshold in the third memory when the target data is stored in the second memory, wherein the third latency of the third memory is greater than the second latency.

[0177] For a description of the features in the embodiment corresponding to the multi-level memory management device, please refer to the relevant description in the embodiment corresponding to the multi-level memory management method, which will not be repeated here.

[0178] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the multi-level memory management method.

[0179] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the multi-level memory management method when it is run.

[0180] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0181] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the multi-level memory management method.

[0182] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described multi-level memory management method embodiments.

[0183] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0184] The foregoing has provided a detailed description of a multi-layer memory management method, apparatus, storage medium, and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A multi-level memory management method, characterized in that, include: A prediction frequency set for the storage device is obtained by using a reference information set corresponding to the storage device. The storage device includes a first memory and a second memory. The first latency of the first memory is less than the second latency of the second memory. The reference information set includes the number of accesses, the most recent access time, and the access time interval. The target data of the storage device is determined to include multiple target sub-data, and the predicted access frequency corresponding to each of the multiple target sub-data is determined based on the predicted frequency set. The target data is the large page memory in memory management, and the target sub-data is the small page memory contained under the large page memory. If the predicted access frequency corresponding to each of the multiple target sub-data satisfies the preset splitting condition, the target data is split into the multiple target sub-data. The target sub-data with a predicted access frequency greater than a frequency threshold is stored in the first memory, and the target sub-data with a predicted access frequency less than the frequency threshold is stored in the second memory; The step of predicting a set of predicted frequencies for the storage device using a set of reference information corresponding to the storage device includes: determining reference sub-data contained in at least one set of reference data for the storage device, wherein the at least one set of reference data includes the target data; accessing a data information table corresponding to the storage device to obtain the set of reference information, wherein the set of reference information includes reference information indicating the reference sub-data contained in each of the at least one set of reference data; and predicting the set of predicted frequencies using the reference information of the reference sub-data contained in each of the at least one set of reference data, wherein the set of predicted frequencies includes at least one predicted access frequency, the predicted access frequency being obtained by predicting the reference sub-data based on the reference information of the reference sub-data. The step of splitting the target data into multiple target sub-data when the predicted access frequencies corresponding to each of the multiple target sub-data satisfy a preset splitting condition includes: calculating a skewness based on the predicted access frequencies corresponding to each of the multiple target sub-data, wherein the skewness is used to indicate the access popularity distribution of the multiple target sub-data contained in the target data; and splitting the target data into multiple target sub-data when the skewness is greater than a preset skewness value.

2. The method according to claim 1, characterized in that, The prediction of the predicted frequency set using the reference information of the reference sub-data contained in each of the at least one reference data includes one of the following: The mean of the reference information corresponding to the reference sub-data is calculated to obtain the average value of the reference sub-data, and the average value is determined as the predicted access frequency of the reference sub-data. The reference information corresponding to the reference sub-data is weighted according to time sequence, and the weighted reference information is averaged to obtain the weighted average value corresponding to the reference sub-data; the weighted average value is determined as the predicted access frequency of the reference sub-data; A linear prediction model is established based on the reference data corresponding to the reference sub-data, and the predicted access frequency of the reference sub-data is obtained based on the linear prediction model.

3. The method according to claim 1, characterized in that, When the skewness is greater than a preset skewness value, the target data is split into multiple target sub-data, including: Determine the duration for which the predicted access frequency is greater than the frequency threshold; If the duration is greater than a preset time and the skewness is greater than the preset skewness value, the target data is split into the multiple target sub-data.

4. The method according to claim 1, characterized in that, The calculation of skewness based on the predicted access frequency corresponding to each of the multiple target sub-data includes: The multiple target sub-data are sorted according to the predicted access frequency corresponding to each of the target sub-data; The skewness is determined by the ratio of the predicted access frequency corresponding to the plurality of target sub-data within the preset range to the total predicted access frequency of the target data.

5. The method according to claim 4, characterized in that, The step of determining the skewness as the ratio of the predicted access frequency corresponding to the plurality of target sub-data within a preset range to the total predicted access frequency of the target data includes: The ratio of the predicted access frequency corresponding to the plurality of target sub-data within the preset range to the total predicted access frequency of the target data is determined as the first skewness; Calculate the degree of dispersion of the predicted access frequency corresponding to each of the multiple target sub-data, and determine the degree of dispersion as the second skewness; Calculate the degree of disorder of the predicted access frequency corresponding to each of the multiple target sub-data, and determine the degree of disorder as the third skewness; The weighted sum of the first skewness, the second skewness, and the third skewness is determined as the skewness.

6. The method according to claim 1, characterized in that, When the skewness is greater than a preset skewness value, the target data is split into multiple target sub-data, including: Determine a first data volume of the target sub-data whose predicted access frequency is less than the frequency threshold; Calculate the ratio of the first data volume to the target data volume of the target data to obtain the first proportion; If the first proportion is greater than a preset ratio and the skewness is greater than a preset skewness, the target data is split into the multiple target sub-data.

7. The method according to claim 6, characterized in that, When the skewness is greater than a preset skewness value, the target data is split into multiple target sub-data, including: Determine the utilization rate and remaining space of the first memory; When the first proportion is greater than a preset ratio, the utilization rate is greater than the first utilization rate, the remaining space is less than a preset space, the hit rate of the second memory needs to be improved, and the skewness is greater than a preset skewness value, the target data is split into the multiple target sub-data.

8. The method according to claim 7, characterized in that, When the skewness is greater than a preset skewness value, after splitting the target data into the multiple target sub-data, the following steps are taken: Determine the lookup table for the storage device; The product of the change in the capacity of the first memory and the access benefit of the first memory is determined as the first product; The product of the page table increment cost and the page table access cost of the lookup table is determined as the second product; If the difference between the first product and the second product is less than the preset benefit, the target sub-data is aggregated to obtain the target data.

9. The method according to any one of claims 1 to 8, characterized in that, The step of storing the target sub-data with a predicted access frequency greater than a frequency threshold in the first memory and storing the target sub-data with a predicted access frequency less than the frequency threshold in the second memory includes: Determine the predicted access frequency for each of at least one candidate sub-data that has been split in the storage device; If the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, the multiple candidate sub-data with consecutive addresses are aggregated to obtain the reference data.

10. The method according to claim 9, characterized in that, When the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, aggregating the multiple candidate sub-data with consecutive addresses to obtain the reference data includes: Calculate the access variance among the predicted access frequencies of each of the multiple candidate sub-data with consecutive addresses; If the access variance is less than the variance threshold, the multiple candidate sub-data with consecutive addresses are aggregated to obtain the reference data.

11. The method according to claim 9, characterized in that, When the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, aggregating the multiple candidate sub-data with consecutive addresses to obtain the reference data includes: Determine the lookup table corresponding to the storage device; When the increase rate of page entries in the lookup table is greater than the preset growth rate, and when the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, the multiple candidate sub-data with consecutive addresses are aggregated to obtain the reference data.

12. The method according to claim 11, characterized in that, When the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, aggregating the multiple candidate sub-data with consecutive addresses to obtain the reference data includes: When the storage device does not include the reference data, the utilization rate of the first memory is less than the second utilization value, the increase rate of page table entries in the lookup table is greater than the preset growth rate, and the predicted access frequency change trend of the multiple candidate sub-data with consecutive addresses is consistent, the multiple candidate sub-data with consecutive addresses are aggregated to obtain the reference data.

13. The method according to claim 12, characterized in that, When the predicted access frequency change trends of multiple candidate sub-data with consecutive addresses are consistent, after aggregating the multiple candidate sub-data with consecutive addresses to obtain the reference data, the process includes: The third product is calculated by multiplying the number of table entries decreased in the lookup table by the increase in the lookup table hit rate. The aggregate benefit is obtained by subtracting the probability of performance degradation of the storage device from the third product. If the aggregated return is less than the second return, the reference data is split into multiple candidate sub-data.

14. The method according to claim 1, characterized in that, If the predicted access frequency corresponding to each of the plurality of target sub-data satisfies the preset splitting condition, then after splitting the target data into the plurality of target sub-data, the following steps are taken: If the target data is stored in the first memory, the target sub-data with a predicted access frequency less than the frequency threshold is stored in the second memory; When the target data is stored in the second memory, the target sub-data with a predicted access frequency less than the frequency threshold is stored in the third memory, wherein the third latency of the third memory is greater than the second latency.

15. A multi-level memory management device, characterized in that, include: A prediction frequency module is used to predict a prediction frequency set of the storage device using a reference information set corresponding to the storage device. The storage device includes a first memory and a second memory. The first latency of the first memory is less than the second latency of the second memory. The reference information set includes access count, recent access time, and access time interval. A frequency determination module is used to determine multiple target sub-data contained in the target data of the storage device, and to determine the predicted access frequency corresponding to each of the multiple target sub-data based on the predicted frequency set. The target data is the large page memory in memory management, and the target sub-data is the small page memory contained under the large page memory. The data splitting module is used to split the target data into the multiple target sub-data when the predicted access frequency corresponding to each of the multiple target sub-data satisfies the preset splitting conditions; A tiered storage module is used to store the target sub-data with a predicted access frequency greater than a frequency threshold in the first memory, and to store the target sub-data with a predicted access frequency less than the frequency threshold in the second memory; The apparatus is further configured to: determine reference sub-data contained in at least one reference data of the storage device, wherein the at least one reference data includes the target data; access a data information table corresponding to the storage device to obtain the reference information set, wherein the reference information set includes reference information indicating the reference sub-data contained in each of the at least one reference data; predict the prediction frequency set using the reference information of the reference sub-data contained in each of the at least one reference data, wherein the prediction frequency set includes at least one predicted access frequency, the predicted access frequency being obtained by predicting the reference sub-data based on the reference information of the reference sub-data; calculate skewness based on the predicted access frequencies corresponding to each of the plurality of target sub-data, wherein the skewness is used to indicate the access popularity distribution of the plurality of target sub-data contained in the target data; and, if the skewness is greater than a preset skew value, split the target data into the plurality of target sub-data.

16. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for implementing the steps of the multi-level memory management method as described in any one of claims 1 to 14 when executing the computer program.

17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the multi-level memory management method as described in any one of claims 1 to 14.

18. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the multi-level memory management method as described in any one of claims 1 to 14.

Citation Information

Patent Citations

  • Application program memory use optimization method and device, equipment and medium

    CN115237821A

  • Hot page threshold adjustment method and device, medium, product and memory system

    CN120371535A