CN116756056A - Memory recycling method and device, electronic equipment and storage medium - Google Patents

Memory recycling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116756056A
CN116756056A CN202310646867.3A CN202310646867A CN116756056A CN 116756056 A CN116756056 A CN 116756056A CN 202310646867 A CN202310646867 A CN 202310646867A CN 116756056 A CN116756056 A CN 116756056A
Authority
CN
China
Prior art keywords
memory
interfaces
interface
electronic device
memories
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310646867.3A
Other languages
Chinese (zh)
Inventor
康惠平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202310646867.3A priority Critical patent/CN116756056A/en
Publication of CN116756056A publication Critical patent/CN116756056A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced 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/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a memory recycling method and device, electronic equipment and a storage medium, and belongs to the technical field of electronics. The method comprises the following steps: under the condition that the electronic equipment displays the first interfaces, N first memories respectively corresponding to N second interfaces and N first confidence degrees respectively corresponding to the N second interfaces are obtained, wherein the N first confidence degrees are probabilities that the N second interfaces are displayed in a first preset time period respectively corresponding to the N second interfaces; recovering and obtaining a second memory according to the N first memories and the N first confidence coefficients; wherein N is an integer greater than or equal to 1.

Description

Memory recycling method and device, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of electronics, and particularly relates to a memory recycling method, a memory recycling device, electronic equipment and a storage medium.
Background
Currently, electronic devices can ensure smooth operation of the electronic devices by recovering memory. In the related art, when the current remaining available memory in the electronic device is lower than a preset threshold, the electronic device may perform memory reclamation processing on the memory occupied by the file in the electronic device, so as to ensure smooth operation of the electronic device.
However, in the above method, after the electronic device performs the memory recovery processing on the memory occupied by the file, if the electronic device needs to use the recovered file at the next moment, the electronic device needs to reallocate the memory again for the file with the memory just recovered, and since the electronic device has recovered the memory corresponding to the file at the last moment, the process of loading the file by the electronic device is longer, and thus, the electronic device is blocked.
Disclosure of Invention
The embodiment of the application aims to provide a memory recycling method, a memory recycling device, electronic equipment and a storage medium, which can reduce the problem of jamming of the electronic equipment.
In a first aspect, an embodiment of the present application provides a memory reclamation method, where the memory reclamation method includes: under the condition that the electronic equipment displays the first interfaces, N first memories respectively corresponding to N second interfaces and N first confidence degrees respectively corresponding to the N second interfaces are obtained, wherein the N first confidence degrees are probabilities that the N second interfaces are displayed in a first preset time period respectively corresponding to the N second interfaces; recovering and obtaining a second memory according to the N first memories and the N first confidence coefficients; wherein N is an integer greater than or equal to 1.
In a second aspect, an embodiment of the present application provides a memory reclamation apparatus, including: an acquisition module and a recovery module. The acquiring module is used for acquiring N first memories respectively corresponding to the N second interfaces and N first confidence degrees respectively corresponding to the N second interfaces under the condition that the first interfaces are displayed by the electronic equipment, wherein the N first confidence degrees are probabilities respectively corresponding to the N second interfaces displayed in a first preset time period. The recovery module is used for recovering and obtaining a second memory according to the N first memories and the N first confidence coefficients; wherein N is an integer greater than or equal to 1.
In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, under the condition of displaying the first interface of the first application, the electronic device can acquire N first memories corresponding to N second interfaces respectively and N first confidences corresponding to the N second interfaces respectively, so that the second memories are recovered according to the N first memories and the N first confidences. In the scheme, the memory recovery can be performed according to the memory requirements of the N second interfaces and the probability that the N second interfaces are displayed at the next moment, so that excessive memory recovery of the electronic equipment can be ensured, and the problem of blocking of the electronic equipment is also reduced.
Drawings
FIG. 1 is a flowchart of a memory reclamation method according to an embodiment of the present application;
FIG. 2 is a second flowchart of a memory reclamation method according to an embodiment of the present application;
FIG. 3 is a third flowchart of a memory reclamation method according to an embodiment of the present application;
FIG. 4 is a flowchart of a memory reclamation method according to an embodiment of the present application;
FIG. 5 is a flowchart of a memory reclamation method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a memory recycling device according to an embodiment of the present application;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application;
fig. 8 is a second schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the objects identified by "first," "second," etc. are generally of a type not limited to the number of objects, for example, the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The following is a description of the generic terms related to the present application.
Memory: the application refers to a running memory, i.e. when an application program needs to run, the electronic device can load the application program from a storage, such as a hard disk, onto the running memory to be called by a central processing unit (Central Processing Unit, CPU).
Remaining available memory: running memory that other applications can currently use. For example, the remaining available memory in the electronic device may be understood as memfree and file cache; wherein memfree is a completely idle memory, and can directly write data when needed; the file cache is a file page cached by the system, and a memory recovery thread writes back the file to a disk when needed, so that the cache memory is changed into free memory, and the free memory can be used by an application program.
Hotspot files: when an application program runs, partial files, such as code segments, files needing to be read and written, and the like, need to be loaded into a memory for use, and some files are operated with higher frequency and are called hot files.
The memory management method provided by the embodiment of the application is described in detail below through specific embodiments and application scenarios thereof with reference to the accompanying drawings.
The execution body of the memory reclaiming method provided by the embodiment of the application can be a memory reclaiming device, and the memory reclaiming device can be an electronic device or a functional module in the electronic device. The technical solution provided by the embodiment of the present application is described below by taking an electronic device as an example.
An embodiment of the application provides a memory recycling method, and fig. 1 shows a flowchart of the memory recycling method provided by the embodiment of the application. As shown in fig. 1, the memory reclaiming method provided in the embodiment of the present application may include the following steps 201 and 202.
Step 201, under the condition that the electronic device displays the first interfaces, the electronic device obtains N first memories corresponding to the N second interfaces respectively, and N first confidence degrees corresponding to the N second interfaces respectively.
In some embodiments of the present application, the N first confidence degrees are probabilities that N second interfaces are displayed in a first predetermined period of time, where the probabilities correspond to each other.
Optionally, in some embodiments of the present application, the first memory includes: and displaying the memory size required by the second interface and the memory type corresponding to the memory.
In some embodiments of the present application, when the electronic device displays the first interface, the electronic device may obtain N first memories corresponding to the N second interfaces respectively and N first confidence degrees corresponding to the N second interfaces respectively according to the historical usage information corresponding to the N second interfaces.
Optionally, in some embodiments of the present application, the history use information includes at least one of: the running time of the application program corresponding to the second interface, the time for displaying the second interface, the memory quantity required for displaying the second interface and the memory type of the memory quantity.
Alternatively, in some embodiments of the present application, the above-described historical usage information may be stored in the electronic device or in the server.
Optionally, in an embodiment of the present application, the first interface and the second interface are user interfaces of the same application program.
In an exemplary case where the first interface and the second interface may be user interfaces of the same application, according to the embodiment of the present application, the electronic device may predict the first memory required for other interfaces in the first application while displaying the first interface.
Alternatively, in some embodiments of the present application, the first interface and the second interface may be user interfaces of different applications.
In an exemplary embodiment, in a case where the first interface and the second interface may be user interfaces of different applications, according to the embodiment of the present application, the electronic device may predict, under a condition that the first application corresponding to the first interface is running, a first memory required for running the second application corresponding to the second interface.
Optionally, in some embodiments of the present application, the first memory may further include a memory required for running the second application and a corresponding memory type.
Alternatively, in some embodiments of the present application, the first interface may be any interface in any application in a desktop or an electronic device.
In an exemplary case where the electronic device displays the desktop, the user may perform a first input on a first application icon in the desktop, so that the electronic device may run a first application corresponding to the first application icon and display a first interface of the first application.
Optionally, in some embodiments of the present application, the first input by the user on the first application icon in the desktop may be any one of the following: click input, slide input, preset track input, long press input, and the like. Specifically, the method can be determined according to the use condition, and the embodiment of the application is not limited.
Alternatively, in some embodiments of the present application, the second interface may be any interface in a desktop or a background running application or any interface in an un-running application.
In the embodiment of the application, the N first confidence degrees corresponding to the N second interfaces may be determined according to a time period of using each second interface by the user history and an operation sequence of each second interface by the user history.
Specifically, for each of the N second interfaces and the first confidence level corresponding to each second interface, after obtaining a period of time (hereinafter abbreviated as first information) for which the user history uses each second interface and an operation order (hereinafter abbreviated as second information) of the user history for each second interface, the electronic device may input the first information and the second information into the first algorithm, so as to obtain the first confidence level corresponding to each second interface.
Alternatively, in some embodiments of the present application, the first algorithm may be any one of the following: artificial intelligence (Artificial Intelligence, AI) algorithms, feedback neural network algorithms or convolutional neural network algorithms.
For example, the first confidence may be a probability value, for example, the probability of the user running the interface associated with the functionality control corresponding to the contact at the next moment is 80%.
Optionally, in some embodiments of the present application, as shown in fig. 2 in conjunction with fig. 1, the "the electronic device obtains N first memories corresponding to the N second interfaces in the above step 201" may be specifically implemented by the following steps 201a and 201 b.
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.
Optionally, in some embodiments of the present application, when the first interface and the N co-interfaces are user interfaces of the same application, the electronic device may analyze, by using a target manner, contents in the N second interfaces when the electronic device displays the first interface, so as to obtain interface information corresponding to the N second interfaces, and then obtain, according to the interface information corresponding to the N second interfaces, memory requirements and memory types corresponding to the N second interfaces.
In some embodiments of the present application, the above-described target manner may include any one of the following: AI algorithm or neural network algorithm.
Illustratively, the electronic device analyzing the content in the second interface may be: acquiring how many windows are included in the second interface, acquiring how many arrays are included in the second interface, acquiring how many images are included in the second interface, acquiring the resolution of the images included in the second interface, and the like.
It should be noted that the above-mentioned image refers to a broad concept, that is, the image includes a picture and a video.
Optionally, in some embodiments of the present application, when the first interface and the N second interfaces are not user interfaces in the same application, the electronic device may determine, according to the historical usage information, a memory type corresponding to the second interface and a memory size required by each of the second interfaces.
Optionally, in the embodiment of the present application, the memory type may be any of the following: a buffer type or a file type.
It should be noted that, the file corresponding to the buffer type must be loaded through the buffer memory, and the file corresponding to the file type must be loaded through the file memory.
Step 201b, the electronic device obtains N first memories corresponding to the N second interfaces according to the memory type corresponding to each second interface and the memory size required by each second interface.
In some embodiments of the present application, the electronic device may determine the memory reclamation amount according to the memory size required by each of the N second interfaces, and then determine the memory reclamation type according to the memory type corresponding to the interface content in each of the N second interfaces, so as to obtain N first memories.
Optionally, in the embodiment of the present application, in the case that the second interface includes a hotspot file, a memory type corresponding to the second interface includes a memory type corresponding to the hotspot file, and a memory size required by the second interface includes a memory size of the hotspot file.
Specifically, for the case where the second interface includes a hotspot file, when the electronic device displays the first interface, the electronic device may further obtain file information of the hotspot file in the second interface, where the file information includes: the number of the hot spot files, the memory size required by the hot spot files and the memory type of the memory required by the hot spot files, so that the first memory acquired by the electronic equipment can further comprise the memory type corresponding to the hot spot files and the memory size of the hot spot files.
It is understood that the second interface may be at least one of the N second interfaces.
Step 202, the electronic device retrieves and obtains a second memory according to the N first memories and the N first confidence levels.
In some embodiments of the application, N is an integer greater than or equal to 1.
Optionally, in some embodiments of the application, the second memory includes a memory reclamation amount and a memory reclamation type.
Optionally, in some embodiments of the present application, the electronic device may retrieve the second memory from the remaining available free memory in the electronic device; or the electronic device may close the application running in the background to obtain the remaining available free memory, and then retrieve the second memory from the remaining available free memory.
For example, 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 may perform memory reclamation in the remaining available memory, and for the buffer type, the electronic device may perform memory reclamation from the remaining buffer memory.
According to the embodiment of the application, the electronic equipment can correspond to different memory recycling modes according to different file types, so that the memory recycling flexibility of the electronic equipment is improved.
In the memory recycling method provided by the embodiment of the application, under the condition that the first interface of the first application is displayed, the electronic equipment can acquire N first memories corresponding to N second interfaces respectively and N first confidences corresponding to the N second interfaces respectively, so that the second memories are recycled according to the N first memories and the N first confidences. In the scheme, the memory recovery can be performed according to the memory requirements of the N second interfaces and the probability that the N second interfaces are displayed at the next moment, so that excessive memory recovery of the electronic equipment can be ensured, and the problem of blocking of the electronic equipment is also reduced.
Optionally, in some embodiments of the present application, as shown in fig. 3 in conjunction with fig. 1, the sum of the N first confidence levels is 100%; the above step 202 may be specifically implemented by the following steps 202a to 202 c.
In step 202a, the electronic device performs a multiplication operation on the memory values of the N first memories and the respective corresponding first confidence degrees, to obtain N first numerical values.
In some embodiments of the present application, the N first values are in one-to-one correspondence with the N second interfaces. The N second interfaces are in one-to-one correspondence with the N first confidence degrees, and the N first memories are corresponding to the N second interfaces. And multiplying the memory value of a first memory corresponding to the second interface with the first confidence coefficient corresponding to the second interface to obtain a first numerical value. And carrying out the processing on the N second interfaces to obtain N first numerical values.
Step 202b, the electronic device performs an addition operation on the N first values to obtain a second value.
Illustratively, assume that the N second interfaces include: the chat application interface, the address book application interface, the discovery application interface and the user application interface, wherein the memory required by the chat application interface is 150M, and the first confidence coefficient corresponding to the chat application interface is 50%; the memory size required by the address book application interface is 120M, and the first confidence coefficient 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 coefficient corresponding to the user application interface is 13%, and the second value is equal to 150×50% +120×2% +70×25% +70×13%.
Step 202c, the electronic device retrieves the second memory according to the second value.
In some embodiments of the present application, the second value is a memory reclamation amount of N second interfaces.
Optionally, in some embodiments of the present application, after the electronic device obtains the second value, the electronic device may retrieve the second memory according to the memory types corresponding to the N second interfaces.
In some embodiments of the present application, the electronic device may perform the memory reclamation process in advance according to the obtained second memory.
Optionally, in some embodiments of the present application, after determining the second memory, the electronic device may reclaim memory resources occupied by the application program that is not to be used in the next preset time period; alternatively, the electronic device may reclaim memory from the remaining available memory; alternatively, the electronic device may reclaim memory from cache memory.
Optionally, in some embodiments of the present application, the electronic device may perform memory reclamation from the above 3 embodiments according to a preset priority.
Alternatively, in some embodiments of the present application, the preset priority may be set by a user, or the electronic device may be determined according to the remaining available memory.
Optionally, in some embodiments of the present application, when the remaining available memory is smaller than the memory requirement of any one of the N second interfaces, the electronic device may reclaim the memory resources occupied by the application program that will not be used in the next preset duration.
Alternatively, in some embodiments of the present application, the number of applications that will not be used in the next preset time period may be one or more. The method can be specifically determined according to actual use conditions, and the embodiment of the application is not limited.
According to the embodiment of the application, the electronic equipment can determine the memory recovery amount and the memory type according to the memory requirements of each second interface, and perform memory recovery, so that the application programs caused by excessive memory recovery are prevented from being checked and killed, and the flexibility of memory recovery of the electronic equipment is improved.
Optionally, in some embodiments of the present application, as shown in fig. 1 and fig. 4, after the step 202, the memory recycling method provided in the embodiment of the present application further includes the following step 301.
Step 301, when the first confidence coefficient of the third interface is greater than or equal to a preset threshold, the electronic device allocates memory for the third interface from the second memory according to the first memory corresponding to the third interface.
In some embodiments of the present application, the third interface is any one of N second interfaces.
Alternatively, in some embodiments of the present application, the number of the third interfaces may be one or more.
Optionally, in some embodiments of the present application, when the first confidence coefficient corresponding to the third interface is greater than or equal to the preset threshold, the electronic device may allocate memory for the third interface from the second memory according to the memory requirement and the memory type of the third interface.
Optionally, in some embodiments of the present application, the electronic device may obtain a first confidence coefficient, a historical usage time period, and a required memory size corresponding to the third interface, so that when the electronic device runs other application programs, the electronic device may allocate the memory for the third interface in advance according to the historical usage time period of the third interface, the first confidence coefficient corresponding to the third interface, and the required memory size of the third interface.
Alternatively, in some embodiments of the present application, as shown in fig. 5 in conjunction with fig. 4, the above step 301 may be specifically implemented by the following step 301 a.
In step 301a, when the first confidence coefficient of the third interface is greater than or equal to a preset threshold, and the first time is matched with 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.
In some embodiments of the present application, the first time is determined by the electronic device according to a historical running time of the third interface.
Specifically, the electronic device may input the historical operation time of the third interface into the first algorithm, so as to predict the operation time period of the third interface in the next time period according to the first algorithm.
It may be understood that after the electronic device obtains the second memory, the electronic device may allocate the required memory for the third interface from the second memory according to the memory requirement of the third interface, and the electronic device may allocate the memory for the third interface from the second memory according to the memory type corresponding to the third interface.
Optionally, in some embodiments of the present application, in a case where the third interface includes a hotspot file, the electronic device may allocate, in advance, memory for the third interface and the hotspot file in the third interface according to file information of the hotspot file.
For example, the electronic device may allocate the memory in advance for the hotspot files in the third interface from the second memory according to the number of the hotspot files, the memory size required by the hotspot files, and the memory type of the memory required by the hotspot files.
Optionally, in some embodiments of the present application, the electronic device may obtain the confidence level of the hotspot file through the foregoing embodiments, so that the electronic device may allocate the memory in advance for the hotspot file in the third interface according to the confidence level.
In some embodiments of the present application, the electronic device may load the hot spot file required in the third interface in advance, and under the condition of excessive memory recovery, the hot spot file may be loaded in advance, so as to reduce a clamping phenomenon caused by input output (input output) reading and writing of the hot spot file when the third interface is started.
Optionally, in some embodiments of the present application, the electronic device may further allocate memory for a third interface in the application running in the background.
For example, assuming that the third interface is an interface in the application running in the background, the electronic device may allocate memory for the third interface from the second memory if the first time matches the current system time.
Optionally, in some embodiments of the present application, the electronic device may further allocate memory for a third interface in the non-running application.
For example, assuming that the third interface is an interface in an application program that is not running, the electronic device may allocate memory for the third interface from the second memory if the first time matches the current system time.
It should be noted that, the electronic device allocates memory for the third interface before the third interface runs, that is, the electronic device may predict the next step of the user and allocate memory to the third interface in advance, so that the electronic device may load the third interface in advance, so as to reduce the operation jamming of the electronic device.
It should be noted that, in the memory reclaiming method provided by the embodiment of the present application, the execution body may be a memory reclaiming device, or an electronic device, or may also be a functional module or entity in the electronic device. In the embodiment of the application, the memory reclamation device executes the memory reclamation method by taking the memory reclamation device as an example, so as to describe the memory reclamation device provided by the embodiment of the application.
Fig. 6 is a schematic diagram of a possible structure of a memory reclamation device according to an embodiment of the present application. As shown in fig. 6, the memory reclamation apparatus 70 may include: an acquisition module 71 and a recovery module 72.
The acquiring module 71 is configured 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, where the N first confidences are probabilities that the N second interfaces are displayed in a first predetermined period of time respectively. The recycling module 72 is configured to recycle the N first memories and the N first confidence degrees acquired by the acquiring module 71 to obtain a second memory; wherein N is an integer greater than or equal to 1.
In one possible implementation manner, the sum of the N first confidence degrees is 100%, and the recycling module 72 is specifically configured to multiply the memory values of the N first memories with the respective corresponding first confidence degrees to obtain N first values, where the N first values are in one-to-one correspondence with the N second interfaces; adding the N first values to obtain a second value; and recycling the second memory according to the second value.
In one possible implementation manner, the obtaining module 71 is specifically configured to determine, for each of the N second interfaces, a memory type corresponding to each second interface and a memory size required by each second interface; and acquiring N first memories respectively corresponding to the N second interfaces according to the memory type corresponding to each second interface and the memory size required by each second interface.
In one possible implementation, in a case where the second interface includes a hotspot file, a memory type corresponding to the second interface includes a memory type corresponding to the hotspot file, and a memory size required by the second interface includes a memory size of the hotspot file.
In one possible implementation, the first interface and the second interface are user interfaces of the same application program.
The embodiment of the application provides a memory recycling device, which can recycle the memory according to the memory requirements of N second interfaces and the probability that the N second interfaces are displayed at the next moment, so that the excessive memory recycling of electronic equipment can be ensured, and the problem of blocking of the electronic equipment is also reduced.
The memory reclamation device in the embodiment of the application can be a device, and can also be a component, an integrated circuit or a chip in electronic equipment. The device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., and may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., without limitation of the embodiments of the present application.
The memory reclamation device in the embodiment of the application can be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The memory recycling device provided by the embodiment of the application can realize each process realized by the embodiment of the method and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
Optionally, as shown in fig. 7, the embodiment of the present application further provides an electronic device 90, including a processor 91 and a memory 92, where the memory 92 stores a program or an instruction that can be executed on the processor 91, and the program or the instruction implements each step of the above-mentioned memory management method embodiment when executed by the processor 91, and the steps achieve the same technical effects, so that repetition is avoided, and no further description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 100 includes, but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.
Those skilled in the art will appreciate that the electronic device 100 may further include a power source (e.g., a battery) for powering the various components, and that the power source may be logically coupled to the processor 110 via a power management system to perform functions such as managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 8 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 110 is configured to obtain N first memories corresponding to the N second interfaces respectively and N first confidences corresponding to the N second interfaces respectively when the first interfaces are displayed by the electronic device, where the N first confidences are probabilities that the N second interfaces are displayed in a first predetermined time period; and recovering and obtaining a second memory according to the N first memories and the N first confidence coefficients; wherein N is an integer greater than or equal to 1.
The embodiment of the application provides electronic equipment, which can recover the memory according to the memory requirements of N second interfaces and the probability that the N second interfaces are displayed at the next moment, so that the electronic equipment can be ensured to recover the memory excessively, and the problem of blocking of the electronic equipment is also reduced.
Optionally, in an embodiment of the present application, a sum of the N first confidence degrees is 100%; the processor 110 is specifically configured to multiply the memory values of the N first memories with the respective corresponding first confidence coefficients to obtain N first values, where the N first values are in one-to-one correspondence with the N second interfaces; adding the N first values to obtain a second value; and recycling the second memory according to the second value.
Optionally, in the embodiment of the present application, the processor 110 is specifically configured to determine, for each of N second interfaces, a memory type corresponding to each second interface and a memory size required by each second interface; and acquiring N first memories respectively corresponding to the N second interfaces according to the memory type corresponding to each second interface and the memory size required by each second interface.
The electronic device provided by the embodiment of the application can realize each process realized by the embodiment of the method and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
The beneficial effects of the various implementation manners in this embodiment may be specifically referred to the beneficial effects of the corresponding implementation manners in the foregoing method embodiment, and in order to avoid repetition, the description is omitted here.
It should be appreciated that in embodiments of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing 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, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also referred to as a touch screen. The touch panel 1071 may include two parts of a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 109 may include volatile memory or nonvolatile memory, or the memory 109 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 109 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
Processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, etc., and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, which when executed by a processor, implements each process of the above method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used for running programs or instructions to realize the processes of the embodiment of the method, and can achieve the same technical effects, so that repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
Embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the processes of the embodiments of the memory reclamation method, and achieve the same technical effects, and for avoiding repetition, a detailed description is omitted herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (12)

1. A memory reclamation method, the method comprising:
under the condition that the electronic equipment displays the first interfaces, N first memories respectively corresponding to N second interfaces and N first confidence degrees respectively corresponding to the N second interfaces are obtained, wherein the N first confidence degrees are probabilities respectively corresponding to the N second interfaces displayed in a first preset time period;
recovering and obtaining a second memory according to the N first memories and the N first confidence coefficients;
wherein N is an integer greater than or equal to 1.
2. The method of claim 1, wherein the sum of the N first confidence levels is 100%; and recovering the second memory according to the N first memories and the N first confidence coefficients, including:
multiplying the memory values of the N first memories with the respective corresponding first confidence coefficients to obtain N first numerical values, wherein the N first numerical values are in one-to-one correspondence with the N second interfaces;
adding the N first values to obtain a second value;
and recycling the second memory according to the second numerical value.
3. The method according to claim 1 or 2, wherein the obtaining N first memories corresponding to the N second interfaces respectively includes:
determining a memory type corresponding to each second interface and a memory size required by each second interface according to each second interface in N second interfaces;
and acquiring N first memories respectively corresponding to the N second interfaces according to the memory type corresponding to each second interface and the memory size required by each second interface.
4. The method of claim 3, wherein, in the case where the second interface includes a hot spot file, the memory type corresponding to the second interface includes a memory type corresponding to the hot spot file, and the memory size required by the second interface includes a memory size of the hot spot file.
5. The method of claim 1, wherein the first interface and the second interface are user interfaces of a same application.
6. A memory reclamation apparatus, the apparatus comprising: the acquisition module and the recovery module;
the acquiring module is configured to acquire N first memories corresponding to N second interfaces respectively and N first confidences corresponding to the N second interfaces respectively when the first interfaces are displayed by the electronic device, where the N first confidences are probabilities that the N second interfaces are displayed in a first predetermined period of time;
the recycling module is configured to recycle the N first memories and the N first confidence degrees acquired by the acquiring module 71 to obtain a second memory;
wherein N is an integer greater than or equal to 1.
7. The apparatus of claim 6, wherein a sum of the N first confidences is 100%, and the recycling module is specifically configured to multiply the memory values of the N first memories with the respective corresponding first confidences to obtain N first values, where the N first values are in one-to-one correspondence with the N second interfaces; adding the N first values to obtain a second value; and recycling the second memory according to the second numerical value.
8. The apparatus according to claim 6 or 7, wherein the obtaining module is specifically configured to determine, for each of the N second interfaces, a memory type corresponding to each of the second interfaces and a memory size required for each of the second interfaces; and acquiring N first memories respectively corresponding to the N second interfaces according to the memory type corresponding to each second interface and the memory size required by each second interface.
9. The apparatus of claim 8, wherein, in the case where the second interface includes a hotspot file, the memory type corresponding to the second interface includes a memory type corresponding to the hotspot file, and the memory size required by the second interface includes the memory size of the hotspot file.
10. The apparatus of claim 6, wherein the first interface and the second interface are user interfaces of a same application.
11. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, the program or instruction when executed by the processor implementing the steps of the memory reclamation method according to any of claims 1 to 5.
12. A readable storage medium, wherein a program or instructions is stored on the readable storage medium, which when executed by a processor, implements the steps of the memory reclamation method according to any of claims 1 to 5.
CN202310646867.3A 2023-06-01 2023-06-01 Memory recycling method and device, electronic equipment and storage medium Pending CN116756056A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310646867.3A CN116756056A (en) 2023-06-01 2023-06-01 Memory recycling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310646867.3A CN116756056A (en) 2023-06-01 2023-06-01 Memory recycling method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116756056A true CN116756056A (en) 2023-09-15

Family

ID=87950625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310646867.3A Pending CN116756056A (en) 2023-06-01 2023-06-01 Memory recycling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116756056A (en)

Similar Documents

Publication Publication Date Title
CN115509953A (en) Memory recovery method and device
CN112035877A (en) Information hiding method and device, electronic equipment and readable storage medium
CN116756056A (en) Memory recycling method and device, electronic equipment and storage medium
CN116107531A (en) Interface display method and device
CN113805997B (en) Information display method, information display device, electronic equipment and storage medium
CN111858395B (en) Data management method and device
CN115729412A (en) Interface display method and device
CN114638742A (en) Scene picture processing method and electronic equipment
CN114385368A (en) Method and device for flashing pre-written log
CN113032290A (en) Flash memory configuration method and device, electronic equipment and storage medium
CN113868269A (en) Screenshot method and device, electronic equipment and readable storage medium
CN114416264A (en) Message display method and device
CN114070892A (en) Data transmission method and device
CN113901033A (en) Data migration method, device, equipment and medium
CN114253449A (en) Screen capturing method, device, equipment and medium
CN116302541A (en) Resource performance adjusting method and device
CN116700866A (en) Window drawing method and device and electronic equipment
CN114595017B (en) Data display method and device, electronic equipment and computer readable storage medium
CN114995663A (en) Word determination method and electronic equipment
CN117271383A (en) Memory recycling management method and device, electronic equipment and readable storage medium
CN116701142A (en) Data acquisition method, device, equipment and storage medium
CN117389645A (en) Application running method, device, electronic equipment and readable storage medium
CN115981765A (en) Content display method and device, electronic equipment and storage medium
CN115344511A (en) File page management method and device, electronic equipment and storage medium
CN116382722A (en) Application program updating method, device and equipment

Legal Events

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