CN108804231B - Memory optimization method and device, readable storage medium and mobile terminal - Google Patents

Memory optimization method and device, readable storage medium and mobile terminal Download PDF

Info

Publication number
CN108804231B
CN108804231B CN201810610159.3A CN201810610159A CN108804231B CN 108804231 B CN108804231 B CN 108804231B CN 201810610159 A CN201810610159 A CN 201810610159A CN 108804231 B CN108804231 B CN 108804231B
Authority
CN
China
Prior art keywords
memory
average
application program
running
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810610159.3A
Other languages
Chinese (zh)
Other versions
CN108804231A (en
Inventor
马超辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qiku Internet Technology Shenzhen Co Ltd
Original Assignee
Qiku Internet Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qiku Internet Technology Shenzhen Co Ltd filed Critical Qiku Internet Technology Shenzhen Co Ltd
Priority to CN201810610159.3A priority Critical patent/CN108804231B/en
Publication of CN108804231A publication Critical patent/CN108804231A/en
Priority to PCT/CN2019/087751 priority patent/WO2019237891A1/en
Application granted granted Critical
Publication of CN108804231B publication Critical patent/CN108804231B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Abstract

The invention relates to a memory optimization method, a device, a readable storage medium and a mobile terminal, wherein the method comprises the following steps: after a system starting signal is received, program running information corresponding to each application program in a use state in each unit timing period is obtained; calculating to obtain a weight value corresponding to each application program according to the obtained running times, the average running time and the average memory occupation value; and when the system residual memory is judged to be lower than the preset memory, clearing the corresponding application program according to the preset sorting rule according to the plurality of weighted values so as to ensure that the system residual memory is not lower than the preset memory. The memory optimization method provided by the invention can realize automatic cleaning of the running memory of the mobile terminal equipment, and improves the user experience.

Description

Memory optimization method and device, readable storage medium and mobile terminal
Technical Field
The invention relates to the technical field of computers, in particular to a memory optimization method, a memory optimization device, a readable storage medium and a mobile terminal.
Background
With the increasing development of economy and the continuous updating and popularization of science and technology products, the mobile terminal has become the most common electronic equipment in daily life of people, and great convenience is provided for the work and life of people.
At present, various intelligent operating systems are applied to mobile phones, tablet computers and vehicle-mounted terminals, so that functions of mobile terminals based on various application programs are more and more abundant, and accordingly higher requirements are put forward for running memory requirements. In recent years, it has become a trend to configure hardware processing chips with higher memory for mobile terminals. In addition, in order to ensure the smoothness of the application program running when the mobile terminal is running and effectively utilize the memory of the mobile terminal, the memory of the mobile terminal often needs to be optimized.
However, when the running memory of some existing mobile terminal products is occupied too much, the function of automatically cleaning the memory cannot be realized, and the actual application experience of the products is affected.
Disclosure of Invention
Based on this, the invention aims to solve the problem that in the prior art, part of mobile terminal products cannot realize automatic memory cleaning.
The invention provides a memory optimization method, wherein the method comprises the following steps:
after a system starting signal is received, acquiring program running information corresponding to each application program in a use state in each unit timing period, wherein the program running information at least comprises running times, average running duration and an average memory occupation value;
calculating to obtain a weight value corresponding to each application program according to the obtained running times, the average running duration and the average memory occupation value;
and when the system residual memory is judged to be lower than the preset memory, clearing the corresponding application program according to a preset sorting rule according to the plurality of weighted values so as to ensure that the system residual memory is not lower than the preset memory.
The memory optimization method provided by the invention divides the operation process of the mobile terminal into a plurality of unit timing cycles, when each application program operates, the system can automatically record the operation times, the average operation time length and the average memory occupation value corresponding to each application program, because the operation times, the average operation time length and the average memory occupation value are directly related to the memory occupation, the weight value corresponding to the application program is obtained by calculation based on the three calculation elements, when the residual memory of the system is lower than the preset memory, the memory overload is indicated, at the moment, the corresponding application program can be cleaned according to the weight value of each application program and the preset sequencing rule, so that the residual memory of the system is larger than the preset memory, and the normal operation of the mobile terminal is ensured. The memory optimization method provided by the invention can realize automatic cleaning of the running memory of the mobile terminal equipment, and improves the user experience.
The memory optimization method comprises the following steps that program running information further comprises an application program name, an application package name, a single running time length and a single memory occupation value, wherein the method for determining the single running time length comprises the following steps:
acquiring a awakened time point of the application program in any unit timing cycle and a released time point adjacent to the awakened time point, wherein the awakened time point is corresponding time when the application program is activated, and the released time point is corresponding time when the application program is closed;
and calculating the single-time operation duration according to the awakened time point and the released time point.
The memory optimization method, wherein the average running time calculation method comprises the following steps:
accumulating the single operation durations in one unit timing period to obtain a unit total operation duration;
dividing the total unit operation time length by the operation times in the unit timing period to obtain the average operation time length.
The memory optimization method, wherein the method for obtaining the weight value corresponding to each application program through calculation comprises the following steps:
and accumulating corresponding unit weight values in each unit timing cycle to obtain the weight value, wherein the unit weight value is the memory contribution proportion of a single application program running in each unit timing cycle.
The memory optimization method, wherein the method for calculating the cell weight value includes the following steps:
when the end of each unit timing period is monitored, respectively subtracting the running times, the average running time and the average memory occupation value in the current unit timing period and the adjacent last unit timing period to respectively obtain a running time difference value, an average running time difference value and an average memory occupation difference value;
and calculating to obtain the unit weight value according to the running time difference, the average running time length difference and the average memory occupation difference.
The memory optimization method, wherein the method for clearing the corresponding application program according to the preset sorting rule comprises the following steps:
arranging the weight values corresponding to each application program according to the mode that the weight values are from small to large to obtain an application program sequence list;
and eliminating the corresponding application program in the application program list according to the mode that the weight value is increased from small to large.
The memory optimization method, wherein the average memory occupancy value calculation method comprises the following steps:
accumulating the single memory occupation values in one unit timing period to obtain a unit memory occupation total value;
dividing the total value of the unit memory occupation by the operation times in the unit timing period to obtain the average memory occupation value.
The invention provides a memory optimization device, wherein the device comprises:
the operation monitoring module is used for acquiring program operation information corresponding to each application program in a use state in each unit timing period after receiving a system starting signal, wherein the program operation information at least comprises operation times, average operation duration and an average memory occupation value;
the weight calculation module is used for calculating and obtaining a weight value corresponding to each application program according to the obtained running times, the average running duration and the average memory occupation value;
and the memory optimization module is used for clearing the corresponding application program according to a preset sorting rule according to a plurality of weighted values when the system residual memory is judged to be lower than the preset memory so as to ensure that the system residual memory is not lower than the preset memory.
The invention also proposes a readable storage medium on which a computer program is stored, wherein said program, when executed by a processor, implements the memory optimization method as described above.
The invention also provides a mobile terminal, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the memory optimization method.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a memory optimization method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a memory optimization method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a memory optimization device according to a third embodiment of the present invention.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
When the operating memory of the existing part of mobile terminal products occupies too much, the function of automatically cleaning the memory cannot be realized, and the actual application experience of the products is influenced.
To solve the technical problem, the present invention provides a memory optimization method, referring to fig. 1, for the memory optimization method according to the first embodiment of the present invention, the method includes the following steps:
s101, after a system starting signal is received, program running information corresponding to each application program in a use state in each unit timing period is obtained, wherein the program running information at least comprises running times, average running duration and an average memory occupation value.
In this embodiment, a mobile phone is taken as an example for illustration, and after the mobile phone is powered on and operated, the mobile phone system immediately monitors the application program in an operating state. In this embodiment, the monitoring process is divided into a plurality of unit timing cycles. Taking the application program X as an example for illustration, the monitored application program X is in the unit timing period T0The program running information in the program running information comprises: application name AppName, application Package name Package, period T0Average running time T in0L, period T0Average memory footprint M in memory0And the number of times of operation N of the application program X0. It should be noted that, in each unit timing cycle, there may be a case where multiple applications run simultaneously, and the mobile phone system also monitors program running information of other applications in a running state.
And S102, calculating to obtain a weight value corresponding to each application program according to the obtained running times, the average running time and the average memory occupation value.
Acquiring the unit timing period T of the application program X after monitoring0Number of runs N in0Average running time period T0L and average memory footprint M0Then, if the mobile phone continues to operate, the mobile phone system will continue to monitor the next unit timing period T1The relevant program running information of the application program X.
For example, in a unit timing period T1The monitored program running information of the application program X is as follows: number of runs N1Average running time period T1L and average memory footprintValue M1. If the mobile phone system continues to operate, the unit is timed for a period T2The monitored program running information of the application program X is as follows: number of runs N2Average running time period T2L and average memory footprint M2. Similarly, one can analogize to the Nth unit timing period TNThe monitored program running information of the application program X is: number of runs NNAverage running time period TNL and average memory footprint MN
After the program running information of the application program X is monitored, the weight value corresponding to each application program is calculated according to the monitored information. Specifically, in a unit timing period T1When the timing is finished, the operation times change, the average operation duration change and the average memory occupancy value change of the application program X are respectively as follows:
number of runs change NC1=N1-N0
Average run length variation TLC1=T1L-T0L
Mean memory footprint change MC1=M1-M0
Therefore, at the end of the unit timing period T1, the unit weight value corresponding to the application program X is:
WX1=NC1*X+TCL1*Y+MC1*Z
wherein X, Y and Z are coefficients.
It should be noted that, for a plurality of subsequent unit timing cycles, the above method may be adopted to calculate the unit weight value WX of the application program X in the plurality of subsequent unit timing cycles2、WX3......WXN. Finally, accumulating the calculated multiple unit timing periods to obtain the total weight value of the application program X. It should be noted that the total weight value of other applications can be calculated by the same method as described above.
And S103, when the system residual memory is judged to be lower than the preset memory, clearing the corresponding application program according to a preset sorting rule according to the plurality of weighted values so as to ensure that the system residual memory is not lower than the preset memory.
When the mobile phone operates, if the mobile phone system judges that the residual memory of the system is lower than the preset memory, the memory of the mobile phone system needs to be cleaned at the moment so as to ensure the smoothness of the operation of the mobile phone. As described above, since the total weight value of the memory occupied by each application program during running is calculated, the application programs can be cleaned according to the preset sorting rule. In this embodiment, the application programs are cleaned in a manner that the total weight value of each application program is sequentially reduced until the remaining memory of the system is not lower than the preset memory, which also can ensure the normal operation of the mobile phone system.
The memory optimization method provided by the invention divides the operation process of the mobile terminal into a plurality of unit timing cycles, when each application program operates, the system can automatically record the operation times, the average operation time length and the average memory occupation value corresponding to each application program, because the operation times, the average operation time length and the average memory occupation value are directly related to the memory occupation, the weight value corresponding to the application program is obtained by calculation based on the three calculation elements, when the residual memory of the system is lower than the preset memory, the memory overload is indicated, at the moment, the corresponding application program can be cleaned according to the weight value of each application program and the preset sequencing rule, so that the residual memory of the system is larger than the preset memory, and the normal operation of the mobile terminal is ensured. The memory optimization method provided by the invention can realize automatic cleaning of the running memory of the mobile terminal equipment, and improves the user experience.
The technical solution of the present invention is explained in more detail below with a specific example. Referring to fig. 2, a memory optimization method according to a second embodiment of the present invention is described as follows:
s201, a system starting signal is received.
The present embodiment is described with reference to a portable tablet. After the user presses the power-on key to start the computer, the intelligent tablet starts to run various application programs.
S202, program running information is monitored, wherein the program running information comprises running times, single running time and a single memory occupation value.
When the smart tablet is running, the tablet system monitors the running information of the running application program. Wherein, the monitoring process is divided into a plurality of unit timing periods.
(1) In a unit timing period T0The program running information of the application program X monitored by the system comprises:
the application name is as follows: AppName
The application package name: PackagenNname
At each point in time that application X is awakened: t is0S0、T0S1、T0S2、T0S3......T0SN
Each point in time at which application X is released: t is0E0、T0E1、T0E2、T0E3......T0EN
Application X single run length: t is0L0、T0L1、T0L2、T0L3......T0LN
Number of runs of application X: n is a radical of0
Memory footprint value at single run of application X: m00、M01、M02、M03......M0N
In a unit timing period T0In the file a, the program operation information of the application program X is recorded.
In the first unit timing period T0After the end, the second unit timing period T is started1. The tablet system will also record the following information for application X into file a:
(2) in a unit timing period T1The program running information of the application program X monitored by the system comprises:
the application name is as follows: AppName
The application package name: PackagenNname
At each point in time that application X is awakened: t is1S0、T1S1、T1S2、T1S3......T1SN
Each point in time at which application X is released: t is1E0、T1E1、T1E2、T1E3......T1EN
Application X single run length: t is1L0、T1L1、T1L2、T1L3......T1LN
Number of runs of application X: n is a radical of1
Memory footprint value at single run of application X: m10、M11、M12、M13......M1N
In the second unit timing period T1After the end, the third unit timing period T is started2. The tablet system will also record the following information for application X into file a:
(3) in a unit timing period T2The program running information of the application program X monitored by the system comprises:
the application name is as follows: AppName
The application package name: PackagenNname
At each point in time that application X is awakened: t is2S0、T2S1、T2S2、T2S3......T2SN
Each point in time at which application X is released: t is2E0、T2E1、T2E2、T2E3......T2EN
Application X single run length: t is2L0、T2L1、T2L2、T2L3......T2LN
Number of runs of application X: n is a radical of2
Memory footprint value at single run of application X: m20、M21、M22、M23......M2N
(4) In a unit timing period TNThe program running information of the application program X monitored by the system comprises:
the application name is as follows: AppName
The application package name: PackagenNname
At each point in time that application X is awakened: t isNS0、TNS1、TNS2、TNS3......TNSN
Each point in time at which application X is released: t isNE0、TNE1、TNE2、TNE3......TNEN
Application X single run length: t isNL0、TNL1、TNL2、TNL3......TNLN
Number of runs of application X: n is a radical ofN
Memory footprint value at single run of application X: mN0、MN1、MN2、MN3......MNN
S203, calculating to obtain the average running time and the average memory occupation value.
(1) In a unit timing period T0Internal:
average running time of application X: t is0L=(T0L0+T0L1+T0L2+T0L3......+T0LN)/N0
Average memory footprint of application X: m0=(M00+M01+M02+M03...M0N)/N0
(2) In a unit timing period T1Internal:
average running time of application X: t is1L=(T1L0+T1L1+T1L2+T1L3......T1LN)/N1
Average memory footprint of application X: m1=(M10+M11+M12+M13...M1N)/N1
(3) In a unit timing period T2Internal:
average running time of application X: t is2L=(T2L0+T2L1+T2L2+T2L3......T2LN)/N2
Average memory footprint of application X: m2=(M20+M21+M22+M23...M2N)/N2
(4) In a unit timing period TNInternal:
average running time of application X: t isNL=(TNL0+TNL1+TNL2+TNL3......TNLN)/NN
Average memory footprint of application X: mN=(MN0+MN1+MN2+MN3...MNN)/NN
And S204, calculating the weight value of each application program.
In a unit timing period T1At the end, the unit is clocked for a period T1And unit timing period T0And recording the corresponding times difference value, the average running time length difference value and the average memory occupation difference value of the application program X into the file B.
Specifically, when the unit counts the period T1At the end of the process, the process is completed,the relevant operating parameter differences for application X are as follows:
number of times difference NC1=N1-N0
Average run length Difference TLC1=T1L-T0L
Average memory footprint difference MC1=M1-M0
When the unit times the period T2At the end, the difference between the relevant operating parameters of the application program X is as follows:
number of times difference NC2=N2-N1
Average run length Difference TLC2=T2L-T1L
Average memory footprint difference MC2=M2-M1
When the unit times the period TNAt the end, the difference between the relevant operating parameters of the application program X is as follows:
number of times difference NCN=NN-NN-1
Average run length Difference TLCN=TNL-TN-1L
Average memory footprint difference MCN=MN-MN-1
In a unit timing period T1At the end, the unit weight value corresponding to the application program X is:
WX1=NC1*X+TCL1*Y+MC1*Z
in a unit timing period T2At the end, the unit weight value corresponding to the application program X is:
WX2=NC2*X+TCL2*Y+MC2*Z
in a unit timing period T3At the end, the unit weight value corresponding to the application program X is:
WX3=NC3*X+TCL3*Y+MC3*Z
in a unit timing period TNAt the end, the unit weight value corresponding to the application program X is:
WXN=NCN*X+TCLN*Y+MCN*Z
wherein X, Y and Z are coefficients.
After the corresponding unit weight value of the application program X in each unit timing period is obtained through calculation, accumulating the multiple unit weight values to obtain a total weight value, wherein the corresponding expression is as follows:
WX=WX1+WX2+WX3......+WXN
it should be noted that the total weight value of any application program in the running state can be calculated by the method described above.
S205, whether the system residual memory is smaller than the preset memory is judged.
In the running process of the intelligent tablet computer, if the tablet computer system judges that the residual memory of the system is smaller than the preset memory, the tablet computer system needs to be subjected to memory cleaning at the moment so as to ensure the smoothness of the tablet computer system in running. It can be understood that when the remaining memory of the system is larger than the preset memory, the memory cleaning is not needed at this time.
And S206, automatically cleaning the corresponding application program.
When memory is cleared, in this embodiment, the total weight values corresponding to the application programs are arranged in a descending order, and the clearing is performed sequentially. For example, the total weight values are arranged in the order from large to small, and the sequence is: "WeChat", corresponding to a total weight of 16%; "Payment treasure", corresponding total weight value is 10%; "high map", corresponding to a total weight of 8%; "panning with mobile phone", the corresponding total weight is 7%; the travel with journey is cleared according to the sequence of WeChat, Paibao, Goodpasture map, Taobao and travel with journey, wherein the corresponding total weight value is 5%.
It should be additionally noted that the memory cleaning software embedded in the tablet system is not cleaned and does not belong to the cleaned list. Meanwhile, the user can manually set the automatic cleaning authority of each application program according to the application requirement of the user, and part of the application programs needing to run in real time are excluded from the cleaning list.
Referring to fig. 3, a memory optimization apparatus according to a third embodiment of the present invention includes an operation monitoring module 11, a weight calculating module 12, and a memory optimization module 13, which are connected in sequence;
wherein the operation monitoring module 11 is specifically configured to:
after a system starting signal is received, acquiring program running information corresponding to each application program in a use state in each unit timing period, wherein the program running information at least comprises running times, average running duration and an average memory occupation value;
the weight calculation module 12 is specifically configured to:
calculating to obtain a weight value corresponding to each application program according to the obtained running times, the average running duration and the average memory occupation value;
the memory optimization module 13 is specifically configured to:
and when the system residual memory is judged to be lower than the preset memory, clearing the corresponding application program according to a preset sorting rule according to the plurality of weighted values so as to ensure that the system residual memory is not lower than the preset memory.
The invention also proposes a readable storage medium on which a computer program is stored, wherein said program, when executed by a processor, implements the memory optimization method as described above.
The invention also provides a mobile terminal, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the memory optimization method.
Those skilled in the art will appreciate that all or part of the steps in the method for implementing the above embodiments may be implemented by a program instructing the relevant hardware. The program may be stored in a computer-readable storage medium. Which when executed comprises the steps of the method described above. The storage medium includes: ROM/RAM, magnetic disk, optical disk, etc.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (6)

1. A memory optimization method, comprising:
after a system starting signal is received, program running information corresponding to each application program in a use state in each unit timing period is obtained, wherein the program running information at least comprises running times, single running duration, average running duration, a single memory occupation value and an average memory occupation value;
calculating to obtain a weight value corresponding to each application program according to the obtained running times, the single running time length, the average running time length, the single memory occupation value and the average memory occupation value; wherein the single operation duration is determined in the following manner: acquiring a awakened time point and a released time point adjacent to the awakened time point of the application program in any unit timing cycle, wherein the awakened time point is corresponding time when the application program is activated, and the released time point is corresponding time when the application program is closed; calculating the single-time operation duration according to the awakened time point and the released time point; the average running time length is determined in the following manner: accumulating a plurality of single operation time lengths in one unit timing period to obtain a unit total operation time length; dividing the total unit operation time length by the operation times in the unit timing period to obtain the average operation time length; the average memory occupancy value is determined in the following manner: accumulating a plurality of single memory occupation values in one unit timing period to obtain a unit memory occupation total value; dividing the total value of the unit memory occupation by the operation times in the unit timing period to obtain the average memory occupation value;
when the system residual memory is judged to be lower than the preset memory, the weighted values corresponding to the application programs are arranged according to the weighted values from large to small to obtain an application program list, and the corresponding application programs are eliminated in the application program list according to the weighted values from large to small to ensure that the system residual memory is not lower than the preset memory.
2. The memory optimization method according to claim 1, wherein the method for calculating the weight value corresponding to each application program comprises the following steps:
and accumulating corresponding unit weight values in each unit timing cycle to obtain the weight value, wherein the unit weight value is the memory contribution proportion of a single application program running in each unit timing cycle.
3. The memory optimization method of claim 2, wherein the method for calculating the cell weight value comprises the following steps:
when the end of each unit timing period is monitored, respectively subtracting the running times, the average running time and the average memory occupation value in the current unit timing period and the adjacent last unit timing period to respectively obtain a running time difference value, an average running time difference value and an average memory occupation difference value;
and calculating to obtain the unit weight value according to the running time difference, the average running time length difference and the average memory occupation difference.
4. An apparatus for memory optimization, the apparatus comprising:
the operation monitoring module is used for acquiring program operation information corresponding to each application program in a use state in each unit timing period after receiving a system starting signal, wherein the program operation information at least comprises operation times, single operation time, average operation time, a single memory occupation value and an average memory occupation value;
the weight calculation module is used for calculating and obtaining a weight value corresponding to each application program according to the acquired running times, the single running time length, the average running time length, the single memory occupation value and the average memory occupation value; wherein the single operation duration is determined in the following manner: acquiring a awakened time point and a released time point adjacent to the awakened time point of the application program in any unit timing cycle, wherein the awakened time point is corresponding time when the application program is activated, and the released time point is corresponding time when the application program is closed; calculating the single-time operation duration according to the awakened time point and the released time point; the average running time length is determined in the following manner: accumulating a plurality of single operation time lengths in one unit timing period to obtain a unit total operation time length; dividing the total unit operation time length by the operation times in the unit timing period to obtain the average operation time length; the average memory occupancy value is determined in the following manner: accumulating a plurality of single memory occupation values in one unit timing period to obtain a unit memory occupation total value; dividing the total value of the unit memory occupation by the operation times in the unit timing period to obtain the average memory occupation value;
and the memory optimization module is used for arranging the weight values corresponding to each application program according to the weight values from large to small to obtain an application program list when the system residual memory is judged to be lower than the preset memory, and eliminating the corresponding application programs in the application program list according to the weight values from large to small to ensure that the system residual memory is not lower than the preset memory.
5. A readable storage medium on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the memory optimization method of any one of the preceding claims 1 to 3.
6. A mobile terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the memory optimization method according to any one of claims 1 to 3 when executing the program.
CN201810610159.3A 2018-06-13 2018-06-13 Memory optimization method and device, readable storage medium and mobile terminal Active CN108804231B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810610159.3A CN108804231B (en) 2018-06-13 2018-06-13 Memory optimization method and device, readable storage medium and mobile terminal
PCT/CN2019/087751 WO2019237891A1 (en) 2018-06-13 2019-05-21 Memory optimization method and apparatus, and readable storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810610159.3A CN108804231B (en) 2018-06-13 2018-06-13 Memory optimization method and device, readable storage medium and mobile terminal

Publications (2)

Publication Number Publication Date
CN108804231A CN108804231A (en) 2018-11-13
CN108804231B true CN108804231B (en) 2020-10-30

Family

ID=64085928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810610159.3A Active CN108804231B (en) 2018-06-13 2018-06-13 Memory optimization method and device, readable storage medium and mobile terminal

Country Status (2)

Country Link
CN (1) CN108804231B (en)
WO (1) WO2019237891A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804231B (en) * 2018-06-13 2020-10-30 奇酷互联网络科技(深圳)有限公司 Memory optimization method and device, readable storage medium and mobile terminal
CN109753316A (en) * 2018-11-22 2019-05-14 惠州Tcl移动通信有限公司 Intelligent terminal and its control method, the device with store function
CN110321224B (en) * 2019-07-04 2022-05-24 深圳市康冠科技股份有限公司 Terminal memory cleaning method and device and computer readable storage medium
CN110737523A (en) * 2019-10-18 2020-01-31 湖南快乐阳光互动娱乐传媒有限公司 method and terminal for improving application starting speed through memory cleaning
CN111078407B (en) * 2019-12-10 2022-11-01 Oppo(重庆)智能科技有限公司 Memory management method and device, storage medium and electronic equipment
CN111104180B (en) * 2019-12-11 2021-08-03 惠州Tcl移动通信有限公司 Application program optimization method and device, storage medium and electronic equipment
CN111666153A (en) * 2020-05-25 2020-09-15 深圳Tcl新技术有限公司 Cache task management method, terminal device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324575B (en) * 2012-03-23 2017-04-05 腾讯科技(深圳)有限公司 The method and mobile terminal of cleaning internal memory
CN103927230B (en) * 2014-03-25 2017-03-29 优视科技有限公司 A kind of feedback method and device of internal memory behaviour in service
CN105354093A (en) * 2015-12-09 2016-02-24 广东欧珀移动通信有限公司 Memory management method and mobile terminal
CN108804231B (en) * 2018-06-13 2020-10-30 奇酷互联网络科技(深圳)有限公司 Memory optimization method and device, readable storage medium and mobile terminal

Also Published As

Publication number Publication date
CN108804231A (en) 2018-11-13
WO2019237891A1 (en) 2019-12-19

Similar Documents

Publication Publication Date Title
CN108804231B (en) Memory optimization method and device, readable storage medium and mobile terminal
CN109740732B (en) Neural network processor, convolutional neural network data multiplexing method and related equipment
CN107678803B (en) Application control method and device, storage medium and electronic equipment
EP3502881B1 (en) Method for preloading application, storage medium, and terminal device
EP3502880A1 (en) Method for preloading application, storage medium, and terminal device
EP3502878B1 (en) Method for preloading application and terminal device
CN107402808B (en) Process management method, device, storage medium and electronic equipment
CN107943534B (en) Background application program closing method and device, storage medium and electronic equipment
CN106060909A (en) Network access method and mobile terminal
CN105786552B (en) A kind of memory method for cleaning and electronic equipment
CN107402804B (en) background process control method and device, storage medium and electronic equipment
TWI570547B (en) Power management using reward-based sleep state selection
CN105022668B (en) Job scheduling method and system
CN104580721A (en) Alarm clock implementation method for terminal
CN110706703A (en) Voice wake-up method, device, medium and equipment
CN106055404B (en) Method and device for cleaning background application program
CN107704317A (en) Smart machine and its application management method and the device with store function
CN111045507B (en) List management and control method, device, mobile terminal and storage medium
CN115219930B (en) Vehicle storage battery aging early warning method and device, electronic equipment and storage medium
CN113439263A (en) Application cleaning method and device, storage medium and electronic equipment
CN112715040A (en) Method for reducing power consumption, terminal equipment and storage medium
CN104793979B (en) Start the method, device and mobile terminal of application program
CN110427092B (en) Battery switching method, device, terminal and computer readable storage medium
CN111078405B (en) Memory allocation method and device, storage medium and electronic equipment
CN114545272A (en) Battery life prediction method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant