Memory adaptive recovery method and device, equipment and storage medium

By determining the adaptive memory recycling strategy and performing memory recycling based on the current application scenario, the problem of inflexible memory recycling in the existing technology is solved, and the performance and user experience of XR applications are improved.

CN119357075APending Publication Date: 2025-01-24WEIFANG GOERTEK ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411390699.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The prior art cannot effectively realize adaptive memory recycling, resulting in lag, delay or crash when running extended reality (XR) applications, affecting the user experience.

Method used

By determining the current application scenario of the target system, when the storage data meets the preset requirements, determine the adaptive memory recycling strategy according to the current application scenario, determine the memory recycling object, and perform memory recovery based on strategies.

Benefits of technology

The adaptive recycling of memory is realized, the memory utilization and application performance are improved, and the stuttering, application collapse or flashback have been reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357075A_ABST
    Figure CN119357075A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive memory recovery method, device and equipment and a storage medium, and relates to the technical field of memory management, and the method comprises the following steps: determining a current application scene of a target system; when the storage data of the target system meets a preset requirement, determining a self-adaptive memory recovery strategy according to the current application scene; determining a memory recovery object according to the self-adaptive memory recovery strategy; performing memory recovery according to the memory recovery object based on the self-adaptive memory recovery strategy; according to the mode, after the current application scene is recognized, whether the storage data of the target system meets the preset requirement or not is judged, if yes, the recovery strategy, namely the self-adaptive memory recovery strategy, is generated in a self-adaptive mode according to different application scenes, and after the memory recovery object is determined, memory recovery is carried out based on the self-adaptive memory recovery strategy; therefore, self-adaptive recovery of the memory can be realized, the memory utilization rate and the application performance are further improved, and the conditions of lagging, application crash or flash back are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of memory management technology, and in particular to a memory adaptive recycling method, device, equipment and storage medium. Background Art

[0002] The rapid development of Extended Reality (XR) technology has brought new challenges to device performance and memory management. XR applications usually need to process a large amount of graphics and virtual environment data, which places higher demands on the device's memory requirements. Due to the limited device memory resources, the existing memory recycling mechanism often cannot meet the special needs of XR applications, resulting in the device being stuck, delayed, or even crashing when running XR applications. In addition, there are different scenarios when the device runs XR applications, and the existing memory recycling mechanism cannot respond in a timely and effective manner, seriously affecting the user experience. Therefore, the above method cannot achieve adaptive memory recycling.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present application is to provide a memory adaptive recycling method, device, equipment and storage medium, aiming to solve the technical problem that the prior art cannot achieve adaptive recycling of memory.

[0005] To achieve the above objectives, the present application proposes a memory adaptive recycling method, the method comprising:

[0006] Determine the current application scenario of the target system;

[0007] When the storage data of the target system meets the preset requirements, determining an adaptive memory recycling strategy according to the current application scenario;

[0008] Determining a memory recycling object according to the adaptive memory recycling strategy;

[0009] Memory reclaim is performed according to the memory reclaim object based on the adaptive memory reclaim strategy.

[0010] In one embodiment, when the storage data of the target system meets the preset requirements, the step of determining the adaptive memory reclaiming strategy according to the current application scenario includes:

[0011] Determine current available memory and current fragmentation characteristic values ​​based on storage data of the target system;

[0012] When the available memory is less than or equal to a preset memory threshold, and / or the current fragmentation feature value is greater than or equal to a preset fragmentation threshold, performing feature extraction on the current application scene to obtain a current application scene feature;

[0013] An adaptive memory recycling strategy is determined according to the characteristics of the current application scenario.

[0014] In one embodiment, the adaptive memory recycling strategy includes a fast memory recycling strategy and a slow memory recycling strategy; the step of determining the adaptive memory recycling strategy according to the characteristics of the current application scenario includes:

[0015] When the current application scenario feature is a multiple memory consumption scenario feature, determining that the adaptive memory recycling strategy is a fast memory recycling strategy;

[0016] When the current application scenario feature is a low memory consumption scenario feature, the adaptive memory recovery strategy is determined to be a slow memory recovery strategy.

[0017] In one embodiment, the step of determining a memory reclamation object according to the adaptive memory reclamation strategy includes:

[0018] When the adaptive memory recycling strategy is a fast memory recycling strategy, historical recycled memory space release data, historical running application impact data, historical system stability impact data, and historical user experience impact data are obtained;

[0019] Determine a memory area related to the file system according to the historical memory space recovery release data and the historical running application impact data;

[0020] Obtaining a file memory page recovery object by scanning the memory area related to the file system;

[0021] Determine a non-critical process recycling object according to the historical system stability impact data and the historical user experience impact data;

[0022] A memory recycling object is obtained according to the file memory page recycling object and the non-critical process recycling object.

[0023] In one embodiment, the step of determining a memory reclamation object according to the adaptive memory reclamation strategy includes:

[0024] When the adaptive memory recycling strategy is a slow memory recycling strategy, determining a memory area that is not related to a file system or device mapping;

[0025] Obtaining an anonymous memory page recovery object by scanning the memory area unrelated to the file system or device mapping;

[0026] Determine cache-level process recycling objects based on system cache processes and inactive service processes;

[0027] A memory reclaim object is obtained according to the anonymous memory page reclaim object and the cache level process reclaim object.

[0028] In one embodiment, the step of performing memory reclamation according to the memory reclamation object based on the adaptive memory reclamation strategy includes:

[0029] Reclaiming memory pages according to the memory reclamation object based on the adaptive memory reclamation strategy;

[0030] Based on the adaptive memory recycling strategy, process termination or process recycling is performed according to the memory recycling object.

[0031] In one embodiment, after the step of performing memory reclamation according to the memory reclamation object based on the adaptive memory reclamation strategy, the method further includes:

[0032] Determine the application scenario of the target system at the next moment;

[0033] Extracting features of the application scenario of the target system at the next moment to obtain features of the target application scenario;

[0034] When the target application scenario feature is not a high memory consumption scenario feature and the target application scenario feature is not a low memory consumption scenario feature, stopping memory recycling;

[0035] When the target application scenario characteristic is a high memory consumption scenario characteristic or the target application scenario characteristic is a low memory consumption scenario characteristic, the step of determining an adaptive memory recovery strategy is continued.

[0036] In addition, to achieve the above purpose, the present application also proposes a memory adaptive recycling device, the memory adaptive recycling device comprising:

[0037] A determination module, used to determine the current application scenario of the target system;

[0038] A judgment module, used to determine an adaptive memory recycling strategy according to the current application scenario when the storage data of the target system meets the preset requirements;

[0039] The determination module is further used to determine the memory recycling object according to the adaptive memory recycling strategy;

[0040] A memory recycling module is used to perform memory recycling according to the memory recycling object based on the adaptive memory recycling strategy.

[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes a memory adaptive recycling device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the memory adaptive recycling method as described above.

[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the memory adaptive recycling method described above are implemented.

[0043] One or more technical solutions proposed in the present application have at least the following technical effects: by determining the current application scenario of the target system; when the storage data of the target system meets the preset requirements, determining an adaptive memory recovery strategy according to the current application scenario; determining a memory recovery object according to the adaptive memory recovery strategy; performing memory recovery according to the memory recovery object based on the adaptive memory recovery strategy; through the above method, after identifying the current application scenario, judging whether the storage data of the target system meets the preset requirements, if so, adaptively generating a recovery strategy according to different application scenarios, i.e., an adaptive memory recovery strategy, and after determining the memory recovery object, performing memory recovery based on the adaptive memory recovery strategy, thereby achieving adaptive memory recovery, thereby improving memory utilization and application performance, and reducing the occurrence of freezes, application crashes or flash backs. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, are used to explain the principles of the present application.

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0046] Figure 1 A flowchart of the first embodiment of the memory adaptive recycling method of the present application is provided;

[0047] Figure 2 A flowchart of the second embodiment of the memory adaptive recycling method of the present application is provided;

[0048] Figure 3 A brief flowchart of the memory adaptive recycling method provided in Example 2 of the present application;

[0049] Figure 4This is a schematic diagram of the module structure of the memory adaptive recycling device according to an embodiment of the present application;

[0050] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the memory adaptive recycling method in the embodiment of the present application.

[0051] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a memory recycling device, etc. The following takes the memory recycling device as an example to illustrate this embodiment and the following embodiments.

[0053] Based on this, the embodiment of the present application provides a memory adaptive recycling method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the memory adaptive recycling method of the present application.

[0054] In this embodiment, the memory adaptive recycling method includes steps S10 to S40:

[0055] Step S10, determining the current application scenario of the target system.

[0056] It should be noted that the target system can be an Android system that can run XR applications normally. The current application scenarios include high memory consumption scenarios and low memory consumption scenarios. The high memory consumption scenario can be a scenario where the XR application is started, and the low memory consumption scenario includes but is not limited to scenarios such as device screen turning off, completely exiting the XR application and returning to the desktop, etc. Among them, the desktop is also an application in the Android system, and its life cycle is managed by AMS.

[0057] It can be understood that the execution location for identifying the current application scenario can be the AMS of the system process. In order to facilitate maintenance and management permissions, the above-mentioned function of identifying application scenarios is added to the AMS of the system process. Among them, the identification of high memory consumption scenarios is before the application managed by AMS is started and before a new application process is created. The identification of low memory consumption scenarios is integrated into the XR system, and the execution location is also in the AMS.

[0058] Step S20, when the storage data of the target system meets the preset requirements, determining an adaptive memory recycling strategy according to the current application scenario.

[0059] It should be understood that storage data refers to the data stored in the target system at the current moment. The storage data can characterize the available memory and degree of fragmentation of the target system. The adaptive memory recovery strategy refers to the memory recovery strategy that is adapted to the current application scenario. Different application scenarios have different corresponding memory recovery strategies, that is, timely and effective responses can be made to improve memory utilization and application performance.

[0060] Further, step S20 includes: determining the current available memory and the current fragmentation characteristic value based on the storage data of the target system; when the available memory is less than or equal to the preset memory threshold, and / or the current fragmentation characteristic value is greater than or equal to the preset fragmentation threshold, performing feature extraction on the current application scenario to obtain the current application scenario feature; determining an adaptive memory recovery strategy based on the current application scenario feature.

[0061] It can be understood that the current available memory refers to the memory that the target system can use at the current moment, and the current fragmentation characteristic value represents the degree of fragmentation at the current moment. The larger the current fragmentation characteristic value, the more serious the fragmentation. After obtaining the current available memory and the current fragmentation characteristic value, it is necessary to determine whether the available memory is less than or equal to the preset memory threshold, and whether the current fragmentation characteristic value is greater than or equal to the preset fragmentation threshold. If at least one of the above conditions is met, the adaptive memory recovery strategy is determined according to the current application scenario characteristics. For example, when the current application scenario characteristic is that the XR apk contains files related to the XR application characteristics, it is determined that the current application scenario characteristic is a multi-memory consumption scenario characteristic.

[0062] Furthermore, the adaptive memory recovery strategy includes a fast memory recovery strategy and a slow memory recovery strategy; the step of determining the adaptive memory recovery strategy according to the current application scenario characteristics includes: when the current application scenario characteristics are high memory consumption scenario characteristics, determining the adaptive memory recovery strategy to be a fast memory recovery strategy; when the current application scenario characteristics are low memory consumption scenario characteristics, determining the adaptive memory recovery strategy to be a slow memory recovery strategy.

[0063] It should be understood that since the adaptive memory recovery strategies corresponding to the characteristics of different application scenarios are different, after obtaining the characteristics of the current application scenario, it is necessary to judge the characteristics of the scenario, that is, to judge whether the characteristics of the current application scenario are characteristics of multiple memory consumption scenarios. If so, the adaptive memory recovery strategy is determined to be a fast memory recovery strategy, otherwise, the adaptive memory recovery strategy is determined to be a slow memory recovery strategy. Among them, the fast memory recovery strategy has the characteristics of quickly releasing available memory and improving the application response speed, and the slow memory recovery strategy has the characteristics of good recovery effect.

[0064] Step S30, determining a memory reclamation object according to the adaptive memory reclamation strategy.

[0065] It can be understood that a memory reclaim object refers to an object that is reclaimed using an adaptive memory reclaim strategy. The types of memory reclaim objects include but are not limited to page reclaim object types and process reclaim object types, for example, file memory page reclaim objects, non-critical process reclaim objects, anonymous memory page reclaim objects, and cache-level process reclaim objects.

[0066] Further, step S30 includes: when the adaptive memory recovery strategy is a fast memory recovery strategy, obtaining historical recovered memory space release data, historical running application impact data, historical system stability impact data and historical user experience impact data; determining a memory area related to the file system based on the historical recovered memory space release data and the historical running application impact data; obtaining a file memory page recovery object by scanning the memory area related to the file system; determining a non-critical process recovery object based on the historical system stability impact data and the historical user experience impact data; and obtaining a memory recovery object based on the file memory page recovery object and the non-critical process recovery object.

[0067] It should be understood that when the adaptive memory recovery strategy is determined to be the fast memory recovery strategy, the file memory pages contain loaded file data based on the historical memory space recovery release data and the historical running application impact data. Recycling them can quickly release a large amount of memory space, and since the file data can be reloaded from the disk, it has less impact on other running applications. At this time, the memory area related to the file system will be scanned first to obtain the file memory page recovery object.

[0068] On the other hand, in addition to file memory page recycling objects, non-critical process recycling objects will also be considered. Non-critical processes refer to background applications or services that have little impact on system stability and user experience. Therefore, it is necessary to determine non-critical process recycling objects based on historical system stability impact data and historical user experience impact data.

[0069] Further, step S30 includes: when the adaptive memory recovery strategy is a slow memory recovery strategy, determining a memory area that is not related to the file system or device mapping; obtaining an anonymous memory page recovery object by scanning the memory area that is not related to the file system or device mapping; determining a cache level process recovery object based on the system cache process and the inactive service process; and obtaining a memory recovery object based on the anonymous memory page recovery object and the cache level process recovery object.

[0070] It is understandable that when the adaptive memory recycling strategy is determined to be the slow memory recycling strategy, based on the analysis of historical user experience impact data, anonymous memory pages contain temporary data or caches, and recycling them has less impact on users and helps to free up memory space. Therefore, memory areas that are not related to the file system or device mapping are scanned first to obtain anonymous memory page recycling objects.

[0071] On the other hand, since cache-level processes include system caches and other temporarily inactive services, recycling them can further free up memory, but has less impact on system performance because these resources can be regenerated or loaded when needed. At this time, the cache-level process recycling objects can be determined based on the system cache processes and inactive service processes.

[0072] Step S40: performing memory reclamation according to the memory reclamation object based on the adaptive memory reclamation strategy.

[0073] Furthermore, step S40 includes: reclaiming memory pages according to the memory reclaim object based on the adaptive memory reclaim strategy; and terminating or reclaiming a process according to the memory reclaim object based on the adaptive memory reclaim strategy.

[0074] It can be understood that the memory recycling of this embodiment includes two parts, the first is page recycling, and the second is process termination or recycling. For example, by calling the underlying execution memory fast recycling strategy of the system through jni, the file memory page recycling object is recycled and the non-critical process recycling object is terminated, so as to quickly release a large amount of memory space and accelerate the startup and operation of XR applications. On the other hand, by executing the slow memory recycling strategy to recycle anonymous memory page recycling objects and cache-level process recycling objects, the purpose of releasing memory space is achieved on the basis of low user impact and low system performance impact.

[0075] It should be noted that this embodiment will determine whether the storage data of the target system meets the preset requirements before starting the XR application. If so, active memory recycling will be enabled, thereby reducing the occurrence of lags and the application will not crash or flash back.

[0076] This embodiment determines the current application scenario of the target system; when the storage data of the target system meets the preset requirements, determines an adaptive memory recovery strategy according to the current application scenario; determines a memory recovery object according to the adaptive memory recovery strategy; and performs memory recovery according to the memory recovery object based on the adaptive memory recovery strategy; in the above manner, after identifying the current application scenario, determines whether the storage data of the target system meets the preset requirements, and if so, adaptively generates a recovery strategy according to different application scenarios, i.e., an adaptive memory recovery strategy, and after determining the memory recovery object, performs memory recovery based on the adaptive memory recovery strategy, thereby achieving adaptive memory recovery, thereby improving memory utilization and application performance, and reducing the occurrence of freezes, application crashes, or flash backs.

[0077] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , after step S40, further comprising steps S501 to S504:

[0078] Step S501, determining the application scenario of the target system at the next moment.

[0079] It should be noted that the application scenario at the next moment refers to the application scenario after memory is reclaimed using the adaptive memory reclaim strategy. The application scenario at the next moment can also be identified by using the identification function in the AMS added to the system process.

[0080] Step S502: extracting features of the application scenario of the target system at the next moment to obtain target application scenario features.

[0081] It can be understood that the target application scenario feature refers to a feature for identifying the application scenario at the next moment, and the target application scenario feature can be obtained by extracting the application scenario of the target system at the next moment using a feature extraction tool.

[0082] Step S503, when the target application scenario feature is not a high memory consumption scenario feature and the target application scenario feature is not a low memory consumption scenario feature, memory recycling is stopped.

[0083] It should be understood that after obtaining the target application scenario characteristics, it is necessary to determine whether the target application scenario characteristics are high memory consumption scenario characteristics and whether the target application scenario characteristics are low memory consumption scenario characteristics. If neither is the case, it indicates that there is sufficient memory for the XR application to use, and memory recovery is not required, that is, memory recovery is stopped.

[0084] Step S504, when the target application scenario characteristic is a high memory consumption scenario characteristic or the target application scenario characteristic is a low memory consumption scenario characteristic, continue to execute the step of determining an adaptive memory recovery strategy.

[0085] It is understandable that, on the other hand, if any one of the conditions that the target application scenario characteristics are high memory consumption scenario characteristics or the target application scenario characteristics are low memory consumption scenario characteristics is met, it indicates that memory recovery is still needed. At this time, the process will return to the step of performing active memory recovery, that is, determining an adaptive memory recovery strategy, determining a memory recovery object according to the adaptive memory recovery strategy, and performing memory recovery according to the memory recovery object based on the adaptive memory recovery strategy, until the new application scenario characteristics are not high memory consumption scenario characteristics and the new application scenario characteristics are not low memory consumption scenario characteristics.

[0086] This embodiment determines the application scenario of the target system at the next moment; extracts features of the application scenario of the target system at the next moment to obtain target application scenario features; stops memory recovery when the target application scenario features are not high memory consumption scenario features and the target application scenario features are not low memory consumption scenario features; continues to execute the step of determining an adaptive memory recovery strategy when the target application scenario features are high memory consumption scenario features or the target application scenario features are low memory consumption scenario features; in the above manner, after feature extraction of the target application scenario features, determines whether the conditions that the target application scenario features are high memory consumption scenario features or the target application scenario features are low memory consumption scenario features are met, if not, stops memory recovery, otherwise, continues memory recovery, thereby ensuring that sufficient memory is provided for XR applications to use and ensuring the normal operation of XR applications.

[0087] For example, to help understand the implementation process of the memory adaptive recycling method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 3 , Figure 3 A brief flowchart of a memory adaptive recycling method is provided, specifically:

[0088] First, determine the current application scenario of the target system. The current application scenario is explained by taking the scenarios such as XR application startup, device screen off, and complete exit of XR application to return to the desktop as examples. XR application startup can also be called scenario 1, and device screen off and complete exit of XR application to return to the desktop are called scenarios 2 and 3 respectively. Then, determine whether the storage data of the target system meets the preset requirements. If so, actively reclaim memory. Specifically, when the current application scenario feature is the feature of scenario 1, determine the adaptive memory recovery strategy as the fast memory recovery strategy. At this time, call the underlying execution memory fast recovery strategy of the system through jni to recycle the file memory page recovery object and terminate the non-critical process recovery object. When the current application scenario feature is the feature of scenario 2 or scenario 3, determine the adaptive memory recovery strategy as the slow memory recovery strategy. At this time, execute the slow memory recovery strategy to recycle the anonymous memory page recovery object and the cache level process recovery object. Then continue to judge whether to leave scenarios 1, 2 and 3, that is, judge whether the target application scenario feature is the feature of the high memory consumption scenario and the target application scenario feature is the feature of the low memory consumption scenario. If not, stop memory recovery, otherwise, continue memory recovery.

[0089] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the memory adaptive recycling method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0090] This application also provides a memory adaptive recovery device, please refer to Figure 4 , the memory adaptive recycling device comprises:

[0091] The determination module 10 is used to determine the current application scenario of the target system.

[0092] The judgment module 20 is used to determine an adaptive memory recycling strategy according to the current application scenario when the storage data of the target system meets the preset requirements.

[0093] The determination module 10 is further configured to determine a memory recycling object according to the adaptive memory recycling strategy.

[0094] The memory recycling module 30 is used to perform memory recycling according to the memory recycling object based on the adaptive memory recycling strategy.

[0095] This embodiment determines the current application scenario of the target system; when the storage data of the target system meets the preset requirements, determines an adaptive memory recovery strategy according to the current application scenario; determines a memory recovery object according to the adaptive memory recovery strategy; and performs memory recovery according to the memory recovery object based on the adaptive memory recovery strategy; in the above manner, after identifying the current application scenario, determines whether the storage data of the target system meets the preset requirements, and if so, adaptively generates a recovery strategy according to different application scenarios, i.e., an adaptive memory recovery strategy, and after determining the memory recovery object, performs memory recovery based on the adaptive memory recovery strategy, thereby achieving adaptive memory recovery, thereby improving memory utilization and application performance, and reducing the occurrence of freezes, application crashes, or flash backs.

[0096] The memory adaptive recycling device provided by the present application adopts the memory adaptive recycling method in the above embodiment, which can solve the technical problem that the prior art cannot realize the adaptive recycling of memory. Compared with the prior art, the beneficial effects of the memory adaptive recycling device provided by the present application are the same as the beneficial effects of the memory adaptive recycling method provided by the above embodiment, and the other technical features in the memory adaptive recycling device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0097] In one embodiment, the determination module 10 is also used to obtain historical recovered memory space release data, historical running application impact data, historical system stability impact data and historical user experience impact data when the adaptive memory recovery strategy is a fast memory recovery strategy; determine the memory area related to the file system based on the historical recovered memory space release data and the historical running application impact data; obtain the file memory page recovery object by scanning the memory area related to the file system; determine the non-critical process recovery object based on the historical system stability impact data and the historical user experience impact data; and obtain the memory recovery object based on the file memory page recovery object and the non-critical process recovery object.

[0098] In one embodiment, the determination module 10 is also used to determine a memory area that is not related to the file system or device mapping when the adaptive memory recovery strategy is a slow memory recovery strategy; obtain an anonymous memory page recovery object by scanning the memory area that is not related to the file system or device mapping; determine a cache level process recovery object based on the system cache process and the inactive service process; and obtain a memory recovery object based on the anonymous memory page recovery object and the cache level process recovery object.

[0099] In one embodiment, the judgment module 20 is also used to determine the current available memory and the current fragmentation characteristic value based on the storage data of the target system; when the available memory is less than or equal to the preset memory threshold, and / or the current fragmentation characteristic value is greater than or equal to the preset fragmentation threshold, perform feature extraction on the current application scenario to obtain the current application scenario feature; determine the adaptive memory recovery strategy based on the current application scenario feature.

[0100] In one embodiment, the adaptive memory recovery strategy includes a fast memory recovery strategy and a slow memory recovery strategy; the judgment module 20 is also used to determine that the adaptive memory recovery strategy is a fast memory recovery strategy when the current application scenario characteristics are high memory consumption scenario characteristics; when the current application scenario characteristics are low memory consumption scenario characteristics, determine that the adaptive memory recovery strategy is a slow memory recovery strategy.

[0101] In one embodiment, the memory recycling module 30 is further used to recycle memory pages according to the memory recycling object based on the adaptive memory recycling strategy; and terminate or recycle processes according to the memory recycling object based on the adaptive memory recycling strategy.

[0102] In one embodiment, the memory recovery module 30 is also used to determine the application scenario of the target system at the next moment; perform feature extraction on the application scenario of the target system at the next moment to obtain target application scenario features; stop memory recovery when the target application scenario features are not high memory consumption scenario features and the target application scenario features are not low memory consumption scenario features; continue to execute the step of determining an adaptive memory recovery strategy when the target application scenario features are high memory consumption scenario features or the target application scenario features are low memory consumption scenario features.

[0103] The present application provides a memory adaptive recycling device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the memory adaptive recycling method in the above-mentioned embodiment one.

[0104] Reference below Figure 5, which shows a schematic diagram of the structure of a memory adaptive recycling device suitable for implementing the embodiment of the present application. The memory adaptive recycling device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The memory adaptive recycling device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0105] like Figure 5 As shown, the memory adaptive recycling device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the memory adaptive recycling device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the memory adaptive recycling device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a memory adaptive recycling device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0106] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. The computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0107] The memory adaptive recycling device provided by the present application adopts the memory adaptive recycling method in the above embodiment, which can solve the technical problem that the prior art cannot realize the adaptive recycling of memory. Compared with the prior art, the beneficial effects of the memory adaptive recycling device provided by the present application are the same as the beneficial effects of the memory adaptive recycling method provided by the above embodiment, and the other technical features in the memory adaptive recycling device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0108] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0110] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the memory adaptive recycling method in the above-mentioned embodiment.

[0111] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM: Erasable Programable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0112] The computer-readable storage medium may be included in the memory adaptive recycling device; or may exist independently without being assembled into the memory adaptive recycling device.

[0113] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system and method according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0115] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0116] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned memory adaptive recycling method, and can solve the technical problem that the prior art cannot realize the adaptive recycling of memory. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the memory adaptive recycling method provided by the above-mentioned embodiment, and will not be repeated here.

[0117] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A memory adaptive recycling method, characterized in that: The method comprises: Determine the current application scenario of the target system; When the storage data of the target system meets the preset requirements, determining an adaptive memory recycling strategy according to the current application scenario; Determining a memory recycling object according to the adaptive memory recycling strategy; Memory reclaim is performed according to the memory reclaim object based on the adaptive memory reclaim strategy.

2. The method according to claim 1, characterized in that The step of determining an adaptive memory reclaiming strategy according to the current application scenario when the storage data of the target system meets the preset requirements includes: Determine current available memory and current fragmentation characteristic values ​​based on storage data of the target system; When the available memory is less than or equal to a preset memory threshold, and / or the current fragmentation feature value is greater than or equal to a preset fragmentation threshold, performing feature extraction on the current application scene to obtain a current application scene feature; An adaptive memory recycling strategy is determined according to the characteristics of the current application scenario.

3. The method according to claim 2, characterized in that The adaptive memory recycling strategy includes a fast memory recycling strategy and a slow memory recycling strategy; the step of determining the adaptive memory recycling strategy according to the characteristics of the current application scenario includes: When the current application scenario feature is a multiple memory consumption scenario feature, determining that the adaptive memory recycling strategy is a fast memory recycling strategy; When the current application scenario feature is a low memory consumption scenario feature, the adaptive memory recovery strategy is determined to be a slow memory recovery strategy.

4. The method according to claim 1, characterized in that The step of determining a memory recycling object according to the adaptive memory recycling strategy comprises: When the adaptive memory recycling strategy is a fast memory recycling strategy, historical recycled memory space release data, historical running application impact data, historical system stability impact data, and historical user experience impact data are obtained; Determine a memory area related to the file system according to the historical memory space recovery release data and the historical running application impact data; Obtaining a file memory page recovery object by scanning the memory area related to the file system; Determine a non-critical process recycling object according to the historical system stability impact data and the historical user experience impact data; A memory recycling object is obtained according to the file memory page recycling object and the non-critical process recycling object.

5. The method according to claim 1, characterized in that The step of determining a memory recycling object according to the adaptive memory recycling strategy comprises: When the adaptive memory recycling strategy is a slow memory recycling strategy, determining a memory area that is not related to a file system or device mapping; Obtaining an anonymous memory page recovery object by scanning the memory area unrelated to the file system or device mapping; Determine cache-level process recycling objects based on system cache processes and inactive service processes; A memory reclaim object is obtained according to the anonymous memory page reclaim object and the cache level process reclaim object.

6. The method according to claim 1, characterized in that The step of performing memory reclamation according to the memory reclamation object based on the adaptive memory reclamation strategy includes: Reclaiming memory pages according to the memory reclamation object based on the adaptive memory reclamation strategy; Based on the adaptive memory recycling strategy, process termination or process recycling is performed according to the memory recycling object.

7. The method according to any one of claims 1 to 6, characterized in that After the step of performing memory reclamation according to the memory reclamation object based on the adaptive memory reclamation strategy, the method further includes: Determine the application scenario of the target system at the next moment; Extracting features of the application scenario of the target system at the next moment to obtain features of the target application scenario; When the target application scenario feature is not a high memory consumption scenario feature and the target application scenario feature is not a low memory consumption scenario feature, stopping memory recycling; When the target application scenario characteristic is a high memory consumption scenario characteristic or the target application scenario characteristic is a low memory consumption scenario characteristic, the step of determining an adaptive memory recovery strategy is continued.

8. A memory adaptive recycling device, characterized in that: The device comprises: A determination module, used to determine the current application scenario of the target system; A judgment module, used to determine an adaptive memory recycling strategy according to the current application scenario when the storage data of the target system meets the preset requirements; The determination module is further used to determine the memory recycling object according to the adaptive memory recycling strategy; A memory recycling module is used to perform memory recycling according to the memory recycling object based on the adaptive memory recycling strategy.

9. A memory adaptive recycling device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the memory adaptive reclamation method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the memory adaptive recycling method according to any one of claims 1 to 7 are implemented.