Memory page management method and device and electronic equipment

By dividing memory management packets according to the program's memory access delay requirements and managing the memory pages of each packet, the problem of inflexible and convenient memory page management in the existing technology is solved, and more efficient memory page management is achieved.

CN119493739APending Publication Date: 2025-02-21GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311032748.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-15
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The method of managing memory pages in the prior art is not flexible and convenient enough, and it is difficult to effectively manage according to the memory access delay requirements of different programs.

Method used

By obtaining the programs to be grouped, the programs are divided into corresponding memory management packets according to their memory access delay requirements, and their memory pages are managed according to the requirements of each packet.

Benefits of technology

It realizes different management measures based on different memory management packets, which improves the flexibility and convenience of memory page management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119493739A_ABST
    Figure CN119493739A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a memory page management method and device and electronic equipment. After to-be-grouped programs are obtained, the programs can be further divided into corresponding memory management groups according to memory access delay requirements of the programs, the memory access delay requirements of the programs in the same memory management group are similar or the same, and then the programs in the same memory management group are divided according to the respective memory access delay requirement of each memory management group. And managing the memory pages corresponding to the programs in each memory management group. In this way, in the process that the electronic device manages the memory page, the corresponding management measures can be collected according to the divided memory management groups, and then different management measures can be taken according to different memory management groups; and the flexibility and convenience of managing the memory page are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a memory page management method, device and electronic device. Background Art

[0002] In memory, data can usually be managed through memory pages. During the operation of an electronic device, the electronic device needs to manage the memory pages in the memory. For example, the electronic device can remove the memory pages in the memory to free up memory space for other processes. However, in the related methods, the method of managing memory pages is not flexible and convenient enough. Summary of the invention

[0003] In view of the above problems, the present application proposes a memory page management method, device and electronic device to improve the above problems.

[0004] In a first aspect, the present application provides a memory page management method, the method comprising: obtaining programs to be grouped; dividing the programs into corresponding memory management groups according to memory access delay requirements of the programs, wherein the memory access delay requirements of programs in the same memory management group are similar or identical; and managing the memory pages corresponding to the programs in each memory management group according to the respective memory access delay requirements of each memory management group.

[0005] In a second aspect, the present application provides a memory page management device, which includes: a program acquisition unit, used to acquire programs to be grouped; a program grouping unit, used to divide the programs into corresponding memory management groups according to the memory access delay requirements of the programs, wherein the memory access delay requirements of programs in the same memory management group are similar or the same; a memory management unit, used to manage the memory pages corresponding to the programs in each memory management group according to the respective memory access delay requirements of each memory management group.

[0006] In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors to implement the above method.

[0007] In a fourth aspect, the present application provides a computer-readable storage medium, in which program code is stored, wherein the above method is executed when the program code is executed by a processor.

[0008] The present application provides a memory page management method, device, and electronic device. After obtaining the programs to be grouped, the programs can be further divided into corresponding memory management groups according to the memory access delay requirements of the programs, wherein the memory access delay requirements of the programs in the same memory management group are similar or identical, and then the memory pages corresponding to the programs in each memory management group are managed according to the memory access delay requirements of each memory management group. Thus, in the process of the electronic device managing the memory pages, the corresponding management measures can be collected respectively according to the divided memory management groups, so that different management measures can be taken for different memory management groups, thereby improving the flexibility and convenience of managing the memory pages. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0010] Figure 1 A flow chart of a memory page management method proposed in an embodiment of the present application is shown;

[0011] Figure 2 A schematic diagram showing multiple memory management groups in an embodiment of the present application is shown;

[0012] Figure 3 A flowchart of a memory page management method proposed in another embodiment of the present application is shown;

[0013] Figure 4 A structural block diagram of a memory page processing device proposed in an embodiment of the present application is shown;

[0014] Figure 5 A structural block diagram of an electronic device for executing a memory page management method according to an embodiment of the present application is shown in real time of the present application;

[0015] Figure 6 A storage unit in real time of the present application is shown for storing or carrying program codes for implementing the memory page management method according to an embodiment of the present application. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0017] Memory, also known as main memory, is a storage space that can be directly addressed by the CPU and is made of semiconductor devices. Processes in electronic devices usually need to use memory to complete data processing during operation. For example, during the startup process, the process will obtain the corresponding memory page for use during the startup process or after startup. In memory, data can usually be managed through memory pages. Among them, during the operation of electronic devices, electronic devices need to manage memory pages in memory. For example, electronic devices can move memory pages out of memory to free up memory space for other processes. However, in related methods, the way to manage memory pages is not flexible and convenient enough.

[0018] Therefore, the inventors have proposed a memory page management method, device, and electronic device in the present application. After obtaining the programs to be grouped, the programs can be further divided into corresponding memory management groups according to the memory access delay requirements of the programs, wherein the memory access delay requirements of the programs in the same memory management group are similar or identical, and then the memory pages corresponding to the programs in each memory management group are managed according to the respective memory access delay requirements of each memory management group. Thus, in the above manner, in the process of the electronic device managing the memory pages, the corresponding management measures can be collected respectively according to the divided memory management groups, and then different management measures can be taken for different memory management groups, thereby improving the flexibility and convenience of managing the memory pages.

[0019] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0020] See also Figure 1 , an embodiment of the present application provides a memory page management method, the method comprising:

[0021] S110: Obtain programs to be grouped.

[0022] The programs to be grouped can be understood as the programs for which the corresponding memory management groups need to be determined. In the embodiment of the present application, there can be multiple ways to determine the programs to be grouped.

[0023] As a method, the started programs are obtained as programs to be grouped.

[0024] It should be noted that after the program is started, it can start running tasks automatically or in response to user operations. In the process of running tasks, the program usually needs to use memory, so the started program can be used as a program to be grouped so that the memory page corresponding to the started program can be managed immediately.

[0025] As another way, newly installed programs can be obtained as programs to be grouped. For newly installed programs, memory will also be used in the subsequent running process, and then when newly installed programs are detected, the newly installed programs are grouped, which is conducive to group management of the programs.

[0026] As another method, the program selected by the user can be obtained as the program to be grouped. In this method, the user can determine the programs to be grouped according to his own habits or needs. For example, if the electronic device has programs P1, P2, P3, P4, and P5 installed, if the user selects programs P1, P2, and P3, then programs P1, P2, and P3 can be used as the programs to be grouped.

[0027] In the case where there are multiple ways to determine the programs to be grouped, the multiple ways can be simultaneously combined to determine the programs to be grouped.

[0028] As a method, when a program is detected to be started, it can be further detected whether the started program belongs to the program selected by the user to be grouped. If it is the program selected by the user to be grouped, the started program will be used as the program to be grouped, otherwise, the started program will not be grouped.

[0029] As another way, when it is detected that a program is being installed, it can be further detected whether the installed program belongs to the program selected by the user to be grouped. If it is the program selected by the user to be grouped, the installed program will be treated as a program to be grouped, otherwise, the installed program will not be grouped.

[0030] S120: Divide the programs into corresponding memory management groups according to the memory access latency requirements of the programs, wherein the memory access latency requirements of the programs in the same memory management group are similar or identical.

[0031] After obtaining the programs to be grouped, the memory access latency requirements of the programs to be grouped can be obtained. In an embodiment of the present application, the memory access latency requirement characterizes the timeliness requirements of the program when performing memory access. For example, some programs expect access requests to be responded to more quickly when performing memory access, wherein a faster response to the access request can be understood as the requested data can be returned to the program more quickly, or a faster response to the access request can be understood as the requested calculation in the memory can get the returned calculation result more quickly.

[0032] Optionally, the memory access delay requirement may represent the maximum delay time that the program can accept. Alternatively, the memory access delay requirement may represent the maximum number of memory access delays that the program can accept within a specified time length.

[0033] After the memory access latency requirements of the programs to be grouped are obtained, corresponding memory management groups may be configured for the programs to be grouped.

[0034] As a method, multiple memory management groups can be pre-configured, and a corresponding memory access delay requirement can be configured for each memory management group. In this way, after obtaining the program to be grouped, the memory access delay requirement of the program to be grouped can be compared with the memory access delay requirement corresponding to each memory management group configuration, so as to use the memory management group whose corresponding memory access requirement is similar or identical to the memory access requirement of the program to be grouped as the group into which the program to be grouped is divided.

[0035] Among them, the two memory access delay requirements are similar, which can be understood as the delay requirements expressed by the two memory access delay requirements are relatively close. For example, taking the meaning represented by the memory access delay requirement as the maximum delay time that the program can accept as an example, the delay requirements expressed by the two memory access delay requirements are relatively close, which can be understood as the difference between the maximum delay times that the two memory access delay requirements can accept is less than the specified threshold. For another example, taking the meaning represented by the memory access delay requirement as the maximum number of memory access delays that the program can accept within a specified time length as an example, the delay requirements expressed by the two memory access delay requirements are relatively close, which can be understood as the difference between the maximum number of memory access delays is less than the specified threshold.

[0036] Exemplarily, the situation of multiple memory management groups can be shown in the following Table 1:

[0037] ID Group ID Memory access latency requirements for groups 1 Group G1 T1 2 Group G2 T2 3 Group G3 T3

[0038] Table 1

[0039] As shown in Table 1 above, T1, T2 and T3 in the memory access delay requirements of the groups in Table 1 above represent the maximum acceptable delay time. Among them, the values ​​of T1, T2 and T3 can be non-negative numbers. For example, T1 can be 0.5 seconds, T2 can be 1 second, and T3 can be 2 seconds. Based on the situation shown in Table 1 above, after obtaining the program to be grouped, if the maximum acceptable delay time represented by the memory access delay requirement of the program to be grouped is T1, the program to be grouped will be divided into group G1. If the maximum acceptable delay time represented by the memory access delay requirement of the program to be grouped is T3, the program to be grouped will be divided into group G3. If the maximum acceptable delay time represented by the memory access delay requirement of the program to be grouped is T4, and the difference between T4 and T1 is calculated to be less than the specified threshold, it is determined that the memory access delay requirement of the program to be grouped is similar to the memory access delay requirement of group G1, and the program to be grouped will be divided into group G1.

[0040] Among them, if the memory access delay requirement of the program to be grouped is different from and similar to the memory access delay requirement of each group, then a new memory management group can be created for the program to be grouped, and the memory access requirement of the program to be grouped can be used as the memory access requirement of the newly created memory management group. For example, if the memory access requirement of the program to be grouped represents the maximum acceptable delay time of T5, and the difference between T5 and T1, T2 and T3 is not less than the specified threshold, then it is determined that the memory access requirement of the program to be grouped is different from and similar to the memory access requirement of the currently established memory management group, and then a new group can be created accordingly, wherein the situation of multiple memory management groups after the new grouping can be shown in Table 2 below:

[0041] ID Group ID Memory access latency requirements for groups 1 Group G1 T1 2 Group G2 T2 3 Group G3 T3 4 Group G4 T5

[0042] Table 2

[0043] Alternatively, if the memory access delay requirement of the program to be grouped is different from and similar to the memory access delay requirement of each group, it is also possible to determine from the currently established memory management groups a group whose corresponding memory access delay requirement is closest to the memory access delay requirement of the program to be grouped, as the memory management group corresponding to the program to be grouped.

[0044] As a method, if the memory access delay requirement of the program to be grouped is different from and not similar to the memory access delay requirement of each group, it is possible to first detect whether a new memory management group is allowed. If it is detected that a new memory management group is allowed, a new memory management group is created, and the memory access requirement of the program to be grouped is used as the memory access requirement of the newly created memory management group. If a new memory management group is not allowed, a group whose corresponding memory access delay requirement is closest to the memory access delay requirement of the program to be grouped is determined from the currently established memory management groups as the memory management group corresponding to the program to be grouped.

[0045] Optionally, the electronic device may determine whether to allow the creation of a new memory management group in a variety of ways.

[0046] As a determination method, the user of the electronic device may configure whether to allow the creation of a new memory management group. In this method, a configuration interface may be displayed in the electronic device, and the configuration interface may display an option of prohibiting the creation of a new memory management group and an option of allowing the creation of a new memory management group. Then, the user may select the desired option according to his or her needs.

[0047] As another determination method, the electronic device can determine whether to allow the creation of a new memory management group based on the currently remaining storage space. It should be noted that when a new memory management group is created, it is necessary to allocate corresponding storage space for the new memory management group to store corresponding data. The data may include the data of the memory management group itself to store the data in the memory management group. Therefore, each time a new memory management group is created, more storage space is consumed. In this case, the electronic device can determine that a new memory management group is not allowed to be created if it detects that the remaining storage space is insufficient, and correspondingly, it can determine that a new memory management group is allowed to be created if it detects that the remaining storage space is sufficient.

[0048] Optionally, when it is detected that the remaining storage space is greater than a specified storage threshold, it is determined that the remaining storage space is sufficient; otherwise, it is determined that the remaining storage space is insufficient.

[0049] As a method, in an embodiment of the present application, dividing the program into corresponding memory management groups according to the memory access delay requirement of the program may include: obtaining the memory access delay level of the program, and dividing the program into memory management groups that match the memory access delay level, wherein the memory access delay levels of programs in the same memory management group are similar or identical. In this case, the memory access delay requirement of the program can be characterized by the memory access delay level.

[0050] It should be noted that, in the embodiments of the present application, the memory access delay requirement of the program can be pre-configured by the developer of the program, or can be determined by the electronic device according to the category and / or running state of the program. Correspondingly, when the memory access delay requirement of the program can be characterized by the memory access delay level, the memory access delay level of the program can be determined according to the category and / or running state of the program.

[0051] For example, if the category of a program indicates that the program is a program running in the foreground or a system program, then the memory access latency requirement of the program indicates that the memory direction requirement of the program needs to be responded to quickly. For another example, if the category of a program indicates that the program is a program running in the background, then the memory access latency requirement of the program indicates that the memory direction requirement of the program can be delayed for a certain period of time before responding.

[0052] It should be noted that the memory access requirements for the same program in different running states may also be different. For example, for an audio player program, in the running state when it is started and no audio playback is performed, the operations performed may include operations with low timeliness. The operations with low timeliness may include page switching operations, music search operations, or configuration operations, etc. In the running state of the audio player program starting to play audio, the audio player program will obtain audio data from the network in real time, and load it into the memory for decoding and playback. Therefore, the audio playback operation performed by the audio player program is an operation with high timeliness.

[0053] For another example, for a game program, when it is started and the game operation interface is not entered, the operations performed may include operations with low timeliness. The operations with low timeliness may include page switching operations, game configuration operations, or game item purchase operations, etc. In the game program, when the game operation interface is displayed, the game program will obtain game data (for example, other players' data or real-time map data, etc.) from the network in real time, and load it into the memory for processing. Therefore, when the game program is in the running state of displaying the game operation interface, the memory access request needs to be responded to faster. Among them, when the game program displays the game operation interface, the game operation object in the game operation interface can be controlled.

[0054] In the embodiment of the present application, the programs in the memory management group can also be deleted. As shown in the foregoing, there are multiple ways to determine the programs to be grouped. In this case, there are also multiple ways to delete the programs in the memory management group.

[0055] As a method, if the program selected by the user is used as the program to be grouped, the user can also select the program to be deleted from the memory management group. Figure 2 As shown, group G1 may include program P1, program P2, program P3, and program P4. Group G2 may include program P5 and program P6. Group G3 may include program P7, program P8, and program P9. In this case, if the user selects program P3, it can be deleted from group G1. For another example, if the user selects program P8 and program P5, program P5 can be deleted from group G2, and program P8 can be deleted from group G3.

[0056] As a method, if the started program is detected as a program to be grouped, and the electronic device detects that programs in multiple memory management groups are closed, the closed program can be deleted from the memory management group.

[0057] As a method, if a newly installed program is used as a program to be grouped, when the electronic device detects that programs in multiple memory management groups are deleted, the deleted program can be deleted from the memory management group.

[0058] In an embodiment of the present application, the memory management group can be implemented based on the memcg mechanism in Linux.

[0059] S130: managing memory pages corresponding to the programs in each memory management group according to the memory access latency requirements of each memory management group.

[0060] The memory page corresponding to the program may include: a memory page used to process data related to the program.

[0061] The present embodiment provides a memory page management method, after obtaining the programs to be grouped, the programs can be further divided into corresponding memory management groups according to the memory access delay requirements of the programs, wherein the memory access delay requirements of the programs in the same memory management group are similar or the same, and then the memory pages corresponding to the programs in each memory management group are managed according to the memory access delay requirements of each memory management group. Thus, in the process of the electronic device managing the memory pages, the corresponding management measures can be collected respectively according to the divided memory management groups, and then different management measures can be taken for different memory management groups, which improves the flexibility and convenience of managing the memory pages.

[0062] See also Figure 3, an embodiment of the present application provides a memory page management method, the method comprising:

[0063] S210: Obtain programs to be grouped.

[0064] S220: Divide the programs into corresponding memory management groups according to the memory access latency requirements of the programs, wherein the memory access latency requirements of the programs in the same memory management group are similar or identical.

[0065] S230: Obtain a corresponding memory removal strategy according to the memory access latency requirement of each memory management group.

[0066] S240: managing memory pages corresponding to the programs in each memory management group according to the memory removal policy of each memory management group.

[0067] In the case where the memory removal strategy of each memory management group is determined, the memory pages of the programs in each memory management group are managed, which may include removing the memory pages of the programs in the memory management group according to the memory removal strategy. Among them, removing the memory pages may include removing the memory pages from the memory to other target locations, and may also include moving them from the original location in the memory to other locations in the memory. Furthermore, for the memory pages of the programs in some memory management groups, the removal operation may not be performed.

[0068] As a method, in an embodiment of the present application, the memory removal strategy according to each memory management group may include: the memory pages of the program in the corresponding memory management group are not removed; or, the memory pages of the program in the corresponding memory management group are removed according to the usage frequency; or, the memory pages of the program in the corresponding memory management group are removed according to the time when they are added to the memory.

[0069] Optionally, in the method of removing memory pages based on the frequency of use, the time when the memory page was last used can be obtained, and then whether to remove the memory page is determined based on the time when the memory page was last used. Optionally, the interval between the time when the memory page was last used and the current moment can be obtained, and if the interval is greater than a specified time, it is determined that the memory page can be removed. Optionally, the time when a plurality of memory pages were last used can be compared, and then it is determined that the memory page with the longest interval between the time and the current moment can be removed. Among them, the plurality of memory pages can be memory pages of a program in the same memory management group, and the memory removal policy corresponding to the memory management group is to remove the memory pages based on the frequency of use of the program in the corresponding memory management group.

[0070] The memory pages that can be removed may be removed according to the usage frequency of the memory pages of the programs in the corresponding memory management group, or the LRU (Least Recently Used) method may be used to determine the memory pages that can be removed.

[0071] Exemplarily, the multiple memory management groups include group G1, group G2, and group G3. Among them, the memory removal strategy corresponding to group G2 is to remove the memory pages according to the usage frequency of the memory pages of the programs in the corresponding memory management group, then the electronic device will determine the memory pages that can be removed from the memory pages corresponding to the programs in group G2 according to the usage frequency of the memory pages of the programs in the corresponding memory management group. For example, if the programs included in group G2 are program P5 and program P6, then the electronic device will determine the memory pages that need to be removed according to the usage frequency of the memory pages of program P5 and program P6.

[0072] Optionally, in the method of removing the memory page of the program in the corresponding memory management group according to the time when it is added to the memory, the FIFO (First Input First Output) method can be used to determine the memory page that can be removed. In this method, the loading time of multiple memory pages loaded into the memory can be compared, and then the memory page with the longest loading time interval from the current time is determined as the memory page that can be removed.

[0073] Exemplarily, the multiple memory management groups include group G1, group G2, and group G3. Among them, the memory removal strategy corresponding to group G3 is to remove the memory pages of the programs in the corresponding memory management group according to the time when the memory pages are added to the memory. Then the electronic device will determine the memory pages that can be removed from the memory pages corresponding to the programs in group G3 according to the time when the memory pages are added to the memory. For example, if the programs included in group G3 are program P7, program P8, and program P9, then the electronic device will determine the memory pages that need to be removed according to the time when the memory pages of programs P7, program P8, and program P9 are loaded into the memory.

[0074] Exemplarily, the multiple memory management groups obtained by division in the embodiment of the present application include a first group, a second group, and a third group. Among them, the programs in the first group may be system programs, the programs in the second group may be programs running in the foreground, and the programs in the third group may be programs running in the background. Among them, the memory removal policy corresponding to the first group may be no removal, the memory removal policy corresponding to the second group may be removal based on the usage frequency of the memory pages of the programs in the corresponding memory management group, and the memory removal policy corresponding to the third group may be removal based on the time when the memory pages of the programs in the corresponding memory management group are added to the memory.

[0075] As a method, the target location to which the memory page being moved is moved is determined according to the memory management group corresponding to the memory page being moved out. It should be noted that, after being moved out, some memory pages will be loaded into the memory again or loaded into the original location in the memory. For different target locations, the speed at which the memory pages included therein are loaded into the memory will be different. For example, some memory pages are moved out to the hard disk, while some memory pages are only compressed. The compressed memory can be loaded into the memory after being decompressed, while the memory pages moved out to the hard disk need to be loaded from the hard disk into the memory, which takes relatively more time.

[0076] Exemplarily, the multiple memory management groups obtained by the division in the embodiment of the present application may include the aforementioned first group, second group and third group. Among them, the target position corresponding to the first group may be the first position, the target position corresponding to the second group may be the second position, and the target position corresponding to the third group may be the third position, wherein the speed at which the memory page in the first position is loaded back into the memory is faster than the speed at which the memory page in the second position is loaded back into the memory, and the speed at which the memory page in the second position is loaded back into the memory is faster than the speed at which the memory page in the third position is loaded back into the memory. Optionally, the first position may be a position in the memory, the second position may be a flash memory (FLASH), and the third position may be a disk (Disk).

[0077] The present embodiment provides a memory page management method, so that in the process of managing memory pages by the electronic device, the corresponding management measures can be collected according to the divided memory management groups, so that different management measures can be taken for different memory management groups, which improves the flexibility and convenience of memory page management. In addition, in the present embodiment, different memory page removal strategies can correspond to different memory management groups, and for memory pages of different memory management groups, after removal, they can also be moved to different target locations, thereby further improving the flexibility of memory page management.

[0078] It should be noted that in an embodiment of the present application, the electronic device can execute the memory page management method provided in the embodiment of the present application based on the Linux Swap mechanism. In this case, the removal of a memory page can be understood as swapping out a memory page, and the loading of a memory page into the memory can be understood as swapping in a memory page. The target location for storing the removed memory page can be understood as a swap space. The swap space can be in a disk, in a flash memory, or in memory. Among them, the size of the Swap Space can be set by the system administrator when the system is installed or configured. For example, it can be reasonably determined based on the system's RAM size and application requirements.

[0079] See also Figure 4 , an embodiment of the present application provides a memory page management device 300, the device 300 comprising:

[0080] A program acquisition unit 310, used to acquire programs to be grouped;

[0081] A program grouping unit 320, configured to group the programs into corresponding memory management groups according to the memory access latency requirements of the programs, wherein the memory access latency requirements of the programs in the same memory management group are similar or identical;

[0082] The memory management unit 330 is used to manage the memory pages corresponding to the programs in each memory management group according to the memory access latency requirements of each memory management group.

[0083] As a method, the memory management unit 330 is specifically used to obtain the corresponding memory eviction policy according to the memory access delay requirements of each memory management group; and manage the memory pages corresponding to the programs in each memory management group according to the memory eviction policy of each memory management group.

[0084] Optionally, the memory removal strategy of each memory management group includes: not removing the memory pages of the program in the corresponding memory management group; or, removing the memory pages of the program in the corresponding memory management group based on the usage frequency; or, removing the memory pages of the program in the corresponding memory management group based on the time when they are added to the memory.

[0085] As a method, the memory management unit 330 is specifically configured to determine the target location to which the removed memory page is moved according to the memory management group corresponding to the removed memory page.

[0086] As a method, the program grouping unit 320 is specifically used to obtain the memory access delay level of the program; divide the program into memory management groups that match the memory access delay level, wherein the memory access delay levels of programs in the same memory management group are similar or the same. Optionally, the program grouping unit 320 is specifically used to determine the memory access delay level of the program according to the category and / or running status of the program.

[0087] As a method, the program acquisition unit 310 is specifically used to acquire the started program as the program to be grouped. The program acquisition unit 310 is also specifically used to delete the closed program from the memory management group if a program in the memory management group is closed.

[0088] As a method, the program acquisition unit 310 is specifically configured to acquire a newly installed program as the program to be grouped; or acquire a program selected by a user as the program to be grouped.

[0089] The memory page management device provided in this embodiment can further divide the programs into corresponding memory management groups according to the memory access delay requirements of the programs after obtaining the programs to be grouped, wherein the memory access delay requirements of the programs in the same memory management group are similar or identical, and then the memory pages corresponding to the programs in each memory management group are managed according to the memory access delay requirements of each memory management group. Thus, in the process of the electronic device managing the memory pages, the corresponding management measures can be collected respectively according to the divided memory management groups, and then different management measures can be taken for different memory management groups, thereby improving the flexibility and convenience of managing the memory pages.

[0090] It should be noted that the device embodiment in the present application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.

[0091] The following will be combined Figure 5An electronic device provided by the present application is described.

[0092] See also Figure 5 Based on the above-mentioned audio processing method and device, the embodiment of the present application also provides another electronic device 200 that can execute the above-mentioned audio processing method. The electronic device 200 includes one or more (only one is shown in the figure) processors 202, a memory 204, a network module 206, a sensor module 208 and an audio acquisition device 210 that are coupled to each other. Among them, the memory 204 stores a program that can execute the content of the above-mentioned embodiment, and the processor 202 can execute the program stored in the memory 204.

[0093] Among them, the processor 202 may include one or more processing cores. The processor 202 uses various interfaces and lines to connect various parts within the entire electronic device 200, and executes various functions and processes data of the electronic device 200 by running or executing instructions, programs, code sets or instruction sets stored in the memory 204, and calling data stored in the memory 204. Optionally, the processor 202 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 202 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 202, but may be implemented separately through a communication chip.

[0094] The memory 204 may include a random access memory (RAM) or a read-only memory (ROM). The memory 204 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 204 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.

[0095] The network module 206 is used to implement information exchange between the electronic device 200 and other devices, for example, transmission of device control instructions, operation request instructions, and status information acquisition instructions, etc. When the electronic device 200 is specifically a different device, the corresponding network module 206 may be different.

[0096] The sensor module 208 may include at least one sensor. Specifically, the sensor module 208 may include but is not limited to: a light sensor, a motion sensor, a pressure sensor, an infrared heat sensor, a distance sensor, an acceleration sensor, and other sensors.

[0097] Among them, the pressure sensor can be a sensor that detects the pressure generated by pressing on the electronic device 200. That is, the pressure sensor detects the pressure generated by the contact or pressing between the user and the electronic device, such as the pressure generated by the contact or pressing between the user's ear and the mobile terminal. Therefore, the pressure sensor can be used to determine whether contact or pressing occurs between the user and the electronic device 200, and the magnitude of the pressure.

[0098] Among them, the acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that recognize the posture of the electronic device 200 (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. In addition, the electronic device 200 can also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, etc., which will not be repeated here.

[0099] The audio acquisition device 210 is used to collect audio signals. Optionally, the audio acquisition device 210 includes a plurality of audio acquisition devices. The audio acquisition device may be a microphone. For example, in one embodiment, the audio acquisition device 210 may include two microphones, in which one of the microphones may correspond to an analog-to-digital converter, and the other microphone may correspond to an analog-to-digital converter with two different analog gains. In another embodiment, the audio acquisition device 210 may include three microphones. In this embodiment, two of the microphones (e.g., a main microphone and a secondary microphone) may each correspond to an analog-to-digital converter, and the other microphone (e.g., a camera microphone) may correspond to an analog-to-digital converter with two different analog gains.

[0100] As a way, the network module of the electronic device 200 is a radio frequency module, which is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The radio frequency module may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM) cards, memories, etc. For example, the radio frequency module can exchange information with an external device through the electromagnetic waves sent or received, and then receive audio signals sent by the external device.

[0101] Furthermore, the electronic device 200 may also include an image acquisition device for image acquisition, for example, a video, a static picture or a dynamic picture may be taken by the image acquisition device.

[0102] Please refer to Figure 6 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0103] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.

[0104] The present application provides a memory page management method, device, and electronic device. After obtaining the programs to be grouped, the programs can be further divided into corresponding memory management groups according to the memory access delay requirements of the programs, wherein the memory access delay requirements of the programs in the same memory management group are similar or identical, and then the memory pages corresponding to the programs in each memory management group are managed according to the memory access delay requirements of each memory management group. Thus, in the process of the electronic device managing the memory pages, the corresponding management measures can be collected respectively according to the divided memory management groups, so that different management measures can be taken for different memory management groups, thereby improving the flexibility and convenience of managing the memory pages.

[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A memory page management method, characterized in that: The method comprises: Get the programs to be grouped; According to the memory access latency requirements of the programs, the programs are divided into corresponding memory management groups, wherein the memory access latency requirements of the programs in the same memory management group are similar or the same; According to the memory access latency requirements of each memory management group, the memory pages corresponding to the programs in each memory management group are managed.

2. The method according to claim 1, characterized in that The managing the memory pages corresponding to the programs in each memory management group according to the memory access latency requirements of each memory management group includes: According to the memory access latency requirements of each memory management group, the corresponding memory removal strategy is obtained; According to the memory removal policy of each memory management group, the memory pages corresponding to the programs in each memory management group are managed.

3. The method according to claim 2, characterized in that The memory removal strategy of each memory management group includes: The memory pages of the programs in the corresponding memory management group are not removed; Alternatively, the memory pages of the programs in the corresponding memory management group are removed according to the usage frequency; Alternatively, the memory page of the program in the corresponding memory management group is removed according to the time when it is added to the memory.

4. The method according to claim 3, characterized in that The method further comprises: According to the memory management group corresponding to the memory page to be removed, a target location to which the memory page to be removed is moved is determined.

5. The method according to claim 1, characterized in that The dividing the program into corresponding memory management groups according to the memory access latency requirement of the program comprises: Obtaining a memory access latency level of the program; The programs are divided into memory management groups that match the memory access latency levels, wherein the memory access latency levels of programs in the same memory management group are similar or the same.

6. The method according to claim 5, characterized in that The obtaining of the memory access latency level of the program includes: A memory access latency level of the program is determined according to the type and / or running state of the program.

7. The method according to claim 1, characterized in that The procedure for obtaining the data to be grouped includes: Get the started program as the program to be grouped; The method further comprises: If a program in a memory management group is closed, the closed program will be deleted from the memory management group.

8. The method according to claim 1, characterized in that The procedure for obtaining the data to be grouped includes: Get newly installed programs as programs to be grouped; Alternatively, the program selected by the user is obtained as the program to be grouped.

9. A memory page management device, characterized in that: The device comprises: A program acquisition unit, used for acquiring programs to be grouped; A program grouping unit, configured to group the programs into corresponding memory management groups according to memory access latency requirements of the programs, wherein the memory access latency requirements of programs in the same memory management group are similar or identical; The memory management unit is used to manage the memory pages corresponding to the programs in each memory management group according to the memory access latency requirements of each memory management group.

10. An electronic device, characterized in that: The method comprises one or more processors and a memory; one or more programs are stored in the memory and are configured so that the one or more processors execute the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method according to any one of claims 1 to 8 is executed.