Memory management method, device, equipment and storage medium

By compressing and migrating the memory pages of the target application, and determining the memory migration based on the application group identifier and activity parameters, the problem of low memory utilization in electronic devices is solved, thereby improving memory utilization and device operational stability.

CN122332300APending Publication Date: 2026-07-03SHENZHEN TCL DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610327929.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-17
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, electronic devices suffer from low memory utilization during memory reclamation, failing to completely release physical memory and resulting in low terminal memory utilization.

Method used

By responding to memory management requests, the target application and memory pages to be processed are identified, compressed, and stored in the virtual compressed memory module. The target migration memory is determined based on the application group identifier and activity parameters, and memory migration is performed. Finally, the target migration memory is deleted from the virtual memory module.

Benefits of technology

It enables adaptive management based on application activity and group identifiers when memory is low, completely freeing up memory for inactive applications, improving memory utilization and application retention, and enhancing device stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122332300A_ABST
    Figure CN122332300A_ABST
Patent Text Reader

Abstract

The application provides a memory management method, device, equipment and storage medium. The memory management method comprises the following steps: in response to a memory management request for a target application program, determining the target application program corresponding to the memory management request and a to-be-processed memory page corresponding to the target application program; performing compression processing on the to-be-processed memory page to obtain a virtual compressed memory page corresponding to the target application program, and storing the virtual compressed memory in a virtual compressed memory module; determining target migration memory in the virtual compressed memory according to an application grouping identifier and / or an application activity parameter of the target application program; performing memory migration processing on the target migration memory, deleting the target migration memory in the virtual memory module, and obtaining a memory management result. The application program memory is adaptively managed by using the application activity degree and the grouping identifier when the memory is low, the application memory with low activity is completely released, and the memory utilization, the application retention rate and the starting speed are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and specifically to a memory management method, apparatus, device, and storage medium. Background Technology

[0002] Currently, with the rapid development of internet technology and target applications, the number of target applications installed on electronic devices is increasing, leading to a continuous increase in the memory requirements of these applications. However, the memory capacity of electronic devices is limited and cannot meet the long-term memory resource usage of a large number of applications. Therefore, electronic devices need to perform memory reclamation during operation. The existing memory reclamation process compresses all memory pages by a certain proportion and stores the compressed memory data in a designated memory space. This memory reclamation method wastes memory space and cannot completely release physical memory, resulting in low terminal memory utilization. Summary of the Invention

[0003] This application provides a memory management method, apparatus, device, and storage medium, aiming to solve the technical problem of low memory utilization when electronic devices reclaim memory in the prior art.

[0004] On one hand, embodiments of this application provide a memory management method, which includes the following steps: In response to a memory management request for a target application, determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application; The memory page to be processed is compressed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in a virtual compressed memory module; The target migration memory in the virtual compressed memory is determined based on the application group identifier and / or application activity parameter of the target application. The target migration memory is processed by memory migration, and then the target migration memory is deleted from the virtual memory module to obtain the memory management result.

[0005] In one possible implementation of this application, determining the target migration memory in the virtual compressed memory based on the application group identifier and / or application activity parameter of the target application includes: In response to a memory grouping request for a target application, the target application is grouped into process groups according to a preset grouping strategy to obtain application groups and the initial active parameters corresponding to the application groups; The initial activity parameters are updated based on the interaction behavior data of the target application to obtain the application activity parameters; The target migration memory to be migrated in the virtual compressed memory is determined using the application activity parameters.

[0006] In one possible implementation of this application, updating the initial activity parameter based on the interaction behavior data of the target application to obtain the application activity parameter includes: In response to the interactive behavior request of the target application, the interactive behavior data corresponding to the interactive behavior request is recorded, and the interactive behavior data includes interactive duration data and interactive number data. The initial activity parameter is updated based on the duration weighting coefficient and the interaction duration data to obtain the duration increment parameter; The initial activity parameter is updated based on the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency data to obtain the frequency increment parameter; The application activity parameter is determined based on the duration activity increment parameter, the frequency increment parameter, and the initial activity parameter.

[0007] In one possible implementation of this application, the frequency increment parameter includes a first frequency increment parameter and a second frequency increment parameter; The step of updating the initial activity parameter based on the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency data to obtain the frequency increment parameter includes: If the number of short-term interactions in the interaction count data is less than the operation count threshold, then the first frequency increment parameter is calculated based on the count weighting coefficient and the interaction count data. If the number of short-term interactions in the interaction count data is greater than or equal to the operation count threshold, then the sum of the preset high-frequency increment parameter and the first frequency increment parameter is determined as the second frequency increment parameter.

[0008] In one possible implementation of this application, determining the application activity parameter based on the duration-based activity increment parameter, the frequency-based activity increment parameter, and the initial activity parameter includes: The sum of the duration-based activity increment parameter, the frequency-based activity increment parameter, and the initial activity parameter is calculated to obtain the updated activity parameter; If the updated active parameter meets the parameter protection conditions, then the updated active parameter is determined as the application active parameter; If the updated active parameter does not meet the parameter protection conditions, then the first protection parameter or the second protection parameter corresponding to the parameter protection conditions will be determined as the application active parameter.

[0009] In one possible implementation of this application, determining the target migration memory in the virtual compressed memory to be migrated using the application activity parameter includes: If the application group identifier of the target application is a regular group identifier, then the migration activity threshold is determined based on the group migration ratio and the application activity parameter. The virtual compressed memory corresponding to the target application whose application activity parameter is less than the migration activity threshold is determined as the target migration memory.

[0010] In one possible implementation of this application, determining the target migration memory in the virtual compressed memory based on the application group identifier and / or application activity parameter of the target application includes: If the application group identifier of the target application is a whitelist group identifier, then the virtual compressed memory of the target application corresponding to the whitelist group identifier is determined as protected compressed memory; The target migration memory in the remaining compressed memory of the virtual compressed memory is determined according to the application activity parameter.

[0011] In one possible implementation of this application, the step of performing memory migration processing on the target migration memory and deleting the target migration memory in the virtual memory module to obtain a memory management result includes: The target memory is migrated to the target storage to obtain the memory migration result; If the memory migration result is a successful migration result, the memory migration data volume corresponding to each target application will be displayed on the preset visual interface, and the target migration memory will be deleted in the virtual memory module to obtain the memory management result.

[0012] On the other hand, this application provides a memory management device, the memory management device comprising: The memory acquisition module is configured to respond to a memory management request for a target application, and determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application. A memory compression module is configured to compress the memory page to be processed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in the virtual compressed memory module; The migration assessment module is configured to determine the target migration memory in the virtual compressed memory based on the application group identifier and / or application activity parameters of the target application. The memory management module is configured to perform memory migration processing on the target migration memory and delete the target migration memory in the virtual memory module to obtain the memory management result.

[0013] On the other hand, this application also provides a memory management device, the memory management device comprising: One or more processors; Memory; and One or more target applications, wherein the one or more target applications are stored in the memory and configured to be executed by the processor to implement the steps of the memory management method.

[0014] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in the memory management method described above.

[0015] In this application, by responding to a memory management request for a target application, the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application are determined; the memory page to be processed is compressed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in a virtual compressed memory module; the target migration memory in the virtual compressed memory is determined according to the application group identifier and / or application activity parameters of the target application; the target migration memory is migrated, and the target migration memory is deleted from the virtual memory module to obtain the memory management result. This system enables the identification of target applications and corresponding memory pages to be managed in memory control scenarios. The system compresses these memory pages to obtain virtual compressed memory pages stored in a virtual memory module. It then uses the application group identifier and / or application activity parameters of the target application to determine whether to migrate the virtual compressed memory. This accurately identifies the target migration memory within the virtual compressed memory and performs the migration process. After migration, the target migration memory is deleted from the virtual memory module. This allows for adaptive management of application memory based on application activity and group identifiers when memory is low, effectively releasing memory from inactive applications, improving memory utilization, application retention, and startup speed, thereby enhancing device stability. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram illustrating a scenario of the memory management method according to an embodiment of this application; Figure 2 This is a flowchart illustrating one embodiment of the memory management method in this application. Figure 3 A flowchart illustrating an embodiment of the memory management method for determining frequency increment parameters provided in this application; Figure 4 A flowchart illustrating an embodiment of the memory management method for determining application activity parameters provided in this application; Figure 5 A schematic diagram of one embodiment of the memory management device provided in this application; Figure 6 This is a schematic diagram of one embodiment of the memory management device provided in this application. Detailed Implementation

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

[0019] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0020] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0021] Currently, with the rapid development of internet technology and target applications, the number of target applications installed on electronic devices is increasing, leading to a continuous increase in the memory requirements of these applications. However, the memory capacity of electronic devices is limited and cannot meet the long-term memory resource usage of a large number of applications. Therefore, electronic devices need to perform memory reclamation during operation. The existing memory reclamation process compresses all memory pages by a certain proportion and stores the compressed memory data in a designated memory space. This memory reclamation method wastes memory space and cannot completely release physical memory, resulting in low terminal memory utilization.

[0022] Based on this, this application proposes a memory management method, apparatus, device, and computer-readable storage medium to solve the technical problem of low memory utilization when electronic devices reclaim memory in the prior art.

[0023] The memory management method in this embodiment of the invention is applied to a memory management device, which is configured in a memory management equipment. The memory management equipment includes one or more processors, a memory, and one or more target applications. The one or more target applications are stored in the memory and configured to be executed by the processor to implement the memory management method. The memory management equipment can be a smart terminal, such as a mobile phone, tablet computer, network device, and smart computer. Optionally, the memory management equipment can also be a server or a service cluster composed of multiple servers.

[0024] like Figure 1 As shown, Figure 1 This is a schematic diagram of a memory management method according to an embodiment of the present application. The memory management scenario in this embodiment includes a memory management device 100 (the memory management device 100 integrates a memory management unit), and the memory management device 100 has a computer-readable storage medium corresponding to the memory management method running in order to execute the steps of the memory management method.

[0025] Understandable Figure 1 The memory management device in the memory management method scenario shown, or the device included in the memory management device, does not constitute a limitation on the embodiments of the present invention. That is, the number or type of the memory management device included in the memory management method scenario, or the number or type of the device included in each device, does not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be considered as equivalent substitutions or derivatives of the technical solutions claimed in the embodiments of the present invention.

[0026] In this embodiment of the invention, the memory management device 100 is mainly used to: respond to a memory management request for a target application, and determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application; The memory page to be processed is compressed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in a virtual compressed memory module; The target migration memory in the virtual compressed memory is determined based on the application group identifier and / or application activity parameter of the target application. The target migration memory is processed by memory migration, and then the target migration memory is deleted from the virtual memory module to obtain the memory management result.

[0027] The memory management device 100 in this embodiment of the invention can be an independent memory management device, such as a mobile phone, tablet computer, network device, smart TV, server and smart computer, or a memory management network or memory management cluster composed of multiple memory management devices.

[0028] This application provides a memory management method, apparatus, device, and computer-readable storage medium, which will be described in detail below.

[0029] It will be understood by those skilled in the art that Figure 1 The application environment shown is only one application scenario related to the solution of this application and does not constitute a limitation on the application scenario of this application. Other application environments may include more than one application scenario. Figure 1 The number of memory management devices shown, or the memory management network connections, for example... Figure 1 Only one memory management device is shown in the figure. It can be understood that the scenario of this memory management method may also include one or more memory management devices, which are not limited here. The memory management device 100 may also include a memory for storing memory data and other data.

[0030] It should be noted that, Figure 1 The schematic diagram of the memory management method shown is merely an example. The scenarios of the memory management method described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention and do not constitute a limitation on the technical solutions provided in the embodiments of the present invention.

[0031] Based on the scenarios described above regarding memory management methods, various embodiments of the memory management method disclosed in this invention are proposed.

[0032] like Figure 2 As shown, Figure 2 This is a flowchart illustrating one embodiment of the memory management method in this application. The memory management method includes the following steps 201 to 204: 201. Respond to a memory management request for a target application, and determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application; The memory management method in this embodiment is applied to a memory management device. The type and number of memory management devices are not specifically limited. That is, the memory management device can be one or more smart terminals or servers. In a specific embodiment, the memory management device is at least one or more smart terminals such as mobile phones, tablets, network devices, smart TVs, servers, and smart computers.

[0033] Optionally, the target application is an application or corresponding process installed in the operating system of the memory management device that is subject to memory management, used to implement specified interactive functions at runtime. For example, the target application can provide interactive functions such as instant messaging, audio and video playback, and online shopping at runtime. Optionally, in a specific embodiment, the target application can be any one or more of a system application pre-installed in the operating system of the data processing device to implement the specified functions and a third-party program installed by the user.

[0034] Optionally, a memory management request is an operation event that drives the memory management device to manage the target application in order to release the physical memory corresponding to the target application. Optionally, the triggering method of this memory management request is not specifically limited here; that is, the memory management request can be actively triggered by the user, for example, by the user clicking the memory management button on the memory management device. Furthermore, the memory management request can also be automatically triggered by the memory management device, for example, by the memory management device automatically triggering the memory management request when it detects that the available memory is lower than a preset memory threshold.

[0035] Optionally, the memory page to be processed is an anonymous memory page associated with the target application and to be migrated for memory reclamation.

[0036] Optionally, in one specific embodiment, the memory management device monitors the available memory of the terminal in real time during operation and compares the available memory with a preset memory threshold. Based on the comparison result, it determines whether to trigger a memory management request to perform memory reclamation. The preset memory threshold is a threshold of available memory used to assess whether memory reclamation should be performed. In one specific embodiment, the preset memory threshold is 10%.

[0037] Optionally, if the available memory is detected to be lower than the preset memory threshold, the memory management device determines that the current available memory is insufficient and memory reclamation is required, and automatically triggers the memory management request.

[0038] Optionally, if the available memory is detected to be higher than the preset memory threshold, the memory management device determines that the current available memory is sufficient and there is no need to perform memory reclamation. The memory management request is automatically triggered only when the user manually clicks the memory management button or when any target application experiences lag.

[0039] Optionally, after receiving a memory management request, the memory management device identifies the running application in the memory management device as the target application to be managed, and obtains the memory pages to be processed corresponding to each target application.

[0040] 202. Compress the memory page to be processed to obtain the virtual compressed memory page corresponding to the target application; Optionally, after acquiring the memory page to be processed, the memory management device compresses the memory page to be processed in order to increase the temporary available memory space, thereby obtaining a virtual compressed memory page corresponding to the target application. This virtual compressed memory page is stored in a virtual compressed memory module (ZRAM), thereby increasing the temporary available memory space of the terminal.

[0041] Optionally, the virtual compressed memory page is a compressed memory page generated by compressing the memory page to be processed by a certain proportion and then migrating it.

[0042] Optionally, the virtual compressed memory module is a virtual memory space allocated in the memory space of the memory management device for temporarily storing virtual compressed memory pages.

[0043] Optionally, after determining the memory page to be processed, the memory management device performs memory compression on the memory page and stores the compressed memory page in the virtual compressed memory module to obtain the virtual compressed memory page.

[0044] Optionally, after acquiring the virtual compressed memory page, the memory management device also stores the compressed memory entity corresponding to the virtual compressed memory page in a memory migration list, thereby marking the compressed memory entity as an entity to be migrated. In one specific embodiment, this memory migration list is a memory reclamation list storing the entities corresponding to the virtual compressed memory pages to be migrated. In another specific embodiment, this memory migration list is an extent lru list.

[0045] 203. Determine the target migration memory in the virtual compressed memory based on the application group identifier and / or application activity parameter of the target application; Optionally, after acquiring the virtual compressed memory page, in order to avoid wasting memory space and achieve true memory release, the memory management device also determines the target migration memory to be physically released in the virtual compressed memory based on the application group identifier and / or application activity parameters of the target application. This enables the determination of the target migration memory to be released based on the application grouping and activity level, thereby flexibly releasing memory for low-activity or non-whitelisted applications, improving the retention rate of high-frequency applications and increasing memory utilization.

[0046] Optionally, the application group identifier is a unique identifier used to characterize the memory group to which the target application belongs. During operation, the memory management device allocates the memory information corresponding to each target application to the corresponding group based on a preset grouping strategy to achieve subsequent resource isolation and unified management. In one specific embodiment, the preset grouping strategy is the Linux Memory Cgroup strategy.

[0047] Optionally, in one specific embodiment, the application group identifier includes a whitelist group identifier and a regular group identifier. The whitelist group identifier represents the identifier information corresponding to whitelisted application groups that are protected and do not require memory management. The regular group identifier represents the identifier information corresponding to non-whitelisted application groups that can perform normal memory management.

[0048] The application activity parameter is a quantitative parameter used to characterize the level of interactive activity of the target application. This application activity parameter is calculated by quantifying the interactive behavior data corresponding to the target application. This interactive behavior data includes any one or more statistical parameters characterizing human-computer interaction behavior, such as interaction duration data and interaction frequency data.

[0049] Optionally, the target migration memory is the virtual compressed memory to be released, selected from the virtual compressed memory by application group identifier and / or application activity parameters. That is, the memory management device selects the virtual compressed memory of the least active application in each application group as the target migration memory by application group identifier and application activity parameters, and performs physical memory release on the target migration memory in subsequent steps to improve the retention rate of high-frequency applications and improve memory utilization.

[0050] Optionally, during operation, the memory management device responds to memory grouping requests for target applications, groups the target applications into process groups according to a preset grouping strategy, and obtains application groups and corresponding initial activity parameters for each application group. Here, each application group is a grouping category used for resource isolation and unified management of the target application processes within the group. The initial activity parameters are pre-set initialization quantification parameters characterizing the activity level of the target applications within each application group. Optionally, in a specific embodiment, the application groups include whitelisted application groups that do not require memory management and regular application groups that require memory management.

[0051] Optionally, in one specific embodiment, after creating an application group, the memory management device also responds to a user-triggered application keep-alive request, obtains the target application corresponding to the keep-alive request, and assigns the target application to a whitelisted application group. The application keep-alive request is a request that drives the memory management device to perform memory protection on a specified application, preventing memory reclamation. In one specific embodiment, the user can trigger an application keep-alive request for a specified target application through the application keep-alive interface provided by the memory management device.

[0052] Optionally, during operation, the memory management device may also update the initial activity parameter based on the interaction behavior data of the target application within each application to obtain the application activity parameter, and use the application activity parameter to determine the target migration memory to be migrated in the virtual compressed memory.

[0053] Optionally, the memory management device responds to the interactive behavior request of the target application and records the interactive behavior data corresponding to the interactive behavior request. This interactive behavior data includes interaction duration data and interaction count data. The interaction duration data represents the active time statistically obtained during the user's use of the target application. The interaction count data represents the number of times the target application is opened or brought to the foreground within a preset time range.

[0054] Optionally, the memory management device updates the initial activity parameter based on the duration weighting coefficient and the interaction duration data to obtain the duration increment parameter. The duration increment parameter is calculated from the interaction duration data, representing the interaction duration of the target application, and is used as quantified incremental data to update the initial activity parameter. The duration weighting coefficient is a pre-set weighting coefficient used to evaluate the duration increment data.

[0055] That is, the memory management device calculates the product between the interaction duration data and the preset duration weighting coefficient to obtain the duration increment data.

[0056] Optionally, the memory management device also updates the initial activity parameter based on the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency data to obtain a frequency increment parameter. That is, the memory management device assesses the frequency and importance of user interaction with the target application using the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency threshold, thereby generating the frequency increment parameter. The frequency increment parameter is a quantified incremental data representing the interaction frequency of the target application, calculated from the interaction frequency data, used to update the initial activity parameter. The frequency weighting coefficient is a pre-set weighting coefficient used to evaluate the frequency increment parameter.

[0057] Optionally, after determining the duration increment parameter and frequency increment parameter based on the interaction duration data and interaction count data, the memory management device further determines the application activity parameter based on the duration active increment parameter, the frequency increment parameter, and the initial activity parameter. That is, the memory management device calculates the sum of the duration active increment parameter, the frequency increment parameter, and the initial activity parameter, and determines the sum of the duration active increment parameter, the frequency increment parameter, and the initial activity parameter as the application activity parameter.

[0058] Optionally, in another specific embodiment, in order to prevent memory management imbalance caused by application activity parameters being too high or too low, the memory management device calculates the sum of the duration activity increment parameter, the frequency increment parameter and the initial activity parameter, determines the sum of the duration activity increment parameter, the frequency increment parameter and the initial activity parameter as the updated activity parameter, and determines the final application activity parameter through the updated activity parameter and parameter protection conditions.

[0059] Optionally, after obtaining the application activity parameters, the memory management device may also perform memory management on the target application corresponding to the regular group identifier based on the application activity parameters.

[0060] That is, if the target application's application group identifier is a regular group identifier, then the migration activity threshold is determined based on the group migration ratio and the application's activity parameters. The group migration ratio is used to filter target memory for migration. This group migration ratio can be customized according to the actual memory reclamation scenario.

[0061] Optionally, the memory management device calculates the average value among the activity parameters of each application to obtain the average activity parameter, and calculates the product between the average activity parameter and the group migration ratio to obtain the migration activity threshold.

[0062] Optionally, after calculating the migration activity threshold, the memory management device will also compare the migration activity threshold with the activity threshold of each application, and determine the virtual compressed memory corresponding to the target application whose application activity parameter is less than the migration activity threshold as the target migration memory. This will enable memory reclamation for cold applications whose application activity threshold is less than the migration activity threshold, and flexibly release memory for low-activity or non-whitelisted applications, thereby improving the retention rate of high-frequency applications and improving memory utilization.

[0063] Optionally, in another embodiment, if the memory management device determines that the application group identifier of the target application is a whitelist group identifier, then the virtual compressed memory of the target application corresponding to the whitelist group identifier is determined as protected compressed memory, and the target migration memory in the remaining compressed memory in the virtual compressed memory is determined according to the application activity parameter, so as to effectively ensure that the keep-alive applications in the whitelist application group can run stably and improve the keep-alive application retention rate.

[0064] 204. Perform memory migration processing on the target migration memory and delete the target migration memory in the virtual memory module to obtain the memory management result.

[0065] Optionally, after determining the target migration memory, the memory management device performs memory migration processing on the target migration memory and deletes the target migration memory in the virtual memory module to obtain the memory management result.

[0066] In other words, after determining the target memory to be migrated, the memory management device migrates the target memory to the target storage, thus obtaining the memory migration result. The target storage is the designated ROM within the memory management device used to store the target memory to be migrated. The memory migration result is the processing result characterizing whether the target memory to be migrated has been successfully migrated to the target storage.

[0067] Optionally, if the memory migration result is a successful migration result, the memory management device displays the memory migration data corresponding to each target application on a preset visual interface and deletes the target migration memory in the virtual memory module to obtain the memory management result, so as to ensure that the underlying memory of the system has been freed up.

[0068] In this embodiment, the memory management device responds to a memory management request for a target application, determines the target application corresponding to the memory management request, and the memory page to be processed corresponding to the target application; compresses the memory page to be processed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in a virtual compressed memory module; determines the target migration memory in the virtual compressed memory according to the application group identifier and / or application activity parameters of the target application; performs memory migration processing on the target migration memory, and deletes the target migration memory in the virtual memory module to obtain the memory management result. This system enables the identification of target applications and corresponding memory pages to be managed in memory control scenarios. The system compresses these memory pages to obtain virtual compressed memory pages stored in a virtual memory module. It then uses the application group identifier and / or application activity parameters of the target application to determine whether to migrate the virtual compressed memory. This accurately identifies the target migration memory within the virtual compressed memory and performs the migration process. After migration, the target migration memory is deleted from the virtual memory module. This allows for adaptive management of application memory based on application activity and group identifiers when memory is low, effectively releasing memory from inactive applications, improving memory utilization, application retention, and startup speed, thereby enhancing device stability.

[0069] like Figure 3 As shown, Figure 3A flowchart illustrating an embodiment of the memory management method provided in this application for determining the frequency increment parameter is shown below. Figure 3 In the illustrated embodiment, the memory management method further includes steps 301 to 302: 301. If the number of short-term interactions in the interaction count data is less than the operation count threshold, then calculate the first frequency increment parameter based on the count weighting coefficient and the interaction count data; 302. If the number of short-term interactions in the interaction count data is greater than or equal to the operation count threshold, then the sum of the preset high-frequency increment parameter and the first frequency increment parameter is determined as the second frequency increment parameter.

[0070] Based on the above embodiments, in this embodiment, the memory management device updates the initial activity parameter according to the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency data to obtain the frequency increment parameter. That is, the memory management device evaluates the frequency and importance of user interaction with the target application using the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency threshold, thereby generating the frequency increment parameter. This frequency increment parameter includes a first frequency increment parameter and a second frequency increment parameter. The first frequency increment parameter characterizes the frequency of user interaction with the target application within the statistical period. The second frequency increment parameter corresponds to the high-frequency interaction scenario in the short-term interaction frequency data within the statistical period.

[0071] That is, after acquiring the interaction count data, the memory management device also acquires the short-term interaction count within the interaction count data. It then compares this short-term interaction count with the operation count threshold to determine whether the target application's corresponding interaction scenario is a short-term, high-frequency interaction scenario. The short-term interaction count refers to the number of application interactions counted within a preset short interaction window.

[0072] Optionally, if the number of short-term interactions in the interaction count data is less than the operation count threshold, the memory management device determines that the interaction scenario corresponding to the target application is a low-frequency interaction scenario, and calculates a first frequency increment parameter based on the frequency weighting coefficient and the interaction count data. That is, the memory management device calculates the product between the frequency weighting coefficient and the interaction count data to obtain the first frequency increment parameter.

[0073] Optionally, if the number of short-term interactions in the interaction count data is greater than or equal to the operation count threshold, the memory management device determines that the interaction scenario corresponding to the target application is a high-frequency interaction scenario, and determines the sum of the preset high-frequency increment parameter and the first frequency increment parameter as the second frequency increment parameter. Here, the high-frequency increment parameter is the frequency increment parameter corresponding to the high-frequency interaction scenario.

[0074] Optionally, after determining the duration increment parameter and frequency increment parameter based on the interaction duration data and interaction count data, the memory management device further determines the application activity parameter based on the duration active increment parameter, the frequency increment parameter, and the initial activity parameter. That is, the memory management device calculates the sum of the duration active increment parameter, the frequency increment parameter, and the initial activity parameter, and determines the sum of the duration active increment parameter, the frequency increment parameter, and the initial activity parameter as the application activity parameter.

[0075] In this embodiment, the memory management device determines a first frequency increment parameter based on the interaction count data and the interaction count data if the number of short-term interactions in the interaction count data is less than the operation count threshold. If the number of short-term interactions in the interaction count data is greater than or equal to the operation count threshold, the sum of the preset high-frequency increment parameter and the first frequency increment parameter is determined as a second frequency increment parameter. This allows for the assessment of the frequency and importance of user interaction with the target application using the interaction count weight coefficient, operation count threshold, and interaction count threshold, thereby generating frequency increment parameters and providing data support for subsequent memory management based on application activity levels.

[0076] like Figure 4 As shown, Figure 4 A flowchart illustrating one embodiment of the memory management method for determining application activity parameters provided in this application is shown below. Figure 4 In the illustrated embodiment, the memory management method further includes steps 401 to 403: 401. Calculate the sum of the duration-based active increment parameter, the frequency-based increment parameter, and the initial active parameter to obtain the updated active parameter; 402. If the updated active parameter meets the parameter protection conditions, then the updated active parameter is determined as the application active parameter; 403. If the updated active parameter does not meet the parameter protection conditions, then the first protection parameter or the second protection parameter corresponding to the parameter protection conditions shall be determined as the application active parameter.

[0077] Based on the above embodiments, in this embodiment, in order to prevent memory management imbalance caused by application activity parameters being too high or too low, the memory management device calculates the sum of the duration activity increment parameter, the frequency increment parameter and the initial activity parameter, determines the sum of the duration activity increment parameter, the frequency increment parameter and the initial activity parameter as the updated activity parameter, and determines the final application activity parameter through the updated activity parameter and parameter protection conditions.

[0078] Optionally, the memory management device pre-configures parameter protection conditions to prevent active parameters from being extremely high or low. These protection conditions are logical conditions used to filter abnormally low or high active parameters. Specifically, each protection condition includes a first protection parameter for filtering abnormally low updated active parameters and a second protection parameter for filtering abnormally high updated active parameters. The protection conditions use both the first and second protection parameters to filter abnormally low or high updated active parameters. In one specific embodiment, the parameter protection condition is that the updated active parameter is greater than the first protection parameter and less than the second protection parameter.

[0079] Optionally, if the memory management device determines that the update active parameter meets the parameter protection conditions, it determines that the value of the update active parameter is normal and determines the update active parameter as the application active parameter.

[0080] Optionally, if the memory management device determines that the update activity parameter does not meet the parameter protection condition, it determines the first or second protection parameter corresponding to the parameter protection condition as the application activity parameter. That is, when the update activity parameter is less than the first protection parameter in the parameter protection condition, it is determined that the update activity parameter does not meet the parameter protection condition, the memory management device determines that the update activity parameter is abnormally low, and determines the first protection parameter as the application activity parameter. Alternatively, when the update activity parameter is greater than the second protection parameter in the parameter protection condition, it is determined that the update activity parameter does not meet the parameter protection condition, the memory management device determines that the update activity parameter is abnormally high, determines the second protection parameter as the application activity parameter, and uses the application activity parameter to screen target migration memory for memory reclamation in subsequent steps.

[0081] In this embodiment, the memory management device calculates the sum of the duration-based active increment parameter, the frequency-based active increment parameter, and the initial active parameter to obtain the updated active parameter. If the updated active parameter meets the parameter protection condition, it is determined as the application active parameter. If the updated active parameter does not meet the parameter protection condition, the first protection parameter or the second protection parameter corresponding to the parameter protection condition is determined as the application active parameter. This effectively avoids extreme high or low activity parameters, improves the effectiveness of subsequent target memory migration screening, and prevents memory management imbalance.

[0082] To better implement the memory management method in the embodiments of this application, a memory management device is also provided in the embodiments of this application, such as... Figure 5 As shown, Figure 5 This is a schematic diagram of one embodiment of the memory management device provided in this application. Specifically, the memory management device 500 includes: The memory acquisition module 501 is configured to respond to a memory management request for a target application, and determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application. The memory compression module 502 is configured to compress the memory page to be processed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in the virtual compressed memory module; Migration assessment module 503 is configured to determine target migration memory in virtual compressed memory based on the application group identifier and / or application activity parameter of the target application. The memory management module 504 is configured to perform memory migration processing on the target migration memory and delete the target migration memory in the virtual memory module to obtain the memory management result.

[0083] In one possible implementation of this embodiment, the memory management device determines the target migration memory in the virtual compressed memory based on the application group identifier and / or application activity parameter of the target application, including: In response to a memory grouping request for a target application, the target application is grouped into process groups according to a preset grouping strategy to obtain application groups and the initial active parameters corresponding to the application groups; The initial activity parameters are updated based on the interaction behavior data of the target application to obtain the application activity parameters; The target migration memory to be migrated in the virtual compressed memory is determined using the application activity parameters.

[0084] In one possible implementation of this embodiment, the memory management device updates the initial activity parameters based on the interaction behavior data of the target application to obtain application activity parameters, including: In response to the interactive behavior request of the target application, the interactive behavior data corresponding to the interactive behavior request is recorded, and the interactive behavior data includes interactive duration data and interactive number data. The initial activity parameter is updated based on the duration weighting coefficient and the interaction duration data to obtain the duration increment parameter; The initial activity parameter is updated based on the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency data to obtain the frequency increment parameter; The application activity parameter is determined based on the duration activity increment parameter, the frequency increment parameter, and the initial activity parameter.

[0085] In one possible implementation of this embodiment, the frequency increment parameter in the memory management device includes a first frequency increment parameter and a second frequency increment parameter; The memory management device updates the initial activity parameter based on the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency data to obtain the frequency increment parameter, including: If the number of short-term interactions in the interaction count data is less than the operation count threshold, then the first frequency increment parameter is calculated based on the count weighting coefficient and the interaction count data. If the number of short-term interactions in the interaction count data is greater than or equal to the operation count threshold, then the sum of the preset high-frequency increment parameter and the first frequency increment parameter is determined as the second frequency increment parameter.

[0086] In one possible implementation of this embodiment, the memory management device determines the application activity parameters based on the duration-based activity increment parameter, the frequency increment parameter, and the initial activity parameter, including: The sum of the duration-based activity increment parameter, the frequency-based activity increment parameter, and the initial activity parameter is calculated to obtain the updated activity parameter; If the updated active parameter meets the parameter protection conditions, then the updated active parameter is determined as the application active parameter; If the updated active parameter does not meet the parameter protection conditions, then the first protection parameter or the second protection parameter corresponding to the parameter protection conditions will be determined as the application active parameter.

[0087] In one possible implementation of this embodiment, the memory management device uses the application activity parameter to determine the target migration memory to be migrated in the virtual compressed memory, including: If the application group identifier of the target application is a regular group identifier, then the migration activity threshold is determined based on the group migration ratio and the application activity parameter. The virtual compressed memory corresponding to the target application whose application activity parameter is less than the migration activity threshold is determined as the target migration memory.

[0088] In one possible implementation of this embodiment, the memory management device determines the target migration memory in the virtual compressed memory based on the application group identifier and / or application activity parameter of the target application, including: If the application group identifier of the target application is a whitelist group identifier, then the virtual compressed memory of the target application corresponding to the whitelist group identifier is determined as protected compressed memory; The target migration memory in the remaining compressed memory of the virtual compressed memory is determined according to the application activity parameter.

[0089] In one possible implementation of this embodiment, the memory management device performs memory migration processing on the target migration memory and deletes the target migration memory in the virtual memory module to obtain a memory management result, including: The target memory is migrated to the target storage to obtain the memory migration result; If the memory migration result is a successful migration result, the memory migration data volume corresponding to each target application will be displayed on the preset visual interface, and the target migration memory will be deleted in the virtual memory module to obtain the memory management result.

[0090] In this embodiment, the memory management device responds to a memory management request for a target application, determines the target application corresponding to the memory management request, and the memory page to be processed corresponding to the target application; compresses the memory page to be processed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in a virtual compressed memory module; determines the target migration memory in the virtual compressed memory according to the application group identifier and / or application activity parameters of the target application; performs memory migration processing on the target migration memory, and deletes the target migration memory in the virtual memory module to obtain the memory management result. This system enables the identification of target applications and corresponding memory pages to be managed in memory control scenarios. The system compresses these memory pages to obtain virtual compressed memory pages stored in a virtual memory module. It then uses the application group identifier and / or application activity parameters of the target application to determine whether to migrate the virtual compressed memory. This accurately identifies the target migration memory within the virtual compressed memory and performs the migration process. After migration, the target migration memory is deleted from the virtual memory module. This allows for adaptive management of application memory based on application activity and group identifiers when memory is low, effectively releasing memory from inactive applications, improving memory utilization, application retention, and startup speed, thereby enhancing device stability.

[0091] This invention also provides a memory management device, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of an embodiment of the memory management device provided in this application.

[0092] The memory management device integrates any of the memory management devices provided in the embodiments of the present invention, and the memory management device includes: One or more processors; Memory; and One or more target applications, wherein the one or more target applications are stored in the memory and configured to be executed by the processor from the steps of the memory management method described in any of the above-described memory management method embodiments.

[0093] Specifically, the memory management device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that... Figure 6 The memory management device structure shown does not constitute a limitation on the memory management device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 601 is the control center of the memory management device. It connects to various parts of the memory management device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, it performs various functions and processes data, thereby providing overall monitoring of the memory management device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and target application, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.

[0094] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one target application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the memory management device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0095] The memory management device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0096] The memory management device may also include an input unit 604, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0097] Although not shown, the memory management device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the memory management device loads the executable files corresponding to the processes of one or more target applications into the memory 602 according to the following instructions, and the processor 601 runs the target applications stored in the memory 602 to realize various functions, as follows: In response to a memory management request for a target application, determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application; The memory page to be processed is compressed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in a virtual compressed memory module; The target migration memory in the virtual compressed memory is determined based on the application group identifier and / or application activity parameter of the target application. The target migration memory is processed by memory migration, and then the target migration memory is deleted from the virtual memory module to obtain the memory management result.

[0098] Therefore, embodiments of the present invention provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, which is loaded by a processor to execute the steps in any of the memory management methods provided in the embodiments of the present invention. For example, the computer program loaded by the processor may execute the following steps: In response to a memory management request for a target application, determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application; The memory page to be processed is compressed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in a virtual compressed memory module; The target migration memory in the virtual compressed memory is determined based on the application group identifier and / or application activity parameter of the target application. The target migration memory is processed by memory migration, and then the target migration memory is deleted from the virtual memory module to obtain the memory management result.

[0099] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.

[0100] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.

[0101] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0102] The above provides a detailed description of a memory management method provided by the embodiments of this application. Specific embodiments have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A memory management method, characterized in that, The memory management method includes: In response to a memory management request for a target application, determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application; The memory page to be processed is compressed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in a virtual compressed memory module; The target migration memory in the virtual compressed memory is determined based on the application group identifier and / or application activity parameter of the target application. The target migration memory is processed by memory migration, and then the target migration memory is deleted from the virtual memory module to obtain the memory management result.

2. The memory management method according to claim 1, characterized in that, Determining the target migration memory in virtual compressed memory based on the application group identifier and / or application activity parameter of the target application includes: In response to a memory grouping request for a target application, the target application is grouped into process groups according to a preset grouping strategy to obtain application groups and the initial active parameters corresponding to the application groups; The initial activity parameters are updated based on the interaction behavior data of the target application to obtain the application activity parameters; The target migration memory to be migrated in the virtual compressed memory is determined using the application activity parameters.

3. The memory management method according to claim 2, characterized in that, The step of updating the initial activity parameters based on the interaction behavior data of the target application to obtain application activity parameters includes: In response to the interactive behavior request of the target application, the interactive behavior data corresponding to the interactive behavior request is recorded, and the interactive behavior data includes interactive duration data and interactive number data. The initial activity parameter is updated based on the duration weighting coefficient and the interaction duration data to obtain the duration increment parameter; The initial activity parameter is updated based on the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency data to obtain the frequency increment parameter; The application activity parameter is determined based on the duration activity increment parameter, the frequency increment parameter, and the initial activity parameter.

4. The memory management method according to claim 3, characterized in that, The frequency increment parameters include a first frequency increment parameter and a second frequency increment parameter; The step of updating the initial activity parameter based on the frequency weighting coefficient, the operation frequency threshold, and the interaction frequency data to obtain the frequency increment parameter includes: If the number of short-term interactions in the interaction count data is less than the operation count threshold, then the first frequency increment parameter is calculated based on the count weighting coefficient and the interaction count data. If the number of short-term interactions in the interaction count data is greater than or equal to the operation count threshold, then the sum of the preset high-frequency increment parameter and the first frequency increment parameter is determined as the second frequency increment parameter.

5. The memory management method according to claim 3, characterized in that, The step of determining the application activity parameters based on the duration-based activity increment parameter, the frequency-based activity increment parameter, and the initial activity parameter includes: The sum of the duration-based activity increment parameter, the frequency-based activity increment parameter, and the initial activity parameter is calculated to obtain the updated activity parameter; If the updated active parameter meets the parameter protection conditions, then the updated active parameter is determined as the application active parameter; If the updated active parameter does not meet the parameter protection conditions, then the first protection parameter or the second protection parameter corresponding to the parameter protection conditions will be determined as the application active parameter.

6. The memory management method according to claim 2, characterized in that, The step of determining the target migration memory in the virtual compressed memory to be migrated using the application activity parameters includes: If the application group identifier of the target application is a regular group identifier, then the migration activity threshold is determined based on the group migration ratio and the application activity parameter. The virtual compressed memory corresponding to the target application whose application activity parameter is less than the migration activity threshold is determined as the target migration memory.

7. The memory management method according to claim 1, characterized in that, Determining the target migration memory in virtual compressed memory based on the application group identifier and / or application activity parameter of the target application includes: If the application group identifier of the target application is a whitelist group identifier, then the virtual compressed memory of the target application corresponding to the whitelist group identifier is determined as protected compressed memory; The target migration memory in the remaining compressed memory of the virtual compressed memory is determined according to the application activity parameter.

8. The memory management method according to any one of claims 1-7, characterized in that, The process of performing memory migration on the target migration memory and deleting the target migration memory in the virtual memory module to obtain memory management results includes: The target memory is migrated to the target storage to obtain the memory migration result; If the memory migration result is a successful migration result, the memory migration data volume corresponding to each target application will be displayed on the preset visual interface, and the target migration memory will be deleted in the virtual memory module to obtain the memory management result.

9. A memory management device, characterized in that, The memory management device includes: The memory acquisition module is configured to respond to a memory management request for a target application, and determine the target application corresponding to the memory management request and the memory page to be processed corresponding to the target application. A memory compression module is configured to compress the memory page to be processed to obtain a virtual compressed memory page corresponding to the target application, and the virtual compressed memory is stored in the virtual compressed memory module; The migration assessment module is configured to determine the target migration memory in the virtual compressed memory based on the application group identifier and / or application activity parameters of the target application. The memory management module is configured to perform memory migration processing on the target migration memory and delete the target migration memory in the virtual memory module to obtain the memory management result.

10. A memory management device, characterized in that, The memory management device includes: One or more processors; Memory; and One or more target applications, wherein the one or more target applications are stored in the memory and configured to be executed by the processor to implement the steps of the memory management method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the steps of the memory management method according to any one of claims 1 to 8.