Memory management method, electronic equipment and related device
By differentiating between hot and non-hot pages at the page level, and combining priority strategies with server collaboration, the problem of low memory management efficiency in existing technologies is solved, achieving efficient memory resource utilization and caching effects.
Patent Information
- Application Number
- CN202511353337.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-02-17
AI Technical Summary
Existing memory management at the file level is inefficient and cannot effectively prevent non-hotspot pages from occupying memory for extended periods.
By differentiating hot and non-hot pages in a file at the granularity of memory management pages, and managing the swapping in and out of hot pages through a priority strategy, combined with the collaborative work of the server and terminal devices, high-frequency data can be accurately identified and cached.
It improves memory management efficiency, reduces the long-term memory occupation of non-hot pages, improves system overhead and version stability, and ensures the effectiveness and flexibility of caching.
Smart Images

Figure CN121542017A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal devices, and more particularly to a memory management method, electronic device, and related apparatus. Background Technology
[0002] During operation, terminal devices often need to load data from external storage (such as hard drives) into memory so that they can directly read data from memory and improve data processing speed. However, due to hardware limitations, terminal devices have limited memory space, and they need to swap out data already loaded into memory to make room for the data to be loaded.
[0003] Currently, terminal devices can configure granular whitelists, where files in the whitelist are considered "hot files," such as those accessed frequently. Once the terminal device loads data from these hot files into memory, it can manage this data separately from other data in memory. For example, data in hot files is retained in memory for a longer period compared to other data in memory. However, whitelists operate on a file-by-file basis, meaning all data within the entire file remains in memory for an extended period, resulting in inefficient memory management. Summary of the Invention
[0004] This application provides a memory management method, an electronic device, and related apparatus. In this method, instead of using files as the granularity, hot pages and non-hot pages in a file are distinguished at the granularity of memory management pages. This can avoid long-term memory occupation by non-hot pages in the file and improve memory management efficiency.
[0005] It should be understood that the hot pages and non-hot pages in the embodiments of this application are pages in the file divided by the size of memory pages, and are not actual document pages.
[0006] Firstly, embodiments of this application provide a memory management method applied to a terminal device. In this method, the terminal device obtains a set of hot pages and performs memory management based on the set of hot pages. Each file in one or more files within the terminal device is divided according to the size of the terminal device's memory pages, and the set of hot pages comprises a subset of pages from multiple pages in the one or more files. During memory management, within the same file, pages belonging to the set of hot pages have a higher swap-in priority than pages not belonging to the set of hot pages, and / or, pages not belonging to the set of hot pages have a higher swap-out priority than pages belonging to the set of hot pages. In other words, hot pages in a file can be retained in memory for a longer period, preventing non-hot pages in the file from occupying memory for extended periods.
[0007] In this embodiment, hot pages and non-hot pages in a file are distinguished at the granularity of memory management pages, which can avoid the long-term memory occupation of non-hot pages in the file and improve memory management efficiency.
[0008] In one possible implementation, the terminal device obtains the set of hot pages by: receiving a set of hot pages from a server; or, receiving hot page set difference information from a server and updating the historical hot page set in the terminal device according to the difference information to obtain the set of hot pages.
[0009] This implementation provides an alternative way for terminal devices to obtain the set of hot pages. The difference information only transmits the changed part of the set of hot pages, which reduces the amount of data transmission compared to the method of distributing the entire set of hot pages. The terminal device can also process the data faster, further reducing system overhead and allowing memory management to adapt to changes while ensuring high efficiency.
[0010] In one possible implementation, the terminal device obtains the set of hot pages by: obtaining a set of hot file segments, and determining the set of hot pages based on the set of hot file segments. Here, the set of hot file segments consists of partial file segments from one or more files. Alternatively, the set of hot file segments can be described as partial file segments from multiple files within one or more files.
[0011] In this implementation, a set of hot pages can be determined based on a set of hot file segments, and memory management can then be performed based on this set of hot pages. Specifically, the terminal device determines hot pages to manage memory based on the set of hot pages. The granularity of pages is small, and distinguishing between hot and non-hot pages within a file at the page level avoids long-term memory occupation by non-hot pages, improving memory management efficiency. Furthermore, the terminal device can directly query the set of hot pages to determine hot pages without complex calculations, resulting in low system overhead. Additionally, the set of hot pages is determined based on a set of hot file segments, which exhibit significant stability during version iterations, not disappearing or changing drastically with updates, thus ensuring good version stability. Therefore, this embodiment of the application uses a method of determining the set of hot pages based on a set of hot file segments for memory management, achieving a balance between caching effectiveness, system overhead, and version stability.
[0012] The terminal device obtains the set of hot file segments in the following ways: receiving the set of hot file segments from the server; or receiving the difference information of the set of hot file segments from the server, and updating the historical set of hot file segments in the terminal device according to the difference information to obtain the set of hot file segments.
[0013] This implementation provides two methods for terminal devices to obtain a set of hot pages based on a set of hot file segments. The server can either distribute the hot file segment set to the terminal device in a full manner, or distribute it in a differential manner, providing the difference in hot file segment sets between two versions during version iteration. The full distribution method is suitable for initial distribution of the hot file segment set or situations where the hot file segments change drastically, while the differential distribution method is suitable for regular iterations. The choice can be made as needed to improve adaptability.
[0014] In one possible implementation, the terminal device itself can determine the set of hot file segments in one or more files.
[0015] In this implementation, the terminal device can determine the set of hot file segments on its own, without relying on pre-configuration, making it more intelligent and more flexible.
[0016] In one possible implementation, the method by which the terminal device determines the set of hot pages based on the set of hot file segments includes: taking the pages occupied by hot file segments in one or more files as target pages, and then determining the set of hot pages based on the target pages.
[0017] In this implementation, hot file segments are associated with pages, and only the pages corresponding to the hot file segments are considered, avoiding misjudgment of irrelevant pages and ensuring that all pages in the hot page set are hot pages, thereby reducing invalid cache usage.
[0018] In one possible implementation, the method by which the terminal device determines the set of hot pages based on the target page includes: designating a target page containing a complete hot file segment as a hot page; and / or, if the proportion of a portion of a hot file segment is greater than or equal to a first threshold, then designating the target page as a hot page if the target page contains portions of multiple hot file segments is greater than or equal to a second threshold. The set containing several hot pages is then designated as the hot page set. The first threshold and the second threshold may be the same or different.
[0019] In this implementation, pages that fully contain complete hot file segments are directly included to ensure that core high-frequency data is not missed. For pages containing partial hot file segments, the filtering is performed by comparing the percentage of a single hot file segment or the cumulative percentage of multiple hot file segments with a threshold. This avoids memory waste caused by misjudging local hot file segments and prevents high-frequency hot file segments from being over-filtered.
[0020] In one possible implementation, the set of hot file segments is based on the page access frequency occupied by file segments from one or more files.
[0021] The file segment is determined by at least one of the following parameters: page fault frequency and file segment size. File segment popularity is used to determine whether a file segment is a hot segment. Specifically, file segment popularity is positively correlated with access frequency, and / or, file segment popularity is positively correlated with page fault frequency, and / or, file segment popularity is negatively correlated with file segment size.
[0022] In this implementation, the terminal device determines hot functional segments based on at least one parameter: the access frequency of pages occupied by file segments, the page fault frequency, and the size of the file segments. This allows for accurate filtering of hot functionalities and optimized memory management. Access frequency identifies pages frequently used by users, page fault frequency reflects loading delays caused by uncached pages, and file segment size balances cache resource allocation. The combination of these three parameters, or any one of them, enables the terminal device to accurately locate the core file segments that truly require focused management, avoiding misclassifying ordinary file segments with low frequency and low page fault requirements as hotspots.
[0023] In one possible implementation, the popularity of a hot file segment is greater than or equal to a third threshold, where the popularity of the file segment is specifically the quotient of the page fault frequency and the size of the file segment.
[0024] In this implementation, the quotient of the page fault frequency of the pages occupied by a file segment and the size of the file segment is essentially the page fault frequency per unit memory size. A higher quotient indicates that the functional segment can solve more real problems with a smaller caching cost, resulting in higher utilization of cache resources. This embodiment can accurately identify hot functional segments that require priority protection and improve the utilization of memory resources.
[0025] In one possible implementation, the terminal device can obtain file segments from the first file based on the header information of the first file in one or more files. In other words, the terminal device can obtain file segments from each file based on the header information of each file in one or more files.
[0026] In this implementation, the file header information typically contains data such as the file segment structure, offset address, and length. The terminal device can directly extract the file segment information from it without traversing the entire file, which reduces the amount of data processing and computational overhead and improves the efficiency of file segment acquisition.
[0027] In one possible implementation, one or more files include system files for the operating system and / or application files.
[0028] In this implementation, the hot file segments originate from operating system files and / or application files. By covering both types of files, the key needs of daily operation of terminal devices can be matched. System files are associated with the stable operation of the operating system, while application files are associated with high-frequency user operations. Including both allows for a more comprehensive collection of hot pages, preventing the omission of high-frequency data from core files.
[0029] In one possible implementation, the collection of hot pages is retrieved after an operating system and / or application update.
[0030] In this implementation, after the operating system and / or application are updated, the file structure or content may change. At this time, the hot page set is updated synchronously to avoid cache failure caused by the mismatch between the old hot page set and the new page, ensuring that the hot page identification is consistent with the current file structure or content, and improving the caching effect.
[0031] In one possible implementation, the hot file segment set includes a first file segment, and the hot page set includes a first page. The first file segment corresponds to the first page, and the first page is a page in the application's files. The method further includes: during application installation, the terminal device determines the first page based on the first file segment. The first file segment may include application startup-related functions, etc.
[0032] In this implementation, the hot pages occupied by application startup functions are identified during the installation phase. These hot pages can be loaded into memory in advance, avoiding loading delays caused by page faults during application execution and improving the user experience.
[0033] In one possible implementation, the hot page set includes an identifier for at least one hot page and an identifier for the file to which the hot page belongs. The hot page identifier indicates a hot page, and the file identifier indicates the file to which the hot page belongs. The hot file segment set includes an identifier for at least one hot file segment and an identifier for the file to which the hot file segment belongs. The hot file segment identifier indicates a hot file segment, and the file identifier indicates the file to which the hot file segment belongs.
[0034] In this implementation, the hot page set is identified by an identifier, indicating the hot page and the file to which the hot page belongs; the hot file segment set is identified by an identifier, indicating the hot file segment and the file to which the hot file segment belongs. Instead of storing the contents of the hot page set or the hot file segment, this approach facilitates the terminal device in finding the corresponding file, page, or file segment, and also reduces the file size of the hot page set and the hot file segment set, saving storage resources for the terminal device.
[0035] In one possible implementation, the hotspot file segment includes at least one of the following: a function, or the contents of a compressed file used to indicate subfiles.
[0036] In this implementation, specifying the exact type of the hot file segment not only makes the configuration of the hot page collection more targeted, but also avoids loading errors and makes the identification of hot pages more accurate.
[0037] In one possible implementation, the memory of the terminal device includes a first queue and a second queue, wherein the page swapping priority of the page in the first queue is lower than the page swapping priority of the page in the second queue, pages belonging to the hot page set enter the first queue after being swapped in, and pages in one or more files that do not belong to the hot page set enter the second queue after being swapped in.
[0038] The following is an introduction to this method:
[0039] When the terminal device determines that a page needs to be switched out, it switches out the page using a first switching strategy, which is as follows:
[0040] When a terminal device determines that it needs to switch to a new page, it can determine whether the length of the second queue is less than or equal to a length threshold. If the length of the second queue is less than or equal to the length threshold, the terminal device can switch to a new page from the first queue; or, if the length of the second queue is greater than the length threshold, the terminal device can switch to a new page from the second queue.
[0041] In one possible implementation, the length threshold is less than or equal to twice the length of the first queue.
[0042] In one possible implementation, the memory of the terminal device may include a queue, which can be called a page queue, and any page enters the page queue after being swapped in.
[0043] The following is an introduction to this method:
[0044] When a terminal device determines that a page needs to be switched out, it uses a first switching strategy to switch out the page, where the first page is at the head of the page queue. It should be understood that when a page enters the page queue, it can be placed at the tail of the queue, and the terminal device can switch out the page at the head of the queue first.
[0045] In this implementation, the first swap-out strategy includes:
[0046] If the first page belongs to the set of popular pages, and the terminal device determines that it wants to switch to the first page for the Nth time, then the first page can be switched. Alternatively,
[0047] When the first page belongs to the set of hot pages and the terminal device determines that the first page needs to be swapped out for the Mth time, adjust the position of the first page from the head of the page queue to another position in the page queue. Here, the other position in the page queue can be the tail of the queue, or a randomly determined position, or a position at a fixed distance from the head of the queue. The other position in the page queue is not the head of the queue.
[0048] Where M < N, and N is an integer greater than 1.
[0049] When the first page is a page in one or more files that does not belong to the set of hot pages, the terminal device can directly swap out the first page.
[0050] In a second aspect, an embodiment of the present application provides a memory management method applied to a server. The method includes: determining a set of hot file segments in one or more files in the server, and determining a set of hot pages according to the set of hot file segments. One or more files are applied to a terminal device, and each file is divided into partial pages of multiple pages according to the size of the memory pages of the terminal device. The set of hot pages is partial pages among the multiple pages of one or more files. The set of hot file segments is partial file segments of one or more files. It can also be said that the set of hot file segments is partial file segments among multiple files of one or more files.
[0051] The set of hot pages is used for the terminal device to perform memory management. When the terminal device performs memory management, among the multiple pages of the same file, the swap-in priority of the pages belonging to the set of hot pages is higher than that of the pages not belonging to the set of hot pages, and / or the swap-out priority of the pages not belonging to the set of hot pages is higher than that of the pages belonging to the set of hot pages.
[0052] In this implementation, the server can determine the set of hot pages based on the set of hot file segments, and then the terminal device performs memory management based on the set of hot pages. The set of hot pages is determined based on the set of hot file segments, and the hot file segments have significant stability during version iteration, will not disappear or change significantly with updates, and have good version stability.
[0053] In a possible implementation, the server obtains the difference information of the set of hot pages according to the set of hot pages and the historical set of hot pages of the terminal device, and the difference information of the set of hot pages is used for the terminal device to obtain the set of hot pages.
[0054] In this implementation, another way for the server to transmit the set of hot pages to the terminal device is provided. The differential distribution method only transmits the changed part of the set of hot pages, reducing the amount of data transmission compared to the full distribution method.
[0055] In one possible implementation, one or more files, including system files of the operating system and / or application files, a set of hot pages, and hot page set difference information, are packaged in an upgrade package for the operating system and / or application and provided to the terminal device.
[0056] In this implementation, the hot page set or hot page set difference information is transmitted synchronously through the regular distribution channels of the upgrade package, without the need to establish an additional transmission link, thus reducing system complexity. The hot page set or hot file segment set is updated synchronously during the upgrade, which ensures that the terminal device can obtain and match the new version file in time, avoids the lag of important information due to version iteration, and ensures the effectiveness of caching.
[0057] In one possible implementation, the server determines a set of hot file segments in one or more files, by means of at least one parameter: the access frequency of the pages occupied by the file segments, the page fault frequency, and the size of the file segments. The popularity of a file segment is used to determine whether it is a hot file segment. Specifically, the popularity of a file segment is positively correlated with the access frequency, and / or positively correlated with the page fault frequency, and / or negatively correlated with the file segment size.
[0058] In this implementation, the server determines hot functional segments based on at least one parameter: the access frequency of pages occupied by file segments, the page fault frequency, and the size of the file segments. This allows for precise filtering of hot functionalities and optimized memory management. Access frequency identifies pages frequently used by users, page fault frequency reflects loading delays caused by uncached pages, and file segment size balances cache resource allocation. The combination of these three parameters, or any one of them, enables terminal devices to accurately locate the core file segments that truly require focused management, avoiding misjudging ordinary file segments with low frequency and low page fault requirements as hotspots.
[0059] In one possible implementation, the popularity of a hot file segment is greater than or equal to a third threshold, where the popularity of the file segment is specifically the quotient of the page fault frequency and the size of the file segment.
[0060] In this implementation, the quotient of the page fault frequency of the pages occupied by a file segment and the size of the file segment is essentially the page fault frequency per unit memory size. A higher quotient indicates that the functional segment can solve more real problems with a smaller caching cost, resulting in higher utilization of cache resources. This embodiment can accurately identify hot functional segments that require priority protection and improve the utilization of memory resources.
[0061] In one possible implementation, the terminal device can obtain a file segment from the first file based on the header information of the first file in one or more files. In other words, the server obtains a file segment from each file based on the header information of each file in one or more files.
[0062] In this implementation, the file header information typically contains data such as the file segment structure, offset address, and length. The terminal device can directly extract the file segment information from it without traversing the entire file, which reduces the amount of data processing and computational overhead and improves the efficiency of file segment acquisition.
[0063] In one possible implementation, the method by which the server determines the set of hot pages based on the set of hot file segments includes: taking the pages occupied by hot file segments in one or more files as target pages, and then determining the set of hot pages based on the target pages.
[0064] In this implementation, hot file segments are associated with pages, and only the pages corresponding to the hot file segments are considered, avoiding misjudgment of irrelevant pages, ensuring that the set of hot pages consists entirely of high-frequency data, and reducing invalid cache usage.
[0065] In one possible implementation, the server determines the set of hot pages based on the target page by: designating a target page containing a complete hot file segment as a hot page; if the proportion of a single hot file segment in a target page is greater than or equal to a first threshold, then the target page is designated as a hot page; if the target page contains multiple hot file segments, and the cumulative proportion of the portions of the multiple hot file segments is greater than or equal to a second threshold, then the target page is designated as a hot page. The set containing several hot pages is then defined as the hot page set. The first and second thresholds may be the same or different.
[0066] In this implementation, pages that fully contain hot file segments are directly included to ensure that core high-frequency data is not missed. For pages containing some hot file segments, the filtering is performed by comparing the percentage of a single hot file segment or the cumulative percentage of multiple hot file segments with a threshold. This avoids memory waste caused by misjudging local hot file segments and prevents high-frequency hot file segments from being over-filtered.
[0067] In one possible implementation, one or more files include system files for the operating system and / or application files.
[0068] In this implementation, the hot file segments originate from operating system files and / or application files. By covering both types of files, the key needs of daily operation of terminal devices can be matched. System files are associated with the stable operation of the operating system, while application files are associated with high-frequency user operations. Including both allows for a more comprehensive collection of hot pages, preventing the omission of high-frequency data from core files.
[0069] In one possible implementation, the hot page set includes an identifier for at least one hot page and an identifier for the file to which the hot page belongs. The hot page identifier indicates a hot page, and the file identifier indicates the file to which the hot page belongs. The hot file segment set includes an identifier for at least one hot file segment and an identifier for the file to which the hot file segment belongs. The hot file segment identifier indicates a hot file segment, and the file identifier indicates the file to which the hot file segment belongs.
[0070] In this implementation, the hot page set is identified by an identifier, indicating the hot page and the file to which the hot page belongs; the hot file segment set is identified by an identifier, indicating the hot file segment and the file to which the hot file segment belongs. Instead of storing the contents of the hot page set or the hot file segment, this approach facilitates the terminal device in finding the corresponding file, page, or file segment, and also reduces the file size of the hot page set and the hot file segment set, saving storage resources for the terminal device.
[0071] In one possible implementation, the hotspot file segment includes at least one of the following: a function, or the contents of a compressed file used to indicate subfiles.
[0072] In this implementation, specifying the exact type of the hot file segment not only makes the configuration of the hot page collection more targeted, but also avoids loading errors and makes the identification of hot pages more accurate.
[0073] Thirdly, embodiments of this application provide a memory management method applied to a server. The method includes: the server determining a set of hot file segments from one or more files, and the one or more files being applied to a terminal device. The set of hot file segments is used by the terminal device to determine a set of hot pages. Each file in the one or more files is divided into multiple pages according to the size of the terminal device's memory pages, and the set of hot pages consists of a subset of these multiple pages from the one or more files. Alternatively, the set of hot file segments can be described as a subset of file segments from multiple files within the one or more files.
[0074] Hot page sets are used for memory management by terminal devices. When performing memory management, among multiple pages of the same file, pages belonging to the hot page set have a higher swap-in priority than pages not belonging to the hot page set, and / or pages not belonging to the hot page set have a higher swap-out priority than pages belonging to the hot page set.
[0075] In this implementation, the server can provide a set of hot file segments to the terminal device, and the terminal device can determine a set of hot pages for memory management based on this set of hot file segments. The set of hot pages is determined based on the set of hot file segments, and the hot file segments have significant stability in version iterations, not disappearing or changing significantly with updates, resulting in good version stability.
[0076] In one possible implementation, the server can obtain hot file segment set difference information based on the hot file segment set and the terminal device's historical hot file segment set. Correspondingly, the terminal device receives the hot file segment set difference information from the server and updates its historical hot file segment set based on this difference information to obtain the new hot file segment set.
[0077] This implementation provides an alternative way for the server to transmit a set of hot file segments to the terminal device. The differential distribution method only transmits the changed parts of the set of hot file segments, which reduces the amount of data transmission compared to the full distribution method.
[0078] In one possible implementation, one or more files, including system files of the operating system, and / or application files, a set of hot file segments, and hot file segment set difference information, are packaged in an upgrade package for the operating system and / or application and provided to the terminal device.
[0079] In this implementation, the hot file segment set or hot file segment set difference information is transmitted synchronously through the regular distribution channels of the upgrade package, without the need to establish an additional transmission link, thus reducing system complexity. The hot file segment set or hot file segment set is updated synchronously during the upgrade, which can ensure that the terminal device can obtain and match the new version file in time, avoid the lag of important information due to version iteration, and ensure the effectiveness of caching.
[0080] In one possible implementation, determining a set of hot file segments in one or more files includes: determining the set of hot file segments based on at least one of the following parameters: the access frequency of pages occupied by file segments in one or more files, the page fault frequency, and the size of file segments.
[0081] In one possible implementation, the popularity of a file segment is positively correlated with its access frequency, and / or, the popularity of a file segment is positively correlated with its page fault frequency, and / or, the popularity of a file segment is negatively correlated with its size. The popularity of a file segment is used to determine whether a file segment is a hot file segment.
[0082] In one possible implementation, the popularity of a hot file segment is greater than or equal to a third threshold.
[0083] In one possible implementation, the hotness of a file segment is specifically the quotient of the page fault frequency and the size of the file segment.
[0084] In one possible implementation, the method further includes: the server can obtain file segments from the first file based on the header information of the first file in one or more files. In other words, the server obtains file segments from each file based on the header information of each file in one or more files.
[0085] In one possible implementation, one or more files include system files for the operating system and / or application files.
[0086] Fourthly, embodiments of this application provide a memory management method applied to a memory management system, which includes a server and a terminal device.
[0087] In this method, the server determines a set of hot file segments from one or more files, and these one or more files are applied to the terminal device. Based on the set of hot file segments, the server determines a set of hot pages. Each file in the one or more files is divided into multiple pages according to the memory page size of the terminal device, and the set of hot pages consists of a subset of these multiple pages from the one or more files. Specifically, the set of hot file segments consists of a subset of file segments from one or more files. Alternatively, it can be described as a subset of file segments from multiple files within the one or more files.
[0088] The terminal device obtains a set of trending pages. This can be achieved by the server providing the set of trending pages to the terminal device, or by the terminal device obtaining the set of trending pages from the server, for example, periodically.
[0089] The terminal device performs memory management based on a set of hot pages. When performing memory management, among multiple pages of the same file, the page belonging to the set of hot pages has a higher swap-in priority than the page not belonging to the set of hot pages, and / or, the page not belonging to the set of hot pages has a higher swap-out priority than the page belonging to the set of hot pages.
[0090] In one possible implementation, one or more files, including system files of the operating system and / or application files, a set of hot pages, and hot page set difference information, are packaged in an upgrade package for the operating system and / or application and provided to the terminal device.
[0091] In one possible implementation, the server obtains a difference information between the hot page set and the terminal device's historical hot page set. Correspondingly, the terminal device receives the hot page set difference information from the server and updates its historical hot page set based on this difference information to obtain the new hot page set. The terminal device then manages its memory based on the hot page set.
[0092] In one possible implementation, the server determines a set of hot file segments in one or more files, including: the server determines the set of hot file segments based on at least one of the following parameters: the access frequency of the pages occupied by the file segments in the one or more files, the page fault frequency, and the size of the file segments.
[0093] The popularity of a file segment is used to determine whether a file segment is a hot segment. Specifically, the popularity of a file segment is positively correlated with access frequency, and / or positively correlated with page fault frequency, and / or negatively correlated with file segment size.
[0094] In one possible implementation, the popularity of a hot file segment is greater than or equal to a third threshold, where the popularity of the file segment is specifically the quotient of the page fault frequency and the size of the file segment.
[0095] In one possible implementation, the server can obtain file segments from the first file based on the header information of the first file among one or more files. In other words, the server obtains file segments from each file based on the header information of each of the one or more files.
[0096] In one possible implementation, the server determines the set of hot pages based on the set of hot file segments, including: the server taking the pages occupied by hot file segments in one or more files as target pages; and the server determining the set of hot pages based on the target pages.
[0097] In one possible implementation, the server determines a set of hot pages based on the target page, including: the server designates a target page containing a complete hot file segment as a hot page; or, if the target page contains a portion of a hot file segment, and the proportion of that portion is greater than or equal to a first threshold, the server designates the target page as a hot page; or, if the target page contains portions of multiple hot file segments, and the cumulative proportion of those portions is greater than or equal to a second threshold, the server designates the target page as a hot page set. The first and second thresholds may be the same or different.
[0098] In one possible implementation, one or more files include system files for the operating system and / or application files.
[0099] In one possible implementation, the hot page set includes an identifier for at least one hot page and an identifier for the file to which the hot page belongs. The hot page identifier indicates a hot page, and the file identifier indicates the file to which the hot page belongs. The hot file segment set includes an identifier for at least one hot file segment and an identifier for the file to which the hot file segment belongs. The hot file segment identifier indicates a hot file segment, and the file identifier indicates the file to which the hot file segment belongs.
[0100] In one possible implementation, the hotspot file segment includes at least one of the following: a function, or the contents of a compressed file used to indicate subfiles.
[0101] Fifthly, embodiments of this application provide a memory management method applied to a memory management system, which includes a server and a terminal device.
[0102] In this method, the server determines a set of hot file segments from one or more files, and these files are applied to the terminal device. The terminal device obtains the set of hot file segments and can determine a set of hot pages based on this set. Alternatively, the server can provide the set of hot file segments to the terminal device, or the terminal device can obtain the set of hot file segments from the server.
[0103] Each of the one or more files is divided into multiple pages according to the memory page size of the terminal device. The hot page set is a subset of these pages from the one or more files. Specifically, the hot file segment set is a subset of file segments from the one or more files. Alternatively, the hot file segment set can be described as a subset of file segments from multiple files within the one or more files.
[0104] Terminal devices can perform memory management based on hot page sets. When performing memory management, among multiple pages of the same file, pages belonging to the hot page set have a higher swap-in priority than pages not belonging to the hot page set, and / or pages not belonging to the hot page set have a higher swap-out priority than pages belonging to the hot page set.
[0105] In one possible implementation, the server can obtain hot file segment set difference information based on the hot file segment set and the terminal device's historical hot file segment set. This difference information is used by the terminal device to obtain the hot file segment set. Correspondingly, the terminal device receives the hot file segment set difference information from the server and updates its historical hot file segment set based on this difference information to obtain the final hot file segment set.
[0106] In one possible implementation, the server obtains a difference information between the hot file segment set and the historical hot file segment set of the terminal device. Correspondingly, the terminal device receives the hot file segment set difference information from the server and updates its historical hot file segment set based on this difference information to obtain the new hot file segment set. The terminal device then manages its memory based on the hot file segment set.
[0107] In one possible implementation, one or more files, including system files of the operating system, and / or application files, a set of hot file segments, and hot file segment set difference information, are packaged in an upgrade package for the operating system and / or application and provided to the terminal device.
[0108] In one possible implementation, the server determines a set of hot file segments in one or more files, including: the server determines the set of hot file segments based on at least one of the following parameters: the access frequency of the pages occupied by the file segments in the one or more files, the page fault frequency, and the size of the file segments.
[0109] The popularity of a file segment is used to determine whether a file segment is a hot segment. Specifically, the popularity of a file segment is positively correlated with access frequency, and / or positively correlated with page fault frequency, and / or negatively correlated with file segment size.
[0110] In one possible implementation, the popularity of a hot file segment is greater than or equal to a third threshold, where the popularity of the file segment is specifically the quotient of the page fault frequency and the size of the file segment.
[0111] In one possible implementation, the server can obtain file segments from the first file based on the header information of the first file among one or more files. In other words, the server obtains file segments from each file based on the header information of each of the one or more files.
[0112] In one possible implementation, the terminal device determines the set of hot pages based on the set of hot file segments, including: the terminal device taking the pages occupied by hot file segments in one or more files as target pages; and the terminal device determining the set of hot pages based on the target pages.
[0113] In one possible implementation, the terminal device determines a set of hot pages based on the target page, including: the terminal device designates a target page containing a complete hot file segment as a hot page; or, if the target page contains a portion of a hot file segment, and the proportion of that portion is greater than or equal to a first threshold, the terminal device designates the target page as a hot page; or, if the target page contains portions of multiple hot file segments, and the cumulative proportion of the portions of the multiple hot file segments is greater than or equal to a second threshold, the terminal device designates the target page as a hot page set; the terminal device then defines the set of hot pages as the hot page set. The first threshold and the second threshold may be the same or different.
[0114] In one possible implementation, one or more files include system files for the operating system and / or application files.
[0115] In one possible implementation, the hot page set includes an identifier for at least one hot page and an identifier for the file to which the hot page belongs. The hot page identifier indicates a hot page, and the file identifier indicates the file to which the hot page belongs. The hot file segment set includes an identifier for at least one hot file segment and an identifier for the file to which the hot file segment belongs. The hot file segment identifier indicates a hot file segment, and the file identifier indicates the file to which the hot file segment belongs.
[0116] In one possible implementation, the hotspot file segment includes at least one of the following: a function, or the contents of a compressed file used to indicate subfiles.
[0117] Sixthly, embodiments of this application provide a terminal device, wherein the terminal device may include a memory and one or more processors; the memory is coupled to the processors; the memory stores computer program code, the computer program code including computer instructions, and when the computer instructions are executed by the processor, the terminal device performs the memory management method as described in the first aspect and any implementation thereof.
[0118] In a seventh aspect, embodiments of this application provide a server, wherein the server may include a memory and one or more processors; the memory is coupled to the processors; the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the server to perform the memory management method as described in the second aspect and any implementation thereof, or the third aspect and any implementation thereof.
[0119] Eighthly, embodiments of this application provide a memory management system, which may include the terminal device of the sixth aspect and the server of the seventh aspect.
[0120] A ninth aspect provides a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform a memory management method as described in the first aspect and any implementation thereof, the second aspect and any implementation thereof, or the third aspect and any implementation thereof.
[0121] In a tenth aspect, a chip system is provided, comprising one or more processors, which, when executing computer instructions, cause an electronic device to perform a memory management method as described in the first aspect and any implementation thereof, the second aspect and any implementation thereof, or the third aspect and any implementation thereof.
[0122] Eleventhly, a computer program product is provided, which, when running on an electronic device, causes the electronic device to execute the memory management method as described in the first aspect and any implementation thereof, the second aspect and any implementation thereof, and the third aspect and any implementation thereof.
[0123] Understandably, the beneficial effects that can be achieved by the above-mentioned aspects four through eleven can be referred to the beneficial effects of the first aspect and any of its possible design methods, the second aspect and any of its possible design methods, and the third aspect and any of its possible design methods, which will not be repeated here. Attached Figure Description
[0124] Figure 1 A schematic diagram of a hierarchical storage structure provided for an embodiment of this application;
[0125] Figure 2 A schematic diagram of page hits and page misses provided for an embodiment of this application;
[0126] Figure 3 This application provides a schematic diagram of a swap-in and swap-out process.
[0127] Figure 4 A schematic diagram illustrating a memory isolation protection method provided in an embodiment of this application;
[0128] Figure 5 A schematic diagram illustrating the generation, management, and use of a file-granular whitelist provided for embodiments of this application;
[0129] Figure 6 This application provides a schematic diagram of the software architecture of a terminal device.
[0130] Figure 7A A schematic flowchart illustrating an embodiment of a memory management method provided in this application;
[0131] Figure 7B A schematic flowchart of another memory management method provided in this application embodiment;
[0132] Figure 7C A schematic flowchart of another memory management method provided in this application embodiment;
[0133] Figure 7D A schematic flowchart of another memory management method provided in this application embodiment;
[0134] Figure 7E A schematic flowchart of another memory management method provided in this application embodiment;
[0135] Figure 8 A flowchart illustrating another memory management method provided in an embodiment of this application;
[0136] Figure 9 A schematic diagram of an ELF file format provided in an embodiment of this application;
[0137] Figure 10 This is a schematic diagram of a ZIP file format provided in an embodiment of this application;
[0138] Figure 11 A schematic diagram of a configuration file provided in an embodiment of this application;
[0139] Figure 12 A schematic diagram of hot file segments stored in a tool repository, provided for an embodiment of this application;
[0140] Figure 13 A schematic diagram illustrating a management method for hotspot file segments and generated hotspot pages provided in an embodiment of this application;
[0141] Figure 14 This is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of this application;
[0142] Figure 15 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0143] Figure 16 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation
[0144] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" are not necessarily different. Meanwhile, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is being used as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.
[0145] Furthermore, the business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0146] To facilitate understanding, the relevant terms and concepts involved in the embodiments of this application will be introduced below:
[0147] 1. Terminal Device: The terminal device involved in the embodiments of this application can be an electronic device configured with memory and external storage. Exemplarily, the terminal device can be, for example, a personal computer (PC), a laptop computer, a server, a mobile phone, a tablet computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal device in industrial control, a wireless terminal device in self-driving, a wireless terminal device in remote medical surgery, a wireless terminal device in a smart grid, a wireless terminal device in transportation safety, a wireless terminal device in a smart city, a wireless terminal device in a smart home, etc., and the embodiments of this application are not limited thereto.
[0148] 2. External storage: Used to store operating system programs, applications, user files (e.g., documents, pictures, videos), etc. The contents stored in the external storage will not be lost even if the terminal device is powered off.
[0149] In some embodiments, the external storage device may be a hard disk or flash memory, etc. In some embodiments, the external storage device may be referred to as read-only memory (ROM).
[0150] 3. Memory: Used for temporary data storage. During terminal device operation, data can be loaded from external storage into memory. The terminal device can then directly read data from memory, avoiding frequent access to external storage and improving data processing speed. The latency difference between accessing data from external storage and accessing data from memory can be 2-4 orders of magnitude.
[0151] When the terminal device is powered off, the data temporarily stored in memory is cleared to free up space. In some embodiments, memory may be referred to as random access memory (RAM).
[0152] It should be noted that the memory and external storage in this embodiment support random read and write.
[0153] 4. Page: The basic unit of data interaction between memory and external storage. Memory is managed at the page level. In some embodiments, the page size can be 4KB. When a terminal device loads data from external storage into memory, it divides this data into fixed-size "pages" and loads them into memory. A "page" is not a physical document page, but rather data with a fixed size (e.g., 4KB).
[0154] 5. Memory Page: Also known as a memory page or memory block, it is a way of dividing memory for storing data. For example, memory can be divided into many memory pages at a granularity of "pages" (e.g., 4KB). When writing data to memory, the data is also divided into pages of the same size as the "memory pages," and then the divided pages are loaded into the corresponding memory pages.
[0155] Note that in this embodiment of the application, before the data (such as one or more files) in the terminal device is loaded into memory, each file can be divided into multiple pages according to the size of the memory page. In the following embodiments, "page" refers to the page divided according to the size of the memory page, not the actual document page.
[0156] 6. Page Miss: When a terminal device accesses data in external storage, if the page corresponding to the data has not yet been loaded into memory, the terminal device needs to load the data from external storage into memory. The phenomenon where the terminal device cannot find the page corresponding to the data in memory is called a page miss.
[0157] In some embodiments, a page fault may also be referred to as a page break or page failure.
[0158] 7. Memory reclamation: When available memory is limited, terminal devices need to reclaim pages that have been written to memory in order to release the memory occupied by those pages.
[0159] 8. Page In and Page Out: When available memory is limited, if a terminal device needs to load a new page, it can write the page already loaded in memory to external storage, releasing the memory occupied by that page to load the new page. The operation on the already loaded page is called page out, and the operation on the new page is called page in.
[0160] 9. Anonymous Pages: Pages generated and stored in memory by applications during runtime on a terminal device, such as heap, stack, and data segments. It should be noted that data in anonymous pages is not pre-stored in external memory. In some embodiments, to reclaim anonymous pages, the terminal device can allocate a swap space in external memory, write the anonymous pages to the swap space, and thus release the memory occupied by the anonymous pages.
[0161] With the development of terminal devices, users' demands for data processing speed have increased. During operation, terminal devices frequently need to read (or access) data from external storage, but due to limitations such as access bandwidth, the speed at which terminal devices read data from external storage is slow. To accelerate data access, caching, such as central processing unit (CPU) cache and disk cache, can be used to store frequently accessed data in electronic devices. It should be understood that terminal device data access can be understood as the CPU accessing data within the terminal device. Figure 1 The following explanation uses the CPU as the execution entity.
[0162] Figure 1 This is a schematic diagram of a hierarchical storage structure in a terminal device. (Refer to...) Figure 1 Terminal devices may include CPU registers, CPU cache, main memory, magnetic disk, and magnetic tape / optical disk. Among them:
[0163] CPU registers are integrated inside the CPU, located at the top of the memory structure pyramid. Because they are integrated into the CPU, the CPU can read data from CPU registers at a very fast speed, such as on the order of nanoseconds. In some embodiments, CPU registers are used to store currently executing instructions, data, and data to be processed.
[0164] CPU cache is a high-speed storage component located between the CPU and main memory. It is also integrated into the CPU chip or closely connected to the CPU via a high-speed bus. Therefore, although the CPU reads data from the CPU cache at a speed slower than the CPU registers, it is much faster than main memory. In some embodiments, the CPU cache is used to store data and instructions that the CPU has recently accessed frequently.
[0165] Memory is the primary storage system relied upon by programs during runtime. The CPU can read data from memory very quickly, within tens of nanoseconds. Furthermore, memory has a large capacity, such as in the GB range, which can meet both the CPU's need for fast data retrieval and the capacity to hold data written to the operating system, applications, and other systems. Unlike CPU registers and CPU cache, memory is volatile; all data in memory is lost when the terminal device loses power. Therefore, external storage devices such as hard drives are necessary to preserve data.
[0166] In some embodiments, a dedicated area of memory is allocated, called the disk cache.
[0167] A magnetic disk is a form of external storage. For example, hard disks have much slower read / write speeds than RAM, such as milliseconds, but they offer much larger capacities, such as terabytes. Hard disks are used for long-term storage of data such as operating system programs and application programs in terminal devices.
[0168] Magnetic Tape / Optical Disk: The CPU reads and writes data the slowest among these, but has the largest capacity, and is mainly used for data archiving and backup.
[0169] Understandably, the purpose of this storage structure in terminal devices is to meet the high-speed data access and large-capacity storage requirements of terminal devices by utilizing the performance of different storage media.
[0170] In one application scenario, a terminal device can load data from external storage into memory. Each time this data is accessed, the terminal device can directly read the data from memory without accessing the external storage again. The following section combines... Figure 2 Introducing the process of terminal devices accessing data:
[0171] A page miss occurs when a terminal device needs to read data from external storage, but the corresponding page has not yet been loaded into memory. In this case, since the page is not in memory, the terminal device must first load it from external storage into memory so that it can directly read the data. The corresponding page is stored in memory page 1. Figure 2 As shown. It should be understood that page faults cause data retrieval delays and affect data processing speed.
[0172] A hit refers to a situation where a terminal device needs to access data in external storage, and the corresponding page is already loaded into memory. For example, if the page is loaded into memory... Figure 2 In memory page 4, the CPU can directly access the data in memory page 4.
[0173] However, due to hardware limitations, the memory space in terminal devices is often limited, and the CPU cannot load all data from external storage into memory. This means that after a new page is loaded, it may exceed the memory size, and the CPU must decide which pages need to be swapped out to make room for the new page. At the same time, memory can also be occupied by anonymous pages, graphics processing unit (GPU) memory, etc., which can also trigger page swapping. The following section combines... Figure 3 Introducing the page: Introducing the page:
[0174] Replacement: Refer to Figure 3 When a new page needs to be loaded into memory, or when a page fault occurs, the terminal device loads the page from external storage into memory. For example, loading memory page 1 into memory is called swapping.
[0175] Swap out: When a page is swapped in, if there is insufficient memory remaining, for example... Figure 3 If memory page 3 is occupied by an anonymous page, then pages in memory page 3 need to be swapped out.
[0176] In some embodiments, the swapping of pages in and out of memory by a terminal device can be referred to as page management. The core principle of swapping in and out is to prioritize the retention of "important pages" in memory. Important pages are, for example, pages accessed frequently. In contrast to important pages are non-important pages, which can be understood as pages accessed infrequently, or ordinary pages. When the CPU needs to swap out pages from memory to make room for new pages, it can prioritize swapping out non-important pages.
[0177] High access frequency means that the data on this page is frequently relied upon by the program during runtime. Examples include core code segments in operating system programs and configuration files that are repeatedly read and written. Keeping these types of pages in memory can significantly improve the data access "hit rate" for terminal devices, thereby reducing page fault rates and ultimately increasing data processing speed.
[0178] Currently, page management methods can include: swap-out replacement algorithms, memory prefetching, and memory isolation protection methods. Among these:
[0179] The essence of the swap-out algorithm is to prioritize swapping out less important pages. For example, less important pages can be pages with low access frequency or pages that were written to memory earliest.
[0180] In some embodiments, the replacement algorithm includes the Least Recently Used (LRU) algorithm. In the LRU algorithm, the page that has not been accessed for the longest time in memory is least likely to be accessed in the future, and the terminal device can prioritize replacing such pages when swapping them out.
[0181] The essence of memory prefetching algorithm is that the terminal device predicts the pages that will be accessed based on the user's behavior characteristics, and loads these pages from external storage into memory in advance to reduce the waiting time when the terminal device accesses these pages later.
[0182] The core of the memory isolation protection method is that the terminal device pre-identifies important files, while other non-important files can be referred to as ordinary files. When pages from important files are loaded into memory, the terminal device can manage these pages separately from other pages in memory. Here, the pages from important files in memory are called important pages, and the other pages in memory are called ordinary pages. In other words, in the memory isolation protection method, the terminal device can manage important pages and ordinary pages separately. For example, the terminal device can allocate more memory space for important pages and use a separate swap-out queue.
[0183] Here we combine Figure 4 The memory isolation protection method is illustrated with an example; please refer to [reference needed]. Figure 4 Terminal devices can divide memory into a first region and a second region.
[0184] The first region is used to store important pages. The terminal device can use the LRU algorithm to manage these important pages. On one hand, because the terminal device can allocate more memory space to important pages, more important pages can be stored in memory, improving the hit rate and reducing the page fault rate. On the other hand, when a page from a new important file needs to be swapped in, if the memory space in the first region is insufficient, the terminal device will invoke the LRU algorithm to swap out the least recently used important page from the first region, making room for the page in the new important file to be loaded.
[0185] The second region is used to store regular pages. The terminal device uses the LRU (Least Recently Used) algorithm to manage these regular pages. When a new regular file needs to be swapped in, if the memory space in the second region is insufficient, the terminal device will invoke the LRU algorithm to swap out the least recently used regular page from the second region. The swapping in and out of regular pages does not affect important pages in the first region, avoiding the encroachment on memory resources of important pages. This ensures that important pages remain in memory for as long as possible, improving the hit rate and reducing the page fault rate.
[0186] In some embodiments, a file-level whitelist can be configured in advance in the terminal device. This file-level whitelist is used to indicate important files in external storage; for example, it may include identifiers of the important files. These identifiers may include, but are not limited to, the file's name or its storage location in external storage.
[0187] In some embodiments, important files may also be referred to as hot files. Hot files are those that are accessed frequently.
[0188] File-level whitelist, based on the entire file. (The following is combined with...) Figure 5 This section introduces the process of generating, managing, and using file-level whitelists:
[0189] This section uses system files from an operating system as an example to introduce the file-level whitelisting mechanism of an operating system. For instance, after developers have developed an operating system installation package using a development device, before the installation package is imaged onto the terminal device, the development device can filter out frequently accessed files within the installation package. Here, imagering the operating system installation package onto the terminal device can be understood as the terminal device installing the operating system installation package.
[0190] The development equipment can generate configuration files based on frequently accessed files. These configuration files can be considered a file-level whitelist. The configuration files can include identifiers for the frequently accessed files. For example... Figure 5 The configuration file shown is an example; it may include names of frequently accessed files such as File 1 and File 2. The development device can package the configuration file into the operating system's installation package. Thus, after the operating system's installation package is imaged onto the terminal device, the terminal device can access the configuration file, meaning the terminal device is configured with that configuration file.
[0191] In some embodiments, upon powering on, the terminal device can read a configuration file to identify hot files in the operating system. The terminal device may employ a memory isolation protection method to manage hot files and regular files separately.
[0192] The memory isolation protection method can be referred to the description in the example above.
[0193] Analysis revealed that before a file is loaded into memory, it can be divided into multiple pages. This means a file can contain multiple pages, and within the same file, there are important and unimportant pages. Referring to memory isolation protection methods, pages in "hot" files are retained in memory for a longer period compared to other pages in memory. In file-granular whitelisting methods, all pages in the entire file are treated as important, resulting in prolonged retention of all pages in memory and low memory management efficiency.
[0194] To reduce the memory usage of unimportant pages in hot files while maintaining a high hit rate, some embodiments can refine the storage granularity by introducing a page-level whitelist. This method treats pages within a file as units, rather than the entire file. For example, a development device can filter out key pages (hot pages) from the installation package files and configure a page-level whitelist based on these hot pages. The page-level whitelist indicates hot pages, such as those accessed frequently. For example, the page-level whitelist may include the identifier of the hot page and the identifier of the file to which it belongs. For example, the page-level whitelist may include the filename and page name, such as file1=**, pages=p1,p3,…,pn.
[0195] The development device can package a page-level whitelist into the operating system's installation package. After the operating system's installation package is imaged onto the terminal device, the terminal device can read the page-level whitelist, identify hot pages in the operating system's system files, and then load the hot pages into memory. The terminal device can employ memory isolation protection methods to manage hot pages and ordinary pages separately. The memory isolation protection methods can be referenced in the example above.
[0196] File-level whitelisting provides "indiscriminate overall protection for all files." If a file is on the list, all pages within that file in memory are protected, which can lead to unimportant pages consuming memory. In contrast, page-level whitelisting offers "precise filtering protection," protecting only the most important pages within a file and preventing unimportant pages from consuming memory. In some embodiments, important pages can be referred to as hot pages, and unimportant pages can be referred to as non-hot pages or ordinary pages.
[0197] Compared to file-level whitelists, page-level whitelists only retain frequently accessed pages. This allows terminal devices to load more frequently accessed pages within the same memory space, further reducing page fault rates.
[0198] However, in practical applications, page-level whitelists face the following problems:
[0199] 1. Compilation obfuscation leads to version inconsistencies: Binary files undergo "obfuscation" during compilation. Obfuscation refers to the deliberate rearrangement of program code without changing its functionality, thereby increasing the difficulty of reverse engineering. Compilation obfuscation can be considered a security protection mechanism. For example, code originally stored in the order of "function A -> function B -> function C" on a page may become "function C -> function A -> function B" after obfuscation. This can lead to changes in the order of popular pages in different versions.
[0200] In some embodiments, for example, in version 1, the hot page is page 1 where function A is located. However, in the updated version 2, due to obfuscation, function A is moved to page 2. Thus, with each version update, the hot page changes from page 1 to page 2.
[0201] This forces the re-identification of hot pages and modification of the page whitelist with each version update. Frequent operations are not only tedious but also error-prone, significantly reducing system maintenance efficiency.
[0202] 2. Internal changes to files across versions: Besides compilation and obfuscation, many files, especially resource files and compressed packages, undergo significant internal changes when crossing versions due to updates or repackaging. These changes can cause the same content to appear in different positions on the page.
[0203] This also forces the re-identification of hot pages and modification of the page granular whitelist with each version update, which also presents the problem mentioned in point 1 above.
[0204] 3. Lack of intuitiveness: The core identifier of a page-level whitelist is the "page identifier," such as Page 1 and Page 2 mentioned above. However, this page identifier is not related to the actual content being protected, resulting in low visibility. Because page-level whitelists lack intuitive meaning, cross-version maintenance requires finding the new location of the page before modifying the whitelist, a cumbersome process that is inefficient and prone to errors. Furthermore, the identifiers in the page-level whitelist cannot indicate the "reason for protecting the page," forcing developers to spend extra time and effort searching the specific content of the page to understand its actual intent, making it difficult to maintain and resulting in low dissemination.
[0205] Whether it's a file-level or page-level whitelist, the whitelists are pre-configured in the terminal device, representing a static protection solution. In some embodiments, the terminal device can also employ a dynamic approach to identify hot objects (such as hot pages) in the operating system programs. For example, by pre-setting an algorithm for dynamically identifying hot objects in the terminal device, the device can identify hot objects in the operating system's system files based on this algorithm.
[0206] Compared to statically configured whitelists, dynamic whitelists have the following advantages and disadvantages:
[0207] Advantages: Dynamic schemes can automatically adapt to cross-version changes—no configuration files need to be updated, and terminal devices can identify hot objects in real time. This solves the problem of "version iteration failure" in static whitelists.
[0208] Disadvantages include: high implementation complexity, requiring the development of algorithms for dynamically identifying hot objects, and the high CPU resources consumed by terminal devices when running such algorithms, resulting in high system overhead.
[0209] In summary, comparing the static whitelist configuration approach and the dynamic whitelist approach from three dimensions—caching effectiveness, system overhead, and version stability—the advantages and disadvantages of each approach are shown in Table 1.
[0210] Table 1
[0211] caching effect System overhead version stable File granularity whitelist generally Low good Page-level whitelist good Low Difference Dynamic methods good high good
[0212] Referring to Table 1, file-level whitelists, page-level whitelists, and dynamic methods show significant differences in caching performance, system overhead, and version stability:
[0213] File-level whitelisting generally has limited caching effectiveness, primarily due to its coarse-grained protection—caching is done on a file-by-file basis. Terminal devices treat all pages within the entire file as hot pages, consuming significant memory and resulting in inefficient memory management. However, file-level whitelisting has low system overhead because the whitelist is pre-configured in the terminal device. When identifying hot files, the device only needs to read the whitelist, eliminating the need for extensive algorithmic computation. In terms of version stability, file-level whitelisting performs well because files, as relatively independent functionalities, are typically replaced or retained entirely during version iterations, requiring less frequent adjustments to the corresponding configuration files.
[0214] Page-level whitelisting offers good caching performance because it caches pages precisely within a file, preventing non-frequented pages from consuming memory. System overhead is also low, as it doesn't require extensive algorithmic computation and relies solely on the pre-configuration of the page-level whitelist. However, it suffers from poor version stability; with software updates, the most popular pages change, necessitating reconfiguration of the page-level whitelist.
[0215] Dynamic caching methods offer good caching performance because they can identify frequently accessed objects (such as popular pages), and these objects consume relatively little memory. They also offer good version stability because they rely on algorithms that dynamically identify frequently accessed objects, eliminating the need to update configuration files. However, they incur high system overhead, requiring real-time dynamic identification of frequently accessed objects, which consumes significant CPU resources.
[0216] In summary, file-level whitelisting sacrifices cache precision for low system overhead and high version stability, page-level whitelisting sacrifices version stability for high cache precision and low overhead, and dynamic methods sacrifice system overhead while simultaneously achieving high cache precision and high version stability. The difference between the three approaches lies in the different trade-offs between cache precision, system overhead, and version stability, but none of them achieve a balance between these three factors.
[0217] Page-level whitelisting offers good caching performance and low system overhead, but its version stability is poor because popular pages change across different versions. Analysis reveals that a page's value stems from its content—the code or resources that support core functionality. A page is frequently accessed because it contains frequently used code or resources; these are the core elements that truly need to be cached first. Therefore, the focus of whitelisting can shift from "pages" to "code or resources."
[0218] In some embodiments, the code or resources that carry core functionality within a page can be referred to as a "file segment". File segments can take various forms: at the code level, they might be a single function, such as a data encryption function, a set of functions working together, or an independent library file, such as a dynamic link library responsible for graphics rendering; at the resource level, they might be frequently accessed image resources, such as application icons, configuration files, or data fragments. For compressed files, which include multiple sub-files, a file segment can be the content within the compressed file used to indicate the sub-file.
[0219] File segments exhibit remarkable stability across version iterations: even with version updates, file segments do not undergo significant changes. In some embodiments, frequently used (or accessed) file segments on a page can be referred to as hot file segments.
[0220] Based on this, this application proposes a memory management method based on a set of hot file segments. The set uses hot file segments as the protection granularity, offering significant advantages. Regarding caching performance, compared to file-level whitelists, the terminal device only loads hot pages belonging to hot file segments, excluding non-hot pages from the file. This avoids non-hot pages occupying memory resources and improves memory management efficiency. In terms of version stability, hot file segments exhibit significant stability during version iterations, not disappearing or changing drastically with updates, resulting in good version stability. Regarding system overhead, only the hot file segment set needs to be pre-configured; the terminal device does not need to perform complex calculations, thus avoiding the consumption of large amounts of CPU resources and resulting in low system overhead. Therefore, the memory management method based on a set of hot file segments provided in this application can achieve a balance between caching accuracy, system overhead, and version stability.
[0221] Figure 6 A schematic diagram of the software structure of the terminal device provided for the implementation of this application. (Refer to...) Figure 6 The terminal device may include: applications and operating system. Applications may include system applications and third-party applications.
[0222] System applications are built into the operating system and exist to fulfill the device's basic functions or core user experience. They are typically provided by the device manufacturer or the operating system developer and are deeply integrated with the system. For example, Figure 6 Applications such as "Desktop," "Control Bar," "Contacts," "Phone," "Camera," and "Settings" are included. In some embodiments, system applications may be included in the operating system's installation package.
[0223] The terminal device provided in this application embodiment can run an operating system (OS) program. This operating system can be various operating systems used in the industry, such as those based on Open Harmony. TM Developed operating systems, such as Harmony OS TM or other operating systems such as Android TM iOS TM Mobile operating system; it can also be various open-source operating systems or their derivatives, such as LinuxOS. TM This includes other embedded operating systems, as well as future new operating systems, such as AI operating systems based on artificial intelligence. An operating system is a set of interconnected system software programs that manage and control the operation of electronic devices, utilize and run hardware and software resources, and provide public services to organize user interaction. In electronic devices, the operating system connects downwards to the physical devices at the hardware layer and provides a runtime environment for application software upwards. Electronic devices used in daily life vary in type and form, and are applied in a wide range of scenarios. Therefore, based on different forms and functions of electronic devices, different application scenarios, and different user needs, the operating systems used in electronic devices may also differ. The basic functions implemented by the electronic device provided in this application can be implemented using a general-purpose operating system or a dedicated operating system.
[0224] Among them, the installation package of the operating system running on the terminal device serves as the core carrier of system deployment. In addition to carrying the operating system's own programs, it also contains system applications such as "Desktop", "Control Bar", "Contacts", "Phone", "Camera" and "Settings".
[0225] When an operating system installation package is imaged onto a terminal device, the terminal device can run the operating system program, and the user can use system applications. In some embodiments, the operating system typically includes a kernel layer, a middleware layer, and an application layer. The application layer includes applications, which may include system applications. The middleware layer includes a series of software providing various services to application developers, or frameworks providing various services such as databases, multimedia, and graphics, or providing various capabilities such as distributed scheduling and system expansion. Exemplarily, the middleware layer may include a framework layer and / or a system service layer. The framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The system service layer includes the core capabilities of the system, providing services to applications through the framework layer. The kernel layer is the layer between hardware and software. The kernel layer may include hardware drivers and the operating system kernel. In addition to providing hardware drivers, the kernel layer also supports functions such as memory management and system process management.
[0226] Third-party applications, for example Figure 6 Applications such as "social networking" and "travel" in the internet.
[0227] It is understood that the memory management method provided in this application embodiment can be applied to files in a terminal device. Files in a terminal device may include: operating system system files, application files, and user files. The following embodiments use files in a terminal device as an example for illustration.
[0228] The memory management method provided in this application will be described below with reference to specific embodiments.
[0229] Before introducing the memory management method provided in the embodiments of this application, we will first introduce the scenarios to which the embodiments of this application are applicable:
[0230] In some embodiments, when a terminal device first installs the file's installation package, the server can provide the file's installation package to the terminal device. Here, the file is either a system file of the operating system or an application file. For example, after the installation of the file is developed on the development device, before the terminal device leaves the factory, the server can image the file's installation package onto the terminal device. The set of hot file segments or hot page sets can be configured in the file's installation package. It should be understood that when the file is a system file of the operating system, the server can be the server corresponding to the operating system; when the file is an application file, the server can be the server corresponding to the application.
[0231] In some embodiments, when the installation package of a file is updated, the server can provide an upgrade package to the terminal device, and the terminal device can download the upgrade package. The hot file segment set, or hot page set, or hot file segment set difference information, or hot page set difference information can be configured in the file upgrade package.
[0232] In some embodiments, the hot file segment set, hot page set, hot file segment set difference information, and hot page set difference information may not be provided with the installation package or upgrade package, such as the server providing them separately to the terminal device.
[0233] The hot file segment set, hot page set, hot file segment set difference information, and hot page set difference information can be referred to the description in the following embodiments.
[0234] Reference Figure 7A This scenario can include: servers and terminal devices.
[0235] In some embodiments, the server can also integrate the functionality of the development device.
[0236] In some embodiments, the server can identify hot file segments in one or more files on the terminal device, generate a set of hot file segments or a set of hot pages, and then provide the set of hot file segments or hot pages to the terminal device. Accordingly, the terminal device can directly obtain the set of hot pages, or determine the set of hot pages based on the set of hot file segments, and then perform memory management based on the set of hot pages.
[0237] Among them, the important steps and procedures can be as follows: Figure 8 As shown, the process requires the following steps in sequence: "Find files with resolvable file segments -> Determine the set of hot file segments -> Generate a set of hot pages -> Perform memory management on the terminal device". See below for details:
[0238] Step 1. Locate the file whose segments can be resolved.
[0239] In some embodiments, step 1 may be performed by the server. For example, for system files or application files of the operating system, the server may pre-obtain the files from the terminal device, thus allowing the server to find a file with a resolvable segment among one or more files. For user files, the terminal device may upload (e.g., periodically) them to the server, which then finds a file with a resolvable segment among one or more files.
[0240] The method by which the server finds a file with a resolvable segment can be found in [reference needed]. Figure 7A Description of S701A.
[0241] In some embodiments, step 1 can also be performed by the terminal device. For example, for system files or application files of the operating system, after downloading the installation package or upgrade package of the file, the terminal device can find a file with a resolvable file segment in one or more files. For example, for user files, the terminal device can find a file with a resolvable file segment in one or more files.
[0242] The method for terminal devices to find parseable files can be found in [reference needed]. Figure 7E Description of S701E.
[0243] In some embodiments, a file with resolvable file segments can be considered as a target file. In some embodiments, the target file may be a file with a predetermined format. For example, the predetermined format may be an executable and linkable format (ELF) or a compressed file format (ZIP). For instance, a server or terminal device may identify the format identifier in the file header to determine the file format.
[0244] Step 2. Determine the set of hot file segments
[0245] In some embodiments, step 2 may be performed by the server. After determining the target file, the server may identify a set of hot file segments within the target file. The method for the server to determine the set of hot file segments can be found in [reference needed]. Figure 7A Description of S701A.
[0246] In some embodiments, step 2 can also be performed by the terminal device. After determining the target file, the terminal device can identify a set of hot file segments within the target file. The method for the terminal device to determine the set of hot file segments can be found in [reference needed]. Figure 7E Description of S701E.
[0247] In some embodiments, a hot file segment is a core functional fragment in one or more files; for example, a hot file segment is a frequently accessed file segment in one or more files. In some embodiments, a hot file segment may include, but is not limited to, at least one of the following: functions, or content in a compressed file used to indicate subfiles. For example, see [link to relevant documentation]. Figure 8 For example, the hot file segments include file 1 with function 1 and file 2 with function 2.
[0248] A hotspot file segment set is used to indicate at least one hotspot file segment. In some embodiments, the hotspot file segment set includes the identifier of at least one hotspot file segment. In some embodiments, the hotspot file segment set includes the identifier of at least one hotspot file segment and the identifier of the file to which the hotspot file segment belongs. For example, refer to... Figure 8A collection of hot file segments, for example, segment 1 = file 1, function 1, segment 2 = file 2, function 2.
[0249] Step 3. Generate a collection of trending pages
[0250] In some embodiments, step 3 may be performed by the server. After determining the set of hot file segments, the server can determine the set of hot pages based on the set of hot file segments. The method for the server to determine the set of hot pages can be found in [reference needed]. Figure 7A Description of S702A.
[0251] In some embodiments, step 3 can also be performed by the terminal device. After determining the set of hot file segments, the terminal device can determine the set of hot pages based on the set of hot file segments.
[0252] Alternatively, the server can provide the terminal device with a set of hot file segments, and the terminal device can determine the set of hot pages based on the set of hot file segments.
[0253] For methods on how terminal devices determine the set of hot pages, please refer to [the relevant documentation / reference]. Figure 7E Description of S702E.
[0254] In some embodiments, the hot page set is used to indicate at least one hot page in a file. In some embodiments, the hot page set may include an identifier of a hot file segment. In some embodiments, the hot page set may include an identifier of the hot file segment and an identifier of the file to which the hot file segment belongs.
[0255] Step 4. Terminal device performs memory management.
[0256] Terminal devices can perform memory management based on a set of hot pages. For example, when performing memory management, among multiple pages of the same file, pages belonging to the set of hot pages have a higher swap-in priority than pages not belonging to the set of hot pages, and / or pages not belonging to the set of hot pages have a higher swap-out priority than pages belonging to the set of hot pages.
[0257] Understandable Figure 8 The process shown is a simplified description; for detailed implementation methods, please refer to [link / reference]. Figures 7A-7E The relevant descriptions in the illustrated embodiments are as follows.
[0258] In some embodiments, such as Figure 7A As shown, the memory management method in the embodiments of this application may include the following S701A-S704A.
[0259] S701A: The server determines a set of hot file segments in one or more files.
[0260] The memory management method provided in this application can be applied to system files of the operating system, application files, and user files of a terminal device. These system files, application files, and user files can all include one or more files.
[0261] In some embodiments, the server may determine the target file from one or more files. This target file is used to determine a set of hot file segments. The target file can be understood as the file containing the parsed file segments described in the above embodiments.
[0262] In some embodiments, the target file can be any file.
[0263] In some embodiments, the target file may be a file with a predetermined format within one or more files.
[0264] In some embodiments, the target file can be one or more files that the server can correctly parse.
[0265] The server can identify hot file segments in the target file, and then use the collection of hot file segments as the hot file segment set.
[0266] In some embodiments, the hot file set may include identifiers of hot file segments.
[0267] To facilitate the locating of hot file segments within a file, in some embodiments, the server can generate a set of hot file segments based on the identifiers of the hot file segments and the identifiers of the files to which the hot file segments belong. In this example, the set of hot file segments includes the identifiers of at least one hot file segment and the identifiers of the files to which the hot file segments belong.
[0268] For example, the collection of hot file segments can be an ini format file list_ini, with the following content:
[0269] config.ini
[0270] "ZNSL3_h10_function6_func1ZN4OHOS10AppExecFwk18AppMgrSer"="function_segment_id"
[0271] "protect_file_system"="file_id"
[0272] "AnotherHotFuncId"="function_segment_id"
[0273] "protect_file_vendor"="file_id"
[0274] In this example, "function_segment_id" corresponds to the identifier of the hot file segment, used to indicate the hot file segment. "file_id" indicates the file to which the hot file segment belongs. This way, when using the set of hot file segments later, for example, if a terminal device needs to check whether a certain hot file segment is within the protection scope, it can first quickly locate the corresponding file based on the file identifier `protect_file_system`, and then search for the corresponding hot file segment within that file.
[0275] In some embodiments, the set of hot file segments can be regarded as a list of hot file segments or a whitelist of hot file segments.
[0276] Because the existence, importance, and size of hot file segments remain relatively constant throughout version iterations, with minimal changes across versions, they can be pre-marked. Therefore, in some embodiments, hot file segments can be pre-configured in one or more files. For example, hot file segments in a file can be marked with a pre-defined "hot" identifier. When the server reads this "hot" identifier, it can determine that the corresponding file segment is a hot file segment, and then use the set of hot file segments as the hot file segment set.
[0277] In some embodiments, the server may determine the set of hot file segments based on at least one of the following parameters: the access frequency of pages occupied by file segments in one or more files, the page fault frequency, and the size of the file segments.
[0278] Access frequency refers to the total number of times a file segment's page is accessed by a terminal device within a unit of time. For example, a payment verification function called 50 times per hour has a higher access frequency than a log archiving function called only 10 times per hour. Access frequency is positively correlated with the popularity of a file segment.
[0279] Page fault frequency: When a terminal device needs to access a page occupied by a file segment, if that page is not loaded into memory, a "page fault" occurs. The page fault frequency is the ratio of the number of page faults to the total number of accesses. For example, if an image resource segment experiences 20 page faults out of 100 accesses, its page fault frequency is 20%. Page fault frequency is positively correlated with the popularity of the file segment.
[0280] File segment size: This refers to the amount of space occupied by the file segment, usually measured in bytes (B) or kilobytes (KB). For example, an encryption algorithm function segment is 4KB in size, and a high-definition icon resource segment is 200KB in size. File segment size is negatively correlated with file segment popularity.
[0281] In some embodiments, when the server identifies hot file segments in one or more files, the core process is to quantitatively analyze the above parameters to filter out the file segments with the highest "popularity." The specific steps are as follows:
[0282] (1) The server can collect the access frequency, page fault frequency, and file segment size of all file segments in one or more files through system logs to form a basic dataset. Based on these parameters, the server can calculate the "heat" of each file segment using a weighted method. The higher the access frequency and the higher the page fault frequency (indicating that the segment is frequently needed but prone to being lost), the higher the heat of the file segment. The larger the file segment size (the more resources it occupies), the lower the heat.
[0283] (2) Filtering hot file segments. For example, the server can pre-set a score threshold, such as 80 points. The server can identify file segments with a score higher than the threshold as "hot file segments". These hot file segments combine high access demand, high page fault impact and reasonable resource consumption, and are prioritized for caching or protection, which can maximize the improvement of system operating efficiency.
[0284] In some embodiments, the server may first send the target file to the test device so that the test can run the target file. During the operation of the test device, the test device can collect the access frequency and page fault frequency of each file segment within the file. Subsequently, the test device feeds these parameters back to the server, which then analyzes and filters them based on parameters such as the access frequency, page fault frequency, and file segment size to determine hot file segments, and then uses the set of hot file segments as the hot file segment set.
[0285] In some embodiments, the popularity of a file segment is used to determine whether the file segment is a hot file segment. Specifically, the popularity of a file segment is positively correlated with the access frequency of the page occupied by the file segment, positively correlated with the page fault frequency of the page occupied by the file segment, and negatively correlated with the size of the file segment. For example, the higher the access frequency of the page occupied by the file segment, the higher the popularity of the file segment; the higher the page fault frequency of the page occupied by the file segment, the higher the popularity of the file segment.
[0286] In some embodiments, the popularity of a hot file segment is greater than or equal to a third threshold. In other words, the server can designate file segments with a popularity greater than or equal to the third threshold as hot file segments.
[0287] For example, the hotness of a file segment is specifically the quotient of the page fault frequency and the size of the file segment.
[0288] The purpose of calculating the quotient between the page fault frequency of the file segment and the size of the file segment is to quantify the balance between the page fault sensitivity of the file segment and resource costs. A higher quotient indicates that the file segment "can resolve more page faults with less space cost," meaning higher utilization of cache resources.
[0289] The third threshold (e.g., "P / S ≥ 5 times / KB") sets a "high cost-effectiveness" threshold. When the popularity is greater than or equal to the threshold, it indicates that the "page fault sensitivity" of the page occupied by the file segment is high enough relative to its "space cost," making it worthwhile to prioritize caching resources. When the popularity is less than the threshold, it indicates that the "page fault problem" of the page occupied by the file segment is not prominent, or the "space cost is too high," and prioritizing caching would waste resources, so it should be postponed or not protected.
[0290] In this embodiment, the relationship between page fault frequency and resource cost is described by calculating the quotient between the page fault frequency of the file segment and the file segment size. If only page fault frequency is used for filtering, file segments with "high page fault frequency but extremely large file segment size" may be mistakenly selected. Although such file segments cause frequent page faults, they occupy too much cache space. After caching, other small but important segments will be squeezed out, which will increase the overall page fault rate.
[0291] This method uses the P / S quotient to prioritize file segments that are small but sensitive to page faults, ensuring that more hot pages are covered within the same memory limit. Conversely, some file segments, such as encryption function segments, may be small in size but have a high page fault frequency. If only page fault frequency is considered, they might be overlooked. However, the quotient shows that their "page fault impact per unit space" is much higher than that of log segments, thus ensuring their correct inclusion in protection and preventing core functions from losing protection due to frequent page faults. The third threshold can be dynamically adjusted; for example, lowering the threshold can expand the protection scope, minimizing page faults while sacrificing some cache space for smoother area switching.
[0292] In some embodiments, the hotspot file segment may include, but is not limited to, at least one of the following: functions, or content in a compressed file used to indicate subfiles. The content in the compressed file used to indicate subfiles refers to "index data" within the compressed package that records key information about the subfiles, not the subfiles themselves. Its purpose is to help the server quickly locate and identify specific subfiles within the compressed package.
[0293] After the server identifies the hot file segments, it can search for the hot file segments in one or more files, obtain the identifiers of the hot file segments, and obtain a set of hot file segments based on the identifiers.
[0294] The server can obtain file segments from each file based on the header information of each file, and then search for hot file segments within those segments.
[0295] The following examples, using two file types, illustrate how the server identifies hot file segments within a file:
[0296] File segment identifiers, such as "function1", "subfilename1", and file identifiers such as "ELF file1" and "ZIP file1", serve as indexes for the system to "locate and protect hot file segments". Their core value is that they allow the system to quickly identify hot file segments simply by "identifier matching" without needing to perform a global scan of file content, while simultaneously ensuring stability across different versions.
[0297] After compilation, program code can be used to create executable files, library files (such as .so files), etc. Figure 9 Taking ELF format as an example, this file can be called an ELF file. (Reference) Figure 9 The data structure of an ELF file includes an ELF header, a program header table, sections, and a section header table. The section header table, located at the end of the ELF file, contains information such as the type, location, and length of each section. The ELF file stores the compiled binary instructions of the program code, which exists in the form of paragraphs. For example, in an ELF file, each function is a text (.txt) section, which can include the function name and the actual function content.
[0298] In one or more files within the installation package, for ELF files, the server can query the ELF file's header table to determine the location of hot file segments (such as hot functions) within the ELF file, and locate the hot file segment based on its location. In this way, the server can determine the identifier of the hot file segment (such as the function name). The identifier of the ELF file to which the hot file segment belongs can then be used as the identifier of the file to which the hot file segment belongs.
[0299] For example, the file identifier is the name of the file, such as "ELF file 1". The identifier of the hot file segment can be the name of the hot file segment or the position of the hot file segment in the file. This application embodiment does not limit this. For example, the hot file segment is function 1, and function 1 can be the identifier of the hot file segment.
[0300] For example, for ELF files, the terminal device can determine hot file segments in the following format, and the file to which the hot file segments belong:
[0301] config.ini
[0302] Hotspot file segment 1 = ELF file 1, function 1
[0303] Hotspot file segment 2 = ELF file 2, function 2
[0304] Files can also include ZIP files, which are a format for compressing and packaging directories. In addition to compressing folders to create ZIP files, application installation packages can all use the ZIP format.
[0305] In some embodiments, the identifier of a hot file segment can be a function name, the position of the file segment in the file, or the starting position and length of the file segment in the file.
[0306] refer to Figure 10 The data structure of a ZIP file includes a local file header, a central directory header, and an end of the central directory record. The central directory header is the "index center" of the ZIP file, and it also records information such as the location and length of each sub-file after packaging. The central directory header is used to indicate the content of sub-files in a ZIP file and can be considered a type of hotspot file segment.
[0307] Each subfile is associated with its local file header and the central directory header, becoming an independently identifiable unit. The server can quickly locate any subfile within the ZIP archive using the central directory header. The following describes the steps the server takes to determine the hottest file segments within a ZIP archive:
[0308] The server reads the central directory header of the ZIP file to obtain the location of all sub-files after packaging, including the location of the hot file segment. The server can locate the hot file segment based on its location. The server can use the name of the hot file segment as its identifier. For example, when the hot file segment is a sub-file, its name can be the filename of the sub-file before packaging.
[0309] For example, for a ZIP file, the server can identify hot file segments in the following format, and the file to which the hot file segments belong:
[0310] config.ini
[0311] Hotspot file segment 1 = ZIP file 1, subfile name 1
[0312] Hotspot file segment 2 = ZIP file 2, subfile name 2
[0313] In summary, the server can retrieve file segments from the first file within one or more files based on the header information of the first file. Here, the first file can be considered as each file within the one or more files. In other words, the server can retrieve file segments from each file within one or more files based on the header information of each file. Specifically, for ELF files, the header information is the ELF file's section header table; for ZIP files, the header information is the ZIP file's central directory header.
[0314] S702A: The server determines the set of hot pages based on the set of hot file segments.
[0315] In some embodiments, the hot file segment set includes identifiers of the hot file segments. The server can iterate through each file, determine the hot pages occupied by the hot file segments, and then use the set of hot pages as the hot page set. In some embodiments, the hot page set is a subset of pages from multiple pages in one or more files. In some embodiments, the hot page set is all pages from multiple pages in one or more files, based on the popularity of pages in that file.
[0316] In some embodiments, the hot file segment set includes the identifier of the hot file segment and the identifier of the file to which the hot file segment belongs. The server can traverse the files to which the hot file segment belongs to determine the hot pages occupied by the hot file segment, and then use the set of hot pages as the hot page set. This method does not require traversing all files, resulting in fast search speed.
[0317] The following describes how the server retrieves popular pages:
[0318] In some embodiments, the server may designate a page occupied by a hot file segment as a hot page.
[0319] In some embodiments, the server may use the page occupied by the hot file segment as the target page, and then determine the set of hot pages based on the target page.
[0320] In some embodiments, the server may designate a target page containing the complete hot file segment as a hot page. In this example, because the target page contains the complete hot file segment, it will be frequently accessed, and therefore can be designated as a hot page.
[0321] In some embodiments, if a target page contains a portion of a hot file segment, and the proportion of the hot file segment is greater than or equal to a first threshold, the server may designate the target page as a hot page.
[0322] For example, the memory page size is 4KB (0x1000). After location, the target page includes the following four pages, and the proportion of hot file segments in each target page is as follows:
[0323] Target page 1: 0x3000-0x4000 (overlapping with hot file segment 0x3500-0x4000, overlap size 0x500 = 1.25KB)
[0324] Target page 2: 0x4000-0x5000 (completely overlaps with the hot file segment, overlap size 0x1000 = 4KB)
[0325] Target page 3: 0x5000-0x6000 (completely overlaps with the hot file segment, overlap size 0x1000 = 4KB)
[0326] Target page 4: 0x6000-0x7000 (overlapping range with hot file segment 0x6000-0x6000, overlap size 0x0 = 0KB)
[0327] In some embodiments, the percentage of hot file segments on the target page is calculated as (number of overlapping bytes between the file segment and the page) / total page size (4KB) x 100%. Based on this calculation, the percentage of hot file segments on each target page is as follows:
[0328] Target page 1: Overlap 1.25KB percentage = 1.25 / 4 x 100% = 31.25%
[0329] Target page 2: Overlapping 4KB percentage = 4 / 4 x 100% = 100%
[0330] Target page 3: Overlap 4KB percentage = 4 / 4 x 100% = 100%
[0331] Target page 4: Overlap 0KB percentage = 0 / 4 x 100% = 0%
[0332] For example, with a first threshold of 50%, the server can designate target page 2 and target page 3 as hot pages.
[0333] In some embodiments, if a target page contains portions of multiple hot file segments, and the cumulative percentage of these portions is greater than or equal to a second threshold, the server designates the target page as a hot page. The first and second thresholds may be the same or different.
[0334] For example, the memory page size is 4KB (0x1000). After location, the target page (0x7000-0x8000) overlaps with three independent hot file segments (hot file segments A, B, and C). The overlap and percentage of each hot file segment with the target page are calculated as follows:
[0335] Hotspot segment 1: 0x7200-0x7600 (overlapping range with the target page (0x7000-0x8000), 0x400 = 1KB)
[0336] Hotspot file segment 2: 0x7500-0x7B00 (overlapping range with the target page (0x7000-0x8000), 0x600 = 1.5KB)
[0337] Hotspot file segment 3: 0x7D00-0x7F00 (overlapping range with the target page (0x7000-0x8000), 0x200 = 0.5KB)
[0338] The percentage of a hot file segment on a single target page = (number of overlapping bytes between the file segment and the page) / total page size (4KB) x 100%. Based on this calculation, the percentage of hot file segments on the target page is as follows:
[0339] Hotspot segment 1: Overlapping percentage of 1KB = 1KB / 4KB × 100% = 25%
[0340] Hotspot segment 2: Overlap of 1.5KB = 1.5KB / 4KB × 100% = 37.5%
[0341] Hotspot file segment 3: Overlap of 0.5KB, percentage = 0.5KB / 4KB × 100% = 12.5%
[0342] Based on the calculation that "the cumulative percentage of multiple hot file segments = the sum of the individual percentages of each file segment", the cumulative percentage of multiple hot file segments on this target page is: 25% (A) + 37.5% (B) + 12.5% (C) = 75%.
[0343] For example, taking a second threshold of 50%, since the cumulative percentage of multiple hot file segments in the target page (75%) is greater than or equal to the second threshold (50%), the target page (0x7000-0x8000) can be identified as a hot page.
[0344] In some embodiments, regardless of whether the target page includes one or more hot file segments, as long as the proportion of any hot file segment in the target page is greater than or equal to the fourth threshold, the target page can be regarded as a hot page. The fourth threshold may be the same as or different from the first threshold and the second threshold.
[0345] In some embodiments, the server uses a collection of frequently accessed pages as a hot page set. This hot page set can also be viewed as a list of hot pages or a whitelist of hot pages.
[0346] In some embodiments, the hot page set includes an identifier for at least one hot page. Alternatively, the hot page set includes an identifier for at least one hot page, and an identifier for the file to which the hot page belongs.
[0347] In some embodiments, the name of a hotspot page or its location in a file can serve as an identifier for the hotspot page.
[0348] For example, Figure 11 This displays the identifier of a hot page within a collection of hot pages, as well as the identifier of the file to which that hot page belongs. (See reference...) Figure 11 691752902764 is the identifier of the file to which the hot page belongs, and 691752902764 is the identifier of the hot page.
[0349] The S703A server provides a collection of hotspot pages for terminal devices.
[0350] In some embodiments, S703A can be replaced by: the terminal device obtaining a set of hotspot pages. It should be understood that in the following embodiments, the server providing the terminal device with hotspot page set difference information, a set of hotspot file segments, or hotspot file segment set difference information can be replaced by the terminal device obtaining hotspot page set difference information, a set of hotspot file segments, or hotspot file segment set difference information, respectively.
[0351] In this embodiment of the application, taking the server providing a set of hot pages to the terminal device as an example, the methods by which the server provides a set of hot pages to the terminal device include, but are not limited to, the following:
[0352] For example, a server can package a collection of trending web pages into an installation or upgrade package of a file and provide it to an end device. The end device can then download the installation or upgrade package to obtain the collection of trending web pages.
[0353] For example, a server can also send a push message to a terminal device, instructing the device to download a collection of trending pages. The terminal device can then respond to this push message and download the collection of trending pages.
[0354] S704A: Terminal devices manage memory based on a set of hot pages.
[0355] In this embodiment of the application, when the terminal device performs memory management, among multiple pages of the same file, pages belonging to the hot page set have a higher swap-in priority than pages not belonging to the hot page set, and / or pages not belonging to the hot page set have a higher swap-out priority than pages belonging to the hot page set. In other words, when the terminal device performs memory management, hot pages in the hot page set can be retained in memory for a longer period of time to improve the hit rate and reduce the page fault rate.
[0356] Terminal devices may manage memory in ways including, but not limited to, swap-out replacement algorithms, memory prefetching, and memory isolation protection methods, as described below:
[0357] 1. Memory isolation protection method
[0358] The difference between this embodiment and the memory isolation protection method mentioned in the above examples is that this embodiment uses a set of hot pages, while the above examples use a file-level whitelist.
[0359] In this embodiment of the application, the terminal device can divide the memory into a first region and a second region.
[0360] The first region is used to store frequently accessed pages. The terminal device uses the LRU (Least Recently Used) algorithm to manage these pages. Firstly, because the terminal device can allocate more memory space to frequently accessed pages in memory, it can store many pages, improving the hit rate and reducing the page fault rate. Secondly, when a new frequently accessed page needs to be swapped in, if the memory space in the first region is insufficient, the terminal device will invoke the LRU algorithm to swap out the least recently used frequently accessed page in the first region, making room for the page to be loaded.
[0361] The second region is used to store non-hot pages. The terminal device uses the LRU algorithm to manage these non-hot pages. When a new non-hot page needs to be swapped in, if the memory space in the second region is insufficient, the terminal device will invoke the LRU algorithm to swap out the least recently used non-hot page from the second region. The swapping in and out of non-hot pages does not affect hot pages in the first region, avoiding encroachment on the memory resources of hot pages. This ensures that hot pages remain in memory for as long as possible, improving the hit rate and reducing the page fault rate.
[0362] 2. Memory prefetching
[0363] In this embodiment of the application, the terminal device can pre-construct a mapping relationship between "state and hot page set" based on the hot page set, and the terminal device can manage the pages in the terminal device's memory based on the mapping relationship.
[0364] In some embodiments, system states may include power on / off state, network environment state, and user operation state. For example, network environment state may include connecting to Wi-Fi or switching to mobile data. User operation states may include unlocking the screen or clicking an application icon.
[0365] For example, a terminal device can establish a mapping between the following states and a set of hot pages:
[0366] Example 1: Mapping between "User unlock screen state" and "APP launch function" in the hotspot page set. In this example, when the terminal device detects that the user has unlocked the screen, it can load the "APP launch function" from the hotspot page set into memory, allowing the terminal device to quickly launch the APP when the user opens it.
[0367] Example 2: Mapping between "Connect to WiFi" and "Network Authentication Functions" in the Hotspots Page Collection. In this example, when a terminal device detects that it is connected to WiFi, the "Network Authentication Functions" in the Hotspots Page Collection can be loaded into memory. This facilitates WiFi network authentication for the terminal device, enabling it to quickly connect to WiFi.
[0368] 3. Replace with an alternative algorithm
[0369] When managing the swapping of pages in and out of memory, terminal devices prioritize swapping in frequently accessed pages and swapping out less frequently accessed pages. For example, when using the LRU algorithm to identify the least recently used page in memory, the terminal device can increase the priority of that page and swap out other less frequently accessed pages first, allowing the frequently accessed page to remain in memory for a longer period.
[0370] In some embodiments, when performing memory management, the terminal device may adopt a first swap-out strategy to manage the swapping out of pages in memory, so that the swapping out priority of pages that do not belong to the hot page set is higher than the swapping out priority of pages that belong to the hot page set.
[0371] In some embodiments, the memory of the terminal device includes a first queue and a second queue, wherein the page swapping priority in the first queue is lower than the page swapping priority in the second queue, pages belonging to the hot page set enter the first queue after being swapped in, and pages in one or more files that do not belong to the hot page set enter the second queue after being swapped in.
[0372] In some embodiments, a first area is used to store a first queue, and a second area is used to store a second queue.
[0373] The following is an introduction to this method:
[0374] Among them, when the terminal device determines to swap out a page, it swaps out the page through the first swap-out policy, and the first swap-out policy is as follows:
[0375] When the terminal device determines to swap out a page, the terminal device can determine whether the length of the second queue is less than or equal to the length threshold. Among them, when it is determined that the length of the second queue is less than or equal to the length threshold, the terminal device can swap out the page in the first queue; or, when it is determined that the length of the second queue is greater than the length threshold, swap out the page in the second queue.
[0376] In some embodiments, the length threshold is less than or equal to twice the length of the first queue.
[0377] In some embodiments, the memory of the terminal device may include a queue, which can be referred to as a page queue, and any page enters the page queue after being swapped in. Among them, any page may include a page among multiple pages in one or more files, or a page that does not belong to the one or more files. It should be understood that when a page enters the page queue, the page can be ranked at the end of the page queue, and the terminal device can first swap out the page at the head of the page queue.
[0378] The following introduces this method:
[0379] Among them, when the terminal device determines to swap out a page, it swaps out the page through the first swap-out policy. Among them, the head of the page queue is the first page.
[0380] In this implementation, the first swap-out policy includes:
[0381] In the case where the first page belongs to the pages in the hot page set and the terminal device determines to swap out the first page for the Nth time, the first page can be swapped out. Or,
[0382] In the case where the first page belongs to the pages in the hot page set and the terminal device determines to swap out the first page for the Mth time, the position of the first page is adjusted from the head of the page queue to other positions in the page queue. Among them, the other positions in the page queue can be the end of the queue, or a randomly determined position, or a position at a fixed distance from the head of the queue. The other position in the page queue is not the head of the queue.
[0383] Among them, M < N, and N is an integer greater than 1.
[0384] In the case where the first page is a page that does not belong to the hot page set in one or more files, the terminal device can directly swap out the first page.
[0385] This application's embodiments achieve more precise and efficient page management in memory by employing a "file segment-level hot page set" design. Based on the file segment-level hot page set, the terminal device can identify hot pages and pre-distinguish between hot and non-hot pages in a file, avoiding prolonged memory occupation by non-hot pages and improving memory management efficiency. Furthermore, the hot page set can be pre-configured in the terminal device without complex calculations, resulting in low system overhead. Additionally, file segments exhibit significant stability during version iterations, not disappearing or changing drastically with updates, demonstrating good version stability. Therefore, this application's embodiments, using a file segment-level hot page set, achieve a balance between caching effectiveness, system overhead, and version stability.
[0386] In some embodiments, the server can provide the terminal device with hot page set difference information, which is used by the terminal device to obtain the hot page set in order to achieve memory management.
[0387] In some embodiments, such as Figure 7B As shown, the memory management method in this embodiment may include the following S701B-S706B. For detailed descriptions of S701B, S702B, and S706B, please refer to [link / reference]. Figure 7A The relevant descriptions of S701A, S702A and S704A in the illustrated embodiments will not be repeated here.
[0388] S701B: The server determines a set of hot file segments in one or more files.
[0389] S702B: The server determines the set of hot pages based on the set of hot file segments.
[0390] S703B: The server determines the hot page set difference information based on the hot page set and the historical hot page set of the terminal device.
[0391] In some embodiments, the historical hot page set of a terminal device refers to the set of hot pages provided to the terminal device by the server in a previous instance, which can be manifested in two forms:
[0392] (1) A collection of trending pages that are sent from the server to the terminal device and stored by the terminal device in one go. Or,
[0393] (2) The collection of hot pages corresponding to the previous version of the operating system or application.
[0394] In some embodiments, the server stores a "historical hot page set" for each terminal device, associated with each device's unique identifier, such as a device ID. The stored content includes not only the historical hot page set but also associated dimensions, such as the generation time of the hot page set and the compatible operating system / application version. This allows for accurate tracking of previously acquired hot page sets on the terminal device and enables quick retrieval of historical hot page sets matching the current scenario when calculating differences later.
[0395] For example, when the version is updated from V1.0 to V2.0, the server can directly extract the historical hot page set corresponding to the V1.0 version of the terminal device, and provide an accurate benchmark for the difference calculation based on the hot page set obtained this time (i.e. the hot page set corresponding to the V2.0 version).
[0396] The server can compare the set of hot pages with the historical set of hot pages on the terminal device to determine the difference information of the hot page set. In some embodiments, the difference information of the hot page set is used to indicate the different parts in the set of hot pages and the historical set of hot pages. For example, the difference information of the hot page set is used to indicate: hot pages to be removed from the historical set of hot pages, and hot pages to be added. For example, the difference information of the hot page set includes: the identifier of the hot page to be removed, and the identifier of the hot page to be added.
[0397] In this embodiment of the application, by transmitting the difference information of the hot page set, only the changed part of the hot page set is transmitted, which can reduce the amount of data transmission.
[0398] For example, the set of hot pages (adapted version V2.0) is: [a2, a3, a4]; the set of historical hot pages (adapted version V1.0) is: [a1, a2, a3] (a1, a2, a3 are the identifiers of the hot pages). The server compares the set of hot pages with the set of historical hot pages of the terminal device to determine the difference information of the hot page set as: [-a1, +a4].
[0399] S704B: The server provides hotspot page set difference information to terminal devices.
[0400] The method by which the server provides the hotspot page set difference information to the terminal device can be found in the relevant description in S703A. It should be noted that providing the hotspot page set difference information to the terminal device is not applicable to scenarios where the terminal device is installing files for the first time.
[0401] S705B: The terminal device updates the historical hot page set in the terminal device based on the hot page set difference information to obtain the hot page set.
[0402] After receiving the difference information of the hot page set, the terminal device can obtain the identifiers of the hot pages to be removed and the identifiers of the hot pages to be added from the historical hot page set. The terminal device can remove the identifiers of the hot pages to be removed from the historical hot page set and add the identifiers of the hot pages to be added to the historical hot page set, thus updating the historical hot page set and obtaining the hot page set.
[0403] For example, the historical hot page set (adapted application V1.0) stored locally on the terminal device is: [a1, a2, a3], and the hot page set difference information is: [-a1, +a4] ("-" represents removal, "+" represents addition). The terminal device removes page a1 marked with "-" from the historical hot page set [a1, a2, a3] and adds page a4 marked with "+", resulting in the hot page set [a2, a3, a4].
[0404] S706B: Terminal devices manage memory based on a set of hot pages.
[0405] In this embodiment, by using the "difference incremental update" method, it is not necessary to receive and process the entire set of hot pages. Only a small number of removal and addition operations are needed on the historical set of hot pages, which reduces the amount of data transmission. At the same time, the terminal device can also obtain the latest set of hot pages.
[0406] In some embodiments, the server provides a set of hot file segments to the terminal device, which can then determine a set of hot pages to retrieve based on this set. The terminal device can then perform memory management based on this set of hot pages.
[0407] In some embodiments, such as Figure 7C As shown, the memory management method in this embodiment may include the following S701C-S704C. For a detailed description of S701C, S703C, and S704C, please refer to... Figure 7A The relevant descriptions of S701A, S702A, and S704A in the illustrated embodiments will not be repeated here.
[0408] The S701C server identifies a set of hot file segments in one or more files.
[0409] The S702C server provides a set of hot file segments for terminal devices.
[0410] The method by which the server provides a set of hot file segments to the terminal device can be found in the description of the server providing a set of hot pages to the terminal device in S703A.
[0411] The S703C and terminal devices determine the set of hot pages based on the set of hot file segments.
[0412] The method by which the terminal device determines the set of hot pages based on the set of hot file segments can be referred to the description in S702A. Unlike S702A, the execution subject in this embodiment is the terminal device.
[0413] S704C: Terminal devices manage memory based on a set of hot pages.
[0414] The implementation principle and technical effects of the memory management method provided in this application embodiment can be referred to the description in the above embodiments.
[0415] In some embodiments, the server can provide the terminal device with hot file segment set difference information, which is used by the terminal device to obtain the hot file segment set in order to obtain the hot page set, so as to realize memory management.
[0416] In some embodiments, such as Figure 7D As shown, the memory management method in this embodiment may include the following S701D-S706D. For a detailed description of S701D, S705D, and S706D, please refer to... Figure 7A The relevant descriptions of steps S701A, S702A, and S704A in the illustrated embodiments will not be repeated here.
[0417] The S701D server identifies a set of hot file segments in one or more files.
[0418] The S702D server determines the difference information of the hot file segment set based on the hot file segment set and the historical hot file segment set of the terminal device.
[0419] S702D can be compared with the description in S703B that "the server determines the hot page set difference information based on the hot page set and the historical hot page set of the terminal device". The difference is that the page is changed to a file segment.
[0420] In some embodiments, the historical hot file segment set of the terminal device refers to the set of hot file segments provided by the server to the terminal device at one time, which can be manifested in two forms:
[0421] (1) A collection of hot file segments that are sent from the server to the terminal device and stored by the terminal device in one go. Or,
[0422] (2) The set of hot file segments corresponding to the previous version of the operating system or application.
[0423] In some embodiments, the server stores a "historical hot file segment set" for each terminal device, associated with each device's unique identifier, such as a device ID. The stored content includes not only the historical hot file segment set but also associated dimensions, such as the generation time of the set and the compatible operating system / application version. This allows for accurate tracking of previously acquired hot file segment sets on the terminal device and enables quick retrieval of historical hot file segment sets matching the current scenario when calculating differences later.
[0424] For example, when the version is updated from V1.0 to V2.0, the server can directly extract the historical hot file segment set corresponding to the V1.0 version of the terminal device, and provide an accurate benchmark for the difference calculation based on the hot file segment set obtained this time (i.e. the hot file segment set corresponding to the V2.0 version).
[0425] The server can compare the set of hot file segments with the historical set of hot file segments on the terminal device to determine the difference information of the hot file segment set. In some embodiments, the difference information of the hot file segment set is used to indicate the different parts in the set of hot file segments and the historical set of hot file segments. For example, the difference information of the hot file segment set is used to indicate: hot file segments to be removed in the historical set of hot file segments, and hot file segments to be added. For example, the difference information of the hot file segment set includes: the identifier of the hot file segment to be removed, and the identifier of the hot page to be added.
[0426] In this embodiment of the application, by transmitting the difference information of the hot file segment set, only the changed part of the hot file segment set is transmitted, which can reduce the amount of data transmission.
[0427] For example, the historical hot file segment set (adapted to V1.0) is [c1,c2,c3], and the hot file segment set (adapted to V2.0) is [c2,c3,c4]. The server compares the hot file segment set with the historical hot file segment set of the terminal device and determines the difference information of the hot file segment set as: [-c1,+c4].
[0428] The S703D server provides hotspot file segment set difference information to terminal devices.
[0429] The method by which the server provides hot file segment set difference information to the terminal device can be found in the relevant description in S704B. It should be noted that this method of providing hot file segment set difference information to the terminal device is not applicable to scenarios where the terminal device is installing files for the first time.
[0430] S704D: The terminal device updates the historical hot file segment set in the terminal device based on the hot file segment set difference information to obtain the hot file segment set.
[0431] After receiving the difference information of the hot file segment set, the terminal device can obtain the identifiers of the hot file segments to be removed and the identifiers of the hot pages to be added in the historical hot file segment set. The terminal device can remove the identifiers of the hot file segments to be removed from the historical hot file segment set and add the identifiers of the hot pages to be added to the historical hot file segment set, thus updating the historical hot file segment set and obtaining the hot file segment set.
[0432] For example, the historical hot file segment set (adapted to V1.0) stored locally on the terminal device is [c1,c2,c3], and the difference information of the hot file segment set is [-c1,+c4]. The terminal device can remove the file segment c1 marked with "-" and add the file segment c4 marked with "+" to the historical hot file segment set, resulting in the hot file segment set (adapted to V2.0) as [c2,c3,c4].
[0433] The S705D terminal device determines the set of hot pages based on the set of hot file segments.
[0434] S706D: Terminal devices manage memory based on a set of hot pages.
[0435] In this embodiment of the application, by using the "difference incremental update" method, it is not necessary to receive and process the full set of hot file segments. Only a small number of removal and addition operations need to be performed on the historical set of hot file segments, which reduces the amount of data transmission. At the same time, the terminal device can also obtain the latest set of hot file segments.
[0436] In summary, Figures 7A-7D The examples shown apply to the following files: operating system system files and application files. The reason is:
[0437] Because the server can provide terminal devices with operating system system files or application files installation packages and upgrade packages, it can obtain the operating system system files and application files completely without relying on the terminal device's upload. Furthermore, the server's computing power is higher than that of the terminal device, allowing it to efficiently complete computational tasks even with large numbers of files. On the other hand, the server can send files to a testing device that simulates the real operating environment of the terminal device, accurately collecting parameters such as the access frequency and page fault frequency of pages occupied by file segments, providing accurate data for the server to filter hot file segments and hot pages. In addition, in this scenario, the server only needs to provide the terminal device with a set of hot file segments, or the difference information between sets of hot file segments, or a set of hot pages, or the difference information between sets of hot pages; the terminal device does not need to perform complex calculations.
[0438] In some embodiments, Figures 7A-7D The files applicable to the illustrated embodiments can also be user files. User files, such as local documents, personal cache files, user-defined configuration files, etc., have local storage attributes and cannot be directly obtained by the server; only the terminal device can fully access them. In this example, the terminal device needs to provide the user file to the server so that the server can obtain the user file.
[0439] In some embodiments, the method provided in this application can also be applied to major version update scenarios and minor version update scenarios of files.
[0440] The memory management method provided in the embodiments of this application will be described below in conjunction with these two scenarios:
[0441] 1. Major version update scenario:
[0442] In major version updates of operating systems or applications (such as updating the operating system from version 4.2 to 4.3), the core architecture, functional modules, and file structure undergo large-scale adjustments. These adjustments include not only adding core services, refactoring resource packages, and optimizing underlying library files, but also changes to ELF file structures and repackaging ZIP resource packages. Such adjustments render the old version's collection of hotspot pages invalid. Therefore, it is necessary to regenerate the hotspot page collection based on the updated files and distribute it to terminal devices for adaptation. The specific logic is as follows:
[0443] To adapt to major version updates, the server will regenerate the set of hot file segments, or the difference information between the set of hot file segments, or the set of hot pages, or the difference information between the set of hot pages, based on the updated files. To improve the efficiency of multi-version adaptation during the development phase, the server will store the newly generated set of hot file segments, or the difference information between the set of hot file segments, or the set of hot pages, or the difference information between the set of hot pages in a dedicated tool repository.
[0444] Figure 12 Taking the dedicated tool repository for storing collections of frequently accessed file segments as an example, such as... Figure 12 As shown, the (protect_lru_tools) tool repository stores hot file segments of function types in categories through the (protect_file_func) directory within the tool repository.
[0445] For example, specific hot file segments can be distinguished by the identifier "_aaa_bbb_file segment 6_function ccc", so as to achieve unified maintenance and iteration of the set of hot pages or hot file segments of major versions.
[0446] In major version update scenarios, the server will include the regenerated set of hot file segments, or the difference information of the set of hot file segments, or the set of hot pages, or the difference information of the set of hot pages in the upgrade package (or update package).
[0447] by Figure 7C The illustrated embodiment is used as an example, referring to Figure 13 In major version update scenarios, it is necessary to execute Figure 7C The embodiments shown are S701C-S704C. The core reason for needing to execute this entire process in this scenario is the large-scale adjustment of the major version file structure, resulting in significant changes to hot file segments or pages. These hot file segments or pages from the old version need to be replaced to achieve effective memory management.
[0448] 2. Minor version update scenarios
[0449] Minor version updates are partial functional updates, fixes, or optimizations of the operating system or applications. They only modify local code segments or resource segments and do not involve rewriting architectural files. Therefore, they do not require the regeneration of hot file segment sets, hot file segment set difference information, hot page sets, or hot page set difference information as in major version updates.
[0450] However, due to updates to some features in minor versions, such as adding a utility function or fixing a logical error in a module, the pages to which the original hot file segments belong may change. Therefore, it is not necessary to execute the entire process of obtaining the set of hot file segments or the difference information of the set of hot file segments. It is only necessary to determine the set of hot pages based on the existing set of hot file segments.
[0451] by Figure 7C The illustrated embodiment is used as an example, referring to Figure 13 In minor version update scenarios, it is necessary to execute... Figure 7C The embodiments shown are S703C-S704C.
[0452] In summary, minor version updates are "functional fine-tuning," unlike the "architectural changes" of major version updates. Minor version updates do not require updating the hot file segment set; the original hot file segment set can be reused, and the hot page set can be obtained, thereby reducing the amount of computation and the system overhead of terminal devices, and improving update efficiency while ensuring the accuracy of hotspot management.
[0453] In some embodiments, the terminal device does not interact with the server. The terminal device can independently determine the set of hot file segments, determine the set of hot pages based on the set of hot file segments, and then perform memory management based on the set of hot pages.
[0454] In some embodiments, such as Figure 7E As shown, the memory management method in this embodiment may include the following S701E-S703E. For a detailed description of S701E-S703E, please refer to... Figure 7A The relevant descriptions of S701A, S702A, and S704A in the illustrated embodiments will not be repeated here.
[0455] S701E, terminal devices determine a set of hot file segments in one or more files.
[0456] The S702E terminal device determines the set of hot pages based on the set of hot file segments.
[0457] S703E: Terminal devices manage memory based on a set of hot pages.
[0458] In this embodiment, the terminal device can configure its own set of hot pages without relying on server configuration, making it more intelligent.
[0459] In some embodiments, Figure 7E The files applicable to the illustrated embodiments are: operating system system files, application files, and user files. The reason is:
[0460] User files, such as local documents, personal cache files, and custom configuration files, have local storage attributes and cannot be directly accessed by the server; only the terminal device can fully access them. Operating system files and application files, after being downloaded and installed on the terminal device, also form complete files locally. In other words, the terminal device can access the operating system's system files, application files, and user files, and therefore can execute them. Figure 7E The steps in the illustrated embodiments.
[0461] In some embodiments, it is important to note that the terminal device can run the file for a period of time to collect parameters such as the access frequency and page fault frequency of the pages occupied by the file segment. These parameters are direct feedback from the user's actual usage behavior. Compared to a fixed standard on the server, this method can accurately collect the access frequency and page fault frequency of the pages occupied by the file segment, and these parameters are precisely adapted to the user's personalized habits. In this way, the set of hot file segments and hot page sets determined by the terminal device are also more adapted to the user's personalized habits, thereby improving the user experience while improving memory management efficiency.
[0462] Figure 14 This is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of this application.
[0463] In some embodiments, refer to Figure 14 The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, buttons 190, a display screen 194, etc.
[0464] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0465] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0466] The processor 110 can serve as the central nervous system and command center of the terminal device 100. The processor 110 can generate operation control signals based on the instruction opcode and timing signals to control instruction fetching and execution.
[0467] In this embodiment, the external memory 120 is used to store programs, which may be the operating system program or a third-party application program in the terminal device 100. The external memory 120 can be referred to the relevant description of external memory in the terminology explanation.
[0468] Internal memory 121, often simply referred to as RAM, is a crucial component of a computer, serving as a bridge for communication with the CPU. Programs in terminal devices run within RAM, therefore, RAM performance has a significant impact on computer performance. For a more detailed explanation of internal memory 121, please refer to the relevant section on RAM in the glossary.
[0469] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system. This memory may be referred to as internal memory 121.
[0470] In this embodiment, the processor 110 can be used to execute the steps performed by the terminal device in the above embodiments.
[0471] This application also provides an electronic device, which can be the terminal device or development device described in the above embodiments. For example... Figure 15 As shown, the electronic device may include one or more processors 1501, memory 1502, and communication interface 1503.
[0472] The memory 1502, communication interface 1503, and processor 1501 are coupled together. For example, the memory 1502, communication interface 1503, and processor 1501 can be coupled together via bus 1504.
[0473] The communication interface 1503 is used for data transmission with other devices. The memory 1502 stores program code. The program code includes programs or instructions, which, when executed by one or more processors 1501, cause the electronic device to perform the code compilation method described in this embodiment.
[0474] The processor 1501 can be a processor, controller, such as an MCU, CPU, general-purpose processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor can also be a combination that implements computational functions, such as including one or more microprocessor combinations, etc. When the processor executes computer instructions, the electronic device can perform the relevant method steps in the above method embodiments.
[0475] When the electronic device is a terminal device, the processor 1501 is used to execute the steps of the terminal device in the above embodiments. When the electronic device is a development device, the processor 1502 is used to execute the steps of the terminal device in the above embodiments.
[0476] Bus 1504 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 1504 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 15 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0477] This application also provides a computer-readable storage medium that includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the relevant method steps described in the above method embodiments.
[0478] This application also provides a chip system, such as... Figure 16As shown, the chip system includes at least one processor 1601 and at least one interface circuit 1602. The processor 1601 and the interface circuit 1602 are interconnected via lines. For example, the interface circuit 1602 can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, the interface circuit 1602 can be used to send signals to other devices (e.g., the processor 1601). Exemplarily, the interface circuit 1602 can read instructions stored in the memory and send those instructions to the processor 1601. When the instructions are executed by the processor 1601, the electronic device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, and this application embodiment does not specifically limit this.
[0479] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to execute the relevant method steps described in the above method embodiments.
[0480] The electronic devices, computer-readable storage media, chip systems, or computer program products provided in this application are all used to perform the methods described above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods described above, and will not be repeated here.
[0481] In some solutions, multiple embodiments or examples of this application can be combined, and the combined solution can be implemented. Optionally, some operations in the processes of various method embodiments may be combined, and / or the order of some operations may be changed. Furthermore, the execution order between the steps of each process is merely exemplary and does not constitute a limitation on the execution order between steps; other execution orders are also possible. It is not intended to indicate that the execution order is the only possible order in which these operations can be performed. Those skilled in the art will conceive of various ways to reorder the operations described in the embodiments of this application. In addition, it should be noted that the process details involved in one embodiment of this application are also applicable to other embodiments in a similar manner, or different embodiments can be combined.
[0482] Furthermore, some steps in the method embodiments can be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and can be deleted in certain use cases. Or, other possible steps may be added to the method embodiments. Moreover, the various method embodiments can be implemented individually or in combination.
[0483] It is understood that, in order to achieve the above functions, the aforementioned electronic devices (such as terminal devices, development devices) include hardware and / or software modules corresponding to perform each function. Based on the implementation steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and software. Whether a function is implemented in a hardware or software-driven manner 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 in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.
[0484] This application embodiment can divide the electronic device into functional modules according to the above method examples. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Through the description of the above embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the above functional module division is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0485] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0486] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0487] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0488] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, in essence, or the part that contributes, or all or part of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0489] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A memory management method characterized by comprising: The method is applied to a terminal device, and comprises: obtaining a hotspot page set, wherein each file in one or more files in the terminal device is divided into a plurality of pages according to the size of a memory page of the terminal device, and the hotspot page set is part of the plurality of pages of the one or more files; performing memory management according to the hotspot page set, wherein, when performing memory management, the swap-in priority of a page belonging to the hotspot page set is higher than the swap-in priority of a page not belonging to the hotspot page set, and / or the swap-out priority of a page not belonging to the hotspot page set is higher than the swap-out priority of a page belonging to the hotspot page set.
2. The method of claim 1, wherein, The obtaining of the hotspot page set comprises: receiving the hotspot page set from a server; or receiving hotspot page set difference information from the server, and updating a historical hotspot page set in the terminal device according to the hotspot page set difference information to obtain the hotspot page set; or obtaining a hotspot file segment set, and determining the hotspot page set according to the hotspot file segment set, wherein the hotspot file segment set is part of file segments of the one or more files.
3. The method of claim 2, wherein, The obtaining of the hotspot file segment set comprises: receiving the hotspot file segment set from the server; or receiving hotspot file segment set difference information from the server, and updating a historical hotspot file segment set in the terminal device according to the hotspot file segment set difference information to obtain the hotspot file segment set.
4. The method of claim 2, wherein, The obtaining of the hotspot file segment set comprises: determining the hotspot file segment set in the one or more files.
5. The method according to any one of claims 2-4, characterized in that, The determining of the hotspot page set according to the hotspot file segment set comprises: taking a page occupied by a hotspot file segment in the one or more files as a target page; determining the hotspot page set according to the target page.
6. The method of claim 5, wherein, The determining of the hotspot page set according to the target page comprises: taking a target page containing a complete hotspot file segment as a hotspot page; and / or in the case that a target page contains part of one hotspot file segment, if the proportion of the part of the one hotspot file segment in the target page is greater than or equal to a first threshold value, taking the target page as a hotspot page; and / or in the case that a target page contains part of a plurality of hotspot file segments, if the cumulative proportion of the part of the plurality of hotspot file segments in the target page is greater than or equal to a second threshold value, taking the target page as a hotspot page. taking the set of the hotspot pages as the hotspot page set.
7. The method according to any one of claims 2-6, characterized in that, The hotspot file segment set is determined based on at least one of the following parameters: the access frequency of a page occupied by a file segment in the one or more files, the page fault frequency, and the size of the file segment.
8. The method of claim 7, wherein, The hotness of the file segment is positively related to the access frequency and / or the page fault frequency and / or negatively related to the size of the file segment, and the hotness of the file segment is used to determine whether the file segment is a hot file segment.
9. The method of claim 8, wherein, The hotness of the hot file segment is greater than or equal to a third threshold value.
10. The method according to claim 8 or 9, characterized in that, The hotness of the file segment is specifically a quotient of the page fault frequency and the size of the file segment.
11. The method according to any one of claims 7-10, characterized in that, The method further includes: According to header information of a first file in the one or more files, a file segment in the first file is obtained.
12. The method according to any one of claims 1-11, characterized in that, The one or more files include system files of an operating system and / or files of an application program.
13. The method according to any one of claims 1-12, characterized in that, The set of hot pages includes an identifier of at least one hot page and an identifier of a file to which the hot page belongs, the identifier of the hot page being used to indicate the hot page, and the identifier of the file to which the hot page belongs being used to indicate the file to which the hot page belongs.
14. The method of any one of claims 1-13, wherein, The set of hot file segments includes an identifier of at least one hot file segment and an identifier of a file to which the hot file segment belongs, the identifier of the hot file segment being used to indicate the hot file segment, and the identifier of the file to which the hot file segment belongs being used to indicate the file to which the hot file segment belongs.
15. The method of any one of claims 1-14, wherein, The hot file segment includes at least one of the following: a function and content in a compressed file used to indicate a sub-file.
16. The method of any one of claims 1-15, wherein, The memory of the terminal device includes a first queue and a second queue, a page in the first queue has a lower swap-out priority than a page in the second queue, a page belonging to the set of hot pages enters the first queue after being swapped in, and a page in the one or more files that does not belong to the set of hot pages enters the second queue after being swapped in.
17. A memory management method characterized by comprising: The method is applied to a server and further includes: A set of hot file segments is determined in one or more files, the one or more files being applied to a terminal device, wherein the set of hot file segments is part of file segments of the one or more files; According to the set of hot file segments, a set of hot pages is determined, each file in the one or more files is divided into a plurality of pages according to a size of a memory page of the terminal device, the set of hot pages is part of pages in the plurality of pages of the one or more files, and the set of hot pages is used for memory management of the terminal device, wherein when the terminal device performs memory management, a page belonging to the set of hot pages has a higher swap-in priority than a page not belonging to the set of hot pages in a plurality of pages of the same file, and / or the page not belonging to the set of hot pages has a higher swap-out priority than the page belonging to the set of hot pages.
18. The method of claim 17, wherein, The set of hot file segments is determined in the one or more files, including: According to at least one of the following parameters, the set of hot file segments is determined: an access frequency of a page occupied by a file segment in the one or more files, a page fault frequency, and a size of the file segment.
19. The method of claim 18, wherein, The hotness of the file segment is positively correlated with the access frequency and / or the page fault frequency and / or negatively correlated with the size of the file segment, and the hotness of the file segment is used to determine whether the file segment is a hot file segment.
20. The method of claim 19, wherein, The hotness of the hot file segment is greater than or equal to a third threshold value.
21. The method of claim 18 or 19, wherein, The hotness of the file segment is specifically a quotient value of the page fault frequency and the size of the file segment.
22. The method of any one of claims 18-21, wherein, The method further comprises: According to the header information of a first file in the one or more files, a file segment in the first file is obtained.
23. The method of any one of claims 17-22, wherein, The determination of the hot page set according to the hot file segment set comprises: Pages occupied by hot file segments in the one or more files are taken as target pages; The hot page set is determined according to the target pages.
24. The method of claim 23, wherein, The determination of the hot page set according to the target pages comprises: A target page containing a complete hot file segment is taken as a hot page; and / or, In the case that a target page contains a part of one hot file segment, if the proportion of the part of the one hot file segment in the target page is greater than or equal to a first threshold value, the target page is taken as a hot page; and / or, In the case that a target page contains parts of multiple hot file segments, if the cumulative proportion of the parts of the multiple hot file segments in the target page is greater than or equal to a second threshold value, the target page is taken as a hot page. The set of hot pages is taken as the hot page set.
25. The method of any one of claims 17-24, wherein, The one or more files comprise system files of an operating system and / or files of an application program.
26. The method of any one of claims 17-25, wherein, The hot page set comprises an identifier of at least one hot page and an identifier of a file to which the hot page belongs, the identifier of the hot page being used to indicate the hot page, and the identifier of the file to which the hot page belongs being used to indicate the file to which the hot page belongs.
27. The method of any one of claims 17-26, wherein, The hot file segment set comprises an identifier of at least one hot file segment and an identifier of a file to which the hot file segment belongs, the identifier of the hot file segment being used to indicate the hot file segment, and the identifier of the file to which the hot file segment belongs being used to indicate the file to which the hot file segment belongs.
28. The method of any one of claims 17-27, wherein, The hot file segment comprises at least one of the following: a function, and content in a compressed file used to indicate a sub-file.
29. A memory management method, comprising: The method is applied to a memory management system comprising a server and a terminal device, and the method comprises: The server determines a hot file segment set in one or more files, the one or more files being applied to the terminal device, wherein the hot file segment set is part of file segments of the one or more files; The server determines a hot page set according to the hot file segment set, each file in the one or more files being divided into multiple pages according to the size of a memory page of the terminal device, and the hot page set being part of the multiple pages of the one or more files; The terminal device obtains the hot page set; and The server determines the hot page set according to the target pages. The terminal device performs memory management according to the hot page set, wherein, when performing memory management, the page swap-in priority of the page belonging to the hot page set is higher than the page swap-in priority of the page not belonging to the hot page set in the multiple pages of the same file, and / or, the page swap-out priority of the page not belonging to the hot page set is higher than the page swap-out priority of the page belonging to the hot page set.
30. The method of claim 29, wherein, The server determines a hot file segment set in one or more files, comprising: The server determines the hot file segment set according to at least one of the following parameters: the access frequency of the page occupied by the file segment in the one or more files, the page fault frequency, and the size of the file segment.
31. The method of claim 29 or 30, wherein, The server determines a hot page set according to the hot file segment set, comprising: The server takes the page occupied by the hot file segment in the one or more files as a target page; The server determines the hot page set according to the target page.
32. The method of claim 31, wherein, The server determines the hot page set according to the target page, comprising: The server takes the target page containing a complete hot file segment as a hot page; and / or, In the case that a target page contains a part of a hot file segment, if the proportion of the part of the hot file segment in the target page is greater than or equal to a first threshold value, the server takes the target page as a hot page; and / or, In the case that a target page contains multiple parts of hot file segments, if the cumulative proportion of the multiple parts of hot file segments in the target page is greater than or equal to a second threshold value, the server takes the target page as a hot page. The server takes the set of hot pages as the hot page set.
33. An electronic device, comprising: Comprising: a memory and one or more processors, the memory being coupled to the processor; The memory is used to store computer program code, the computer program code comprising computer instructions, when the computer instructions are executed by the electronic device, causing the electronic device to perform the method of any one of claims 1-32.
34. A computer-readable storage medium, characterized in that, The computer instructions, when executed on an electronic device, cause the electronic device to perform the method of any one of claims 1-32.
35. A chip system, characterized by The chip system is applied to an electronic device, and the chip system comprises one or more processors for invoking computer instructions to cause the electronic device to perform the method of any one of claims 1-32.
36. A computer program product, characterised in that, The computer program product, when executed on an electronic device, causes the electronic device to perform the method of any one of claims 1-32.
Citation Information
Patent Citations
Cache address mapping method and related device
CN109857681A
Page data processing method, page display method and device
CN113535288A
Memory optimization method and device and storage medium
CN118733056A
Container deployment optimization method and device, equipment and storage medium
CN118796332A