Memory reclamation method and apparatus, electronic device, and storage medium

By recycling memory according to the corresponding memory requirements and display probability in the second interface in the electronic device, the problem of device lag is solved, the flexibility and efficiency of memory recovery are improved, and the smooth operation of the device is ensured.

WO2024245175A1PCT designated stage expired Publication Date: 2024-12-05VIVO MOBILE COMM CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/095398
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-01
Filing Date
2024-05-27
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

In electronic devices, when the memory occupied by the file is recycled, if the file needs to be reloaded at the next moment, the electronic devices need to reallocate memory, resulting in a long process of loading the file and causing the device to stutter.

Method used

By obtaining the memory and confidence corresponding to the N second interfaces respectively when displaying the first interface, memory recovery is performed based on this information, ensuring that the amount and type of memory recovery matches the requirements of the next moment, and avoiding excessive recovery.

Benefits of technology

It reduces the lag problem of electronic devices, improves the flexibility and efficiency of memory recycling, and ensures the smooth operation of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024095398_05122024_PF_FP_ABST
    Figure CN2024095398_05122024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electronics, and discloses a memory reclamation method and apparatus, an electronic device, and a storage medium. The method comprises: when an electronic device displays a first interface, acquiring N first memories respectively corresponding to N second interfaces and N first confidence levels respectively corresponding to the N second interfaces, the N first confidence levels being probabilities respectively corresponding to displaying the N second interfaces within a first predetermined time period; and according to the N first memories and the N first confidence levels, obtaining a second memory by means of reclamation, wherein N is an integer greater than or equal to 1.
Need to check novelty before this filing date? Find Prior Art

Description

Memory recycling method, device, electronic device and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on June 1, 2023, with application number 202310646867.3 and entitled “Memory Recovery Method, Device, Electronic Device and Storage Medium,” the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application belongs to the field of electronic technology, and specifically relates to a memory recovery method, device, electronic device and storage medium. Background Art

[0004] Currently, electronic devices can recycle memory to ensure smooth operation. In related technologies, when the current remaining available memory in an electronic device is lower than a preset threshold, the electronic device can recycle the memory occupied by files in the electronic device to ensure smooth operation of the electronic device.

[0005] However, in the above method, after the electronic device reclaims the memory occupied by the file, if the electronic device needs to use the recycled file at the next moment, the electronic device needs to reallocate memory for the file whose memory has just been recycled. Since the electronic device has already recycled the memory corresponding to the file at the previous moment, the process of loading the file by the electronic device is longer, thus causing the electronic device to freeze.

[0006] Summary of the Invention

[0007] The purpose of the embodiments of the present application is to provide a memory recovery method, device, electronic device and storage medium, which can reduce the problem of electronic device freezing.

[0008] In a first aspect, an embodiment of the present application provides a memory recovery method, which includes: when the electronic device displays a first interface, obtaining N first memories corresponding to N second interfaces, and N first confidences corresponding to the N second interfaces, the N first confidences being the probabilities of displaying the N second interfaces within a first predetermined time period; recovering the second memory based on the N first memories and the N first confidences; wherein N is an integer greater than or equal to 1.

[0009] In a second aspect, an embodiment of the present application provides a memory recovery device, which includes: an acquisition module and a recovery module. The acquisition module is used to obtain N first memories corresponding to N second interfaces and N first confidences corresponding to the N second interfaces when the electronic device displays the first interface, and the N first confidences are the probabilities of displaying the N second interfaces within a first predetermined time period. The recovery module is used to recover the second memory based on the N first memories and the N first confidences; wherein N is an integer greater than or equal to 1.

[0010] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0011] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0012] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.

[0013] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method described in the first aspect.

[0014] In an embodiment of the present application, when displaying the first interface of the first application, the electronic device can obtain N first memories corresponding to the N second interfaces, and N first confidence levels corresponding to the N second interfaces, and then reclaim the second memory based on the N first memories and the N first confidence levels. In this solution, since memory can be reclaimed based on the memory requirements of the N second interfaces and the probability of the N second interfaces being displayed at the next moment, this ensures that the electronic device does not reclaim excessive memory and reduces the problem of electronic device lag. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] FIG1 is a flowchart of a memory recovery method according to an embodiment of the present invention;

[0016] FIG2 is a second flowchart of a memory recovery method provided in an embodiment of the present application;

[0017] FIG3 is a third flowchart of a memory recovery method provided in an embodiment of the present application;

[0018] FIG4 is a fourth flowchart of a memory recovery method provided in an embodiment of the present application;

[0019] FIG5 is a fifth flowchart of a memory recovery method provided in an embodiment of the present application;

[0020] FIG6 is a schematic structural diagram of a memory recycling device provided in an embodiment of the present application;

[0021] FIG7 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application;

[0022] FIG8 is a second schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. Specific embodiments

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

[0024] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0025] The following is an explanation of the professional terms involved in this application.

[0026] Memory: This application refers to the running memory, that is, when the application needs to run, the electronic device can load the application from the storage, such as the hard disk, to the running memory so that it can be called by the central processing unit (CPU).

[0027] Remaining available memory: The amount of running memory currently available for use by other applications. For example, the remaining available memory in a device can be divided into memfree and file cache. Memfree is completely idle memory, to which data can be written directly when needed. File cache is file pages cached by the system. When needed, the memory recycling thread writes files back to disk, turning cache memory into free memory that can then be used by applications.

[0028] Hot files: When an application is running, some files need to be loaded into memory for use, such as code segments and files that need to be read or written. Some files are operated frequently and are called hot files.

[0029] The memory recycling method provided in the embodiment of the present application is described in detail below with reference to specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0030] The memory recovery method provided in the embodiment of the present application may be executed by a memory recovery device, which may be an electronic device or a functional module in the electronic device. The technical solution provided in the embodiment of the present application is described below using an electronic device as an example.

[0031] The present invention provides a memory recovery method, and Figure 1 shows a flowchart of the memory recovery method provided by the present invention. As shown in Figure 1, the memory recovery method provided by the present invention may include the following steps 201 and 202.

[0032] Step 201: When the electronic device displays a first interface, the electronic device obtains N first memories corresponding to N second interfaces, and N first confidences corresponding to the N second interfaces.

[0033] In some embodiments of the present application, the N first confidence levels are probabilities corresponding to displaying the N second interfaces within a first predetermined time period.

[0034] Optionally, in some embodiments of the present application, the first memory includes: a memory size required to display the second interface and a memory type corresponding to the memory.

[0035] In some embodiments of the present application, when the electronic device displays the first interface, the electronic device can obtain N first memories corresponding to the N second interfaces and N first confidences corresponding to the N second interfaces based on historical usage information corresponding to the N second interfaces.

[0036] Optionally, in some embodiments of the present application, the above-mentioned historical usage information includes at least one of the following: the running time of the application corresponding to the second interface, the time of displaying the second interface, the amount of memory required to display the second interface, and the memory type of the memory amount.

[0037] Optionally, in some embodiments of the present application, the above historical usage information may be stored in an electronic device or a server.

[0038] Optionally, in an embodiment of the present application, the first interface and the second interface are user interfaces of the same application.

[0039] Exemplarily, in the case where the first interface and the second interface can be user interfaces of the same application, based on an embodiment of the present application, the electronic device can predict the first memory required for other interfaces in the first application while displaying the first interface.

[0040] Optionally, in some embodiments of the present application, the first interface and the second interface may be user interfaces of different applications.

[0041] For example, when the first interface and the second interface can be user interfaces of different applications, based on an embodiment of the present application, the electronic device can predict the first memory required to run the second application corresponding to the second interface when the first application corresponding to the first interface is running.

[0042] Optionally, in some embodiments of the present application, the first memory may further include memory required to run the second application and a corresponding memory type.

[0043] Optionally, in some embodiments of the present application, the first interface may be any interface in any application on a desktop or electronic device.

[0044] Exemplarily, when the electronic device displays a desktop, the user can perform a first input on a first application icon on the desktop, so that the electronic device can run a first application corresponding to the first application icon and display a first interface of the first application.

[0045] Optionally, in some embodiments of the present application, the first input performed by the user on the first application icon on the desktop may be any of the following: click input, slide input, preset track input, long press input, etc. The specific input may be determined according to the usage situation and is not limited in the embodiments of the present application.

[0046] Optionally, in some embodiments of the present application, the second interface may be any interface of an application running on the desktop or in the background, or any interface of an application not running.

[0047] In the embodiment of the present application, the N first confidence levels corresponding to the above-mentioned N second interfaces can be determined according to the time period of the user's historical use of each second interface and the user's historical operation sequence on each second interface.

[0048] Specifically, for each second interface among the N second interfaces and the first confidence level corresponding to each second interface, after obtaining the time period in which the user has used each second interface in history (hereinafter referred to as the first information) and the order in which the user has operated each second interface in history (hereinafter referred to as the second information), the electronic device can input the first information and the second information into the first algorithm to obtain the first confidence level corresponding to each second interface.

[0049] Optionally, in some embodiments of the present application, the first algorithm may be any one of the following: an artificial intelligence (AI) algorithm, a feedback neural network algorithm, or a convolutional neural network algorithm.

[0050] Exemplarily, the first confidence level may be a probability value. For example, the probability that the user runs the interface associated with the function control corresponding to the contact at the next moment is 80%.

[0051] Optionally, in some embodiments of the present application, in combination with Figure 1, as shown in Figure 2, the "electronic device obtains N first memories corresponding to N second interfaces respectively" in the above step 201 can be specifically implemented through the following steps 201a and 201b.

[0052] Step 201a: For each of the N second interfaces, the electronic device determines a memory type corresponding to each second interface and a memory size required by each second interface.

[0053] Optionally, in some embodiments of the present application, when the first interface and N second interfaces are user interfaces of the same application, when the electronic device displays the first interface, the electronic device can analyze the content in the N second interfaces in a targeted manner, thereby obtaining interface information corresponding to the N second interfaces respectively, and then obtain the memory requirements and memory types corresponding to the N second interfaces based on the interface information corresponding to the N second interfaces.

[0054] In some embodiments of the present application, the above-mentioned target method may include any of the following: an AI algorithm or a neural network algorithm.

[0055] Exemplarily, the electronic device may analyze the content in the second interface by: obtaining the number of windows included in the second interface, obtaining the number of arrays included in the second interface, obtaining the number of images included in the second interface, and obtaining the resolution of the images included in the second interface, etc.

[0056] It should be noted that the above-mentioned image refers to a broad concept, that is, images include pictures and videos.

[0057] Optionally, in some embodiments of the present application, when the first interface and N second interfaces are not user interfaces in the same application, the electronic device can determine the memory type corresponding to the second interface and the memory size required for each of the second interfaces based on the above historical usage information.

[0058] Optionally, in an embodiment of the present application, the above-mentioned memory type can be any one of the following: a buffer type or a file type.

[0059] It should be noted that files corresponding to the buffer type must be loaded through the buffer memory, and files corresponding to the file type must be loaded through the file memory.

[0060] Step 201b: The electronic device obtains N first memories corresponding to the N second interfaces respectively according to the memory type corresponding to each second interface and the memory size required by each second interface.

[0061] In some embodiments of the present application, the electronic device can determine the amount of memory recovery based on the memory size required for each of the N second interfaces, and then determine the memory recovery type based on the memory type corresponding to the interface content in each second interface, thereby obtaining N first memories.

[0062] Optionally, in an embodiment of the present application, when the second interface includes a hotspot file, the memory type corresponding to the second interface includes the memory type corresponding to the hotspot file, and the memory size required by the second interface includes the memory size of the hotspot file.

[0063] Specifically, in the case where the second interface includes hot files, when the electronic device displays the first interface, the electronic device can also obtain file information of the hot files in the second interface. The file information includes: the number of hot files, the memory size required for the hot files, and the memory type of the memory required for the hot files. In this way, the first memory obtained by the electronic device can also include the memory type corresponding to the hot files and the memory size of the hot files.

[0064] It can be understood that the second interface can be at least one interface among the N second interfaces.

[0065] Step 202: The electronic device recovers the second memory based on the N first memories and the N first confidence levels.

[0066] In some embodiments of the present application, N is an integer greater than or equal to 1.

[0067] Optionally, in some embodiments of the present application, the second memory includes a memory recycling amount and a memory recycling type.

[0068] Optionally, in some embodiments of the present application, the electronic device can reclaim the second memory from the remaining available free memory in the electronic device; or, the electronic device can close the application running in the background to obtain the remaining available free memory, and then reclaim the second memory from the remaining available free memory.

[0069] Exemplarily, assuming that the memory type corresponding to the second interface includes a file type and a buffer type, for the file type, the electronic device can recycle memory from the remaining available memory, and for the buffer type, the electronic device can recycle memory from the remaining buffer memory.

[0070] In the embodiment of the present application, the electronic device can correspond to different memory recycling methods according to different file types, thereby improving the flexibility of memory recycling of the electronic device.

[0071] In the memory recovery method provided in an embodiment of the present application, when displaying the first interface of the first application, the electronic device can obtain N first memories corresponding to the N second interfaces, and N first confidences corresponding to the N second interfaces, thereby recovering the second memory based on the N first memories and the N first confidences. In this solution, since memory recovery can be performed based on the memory requirements of the N second interfaces and the probability of the N second interfaces being displayed at the next moment, this ensures that the electronic device does not recycle excessive memory and reduces the problem of electronic device freezes.

[0072] Optionally, in some embodiments of the present application, in combination with FIG1 , as shown in FIG3 , the sum of the N first confidence levels is 100%; the step 202 can be specifically implemented through the following steps 202a to 202c.

[0073] Step 202a: The electronic device multiplies the memory values ​​of the N first memories by their corresponding first confidence levels to obtain N first numerical values.

[0074] In some embodiments of the present application, the N first values ​​correspond one-to-one to the N second interfaces. The N second interfaces correspond one-to-one to the N first confidence levels, and the N first memories correspond to the N second interfaces. A first value is obtained by multiplying the memory value of a first memory corresponding to a second interface by the first confidence level corresponding to the second interface. The above process is performed on each of the N second interfaces to obtain the N first values.

[0075] Step 202b: The electronic device performs an addition operation on the N first values ​​to obtain a second value.

[0076] For example, assume that the N second interfaces include: a chat application interface, an address book application interface, a discovery application interface and a user application interface, and the memory size required by the chat application interface is 150M, and the first confidence corresponding to the chat application interface is 50%; the memory size required by the address book application interface is 120M, and the first confidence corresponding to the address book application interface is 2%; the memory size required by the discovery application interface is 70M, and the first confidence corresponding to the discovery application interface is 25%; the memory size required by the user application interface is 70M, and the first confidence corresponding to the user application interface is 13%, then the second value is equal to 150*50%+120*2%+70*25%+70*13%.

[0077] Step 202c: The electronic device recovers the second memory according to the second value.

[0078] In some embodiments of the present application, the second value is the memory reclaimed amount of N second interfaces.

[0079] Optionally, in some embodiments of the present application, after obtaining the second value, the electronic device may recycle the second memory according to the memory types corresponding to the N second interfaces.

[0080] In some embodiments of the present application, the electronic device may perform memory recycling processing in advance based on the second memory obtained as described above.

[0081] Optionally, in some embodiments of the present application, after determining the second memory, the electronic device can reclaim memory resources occupied by applications that will not be used within the next preset time period; or, the electronic device can reclaim memory from the remaining available memory; or, the electronic device can reclaim memory from the cache memory.

[0082] Optionally, in some embodiments of the present application, the electronic device may reclaim memory from the above three embodiments according to a preset priority.

[0083] Optionally, in some embodiments of the present application, the above-mentioned preset priority may be set by the user, or determined by the electronic device according to the remaining available memory.

[0084] Optionally, in some embodiments of the present application, when the remaining available memory is less than the memory requirement of any of the N second interfaces, the electronic device may reclaim memory resources occupied by applications that will not be used within the next preset time period.

[0085] Optionally, in some embodiments of the present application, the number of applications that will not be used within the next preset time period may be one or more, which may be determined based on actual usage and is not limited by the embodiments of the present application.

[0086] In an embodiment of the present application, the electronic device can determine the memory recovery amount and memory type based on the memory requirements of each second interface, and perform memory recovery, thereby avoiding the killing of all applications due to excessive memory recovery and improving the flexibility of the electronic device in recovering memory.

[0087] Optionally, in some embodiments of the present application, in combination with FIG. 1 , as shown in FIG. 4 , after the above step 202 , the memory recycling method provided in the embodiment of the present application further includes the following step 301 .

[0088] Step 301: When the first confidence level of the third interface is greater than or equal to a preset threshold, the electronic device allocates memory to the third interface from the second memory according to the first memory corresponding to the third interface.

[0089] In some embodiments of the present application, the third interface is any one of the N second interfaces.

[0090] Optionally, in some embodiments of the present application, the number of the third interfaces may be one or more.

[0091] Optionally, in some embodiments of the present application, when the first confidence corresponding to the third interface is greater than or equal to a preset threshold, the electronic device can allocate memory to the third interface from the second memory according to the memory requirements and memory type of the third interface.

[0092] Optionally, in some embodiments of the present application, the electronic device can obtain the first confidence level, historical usage time period, and required memory size corresponding to the third interface, so that when the electronic device runs other applications, the electronic device can allocate memory for the third interface in advance based on the historical usage time period of the third interface, the first confidence level corresponding to the third interface, and the memory size required for the third interface.

[0093] Optionally, in some embodiments of the present application, in combination with FIG. 4 , as shown in FIG. 5 , the above step 301 may be specifically implemented through the following step 301 a.

[0094] Step 301a: When the first confidence of the third interface is greater than or equal to the preset threshold and the first time matches the current system time of the electronic device, the electronic device allocates memory for the third interface from the second memory according to the first memory corresponding to the third interface.

[0095] In some embodiments of the present application, the first time is determined by the electronic device based on the historical operating time of the third interface.

[0096] Specifically, the electronic device may input the historical running time of the third interface into the first algorithm, thereby predicting the running time period of the third interface in the next time period according to the first algorithm.

[0097] It can be understood that after the electronic device obtains the second memory, the electronic device can allocate the required memory to the third interface from the second memory according to the memory requirements of the third interface, and the electronic device can allocate memory to the third interface from the second memory according to the memory type corresponding to the third interface.

[0098] Optionally, in some embodiments of the present application, when the third interface includes a hot file, the electronic device may allocate memory in advance to the third interface and the hot file in the third interface based on the file information of the hot file.

[0099] For example, the electronic device may allocate memory in advance from the second memory for the hot files in the third interface according to the number of hot files, the memory size required by the hot files, and the memory type required by the hot files.

[0100] Optionally, in some embodiments of the present application, the electronic device may obtain the confidence level of the hotspot file through the above embodiments, so that the electronic device may allocate memory to the hotspot file in the third interface in advance according to the confidence level.

[0101] In some embodiments of the present application, the electronic device can pre-load the hotspot files required in the third interface. The hotspot files can be loaded in advance without excessive memory recovery, thereby reducing the lag caused by the input and output (InputOutput) reading and writing of the hotspot files when the third interface is started.

[0102] Optionally, in some embodiments of the present application, the electronic device may further allocate memory for a third interface in an application running in the background.

[0103] Exemplarily, assuming that the third interface is an interface in an application running in the background, when the first time matches the current system time, the electronic device can allocate memory for the third interface from the second memory.

[0104] Optionally, in some embodiments of the present application, the electronic device may further allocate memory for a third interface in an application that is not running.

[0105] Exemplarily, assuming that the third interface is an interface in an application that is not running, when the first time matches the current system time, the electronic device can allocate memory for the third interface from the second memory.

[0106] It should be noted that the electronic device always allocates memory to the third interface before the third interface is running. That is to say, the electronic device can predict the user's next behavior and allocate memory to the third interface in advance, so that the electronic device can load the third interface in advance to reduce the running lag of the electronic device.

[0107] It should be noted that the memory recovery method provided in the embodiments of the present application can be executed by a memory recovery device, an electronic device, or a functional module or entity in an electronic device. In the embodiments of the present application, the memory recovery device provided in the embodiments of the present application is described by taking the memory recovery device executing the memory recovery method as an example.

[0108] FIG6 shows a possible structural diagram of a memory recycling device involved in an embodiment of the present application. As shown in FIG6 , the memory recycling device 70 may include: an acquisition module 71 and a recycling module 72 .

[0109] The acquisition module 71 is configured to, when the electronic device displays the first interface, acquire N first memories corresponding to the N second interfaces, and N first confidence levels corresponding to the N second interfaces, where the N first confidence levels represent the probabilities of displaying the N second interfaces within a first predetermined time period. The recovery module 72 is configured to recover the second memories based on the N first memories and N first confidence levels acquired by the acquisition module 71, where N is an integer greater than or equal to 1.

[0110] In one possible implementation, the sum of the N first confidence levels is 100%, and the recovery module 72 is specifically used to multiply the memory values ​​of the N first memories by their respective corresponding first confidence levels to obtain N first numerical values, and the N first numerical values ​​correspond one-to-one to the N second interfaces; and to add the N first numerical values ​​to obtain a second numerical value; and to recover the second memory based on the second numerical value.

[0111] In one possible implementation, the above-mentioned acquisition module 71 is specifically used to determine, for each of the N second interfaces, the memory type corresponding to each second interface and the memory size required for each second interface; and based on the memory type corresponding to each second interface and the memory size required for each second interface, obtain the N first memories corresponding to the N second interfaces respectively.

[0112] In a possible implementation, when the second interface includes a hotspot file, the memory type corresponding to the second interface includes the memory type corresponding to the hotspot file, and the memory size required by the second interface includes the memory size of the hotspot file.

[0113] In a possible implementation, the first interface and the second interface are user interfaces of the same application.

[0114] An embodiment of the present application provides a memory recovery device. Since the memory recovery device can recycle memory based on the memory requirements of N second interfaces and the probability of N second interfaces being displayed at the next moment, it can ensure that the electronic device does not recycle excessive memory and reduce the lag problem of the electronic device.

[0115] The memory recovery device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in an electronic device. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not make specific limitations.

[0116] The memory recovery device in the embodiment of the present application can be a device having an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0117] The memory recovery device provided in the embodiment of the present application can implement the various processes implemented in the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0118] Optionally, as shown in Figure 7, an embodiment of the present application also provides an electronic device 90, including a processor 91 and a memory 92, and the memory 92 stores a program or instruction that can be run on the processor 91. When the program or instruction is executed by the processor 91, the various steps of the above-mentioned memory recovery method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0119] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0120] FIG8 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

[0121] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101 , a network module 102 , an audio output unit 103 , an input unit 104 , a sensor 105 , a display unit 106 , a user input unit 107 , an interface unit 108 , a memory 109 , and a processor 110 .

[0122] Those skilled in the art will appreciate that the electronic device 100 may further include a power source (such as a battery) for powering various components. The power source may be logically connected to the processor 110 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The electronic device structure shown in FIG8 does not limit the electronic device. The electronic device may include more or fewer components than shown, or may combine certain components or arrange the components differently, which will not be described in detail here.

[0123] Among them, the processor 110 is used to obtain N first memories corresponding to N second interfaces and N first confidence levels corresponding to the N second interfaces when the electronic device displays the first interface, and the N first confidence levels are the probabilities of displaying the N second interfaces within a first predetermined time period; and recover the second memory based on the N first memories and the N first confidence levels; wherein N is an integer greater than or equal to 1.

[0124] An embodiment of the present application provides an electronic device. Since the electronic device can recycle memory based on the memory requirements of N second interfaces and the probability of N second interfaces being displayed at the next moment, this can ensure that the electronic device does not recycle memory excessively and reduce the lag problem of the electronic device.

[0125] Optionally, in an embodiment of the present application, the sum of the above-mentioned N first confidences is 100%; the above-mentioned processor 110 is specifically used to multiply the memory values ​​of the N first memories by their respective corresponding first confidences to obtain N first numerical values, and the N first numerical values ​​correspond one-to-one to the N second interfaces; and add the N first numerical values ​​to obtain a second numerical value; and recover the second memory based on the second numerical value.

[0126] Optionally, in an embodiment of the present application, the above-mentioned processor 110 is specifically used to determine, for each of the N second interfaces, the memory type corresponding to each second interface and the memory size required for each second interface; and obtain N first memories corresponding to the N second interfaces respectively according to the memory type corresponding to each second interface and the memory size required for each second interface.

[0127] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described here.

[0128] The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, they will not be described here.

[0129] It should be understood that in an embodiment of the present application, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0130] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0131] Processor 110 may include one or more processing units. Optionally, processor 110 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 110.

[0132] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0133] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0134] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0135] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0136] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned memory recovery method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0137] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0138] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0139] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A memory recovery method, wherein: The method comprises: When the electronic device displays the first interface, obtaining N first memories corresponding to N second interfaces respectively, and N first confidences corresponding to the N second interfaces respectively, wherein the N first confidences are probabilities corresponding to the N second interfaces being displayed within a first predetermined time period; Recovering a second memory according to the N first memories and the N first confidences; Wherein, N is an integer greater than or equal to 1.

2. The method according to claim 1, wherein: The sum of the N first confidences is 100%; The step of recovering the second memory according to the N first memories and the N first confidences includes: Multiplying the memory values ​​of the N first memories by their respective corresponding first confidences to obtain N first values, wherein the N first values ​​correspond one-to-one to the N second interfaces; Add the N first values ​​to obtain a second value; The second memory is recovered according to the second value.

3. The method according to claim 1 or 2, wherein: The obtaining of N first memories respectively corresponding to the N second interfaces includes: For each of the N second interfaces, determining a memory type corresponding to each of the second interfaces and a memory size required by each of the second interfaces; According to the memory type corresponding to each of the second interfaces and the memory size required by each of the second interfaces, N first memories respectively corresponding to the N second interfaces are obtained.

4. The method according to claim 3, wherein: In the case where the second interface includes a hotspot file, the memory type corresponding to the second interface includes the memory type corresponding to the hotspot file, and the memory size required by the second interface includes the memory size of the hotspot file.

5. The method according to claim 1, wherein: The first interface and the second interface are user interfaces of the same application.

6. A memory recovery device, wherein: The device comprises: an acquisition module and a recovery module; The acquisition module is used to acquire, when the electronic device displays the first interface, N first memories corresponding to the N second interfaces respectively, and N first confidences corresponding to the N second interfaces respectively, wherein the N first confidences are probabilities corresponding to the N second interfaces being displayed within a first predetermined time period; The recycling module is used to recycle the second memory according to the N first memories and the N first confidences acquired by the acquisition module; Wherein, N is an integer greater than or equal to 1.

7. The device according to claim 6, wherein: The sum of the N first confidences is 100%, and the recovery module is specifically used to multiply the memory values ​​of the N first memories by the first confidences corresponding to each other, to obtain N first values, the N first values ​​corresponding to the N second interfaces one by one; and add the N first values ​​to obtain a second value; And according to the second value, the second memory is recovered.

8. The device according to claim 6 or 7, wherein: The acquisition module is specifically used to determine, for each of the N second interfaces, a memory type corresponding to each of the second interfaces and a memory size required by each of the second interfaces; And according to the memory type corresponding to each of the second interfaces and the memory size required by each of the second interfaces, N first memories respectively corresponding to the N second interfaces are obtained.

9. The device according to claim 8, wherein: In the case where the second interface includes a hotspot file, the memory type corresponding to the second interface includes the memory type corresponding to the hotspot file, and the memory size required by the second interface includes the memory size described in the hotspot file.

10. The device according to claim 6, wherein: The first interface and the second interface are user interfaces of the same application.

11. An electronic device, wherein: It comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the memory recycling method as described in any one of claims 1 to 5.

12. A readable storage medium, wherein: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the memory recycling method as described in any one of claims 1 to 5 are implemented.

13. A chip, wherein: The chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the memory recovery method according to any one of claims 1 to 5.

14. A computer program product, wherein: The program product is stored in a non-volatile storage medium, and the program product is executed by at least one processor to implement the steps of the memory recycling method according to any one of claims 1 to 5.

15. An electronic device, wherein: The electronic device is configured to implement the steps of the memory recycling method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Teaching device memory usage management method and device, terminal and storage medium

    CN109739639A

  • Memory management method and related equipment

    CN110377527A

  • Memory recovery method and device, electronic equipment and storage medium

    CN116756056A

  • Memory reclaiming method and terminal

    US20190220216A1