WO2023169173A1 - 内存清理方法、装置、存储介质及电子设备 - Google Patents

内存清理方法、装置、存储介质及电子设备 Download PDF

Info

Publication number
WO2023169173A1
WO2023169173A1 PCT/CN2023/076506 CN2023076506W WO2023169173A1 WO 2023169173 A1 WO2023169173 A1 WO 2023169173A1 CN 2023076506 W CN2023076506 W CN 2023076506W WO 2023169173 A1 WO2023169173 A1 WO 2023169173A1
Authority
WO
WIPO (PCT)
Prior art keywords
cleaning
weight
update
target
self
Prior art date
Application number
PCT/CN2023/076506
Other languages
English (en)
French (fr)
Inventor
李响
丁健
Original Assignee
深圳Tcl新技术有限公司
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 深圳Tcl新技术有限公司 filed Critical 深圳Tcl新技术有限公司
Publication of WO2023169173A1 publication Critical patent/WO2023169173A1/zh

Links

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

Definitions

  • This application relates to the field of communication technology, and specifically to a memory cleaning method, device, storage medium and electronic equipment.
  • the operating systems of various terminals usually have a memory cleaning module that is responsible for cleaning (such as releasing or recycling) application memory in a timely manner when the system memory is insufficient.
  • a memory cleaning module that is responsible for cleaning (such as releasing or recycling) application memory in a timely manner when the system memory is insufficient.
  • the memory cleaning module in the terminal will be cleaned uniformly and indiscriminately. of application memory, resulting in low memory cleaning efficiency and low cleaning reliability.
  • the embodiments of this application provide a solution that can improve the efficiency and reliability of memory cleaning.
  • a memory cleaning method includes: obtaining multiple self-start times of a local target application; calculating the time intervals of the multiple self-start times; Calculate the cleaning weight of the target application at the time interval; perform a memory cleaning operation on the target application according to the cleaning weight.
  • calculating the cleanup weight of the target application based on the time intervals of the multiple self-start times includes: calculating an average of the time intervals of the multiple self-start times; The average value determines the cleaning weight of the target application, wherein the average value is inversely proportional to the cleaning weight, and the cleaning weight higher than a predetermined threshold is used to indicate that memory cleaning processing is not performed on the target application.
  • the method further includes: if a first event is detected, obtaining the first Adjustment value; updating the cleaning weight based on the first adjustment value, wherein the cleaning weight after the update is greater than the cleaning weight before the update.
  • the method further includes: if a second event is detected, obtaining a second Adjustment value; updating the cleaning weight based on the second adjustment value, wherein the cleaning weight after the update is smaller than the cleaning weight before the update.
  • the method further includes: at the target time, obtaining all locally recorded The target applies multiple target self-start times before the target time; calculate the adjacent time intervals of two adjacent target self-start times, and average the adjacent time intervals to obtain the target average value; update the cleaning weight based on the target average value, wherein if the target average value is less than the first value, then the cleaning weight after the update is greater than the cleaning weight before the update, if the target average value is greater than the first value, the cleaning weight after the update is smaller than the cleaning weight before the update.
  • updating the cleaning weight based on the target average value includes: determining a size range in which the target average value is located; obtaining a preset adjustment value corresponding to the size range; based on The preset adjustment value updates the cleaning weight.
  • performing a memory cleaning operation on the target application according to the cleaning weight includes: if the cleaning weight is less than a predetermined threshold, performing memory cleaning processing on the target application; if the cleaning weight is less than a predetermined threshold, performing memory cleaning processing on the target application; If the cleaning weight is greater than the predetermined threshold, the memory cleaning process of the target application will not be performed.
  • a memory cleaning device includes: a time acquisition module, used to obtain multiple self-start times of local target applications; and an interval calculation module, used to calculate the multiple self-start times. a time interval; a weight calculation module, configured to calculate the cleanup weight of the target application based on the time intervals of the multiple self-start times; and a cleanup control module, configured to perform a memory cleanup operation on the target application based on the cleanup weight.
  • a storage medium has a computer program stored thereon.
  • the computer program is executed by a processor of a computer, the computer is caused to execute the method described in the embodiment of the present application.
  • an electronic device may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the method described in the embodiment of the present application.
  • multiple self-start times of the local target application are obtained; the time intervals of the multiple self-start times are calculated; and the cleanup weight of the target application is calculated based on the time intervals of the multiple self-start times; Perform a memory cleaning operation on the target application according to the cleaning weight.
  • Figure 1 shows a flow chart of a memory cleaning method according to an embodiment of the present application.
  • Figure 2 shows a flow chart of a weight update process according to an embodiment of the present application.
  • Figure 3 shows a flow chart of weight update processing according to an embodiment of the present application.
  • Figure 4 shows a block diagram of a memory cleaning device according to an embodiment of the present application.
  • Figure 5 shows a block diagram of an electronic device according to one embodiment of the present application.
  • Figure 1 schematically shows a flow chart of a memory cleaning method according to an embodiment of the present application.
  • the execution subject of the memory cleaning method can be any electronic device, such as a smart TV or a mobile phone.
  • the memory cleaning method may include steps S110 to S140.
  • Step S110 obtain multiple self-start times of the local target application;
  • Step S120 calculate the time intervals of the multiple self-start times;
  • Step S130 calculate the cleanup weight of the target application according to the time interval;
  • Step S140 Perform a memory cleaning operation on the target application according to the cleaning weight.
  • the self-start time is the time when the application starts, not the time when the application is opened due to user triggering or other triggering operations.
  • the local system can only record the self-starting time of the target application, but not the time when the user opens the target application. Multiple self-start times of the target application can be obtained from local records.
  • the time intervals of multiple self-start times can be calculated.
  • the cleaning weight of the target application is calculated based on the time interval, and the cleaning weight is a weight indicating memory cleaning of the target application.
  • the corresponding memory cleaning weight can be performed according to the cleaning weight during memory cleaning, and then the applications with different self-starting conditions can be cleaned according to the corresponding cleaning weight.
  • step S110 to step S140 by determining the cleaning weight of the application based on the time interval of the application's self-start time and instructing the application to perform a memory cleaning operation, uniform and indiscriminate application memory cleaning can be avoided. This improves the efficiency and reliability of memory cleaning.
  • step S110 multiple self-starting times of the local target application are obtained.
  • the self-start time is the time when the application starts, not the time when the application is opened due to user triggering or other triggering operations.
  • the local device may only record the self-starting time of the application for the target application, but not the time when the user opens the target application. Multiple self-start times of the target application can be obtained from local records.
  • step S120 time intervals of the plurality of self-starting times are calculated.
  • the time intervals of multiple self-start times can be calculated.
  • the time intervals of the multiple self-start times may specifically include the time intervals between each two adjacent self-start times in the multiple self-start times.
  • the time intervals between all two adjacent self-start times can be calculated sequentially to obtain multiple time intervals, that is, the time intervals of multiple self-start times include the multiple time intervals.
  • the time intervals of multiple self-start times may include the time intervals between two adjacent self-start times in the multiple self-start times.
  • a predetermined number of consecutive self-start times can be selected from multiple self-start times, and then the time intervals between two adjacent self-start times can be calculated to obtain multiple time intervals, that is, the time intervals of the multiple self-start times include the Multiple time intervals.
  • step S130 the cleaning weight of the target application is calculated according to the time intervals of the plurality of self-starting times.
  • step S130, calculating the cleanup weight of the target application based on the time intervals of the multiple self-start times includes: combining the time intervals of the multiple self-start times and the time intervals of the target application.
  • Application information (such as application identification) is input into a machine learning-based analysis model to obtain cleaning weights output by the analysis model.
  • the analysis model can be a decision tree model or a neural network model.
  • the analysis model can take training samples (each training sample can include a time interval corresponding to an application and application information) as input, and the cleaning weight label corresponding to the training sample as the expectation.
  • the output is trained and the resulting trained analysis model can be automatically and reliably evaluated based on machine learning to further improve the reliability of the cleaning weights.
  • step S130 calculating the cleaning weight of the target application based on the time intervals of the multiple self-starting times, includes: calculating an average of the time intervals of the multiple self-starting times; The value determines the cleaning weight of the target application, wherein the average value is inversely proportional to the cleaning weight, and the cleaning weight higher than a predetermined threshold is used to indicate that no memory cleaning operation is performed on the target application.
  • Calculate the average of multiple self-start time intervals that is, calculate the average of multiple time intervals. Based on this average, the frequency of self-start of the target application can be reflected. The smaller the average value, the more frequent the corresponding self-start.
  • Calculating the cleaning weight based on the average value means calculating a cleaning weight based on the frequency of self-start.
  • the cleaning weight can be calculated based on a predetermined formula or based on a predetermined query table matching.
  • This average value is inversely proportional to the cleanup weight, that is, the higher the frequency of self-start, the higher the corresponding cleanup weight. Furthermore, a cleanup weight higher than the predetermined threshold is used to indicate that the target application will not perform memory cleanup operations, that is, frequent cleaning operations can be performed. Self-launched applications do not perform memory cleanup processing.
  • the method further includes: if a first event is detected, obtaining a first adjustment value; The cleaning weight is updated based on the first adjustment value, wherein the cleaning weight after the update is greater than the cleaning weight before the update.
  • the first event can be set according to requirements.
  • the first event can be a specific operation event of the user on the target application.
  • the first adjustment value is obtained, and the cleaning weight is updated based on the first adjustment value (for example, the product of the first adjustment value and the existing cleaning weight is calculated) , get the updated cleaning weight), where the updated cleaning weight is greater than the cleaning weight before the update. This allows the cleaning weight to be adjusted when the first event is triggered.
  • the method further includes: if a second event is detected, obtaining a second adjustment value; The cleaning weight is updated based on the second adjustment value, wherein the cleaning weight after the update is smaller than the cleaning weight before the update.
  • the second event can be set according to requirements.
  • the second event can be a user's click event on the target application, etc.
  • the second adjustment value is obtained, and the cleaning weight is updated based on the second adjustment value (for example, the product of the second adjustment value and the existing cleaning weight is calculated) , get the updated cleaning weight), where the updated cleaning weight is smaller than the cleaning weight before the update. This allows the cleaning weight to be adjusted when the second event is triggered.
  • the method further includes: at the target time, obtaining the locally recorded target application Multiple target self-start times before the target time; calculate the adjacent time intervals of two adjacent target self-start times, and average the adjacent time intervals to obtain the target average; based on The target average value updates the cleaning weight, wherein, if the target average value is less than the first value, the cleaning weight after the update is greater than the cleaning weight before the update, and if the target average value is greater than the first value, the cleaning weight after the update is greater than the cleaning weight before the update. First value, the cleaning weight after the update is smaller than the cleaning weight before the update.
  • multiple target self-start times of the target application before the target time can be obtained at a subsequent target time point (which can be specified according to requirements), and the target average is calculated. value, further update the cleaning weight based on the target average value, where, if the target average value is less than the first value, the updated cleaning weight is greater than the cleaning weight before the update, if the target average value is greater than the first value, then the updated cleaning weight The weight is less than the clean weight before the update.
  • the cleaning weight after the update is greater than the cleaning weight before the update. If the target average value is greater than the first value, the cleaning weight after the update is less than the cleaning weight before the update.
  • the first value can be set according to requirements. Based on the setting of the first value, the initial cleaning weight can be adjusted to obtain an updated cleaning weight, further improving the reliability of the cleaning weight.
  • updating the cleaning weight based on the target average value includes: determining a size range in which the target average value is located; obtaining a preset adjustment value corresponding to the size range; and based on the preset adjustment value. Let the adjustment value update the cleaning weight.
  • the size range can include multiple, that is, different target averages can be matched to the corresponding size range.
  • Each size range is set with a corresponding preset adjustment value, and the preset adjustment value is used to adjust the cleaning weight.
  • the cleaning weight (gap) will be updated (updateGapBegin), and the adjustment value (scale1) required to update the cleaning weight (gap) may include the first adjustment value, the first adjustment value, and the first adjustment value (scale1).
  • the "updated cleaning weight (gap')" is equal to the "pre-updated cleaning weight (gap)” * adjustment value (scale1), update
  • the size of the final cleaning weight (gap') must be within the set interval, that is, MIN_GAP ⁇ gap' ⁇ MAX_GAP.
  • MIN_GAP 3s
  • gap’ MAX_GAP.
  • gap’ MIN_GAP.
  • the preset calculateGapScale method is shown in Figure 3.
  • the process can find the preset adjustment value scale2 corresponding to the target average avg, update the cleaning weight based on the preset adjustment value scale2 corresponding to the target average, and then the update is completed (updateGapFinish).
  • the first value can be 20S. If the target average value is less than the first value, the cleaning weight after the update is greater than the cleaning weight before the update. If the target average value is greater than the first value, the cleaning weight after the update is less than the cleaning weight before the update. The cleaning weight, and the degree of adjustment according to different size ranges.
  • step S140 a memory cleaning operation is performed on the target application according to the cleaning weight.
  • performing a memory cleaning operation on the target application according to the cleaning weight includes: if the cleaning weight is less than a predetermined threshold, performing memory cleaning processing on the target application; if the cleaning weight If it is greater than the predetermined threshold, the memory cleaning process of the target application will not be performed.
  • the cleaning weight is less than the predetermined threshold, it can indicate that the self-starting situation of the target application meets the cleaning requirements, and the target application will be memory cleaned during memory cleaning.
  • the cleaning weight is greater than the predetermined threshold, it can indicate the self-starting situation of the target application. It does not meet the cleaning requirements and does not perform memory cleaning on the target application.
  • corresponding cleaning operations can be performed for different applications based on the cleaning weight calculated from the startup time.
  • the cleanup weight is calculated in step S130, or after each updated cleanup weight is calculated, if the cleanup weight is greater than a predetermined threshold, the mark information of the target application is recorded in the memory cleanup table. ; When performing memory cleaning, if it is detected that the mark information exists in the memory cleaning table, perform memory cleaning processing on the target application.
  • the embodiment of the present application also provides a memory cleaning device based on the above memory cleaning method.
  • the meanings of the nouns are the same as in the above memory cleaning method.
  • Figure 3 shows a block diagram of a memory cleaning device according to an embodiment of the present application.
  • the memory cleaning device 200 may include a time acquisition module 210 , an interval calculation module 220 , a weight calculation module 230 and a cleaning control module 240 .
  • the time acquisition module 210 can be used to obtain multiple self-start times of the local target application; the interval calculation module 220 can be used to calculate the time intervals of the multiple self-start times; the weight calculation module 230 can be used to calculate the time intervals according to the multiple self-start times. Calculate the cleanup weight of the target application based on the time interval from the startup time; the cleanup control module 240 may be configured to perform a memory cleanup operation on the target application according to the cleanup weight.
  • the weight calculation module 230 is configured to: calculate an average of the time intervals of the plurality of self-start times; and determine a cleanup weight of the target application based on the average, wherein: The average value is inversely proportional to the cleaning weight, and the cleaning weight higher than a predetermined threshold is used to indicate that memory cleaning processing is not performed on the target application.
  • the device further includes a first update module, configured to: if a first event is detected, obtain a first adjustment value; and update the cleaning weight based on the first adjustment value, wherein , the cleaning weight after the update is greater than the cleaning weight before the update.
  • a first update module configured to: if a first event is detected, obtain a first adjustment value; and update the cleaning weight based on the first adjustment value, wherein , the cleaning weight after the update is greater than the cleaning weight before the update.
  • the device further includes a second update module, configured to: if a second event is detected, obtain a second adjustment value; and update the cleaning weight based on the second adjustment value, wherein , the cleaning weight after the update is smaller than the cleaning weight before the update.
  • a second update module configured to: if a second event is detected, obtain a second adjustment value; and update the cleaning weight based on the second adjustment value, wherein , the cleaning weight after the update is smaller than the cleaning weight before the update.
  • the device further includes a third update module, including: an update data acquisition unit configured to acquire multiple targets of the locally recorded target application before the target time at the target time. Self-start time; update the calculation unit for calculating the adjacent time intervals of two adjacent target self-start times, and average the adjacent time intervals to obtain the target average; update the processing unit with The cleaning weight is updated based on the target average value, wherein if the target average value is less than a first value, the cleaning weight after the update is greater than the cleaning weight before the update, and if the target average value is greater than If the first value is equal to the first value, the cleaning weight after the update is smaller than the cleaning weight before the update.
  • a third update module including: an update data acquisition unit configured to acquire multiple targets of the locally recorded target application before the target time at the target time. Self-start time; update the calculation unit for calculating the adjacent time intervals of two adjacent target self-start times, and average the adjacent time intervals to obtain the target average; update the processing unit with The cleaning weight is updated based on the target average value,
  • the update processing unit is configured to: determine the size range in which the target average value is located; obtain the preset adjustment value corresponding to the size range; update based on the preset adjustment value Said cleanup weights.
  • the cleanup control module 240 is configured to: if the cleanup weight is less than a predetermined threshold, perform memory cleanup processing on the target application; if the cleanup weight is greater than the predetermined threshold, perform memory cleanup processing on all target applications. Perform memory cleanup processing on the above target application.
  • embodiments of the present application also provide an electronic device, which may be a terminal or a server, as shown in Figure 5, which shows a schematic structural diagram of the electronic device involved in the embodiment of the present application. Specifically:
  • the electronic device may include components such as a processor 301 of one or more processing cores, a memory 302 of one or more computer-readable storage media, a power supply 303, and an input unit 304.
  • a processor 301 of one or more processing cores a memory 302 of one or more computer-readable storage media
  • a power supply 303 a power supply 303
  • an input unit 304 an input unit 304.
  • the processor 301 is the control center of the electronic device, using various interfaces and lines to connect various parts of the entire computer device, by running or executing software programs and/or modules stored in the memory 302, and calling software programs stored in the memory 302. Data, perform various functions of computer equipment and process data to provide overall monitoring of electronic equipment.
  • the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user pages, application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 301.
  • the memory 302 can be used to store software programs and modules.
  • the processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302 .
  • the memory 302 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store a program according to Data created by the use of computer equipment, etc.
  • memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302 .
  • the electronic device also includes a power supply 303 that supplies power to various components.
  • the power supply 303 can be logically connected to the processor 301 through a power management system, so that functions such as charging, discharging, and power consumption management can be implemented through the power management system.
  • the power supply 303 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
  • the electronic device may also include an input unit 304 that may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
  • an input unit 304 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
  • the electronic device may also include a display unit and the like, which will not be described again here.
  • the processor 301 in the electronic device will load the executable files corresponding to the processes of one or more computer programs into the memory 302 according to the following instructions, and the processor 301 will run the executable files stored in the computer program.
  • the computer program in the memory 302 can realize various functions in the aforementioned embodiments of the present application.
  • the processor 301 can perform the following steps:
  • the target application performs memory cleaning operations.
  • the processor 301 may perform: calculate the time intervals of the multiple self-start times. Average value; determine the cleaning weight of the target application according to the average value, wherein the average value is inversely proportional to the cleaning weight, and the cleaning weight higher than a predetermined threshold is used to indicate that the target application is not to be memory-based Cleanup process.
  • the processor 301 may execute: if the first event is detected, obtain a first adjustment value; updating the cleaning weight based on the first adjustment value, wherein the cleaning weight after the update is greater than the cleaning weight before the update.
  • the processor 301 may execute: if a second event is detected, obtain a second adjustment value; updating the cleaning weight based on the second adjustment value, wherein the cleaning weight after the update is smaller than the cleaning weight before the update.
  • the processor 301 may execute: at the target time, obtain the local record The target application has multiple target self-start times before the target time; calculate the adjacent time intervals of the two adjacent target self-start times, and average the adjacent time intervals to obtain Target average; update the cleaning weight based on the target average, wherein if the target average is less than the first value, the updated cleaning weight is greater than the cleaning weight before the update, if the target If the average value is greater than the first value, the cleaning weight after the update is smaller than the cleaning weight before the update.
  • the processor 301 may perform: determine the size range in which the target average value is located; obtain the preset value corresponding to the size range. Set an adjustment value; update the cleaning weight based on the preset adjustment value.
  • the processor 301 when performing a memory cleaning operation on the target application according to the cleaning weight, may perform: if the cleaning weight is less than a predetermined threshold, perform a memory cleaning operation on the target application. Cleaning processing; if the cleaning weight is greater than a predetermined threshold, memory cleaning processing will not be performed on the target application.
  • embodiments of the present application also provide a storage medium in which a computer program is stored, and the computer program can be loaded by the processor to execute steps in any method provided by the embodiments of the present application.
  • the storage medium may include: read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)

Abstract

本申请公开了一种内存清理方法、装置、存储介质及电子设备,涉及计算机技术领域,该方法包括:获取本地的目标应用的多个自启动时间;计算多个自启动时间的时间间隔;根据时间间隔计算清理权重;根据清理权重对目标应用进行内存清理操作。本申请可以避免统一不区分的应用内存清理,进而提升内存清理的效率及可靠性。

Description

内存清理方法、装置、存储介质及电子设备 技术领域
本申请涉及通信技术领域,具体涉及一种内存清理方法、装置、存储介质及电子设备。
背景技术
目前,各类终端的操作系统中通常会设置内存清理模块负责在系统内存不足时及时清理(如释放或回收)应用内存,但是,在对应用进行内存清理时会对统一不区分的清理终端中的应用内存,导致内存清理的效率较低,且清理可靠性较低。
技术问题
在对应用进行内存清理时会对统一不区分的清理终端中的应用内存,导致内存清理的效率较低,且清理可靠性较低。
技术解决方案
本申请实施例提供一种方案,可以提升内存清理的效率及可靠性。
本申请实施例提供以下技术方案:
根据本申请的一个实施例,一种内存清理方法,其包括:获取本地的目标应用的多个自启动时间;计算所述多个自启动时间的时间间隔;根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重;根据所述清理权重对所述目标应用进行内存清理操作。
在本申请的一些实施例中,所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重,包括:计算所述多个自启动时间的时间间隔的平均值;根据所述平均值确定所述目标应用的清理权重,其中,所述平均值与所述清理权重成反比,高于预定阈值的所述清理权重用于指示不对所述目标应用进行内存清理处理。
在本申请的一些实施例中,在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:若检测到第一事件,则获取第一调整值;基于所述第一调整值更新所述清理权重,其中,更新后的所述清理权重大于更新前的所述清理权重。
在本申请的一些实施例中,在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:若检测到第二事件,则获取第二调整值;基于所述第二调整值更新所述清理权重,其中,更新后的所述清理权重小于更新前的所述清理权重。
在本申请的一些实施例中,所述在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:在目标时刻,获取本地记录的所述目标应用在所述目标时刻之前的多个目标自启动时间;计算相邻的两个所述目标自启动时间的相邻时间间隔,并对所述相邻时间间隔求平均值,得到目标平均值;基于所述目标平均值更新所述清理权重,其中,若所述目标平均值小于第一值,则更新后的所述清理权重大于更新前的所述清理权重,若所述目标平均值大于所述第一值,则更新后的所述清理权重小于更新前的所述清理权重。
在本申请的一些实施例中,所述基于所述目标平均值更新所述清理权重,包括:确定所述目标平均值所在的大小范围;获取所述大小范围所对应的预设调整值;基于所述预设调整值更新所述清理权重。
在本申请的一些实施例中,所述根据所述清理权重对所述目标应用进行内存清理操作,包括:若所述清理权重小于预定阈值,则对所述目标应用进行内存清理处理;若所述清理权重大于预定阈值,则不对所述目标应用进行内存清理处理。
根据本申请的一个实施例,一种内存清理装置,其包括:时间获取模块,用于获取本地的目标应用的多个自启动时间;间隔计算模块,用于计算所述多个自启动时间的时间间隔;权重计算模块,用于根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重;清理控制模块,用于根据所述清理权重对所述目标应用进行内存清理操作。
根据本申请的另一实施例,一种存储介质,其上存储有计算机程序,当所述计算机程序被计算机的处理器执行时,使计算机执行本申请实施例所述的方法。
根据本申请的另一实施例,一种电子设备可以包括:存储器,存储有计算机程序;处理器,读取存储器存储的计算机程序,以执行本申请实施例所述的方法。
有益效果
本申请实施例中,获取本地的目标应用的多个自启动时间;计算所述多个自启动时间的时间间隔;根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重;根据所述清理权重对所述目标应用进行内存清理操作。
以这种方式,通过根据应用的自启动时间的时间间隔,基于时间间隔确定应用的清理权重来指示对应用进行内存清理操作,可以避免统一不区分的应用内存清理,进而提升内存清理的效率及可靠性。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了根据本申请的一个实施例的内存清理方法的流程图。
图2示出了根据本申请的一个实施例的权重更新处理流程图。
图3示出了根据本申请的一个实施例的权重更新处理流程图。
图4示出了根据本申请的一个实施例的内存清理装置的框图。
图5示出了根据本申请的一个实施例的电子设备的框图。
本发明的实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
图1示意性示出了根据本申请的一个实施例的内存清理方法的流程图。该内存清理方法的执行主体可以是任意的电子设备,例如智能电视或手机等。
如图1所示,该内存清理方法可以包括步骤S110至步骤S140。
步骤S110,获取本地的目标应用的多个自启动时间;步骤S120,计算所述多个自启动时间的时间间隔;步骤S130,根据所述时间间隔计算所述目标应用的清理权重;步骤S140,根据所述清理权重对所述目标应用进行内存清理操作。
多个自启动时间即至少2个自启动时间。自启动时间即应用自启动的时间点,而非由于用户触发等触发操作打开应用的时间点。本地可以针对目标应用仅记录应用自启的自启动时间,不记录用户打开该目标应用的时间。从本地的记录中可以获取目标应用的多个自启动时间。
通过计算相邻的两个自启动时间的间隔,可以计算出多个自启动时间的时间间隔。基于该时间间隔计算目标应用的清理权重,该清理权重为指示对目标应用进行内存清理的权重。
基于该清理权重对目标应用进行内存清理操作,可以在内存清理时根据该清理权重进行对应的内存清理权重,进而针对不同自启动情况的应用根据对应的清理权重进行清理。
以这种方式,基于步骤S110至步骤S140,通过根据应用的自启动时间的时间间隔,基于时间间隔确定应用的清理权重来指示对应用进行内存清理操作,可以避免统一不区分的应用内存清理,进而提升内存清理的效率及可靠性。
下面描述进行内存清理时,所进行的各步骤的具体过程。
在步骤S110中,获取本地的目标应用的多个自启动时间。
多个自启动时间即至少2个自启动时间。自启动时间即应用自启动的时间点,而非由于用户触发等触发操作打开应用的时间点。目标应用每次自启动时,均可记录相应的自启动时间。可选地,本地可以针对目标应用仅记录应用自启的自启动时间,不记录用户打开该目标应用的时间。从本地的记录中可以获取目标应用的多个自启动时间。
在步骤S120中,计算所述多个自启动时间的时间间隔。
通过计算相邻的两个自启动时间的间隔,可以计算出多个自启动时间的时间间隔。
一个示例中,多个自启动时间的时间间隔具体可以包含该多个自启动时间中每两个相邻的自启动时间之间的时间间隔。可以依次计算所有的相邻的两个自启动时间的时间间隔,得到多个时间间隔,即多个自启动时间的时间间隔包含该多个时间间隔。
一个示例中,多个自启动时间的时间间隔可以包含该多个自启动时间中部分相邻的两个自启动时间之间的时间间隔。可以从多个自启动时间中选取预定数量个连续的自启动时间,然后,计算相邻的两个自启动时间的时间间隔,得到多个时间间隔,即多个自启动时间的时间间隔包含该多个时间间隔。
在步骤S130中,根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重。
一种实施例中,步骤S130,所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重,包括:将所述多个自启动时间的时间间隔及所述目标应用的应用信息(例如应用标识)输入基于机器学习的分析模型,得到所述分析模型输出的清理权重。
其中该分析模型可以是决策树模型或神经网络模型等,分析模型可以以训练样本(每个训练样本可以包括一个应用对应的时间间隔以及应用信息)作为输入,训练样本对应的清理权重标签作为期望输出进行训练,得到的训练后的分析模型,这样可以基于机器学习进行清理权重的自动可靠评估,进一步提升清理权重的可靠性。
一种实施例中,步骤S130,根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重,包括:计算所述多个自启动时间的时间间隔的平均值;根据所述平均值确定所述目标应用的清理权重,其中,所述平均值与所述清理权重成反比,高于预定阈值的所述清理权重用于指示不对所述目标应用进行内存清理操作。
计算多个自启动时间的时间间隔的平均值,即计算多个时间间隔的平均值,基于该平均值可以反映目标应用的自启动的频繁程度,平均值越小对应的自启动越频繁,进而基于该平均值计算清理权重即根据自启动的频繁程度计算一个清理权重。其中,清理权重可以基于预定公式计算或基于预定查询表匹配计算得到。
该平均值与清理权重成反比,即自启动的频繁程度越高对应的清理权重越高,进一步的,高于预定阈值的清理权重用于指示不对目标应用进行内存清理操作,也即可以对频繁自启动的应用不进行内存清理处理。
以这种方式,可以避免在设备中进行内存清理时,对频繁自启动的应用进行清理,提升内存清理效率及清理效果。
一种实施例中,在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:若检测到第一事件,则获取第一调整值;基于所述第一调整值更新所述清理权重,其中,更新后的所述清理权重大于更新前的所述清理权重。
第一事件可以根据需求设定,例如第一事件可以时用户对目标应用的特定操作事件。在步骤S130中计算到初始的清理权重后,每次检测到第一事件,则获取第一调整值,基于第一调整值更新清理权重(例如计算第一调整值与已有的清理权重的乘积,得到更新后的清理权重),其中,更新后的清理权重大于更新前的清理权重。这样可以在第一事件的触发下调节清理权重。
一种实施例中,在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:若检测到第二事件,则获取第二调整值;基于所述第二调整值更新所述清理权重,其中,更新后的所述清理权重小于更新前的所述清理权重。
第二事件可以根据需求设定,例如第二事件可以时用户对目标应用的点击事件等。在步骤S130中计算到初始的清理权重后,每次检测到第二事件,则获取第二调整值,基于第二调整值更新清理权重(例如计算第二调整值与已有的清理权重的乘积,得到更新后的清理权重),其中,更新后的清理权重小于更新前的清理权重。这样可以在第二事件的触发下调节清理权重。
一种实施例中,所述在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:在目标时刻,获取本地记录的所述目标应用在所述目标时刻之前的多个目标自启动时间;计算相邻的两个所述目标自启动时间的相邻时间间隔,并对所述相邻时间间隔求平均值,得到目标平均值;基于所述目标平均值更新所述清理权重,其中,若所述目标平均值小于第一值,则更新后的所述清理权重大于更新前的所述清理权重,若所述目标平均值大于所述第一值,则更新后的所述清理权重小于更新前的所述清理权重。
该实施例下,在步骤S130中计算到初始的清理权重后,可以在后续的某个目标时刻点(可以根据需求指定)获取目标应用在目标时刻之前的多个目标自启动时间,计算目标平均值,进一步的基于目标平均值更新清理权重,其中,若目标平均值小于第一值,则更新后的清理权重大于更新前的清理权重,若目标平均值大于第一值,则更新后的清理权重小于更新前的清理权重。
若目标平均值小于第一值,则更新后的清理权重大于更新前的清理权重,若目标平均值大于第一值,则更新后的清理权重小于更新前的清理权重。第一值可以根据需求设定,基于设定第一值,可以对初始的清理权重进行调整,得到更新后的清理权重,进一步提升清理权重的可靠性。
一种实施例中,所述基于所述目标平均值更新所述清理权重,包括:确定所述目标平均值所在的大小范围;获取所述大小范围所对应的预设调整值;基于所述预设调整值更新所述清理权重。
大小范围可以包括多个,即不同的目标平均值可以匹配到对应的大小范围。每个大小范围设置有对应的预设调整值,预设调整值用于对清理权重进行调整。
进一步的,一种实施例中,参阅图2,步骤S130之后会进行清理权重(gap)更新(updateGapBegin),更新清理权重(gap)所需要的调整值(scale1,可以包括第一调整值、第二调整值以及预设调整值)由预设的calculateGapScale方法计算得出后,“更新后的清理权重(gap’)”等于“更新前的清理权重(gap)”*调整值(scale1),更新后的清理权重(gap’)的大小必须在所设定的区间内,即MIN_GAP≤gap’≤MAX_GAP。
其中,一种优化实施例中,MIN_GAP =3s,MAX_GAP=3*16*1024=49152s。进而,若更新后的gap’值大于MAX_GAP,则gap’= MAX_GAP,若更新后的gap’值小于MIN_GAP,则gap’=MIN_GAP。
一种实施例中,预设的calculateGapScale方法参阅图3所示,大小范围可以包括X1至X6,其中:0S≤X1<5S,对应的预设调整值scale2=8;5S≤X2<10S,对应的预设调整值scale2=4;10S≤X3<20S,对应的预设调整值scale2=2;20S≤X4<40S,对应的预设调整值scale2=0.5;40S≤X5<90S,对应的预设调整值scale2=0.25;90S≤X6,对应的预设调整值scale2=0.125。
在获取目标应用在目标时刻之前的多个目标自启动时间计算目标平均值(即计算自启动时间记录表(RestartGapTimeList)中多个目标自启动时间的目标平均值avg)之后,根据图3所示的流程可以找到目标平均值avg对应的预设调整值scale2,基于目标平均值对应的预设调整值scale2更新清理权重,进而更新完成(updateGapFinish)。
此时,第一值可以是20S,若目标平均值小于第一值,则更新后的清理权重大于更新前的清理权重,若目标平均值大于第一值,则更新后的清理权重小于更新前的清理权重,且根据不同的大小范围调整的程度。
在步骤S140中,根据所述清理权重对所述目标应用进行内存清理操作。
一种实施例中,所述根据所述清理权重对所述目标应用进行内存清理操作,包括:若所述清理权重小于预定阈值,则对所述目标应用进行内存清理处理;若所述清理权重大于预定阈值,则不对所述目标应用进行内存清理处理。
若所述清理权重小于预定阈值,可以指示目标应用的自启动情况符合清理要求,则在内存清理时对目标应用进行内存清理,相反,若清理权重大于预定阈值,可以指示目标应用的自启动情况不符合清理要求,不对目标应用进行内存清理处理。根据设定的预定阈值,可以针对不同的应用可以基于自启动时间计算的清理权重进行对应的清理操作。
进一步的,一种实施例中,步骤S130中计算到清理权重之后,或每次计算到更新后的清理权重后,若清理权重大于预定阈值,则将目标应用的标记信息记录在内存清理表中;在进行内存清理时,若检测到内存清理表中存在所述标记信息,则对目标应用执行内存清处理。
为便于更好的实施本申请实施例提供的内存清理方法,本申请实施例还提供一种基于上述内存清理方法的内存清理装置。其中名词的含义与上述内存清理方法中相同,具体实现细节可以参考方法实施例中的说明。图3示出了根据本申请的一个实施例的内存清理装置的框图。
如图4所示,内存清理装置200中可以包括时间获取模块210、间隔计算模块220、权重计算模块230以及清理控制模块240。
时间获取模块210可以用于获取本地的目标应用的多个自启动时间;间隔计算模块220可以用于计算所述多个自启动时间的时间间隔;权重计算模块230可以用于根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重;清理控制模块240可以用于根据所述清理权重对所述目标应用进行内存清理操作。
在本申请的一些实施例中,所述权重计算模块230用于:计算所述多个自启动时间的时间间隔的平均值;根据所述平均值确定所述目标应用的清理权重,其中,所述平均值与所述清理权重成反比,高于预定阈值的所述清理权重用于指示不对所述目标应用进行内存清理处理。
在本申请的一些实施例中,所述装置还包括第一更新模块,用于:若检测到第一事件,则获取第一调整值;基于所述第一调整值更新所述清理权重,其中,更新后的所述清理权重大于更新前的所述清理权重。
在本申请的一些实施例中,所述装置还包括第二更新模块,用于:若检测到第二事件,则获取第二调整值;基于所述第二调整值更新所述清理权重,其中,更新后的所述清理权重小于更新前的所述清理权重。
在本申请的一些实施例中,所述装置还包括第三更新模块,包括:更新数据获取单元,用于在目标时刻,获取本地记录的所述目标应用在所述目标时刻之前的多个目标自启动时间;更新计算单元,用于计算相邻的两个所述目标自启动时间的相邻时间间隔,并对所述相邻时间间隔求平均值,得到目标平均值;更新处理单元,用于基于所述目标平均值更新所述清理权重,其中,若所述目标平均值小于第一值,则更新后的所述清理权重大于更新前的所述清理权重,若所述目标平均值大于所述第一值,则更新后的所述清理权重小于更新前的所述清理权重。
在本申请的一些实施例中,所述更新处理单元,用于:确定所述目标平均值所在的大小范围;获取所述大小范围所对应的预设调整值;基于所述预设调整值更新所述清理权重。
在本申请的一些实施例中,所述清理控制模块240用于:若所述清理权重小于预定阈值,则对所述目标应用进行内存清理处理;若所述清理权重大于预定阈值,则不对所述目标应用进行内存清理处理。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
此外,本申请实施例还提供一种电子设备,该电子设备可以为终端或者服务器,如图5所示,其示出了本申请实施例所涉及的电子设备的结构示意图,具体来讲:
该电子设备可以包括一个或者一个以上处理核心的处理器301、一个或一个以上计算机可读存储介质的存储器302、电源303和输入单元304等部件。本领域技术人员可以理解,图5中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
处理器301是该电子设备的控制中心,利用各种接口和线路连接整个计算机设备的各个部分,通过运行或执行存储在存储器302内的软件程序和/或模块,以及调用存储在存储器302内的数据,执行计算机设备的各种功能和处理数据,从而对电子设备进行整体监控。可选的,处理器301可包括一个或多个处理核心;优选的,处理器301可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户页面和应用程序等,调制解调处理器主要处理无线通讯。可以理解的是,上述调制解调处理器也可以不集成到处理器301中。
存储器302可用于存储软件程序以及模块,处理器301通过运行存储在存储器302的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器302可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备的使用所创建的数据等。此外,存储器302可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器302还可以包括存储器控制器,以提供处理器301对存储器302的访问。
电子设备还包括给各个部件供电的电源303,优选的,电源303可以通过电源管理系统与处理器301逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源303还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
该电子设备还可包括输入单元304,该输入单元304可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。
尽管未示出,电子设备还可以包括显示单元等,在此不再赘述。具体在本实施例中,电子设备中的处理器301会按照如下的指令,将一个或一个以上的计算机程序的进程对应的可执行文件加载到存储器302中,并由处理器301来运行存储在存储器302中的计算机程序,从而实现本申请前述实施例中各种功能,如处理器301可以执行下述步骤:
获取本地的目标应用的多个自启动时间;计算所述多个自启动时间的时间间隔;根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重;根据所述清理权重对所述目标应用进行内存清理操作。
在本申请的一些实施例中,所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重时,处理器301可以执行:计算所述多个自启动时间的时间间隔的平均值;根据所述平均值确定所述目标应用的清理权重,其中,所述平均值与所述清理权重成反比,高于预定阈值的所述清理权重用于指示不对所述目标应用进行内存清理处理。
在本申请的一些实施例中,在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述处理器301可以执行:若检测到第一事件,则获取第一调整值;基于所述第一调整值更新所述清理权重,其中,更新后的所述清理权重大于更新前的所述清理权重。
在本申请的一些实施例中,在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述处理器301可以执行:若检测到第二事件,则获取第二调整值;基于所述第二调整值更新所述清理权重,其中,更新后的所述清理权重小于更新前的所述清理权重。
在本申请的一些实施例中,所述在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述处理器301可以执行:在目标时刻,获取本地记录的所述目标应用在所述目标时刻之前的多个目标自启动时间;计算相邻的两个所述目标自启动时间的相邻时间间隔,并对所述相邻时间间隔求平均值,得到目标平均值;基于所述目标平均值更新所述清理权重,其中,若所述目标平均值小于第一值,则更新后的所述清理权重大于更新前的所述清理权重,若所述目标平均值大于所述第一值,则更新后的所述清理权重小于更新前的所述清理权重。
在本申请的一些实施例中,所述基于所述目标平均值更新所述清理权重时,处理器301可以执行:确定所述目标平均值所在的大小范围;获取所述大小范围所对应的预设调整值;基于所述预设调整值更新所述清理权重。
在本申请的一些实施例中,所述根据所述清理权重对所述目标应用进行内存清理操作时,处理器301可以执行:若所述清理权重小于预定阈值,则对所述目标应用进行内存清理处理;若所述清理权重大于预定阈值,则不对所述目标应用进行内存清理处理。
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过计算机程序来完成,或通过计算机程序控制相关的硬件来完成,该计算机程序可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。
为此,本申请实施例还提供一种存储介质,其中存储有计算机程序,该计算机程序能够被处理器进行加载,以执行本申请实施例所提供的任一种方法中的步骤。
其中,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。
由于该存储介质中所存储的计算机程序,可以执行本申请实施例所提供的任一种方法中的步骤,因此,可以实现本申请实施例所提供的方法所能实现的有益效果,详见前面的实施例,在此不再赘述。
本领域技术人员在考虑说明书及实践这里公开的实施方式后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的实施例,而可以在不脱离其范围的情况下进行各种修改和改变。

Claims (20)

  1. 一种内存清理方法,其中,包括:
    获取本地的目标应用的多个自启动时间;
    计算所述多个自启动时间的时间间隔;
    根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重;
    根据所述清理权重对所述目标应用进行内存清理操作。
  2. 根据权利要求1所述的方法,其中,所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重,包括:
    计算所述多个自启动时间的时间间隔的平均值;
    根据所述平均值确定所述目标应用的清理权重,其中,所述平均值与所述清理权重成反比,高于预定阈值的所述清理权重用于指示不对所述目标应用进行内存清理处理。
  3. 根据权利要求1所述的方法,其中,在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:
    若检测到第一事件,则获取第一调整值;
    基于所述第一调整值更新所述清理权重,其中,更新后的所述清理权重大于更新前的所述清理权重。
  4. 根据权利要求1所述的方法,其中,在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:
    若检测到第二事件,则获取第二调整值;
    基于所述第二调整值更新所述清理权重,其中,更新后的所述清理权重小于更新前的所述清理权重。
  5. 根据权利要求1所述的方法,其中,所述在所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重之后,所述方法还包括:
    在目标时刻,获取本地记录的所述目标应用在所述目标时刻之前的多个目标自启动时间;
    计算相邻的两个所述目标自启动时间的相邻时间间隔,并对所述相邻时间间隔求平均值,得到目标平均值;
    基于所述目标平均值更新所述清理权重,其中,若所述目标平均值小于第一值,则更新后的所述清理权重大于更新前的所述清理权重,若所述目标平均值大于所述第一值,则更新后的所述清理权重小于更新前的所述清理权重。
  6. 根据权利要求1所述的方法,其中,所述基于所述目标平均值更新所述清理权重,包括:
    确定所述目标平均值所在的大小范围;
    获取所述大小范围所对应的预设调整值;
    基于所述预设调整值更新所述清理权重。
  7. 根据权利要求2所述的方法,其中,所述根据所述清理权重对所述目标应用进行内存清理操作,包括:
    若所述清理权重小于预定阈值,则对所述目标应用进行内存清理处理;
    若所述清理权重大于预定阈值,则不对所述目标应用进行内存清理处理。
  8. 根据权利要求1所述的方法,其中,所述多个自启动时间的时间间隔包含所述多个自启动时间中每两个相邻的自启动时间之间的时间间隔。
  9. 根据权利要求1所述的方法,其中,所述多个自启动时间的时间间隔包含多个自启动时间中部分相邻的两个自启动时间之间的时间间隔。
  10. 根据权利要求1所述的方法,其中,所述根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重,包括:
    将所述多个自启动时间的时间间隔及所述目标应用的应用信息输入基于机器学习的分析模型,得到所述分析模型输出的清理权重。
  11. 根据权利要求1所述的方法,其中,所述方法还包括:
    若所述清理权重大于预定阈值,则将所述目标应用的标记信息记录在内存清理表中;
    在进行内存清理时,若检测到所述内存清理表中存在所述标记信息,则对所述目标应用执行内存清处理。
  12. 一种内存清理装置,其中,包括:
    时间获取模块,用于获取本地的目标应用的多个自启动时间;
    间隔计算模块,用于计算所述多个自启动时间的时间间隔;
    权重计算模块,用于根据所述多个自启动时间的时间间隔计算所述目标应用的清理权重;
    清理控制模块,用于根据所述清理权重对所述目标应用进行内存清理操作。
  13. 根据权利要求12所述的装置,其中,所述权重计算模块用于:计算所述多个自启动时间的时间间隔的平均值;根据所述平均值确定所述目标应用的清理权重,其中,所述平均值与所述清理权重成反比,高于预定阈值的所述清理权重用于指示不对所述目标应用进行内存清理处理。
  14. 根据权利要求12所述的装置,其中,所述装置还包括第一更新模块,用于:若检测到第一事件,则获取第一调整值;基于所述第一调整值更新所述清理权重,其中,更新后的所述清理权重大于更新前的所述清理权重。
  15. 根据权利要求12所述的装置,其中,所述装置还包括第二更新模块,用于:若检测到第二事件,则获取第二调整值;基于所述第二调整值更新所述清理权重,其中,更新后的所述清理权重小于更新前的所述清理权重。
  16. 根据权利要求12所述的装置,其中,所述装置还包括第三更新模块,包括:更新数据获取单元,用于在目标时刻,获取本地记录的所述目标应用在所述目标时刻之前的多个目标自启动时间;更新计算单元,用于计算相邻的两个所述目标自启动时间的相邻时间间隔,并对所述相邻时间间隔求平均值,得到目标平均值;更新处理单元,用于基于所述目标平均值更新所述清理权重,其中,若所述目标平均值小于第一值,则更新后的所述清理权重大于更新前的所述清理权重,若所述目标平均值大于所述第一值,则更新后的所述清理权重小于更新前的所述清理权重。
  17. 根据权利要求12所述的装置,其中,所述更新处理单元,用于:确定所述目标平均值所在的大小范围;获取所述大小范围所对应的预设调整值;基于所述预设调整值更新所述清理权重。
  18. 根据权利要求13所述的装置,其中,所述清理控制模块用于:若所述清理权重小于预定阈值,则对所述目标应用进行内存清理处理;若所述清理权重大于预定阈值,则不对所述目标应用进行内存清理处理。
  19. 一种存储介质,其中,其上存储有计算机程序,当所述计算机程序被计算机的处理器执行时,使计算机执行权利要求1至11任一项所述的方法。
  20. 一种电子设备,其中,包括:存储器,存储有计算机程序;处理器,读取存储器存储的计算机程序,以执行权利要求1至11任一项所述的方法。
PCT/CN2023/076506 2022-03-09 2023-02-16 内存清理方法、装置、存储介质及电子设备 WO2023169173A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210223782.X 2022-03-09
CN202210223782.XA CN114647509A (zh) 2022-03-09 2022-03-09 内存清理方法、装置、存储介质及电子设备

Publications (1)

Publication Number Publication Date
WO2023169173A1 true WO2023169173A1 (zh) 2023-09-14

Family

ID=81993692

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/076506 WO2023169173A1 (zh) 2022-03-09 2023-02-16 内存清理方法、装置、存储介质及电子设备

Country Status (2)

Country Link
CN (1) CN114647509A (zh)
WO (1) WO2023169173A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114647509A (zh) * 2022-03-09 2022-06-21 深圳Tcl新技术有限公司 内存清理方法、装置、存储介质及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293924A (zh) * 2015-05-20 2017-01-04 Tcl集团股份有限公司 安卓系统的内存管理方法及装置
CN106325990A (zh) * 2016-08-19 2017-01-11 宇龙计算机通信科技(深圳)有限公司 应用程序的控制方法、控制装置和终端
CN106445664A (zh) * 2016-09-18 2017-02-22 深圳市邦华电子有限公司 一种应用程序管理方法和装置
CN107179930A (zh) * 2017-06-12 2017-09-19 广东小天才科技有限公司 一种应用卸载推荐方法及装置
CN114647509A (zh) * 2022-03-09 2022-06-21 深圳Tcl新技术有限公司 内存清理方法、装置、存储介质及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106293924A (zh) * 2015-05-20 2017-01-04 Tcl集团股份有限公司 安卓系统的内存管理方法及装置
CN106325990A (zh) * 2016-08-19 2017-01-11 宇龙计算机通信科技(深圳)有限公司 应用程序的控制方法、控制装置和终端
CN106445664A (zh) * 2016-09-18 2017-02-22 深圳市邦华电子有限公司 一种应用程序管理方法和装置
CN107179930A (zh) * 2017-06-12 2017-09-19 广东小天才科技有限公司 一种应用卸载推荐方法及装置
CN114647509A (zh) * 2022-03-09 2022-06-21 深圳Tcl新技术有限公司 内存清理方法、装置、存储介质及电子设备

Also Published As

Publication number Publication date
CN114647509A (zh) 2022-06-21

Similar Documents

Publication Publication Date Title
US7137115B2 (en) Method for controlling multithreading
US8516462B2 (en) Method and apparatus for managing a stack
JP5524117B2 (ja) 自動負荷検出に基づく電力管理
CN102597912B (zh) 用于平台功率节省的协调设备和应用程序中断事件
US11144330B2 (en) Algorithm program loading method and related apparatus
WO2023169173A1 (zh) 内存清理方法、装置、存储介质及电子设备
WO2023115999A1 (zh) 设备状态监控方法、装置、设备及计算机可读存储介质
CN107885545B (zh) 应用管理方法、装置、存储介质及电子设备
WO2023169171A1 (zh) 进程管控方法、装置、存储介质及电子设备
KR20110097859A (ko) 장치와, 이 장치의 전력 소비를 관리하는 방법 및 컴퓨터 판독가능 저장 매체
CN107797832B (zh) 应用清理方法、装置、存储介质及电子设备
US20130339639A1 (en) Tracking ownership of memory in a data processing system through use of a memory monitor
CN107844859B (zh) 基于人工智能的大型医疗设备能耗预测方法和终端设备
CN111381953B (zh) 进程管理方法、装置、存储介质及电子设备
CN106648916B (zh) 计步器消息的上报方法及装置
WO2020224218A1 (zh) 基于hbase的数据写入方法、系统、装置及可读存储介质
WO2024021494A1 (zh) 软件服务的处理方法、电子设备及存储介质
CN107748711A (zh) 自动优化Storm并行度的方法、终端设备及存储介质
CN112463626B (zh) 内存泄漏定位方法、装置、计算机设备及存储介质
US7870370B2 (en) Determining thermal characteristics of instruction sets
CN109961796B (zh) 音频数据处理方法、装置和存储介质
CN113419795B (zh) 调用关系的展示方法、装置、计算机设备及存储介质
CN115098017B (zh) 数据的处理方法、装置、电子设备及存储介质
CN111376248B (zh) 机器人、机器人的决策方法及终端设备
CN114625543A (zh) 内存管理方法、装置、存储介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23765751

Country of ref document: EP

Kind code of ref document: A1