A memory optimization method and device for a mobile terminal, a processor and a mobile terminal
By acquiring application characteristics and using predictive models to optimize mobile terminal memory, the problem of overheating and crashes caused by excessive memory usage by applications has been solved, ensuring the normal operation of important applications and improving user experience.
Patent Information
- Application Number
- CN202111275791.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2041-10-29
AI Technical Summary
Unstable application software quality in mobile terminals can lead to excessive memory usage, causing problems such as overheating, restarts, or crashes, which are especially difficult for elderly users to handle.
By acquiring application characteristics, determining their priorities, and using predictive models to forecast future memory usage increases, a decision is made based on the priorities and memory usage increases to determine whether to stop the application from running, thereby optimizing memory usage.
It effectively avoids overheating and crashing issues on mobile devices, while preserving the running of important applications based on user habits, thus improving the user experience.
Smart Images

Figure CN113986548B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communications, and more particularly to a method and apparatus for optimizing mobile terminal memory, a processor, and a mobile terminal. Background Technology
[0002] Currently, due to the instability of the quality of various applications on mobile devices, there are still occasional instances where a certain application consumes a large amount of memory, causing the mobile device to overheat, or even restart or crash. This is especially problematic for elderly users who are unsure how to handle such situations. Summary of the Invention
[0003] In view of this, the present invention discloses a mobile terminal memory optimization method and apparatus, processor and mobile terminal, which can at least solve the problem of the instability of the quality of various application software in the mobile terminal, which still occasionally causes the mobile terminal to overheat, or even restart and crash due to a large amount of memory occupied by a certain application.
[0004] To achieve the above objectives, the technical solution adopted by this invention is as follows:
[0005] The first aspect of this invention discloses a mobile terminal memory optimization method, characterized in that it includes: acquiring the application characteristics of all applications running in the mobile terminal;
[0006] The priority of running each application is determined based on its application characteristics;
[0007] The application features are input into a trained prediction model to predict memory value-added data for future time periods.
[0008] The decision to stop the application's execution is determined based on the memory increment data and the application's running priority.
[0009] Further optionally, the application characteristics include one or more combinations of: category, average foreground runtime, average background runtime, average usage frequency, the ratio of total memory used during foreground runtime, the ratio of total memory used during background runtime, the mobile terminal temperature change value within the foreground runtime t, and the mobile terminal temperature change value within the background runtime t; determining the running priority of each application based on its application characteristics includes:
[0010] P = A*X₁ + B*X₂ + C*X₃
[0011] Wherein, P is the priority of the application, A is the foreground runtime of the application, X1 is the weight of the foreground runtime of the application, B is the average usage frequency of the application, X2 is the weight of the average usage frequency of the application, C is the average background runtime, and X3 is the weight of the average background runtime.
[0012] Further, optionally, the training process of the prediction model includes:
[0013] Obtain sample data of the application, which is divided into validation set data and training set data;
[0014] The base model is read from the server, the training set data is collected and the base model is trained, the data in the validation set is input into the trained base model, and the validation set data prediction results are obtained; new training samples are generated based on the validation set data prediction results, and a preset Gaussian process regression model is trained based on the training samples to obtain a trained meta-model.
[0015] The prediction model is constructed based on the trained base model and the trained meta-model.
[0016] Further optionally, determining whether to stop the application based on the memory increment data and the application's running priority includes:
[0017] First, keep running a number of applications with high to low priority, terminate the processes of other running applications, and determine whether the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to a preset value. If not, end the memory optimization.
[0018] Further optionally, if the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to the preset value, then the prediction model is judged based on the memory increment data of the several running applications in the future period of time, and the prediction model has different first thresholds for different applications in different running times.
[0019] If any of the running applications has memory increment data greater than or equal to the first threshold of the prediction model, then the process of that application is terminated, and it is determined whether the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to a preset value. If not, then memory optimization is terminated; if so, then memory is optimized according to the priority.
[0020] If none of the running applications has memory increment data greater than or equal to the first threshold of the prediction model, then the comparison between the memory increment data and the first threshold is skipped, and memory is optimized according to the priority.
[0021] Further optionally, the optimization of memory according to the priority includes:
[0022] The running applications are terminated from low to high priority. After each application is terminated, it is determined whether the ratio of the memory used by the mobile terminal to the total memory is greater than or equal to the preset value. If not, the memory optimization ends.
[0023] Further optionally, if only the highest priority application is running, and the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to the preset value, it is determined whether the highest priority application is running in the foreground. If so, the user is prompted to end the application; otherwise, the application is ended directly.
[0024] A second aspect of the present invention discloses a mobile terminal memory optimization device, comprising:
[0025] The application feature acquisition module is suitable for acquiring the application features of all applications running on a mobile terminal.
[0026] The priority determination module is suitable for determining the running priority of each application based on the application characteristics of each application.
[0027] The value-added prediction module is suitable for inputting the application features into a trained prediction model to predict memory value-added data for future time periods.
[0028] The memory optimization module is suitable for determining whether to stop the application from running based on the memory increment data and the application's running priority.
[0029] A third aspect of the present invention discloses a processor for running a mobile terminal application, wherein the mobile terminal application executes the mobile terminal memory optimization method described in the first aspect during runtime.
[0030] The fourth aspect of the present invention discloses a mobile terminal, including the processor described in the third aspect and / or the mobile terminal memory optimization device described in the second aspect.
[0031] Beneficial effects: Based on memory usage, this invention comprehensively optimizes the memory of mobile terminal applications according to priority and memory increment data. This not only avoids problems such as overheating and crashing of mobile terminals, but also prioritizes the use of user applications based on the usage habits of mobile terminal users. Attached Figure Description
[0032] The above and other objects, features, and advantages of the present invention will become more apparent from the detailed description of exemplary embodiments with reference to the accompanying drawings. The drawings described below are merely some embodiments disclosed in the present invention; those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0033] Figure 1 A simplified flowchart of an embodiment of the present invention is shown;
[0034] Figure 2 A control flowchart of an embodiment of the present invention is shown. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0036] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. “Multiple” generally includes at least two, but does not exclude the inclusion of at least one.
[0037] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0038] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the product or system that includes said element.
[0039] Currently, mobile terminal applications often experience issues during operation. On one hand, software quality can lead to excessive heat generation, even causing restarts or crashes. On the other hand, too many applications running in the background can cause insufficient memory, resulting in overheating, lag, restarts, or crashes. This invention optimizes mobile terminal memory using a combination of priority and memory increment data. This prevents applications from consuming excessive memory, thus avoiding lag and overheating. Simultaneously, while ensuring that application memory usage does not exceed preset limits, it maximizes user experience based on user habits.
[0040] To further illustrate the technical solution of this invention, the following is combined with... Figure 1 and Figure 2 The following specific implementation examples are provided.
[0041] Example 1
[0042] This embodiment provides a mobile terminal memory optimization method, including: acquiring application characteristics of all running applications in the mobile terminal; determining the running priority of each application based on its application characteristics; inputting the application characteristics into a trained prediction model to predict memory increment data for a future time period; and determining whether to stop the running of the application based on the memory increment data and the running priority of the application.
[0043] In one real-time mode of this embodiment, the application characteristics include one or more combinations of: category, average foreground runtime, average background runtime, average usage frequency, the ratio of total memory occupied by foreground operation, the ratio of total memory occupied by background operation, the mobile terminal temperature change value within the foreground runtime t, and the mobile terminal temperature change value within the background runtime t; determining the running priority of each application based on its application characteristics includes:
[0044] P = A*X₁ + B*X₂ + C*X₃
[0045] Where P is the priority of the application, A is the foreground runtime of the application, X1 is the weight of the foreground runtime of the application, B is the average usage frequency of the application, X2 is the weight of the average usage frequency of the application, C is the average background runtime, X3 is the weight of the average background runtime, and X1 + X2 + X3 = 1.
[0046] Optionally, the determination of the running priority of each application based on its application characteristics can also be achieved using the following formula:
[0047] P = A*Y1 + T*Y2 + R*Y3
[0048] Wherein, P is the priority of the application, A is the foreground runtime of the application, Y1 is the weight of the foreground runtime of the application, T is the temperature change of the mobile terminal within the foreground runtime t, Y2 is the weight of the temperature change of the mobile terminal within the foreground runtime t, R is the proportion of total memory occupied by background operation, Y3 is the weight of the proportion of total memory occupied by background operation, and Y1 + Y2 + Y3 = 1.
[0049] Specifically, the training process of the prediction model includes: acquiring sample data from the application, which is divided into validation set data and training set data; reading the base model through the server, collecting the training set data to train the base model, inputting the data from the validation set into the trained base model to obtain the prediction results of the validation set data; generating new training samples based on the prediction results of the validation set data, and training a preset Gaussian process regression model based on the training samples to obtain a trained meta-model; and constructing the prediction model based on the trained base model and the trained meta-model. In one embodiment, a pre-stored base model based on a BP neural network and a random forest can be read through the server, with the training set accounting for 80% of the total sample data and the validation set accounting for 20%.
[0050] In one implementation, the application features can be used as sample data.
[0051] The sample data can be the application's historical records, which include any one or more combinations of the following: average foreground runtime, average background runtime, average usage frequency, the ratio of total memory used during foreground runtime, the ratio of total memory used during background runtime, the mobile terminal temperature change within foreground runtime t, and the mobile terminal temperature change within background runtime t. The historical records of the mobile terminal application can be obtained through a server, with the application's historical records collected at fixed time intervals to obtain a sample set containing both a training set and a validation set.
[0052] Furthermore, determining whether to stop the application's execution based on the memory increment data and the application's running priority includes:
[0053] First, keep running a number of applications ranked from high to low priority, terminate the processes of other running applications, and determine whether the ratio of currently used memory to total memory on the mobile terminal is greater than or equal to a preset value. If not, end memory optimization. First, perform a first-level optimization of memory according to the priority of mobile terminal applications. After optimization, assess the mobile terminal's memory usage. If the ratio of currently used memory to total memory is greater than or equal to a preset value, continue optimization. The number of applications kept ranked from high to low priority can be 1-3.
[0054] Optionally, users can set the preset value themselves. For example, the preset value of the ratio of mobile terminal memory to total memory can be set to 80%, that is, if the mobile terminal memory usage exceeds 80%, memory optimization will be performed.
[0055] Furthermore, if the ratio of currently used memory to total memory on the mobile terminal is greater than or equal to the preset value, then a judgment is made based on the memory increment data of the running applications over a future period. The prediction model has different first thresholds for different applications at different running times. If any of the running applications has memory increment data greater than or equal to the first threshold of the prediction model, then the process of that application is terminated, and it is determined whether the ratio of currently used memory to total memory on the mobile terminal is greater than or equal to the preset value. If not, memory optimization ends; if so, memory is optimized according to priority. If none of the running applications has memory increment data greater than or equal to the first threshold of the prediction model, then the comparison between memory increment data and the first threshold is skipped, and memory is optimized according to priority. Optimizing memory for higher-priority applications using memory increment data addresses the problem of excessive memory usage during abnormal application operation; this is the second level of memory optimization.
[0056] The memory optimization based on priority includes: ending running applications from lowest to highest priority. After each application ends, the ratio of currently used memory to total memory is checked against a preset value; otherwise, memory optimization ends. If the first and second level optimizations fail to reduce the ratio of currently used memory to total memory below the preset value, applications are ended from lowest to highest priority. Before ending, it can be checked whether the application is running in the foreground; if not, it ends directly. Further, if only the highest priority application remains running, and the ratio of currently used memory to total memory is greater than or equal to the preset value, it is checked whether the highest priority application is running in the foreground. If so, the user is prompted to end the application; otherwise, it ends directly. This is the third level of mobile terminal memory optimization. To avoid affecting normal user experience, a prompt is needed to inform the user whether to end the application. For example, the highest priority application could be a video / voice call application. Through these optimization methods, the user experience can be improved to the greatest extent possible.
[0057] like Figure 2 As shown, this embodiment can be implemented using the following steps:
[0058] S1. Obtain the application characteristics of all applications running in the mobile terminal, and determine the running priority of each application based on the application characteristics of each application;
[0059] S2. Retain the running of several applications with high to low priority, terminate the processes of other running applications, and determine whether the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to a preset value. If not, end the memory optimization; if yes, continue to the next step.
[0060] S3. If the ratio of the currently used memory to the total memory of the mobile terminal is greater than or equal to the preset value, then the application characteristics of the applications currently running on the mobile terminal are input into the prediction model, and the memory increment data of the running applications in the future are predicted.
[0061] If any of the running applications has memory increment data greater than or equal to the first threshold of the prediction model, then the process of that application is terminated, and it is determined whether the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to a preset value. If yes, then step S4 is executed; otherwise, memory optimization is terminated.
[0062] If none of the running applications has memory increment data greater than or equal to the first threshold of the prediction model, then proceed to step S4.
[0063] S4. Optimize memory according to the priority: terminate the running applications from low to high priority. After each application is terminated, determine whether the ratio of the memory used by the mobile terminal to the total memory is greater than or equal to the preset value. If not, terminate memory optimization.
[0064] S5. If only the highest priority application is running, and the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to the preset value, determine whether the highest priority application is running in the foreground. If yes, remind the user to end the application; otherwise, end the application directly.
[0065] This embodiment can preserve the user's application usage to the greatest extent according to the user's usage habits. For example, during voice calls or games, the memory optimization program in this embodiment runs automatically in the background of the mobile terminal without affecting the user experience. At the same time, during the optimization process, it also improves the user experience by reducing the use of excessive background resources, which can cause lag and overheating. There is no need to manually clean up background programs; you only need to manually set the value of memory usage relative to the total memory capacity.
[0066] Example 2
[0067] This embodiment provides a mobile terminal memory optimization device, including:
[0068] The application feature acquisition module is suitable for acquiring the application features of all applications running on a mobile terminal.
[0069] The priority determination module is suitable for determining the running priority of each application based on the application characteristics of each application.
[0070] The value-added prediction module is suitable for inputting the application features into a trained prediction model to predict memory value-added data for future time periods.
[0071] The memory optimization module is suitable for determining whether to stop the application from running based on the memory increment data and the application's running priority.
[0072] This embodiment provides a mobile terminal memory optimization device that implements the mobile terminal memory optimization method in Embodiment 1. The device obtains the application characteristics of the mobile terminal through the application feature acquisition module, drives the priority of the application based on the application characteristics of the application, and the value-added prediction module also inputs the application characteristics into the prediction model based on the trained model. Finally, the memory optimization module executes the steps of the memory optimization method described in Embodiment 1.
[0073] Example 3
[0074] This embodiment provides a processor for running a mobile terminal application, wherein the mobile terminal application executes the mobile terminal memory optimization method described in Embodiment 1 during runtime.
[0075] Example 4
[0076] This embodiment provides a mobile terminal, including a processor as described in Embodiment 3 and / or a mobile terminal memory optimization device as described in Embodiment 2.
[0077] Exemplary embodiments of this disclosure have been specifically shown and described above. It should be understood that this disclosure is not limited to the detailed structures, arrangements, or implementations described herein; rather, this disclosure is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.
Claims
1. A method for optimizing mobile terminal memory, characterized in that, include: Obtain the application characteristics of all running applications on the mobile terminal; Based on the application characteristics of each application, determine the priority of running each application; The application features are input into a trained prediction model to predict memory value-added data for future time periods. Determine whether to stop the application from running based on the memory increment data and the application's running priority; The application features include: Category, average runtime of the foreground, average runtime of the background, average usage frequency, the ratio of total memory used during foreground runtime, the ratio of total memory used during background runtime, the change in mobile terminal temperature within the foreground runtime t, and the change in mobile terminal temperature within the background runtime t; one or more combinations of these. The step of determining the execution priority of each application based on its application characteristics includes: P = A*Y1 + T*Y2 + R*Y3 Wherein, P is the priority of the application, A is the foreground runtime of the application, Y1 is the weight of the foreground runtime of the application, T is the temperature change of the mobile terminal within the foreground runtime t, Y2 is the weight of the temperature change of the mobile terminal within the foreground runtime t, R is the proportion of total memory occupied by background operation, and Y3 is the weight of the proportion of total memory occupied by background operation.
2. The mobile terminal memory optimization method as described in claim 1, characterized in that, The step of determining the execution priority of each application based on its application characteristics further includes: P = A*X1 + B*X2 + C*X3 Wherein, P is the priority of the application, A is the foreground runtime of the application, X1 is the weight of the foreground runtime of the application, B is the average usage frequency of the application, X2 is the weight of the average usage frequency of the application, C is the average background runtime, and X3 is the weight of the average background runtime.
3. The mobile terminal memory optimization method as described in claim 2, characterized in that, The training process of the prediction model includes: Obtain sample data of the application, which is divided into validation set data and training set data; The base model is read from the server, the training set data is collected and the base model is trained, the data in the validation set is input into the trained base model, and the validation set data prediction results are obtained; new training samples are generated based on the validation set data prediction results, and a preset Gaussian process regression model is trained based on the training samples to obtain a trained meta-model. The prediction model is constructed based on the trained base model and the trained meta-model.
4. The mobile terminal memory optimization method as described in claim 3, characterized in that, The step of determining whether to stop the application based on the memory increment data and the application's running priority includes: First, keep running a number of applications with high to low priority, terminate the processes of other running applications, and determine whether the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to a preset value. If not, end the memory optimization.
5. A mobile terminal memory optimization method as described in claim 4, characterized in that, If the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to the preset value, then the prediction model is judged based on the memory increment data of the several running applications in the future period of time. The prediction model has different first thresholds for different applications in different running times. If any of the running applications has memory increment data greater than or equal to the first threshold of the prediction model, then the process of that application is terminated, and it is determined whether the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to a preset value. If not, then memory optimization is terminated; if so, then memory is optimized according to the priority. If none of the running applications has memory increment data greater than or equal to the first threshold of the prediction model, then the comparison between the memory increment data and the first threshold is skipped, and memory is optimized according to the priority.
6. The mobile terminal memory optimization method as described in claim 5, characterized in that, The optimization of memory according to the priority order includes: The running applications are terminated from low to high priority. After each application is terminated, it is determined whether the ratio of the memory used by the mobile terminal to the total memory is greater than or equal to the preset value. If not, the memory optimization ends.
7. A mobile terminal memory optimization method as described in claim 6, characterized in that, If only the highest priority application is running, and the ratio of the memory currently used by the mobile terminal to the total memory is greater than or equal to the preset value, determine whether the highest priority application is running in the foreground. If yes, prompt the user to end the application; otherwise, end the application directly.
8. A mobile terminal memory optimization device, characterized in that, include: The application feature acquisition module is suitable for acquiring the application features of all applications running on a mobile terminal. The priority determination module is suitable for determining the running priority of each application based on the application characteristics of each application. The value-added prediction module is suitable for inputting the application features into a trained prediction model to predict memory value-added data for future time periods. The memory optimization module is adapted to determine whether to stop the application from running based on the memory increment data and the application's running priority; The application features include: Category, average runtime of the foreground, average runtime of the background, average usage frequency, the ratio of total memory used during foreground runtime, the ratio of total memory used during background runtime, the change in mobile terminal temperature within the foreground runtime t, and the change in mobile terminal temperature within the background runtime t; one or more combinations of these. The step of determining the execution priority of each application based on its application characteristics includes: P = A*Y1 + T*Y2 + R*Y3 Wherein, P is the priority of the application, A is the foreground runtime of the application, Y1 is the weight of the foreground runtime of the application, T is the temperature change of the mobile terminal within the foreground runtime t, Y2 is the weight of the temperature change of the mobile terminal within the foreground runtime t, R is the proportion of total memory occupied by background operation, and Y3 is the weight of the proportion of total memory occupied by background operation.
9. A processor, characterized in that, The processor is used to run a mobile terminal application, and the mobile terminal application executes the mobile terminal memory optimization method according to any one of claims 1-7 when it runs.
10. A mobile terminal, characterized in that, It includes the processor of claim 9 and / or the mobile terminal memory optimization device of claim 8.
Citation Information
Patent Citations
Virtualization-based method and device for adjusting QoS (quality of service) of node memory of NUMA (non uniform memory access architecture)
CN103823714A
Memory management method, terminal and computer readable storage medium
CN110221921A
Cloud simulation memory resource prediction model construction method and memory resource prediction method
CN112181659A