Nothing Special   »   [go: up one dir, main page]

CN111124668A - Memory release method and device, storage medium and terminal - Google Patents

Memory release method and device, storage medium and terminal Download PDF

Info

Publication number
CN111124668A
CN111124668A CN201911190959.5A CN201911190959A CN111124668A CN 111124668 A CN111124668 A CN 111124668A CN 201911190959 A CN201911190959 A CN 201911190959A CN 111124668 A CN111124668 A CN 111124668A
Authority
CN
China
Prior art keywords
memory
terminal
memory release
release
strategy
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.)
Granted
Application number
CN201911190959.5A
Other languages
Chinese (zh)
Other versions
CN111124668B (en
Inventor
虎跃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201911190959.5A priority Critical patent/CN111124668B/en
Publication of CN111124668A publication Critical patent/CN111124668A/en
Application granted granted Critical
Publication of CN111124668B publication Critical patent/CN111124668B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a memory release method, a memory release device, a memory medium and a terminal, and belongs to the field of computers. The method comprises the following steps: when detecting that a terminal meets a memory release condition, determining a use scene of the terminal; and inquiring a target memory release strategy corresponding to the use scene, and executing memory release operation according to the target memory release strategy. The memory release strategy can be determined in a self-adaptive mode according to the use scene, so that the smoothness of terminal operation is improved.

Description

Memory release method and device, storage medium and terminal
Technical Field
The present application relates to the field of memory control, and in particular, to a method and an apparatus for releasing a memory, a storage medium, and a terminal.
Background
The mobile phone can feel obvious blocking after being used for a period of time, and the phenomenon is mainly caused by insufficient memory of the mobile phone due to the fact that a system is largely cached and mobile phone software occupies the system. The mobile phone generally has a memory cleaning function, and reduces the card-passing situations such as card pause by closing background application, for example: and the user double-clicks the memory release icon displayed on the user interface, and the terminal cleans the system memory cache according to a preset release strategy after detecting the operation, so as to improve the smoothness of the terminal operation.
Disclosure of Invention
The memory release method, the memory release device, the storage medium and the terminal provided by the embodiment of the application can solve the problem of poor flexibility caused by using a fixed memory release strategy in the related technology. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a memory release method, where the method includes:
when detecting that the terminal meets the memory release condition, determining the use scene of the terminal;
inquiring a target memory release strategy corresponding to the use scene in a memory release strategy list;
and executing the memory release operation according to the target memory release strategy.
In a second aspect, an embodiment of the present application provides a memory releasing device, where the memory releasing device includes:
the terminal comprises a detection unit, a storage unit and a processing unit, wherein the detection unit is used for determining a use scene of the terminal when detecting that the terminal meets a memory release condition;
the query unit is used for querying a target memory release strategy corresponding to the use scene in the memory release strategy list;
and the release unit is used for executing the memory release operation according to the target memory release strategy.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fourth aspect, an embodiment of the present application provides a terminal, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
when the terminal is detected to meet the memory release condition, the use scene of the terminal is determined, the target memory release strategy corresponding to the use scene is inquired, and the memory release operation is performed on the memory according to the target memory release strategy, so that the problem of low flexibility caused by the fact that a preset fixed memory release strategy is used in the related technology is solved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of an operating system and a user space provided in an embodiment of the present application;
FIG. 3 is an architectural diagram of the android operating system of FIG. 1;
FIG. 4 is an architecture diagram of the IOS operating system of FIG. 1;
fig. 5 is a schematic flowchart of a memory release method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a memory release method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an apparatus according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, a block diagram of a terminal according to an exemplary embodiment of the present application is shown. A terminal in the present application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the entire terminal using various interfaces and lines, and performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-programmable gate array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a read-only Memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like, and the operating system may be an Android (Android) system (including a system based on Android system depth development), an IOS system developed by apple inc (including a system based on IOS system depth development), or other systems. The storage data area may also store data created by the terminal in use, such as a phonebook, audio-video data, chat log data, and the like.
Referring to fig. 2, the memory 120 may be divided into an operating system space, in which an operating system runs, and a user space, in which native and third-party applications run. In order to ensure that different third-party application programs can achieve a better operation effect, the operating system allocates corresponding system resources for the different third-party application programs. However, the requirements of different application scenarios in the same third-party application program on system resources are different, for example, in a local resource loading scenario, the third-party application program has a higher requirement on the disk reading speed; in the animation rendering scene, the third-party application program has a high requirement on the performance of the GPU. The operating system and the third-party application program are independent from each other, and the operating system cannot sense the current application scene of the third-party application program in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third-party application program.
In order to enable the operating system to distinguish a specific application scenario of the third-party application program, data communication between the third-party application program and the operating system needs to be opened, so that the operating system can acquire current scenario information of the third-party application program at any time, and further perform targeted system resource adaptation based on the current scenario.
Taking an operating system as an Android system as an example, programs and data stored in the memory 120 are as shown in fig. 3, and a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360, and an application layer 380 may be stored in the memory 120, where the Linux kernel layer 320, the system runtime library layer 340, and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space. The Linux kernel layer 320 provides underlying drivers for various hardware of the terminal, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, a power management, and the like. The system runtime library layer 340 provides a main feature support for the Android system through some C/C + + libraries. For example, the SQLite library provides support for a database, the OpenGL/ES library provides support for 3D drawing, the Webkit library provides support for a browser kernel, and the like. Also provided in the system runtime library layer 340 is an Android runtime library (Android runtime), which mainly provides some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used in building an application, and developers may build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, package management, session management, resource management, and location management. At least one application program runs in the application layer 380, and the application programs may be native application programs carried by the operating system, such as a contact program, a short message program, a clock program, a camera application, and the like; or a third-party application developed by a third-party developer, such as a game-like application, an instant messaging program, a photo beautification program, a shopping program, and the like.
Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 4, and the IOS system includes: a Core operating system Layer 420(Core OS Layer), a Core Services Layer 440(Core Services Layer), a Media Layer 460(Media Layer), and a touchable Layer 480(Cocoa Touch Layer). The kernel operating system layer 420 includes an operating system kernel, drivers, and underlying program frameworks that provide functionality closer to hardware for use by program frameworks located in the core services layer 440. The core services layer 440 provides system services and/or program frameworks, such as a Foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and so forth, as required by the application. The media layer 460 provides audiovisual related interfaces for applications, such as graphics image related interfaces, audio technology related interfaces, video technology related interfaces, audio video transmission technology wireless playback (AirPlay) interfaces, and the like. Touchable layer 480 provides various common interface-related frameworks for application development, and touchable layer 480 is responsible for user touch interaction operations on the terminal. Such as a local notification service, a remote push service, an advertising framework, a game tool framework, a messaging User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
In the framework shown in FIG. 4, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 440 and a UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a basic library of UI classes for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and the like.
The Android system can be referred to as a mode and a principle for realizing data communication between the third-party application program and the operating system in the IOS system, and details are not repeated herein.
The input device 130 is used for receiving input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens for receiving touch operations of a user on or near the touch display screens by using any suitable object such as a finger, a touch pen, and the like, and displaying user interfaces of various applications. The touch display screen is generally provided at a front panel of the terminal. The touch display screen may be designed as a full-face screen, a curved screen, or a profiled screen. The touch display screen can also be designed to be a combination of a full-face screen and a curved-face screen, and a combination of a special-shaped screen and a curved-face screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configurations of the terminals illustrated in the above-described figures do not constitute limitations on the terminals, as the terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components may be used. For example, the terminal further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the embodiment of the present application, the main body of execution of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or another operating system, which is not limited in this embodiment of the present application.
The terminal of the embodiment of the application can also be provided with a display device, and the display device can be various devices capable of realizing a display function, for example: a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink panel, a Liquid Crystal Display (LCD), a Plasma Display Panel (PDP), and the like. The user can view information such as displayed text, images, video, etc. using the display device on the terminal 101. The terminal may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, an automobile, a data storage device, an audio playing device, a video playing device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
In the terminal shown in fig. 1, the processor 110 may be configured to call an application program stored in the storage 120, and specifically execute the memory release method according to the embodiment of the present application.
According to the technical scheme provided by the embodiment of the application, when the terminal is detected to meet the memory release condition, the use scene of the terminal is determined, the target memory release strategy corresponding to the use scene is inquired, and the memory release operation is performed on the memory according to the target memory release strategy, so that the problem of low flexibility caused by the fact that a pre-configured fixed memory release strategy is used in the related technology is solved.
In the following method embodiments, for convenience of description, only the main execution body of each step is described as a terminal.
The memory release method provided by the embodiment of the present application will be described in detail below with reference to fig. 5 to 6. The memory release device in the embodiment of the present application may be a terminal shown in fig. 5 to 6.
Fig. 5 is a schematic flow chart of a memory releasing method according to an embodiment of the present application. As shown in fig. 5, the method of the embodiment of the present application may include the steps of:
s501, when the terminal is detected to meet the memory release condition, determining the use scene of the terminal.
The memory release condition indicates a condition for executing a memory release operation on the memory, and the terminal may determine whether the memory release condition is satisfied according to a parameter value of an operating state parameter of the memory, for example, the operating state parameter of the memory includes: the total amount of remaining physical memory, the occupancy rate of memory space, the remaining rate of memory space, the total amount of remaining virtual memory, error pages processed by the processor per second (page faults/sec), pages read on the disk per second (page input/sec), and pages written to the disk per second (page output/sec). The terminal may monitor the load state of the memory according to the parameter value of the operating state parameter, for example: when detecting that the total amount of the residual physical memory of the memory is smaller than a preset value, the terminal determines that the load of the memory is too heavy; and when the total amount of the remaining physical memory of the memory is detected to be larger than or equal to a preset value, determining that the load of the memory is normal.
The terminal can determine the corresponding use scene through the identification of the currently running application program, the terminal prestores the mapping relation between the identification of the application program and the use scene, and the terminal queries the use scene corresponding to the identification of the currently running application program in the foreground according to the mapping relation.
S502, inquiring a target memory release strategy corresponding to the use scene.
The terminal prestores or is preconfigured with a memory release strategy list, the memory release strategy list comprises one or more memory release strategies, and the memory release strategies indicate rules of how to store memory space in the memory. For example: the memory release strategy is to release the application which is currently operated and occupies the largest memory; or release the application that was used the least number of times within a preset length of time. The terminal prestores or preconfigures a mapping relation between the use scene and the memory release strategy, and the terminal queries in the mapping relation according to the use scene determined in the step S501 to obtain a corresponding target memory release strategy.
S503, executing the memory release operation according to the target memory release strategy.
The terminal executes the memory release operation according to the target memory release policy in S502, so as to increase the total amount of the remaining physical memory of the memory, reduce the load degree of the memory, and improve the smoothness of the terminal operation.
When the scheme of the embodiment of the application is executed, when the situation that the terminal meets the memory release condition is detected, the use scene of the terminal is determined, the target memory release strategy corresponding to the use scene is inquired, and the memory release operation is performed on the memory according to the target memory release strategy, so that the problem of low flexibility caused by the fact that a pre-configured fixed memory release strategy is used in the related technology is solved.
Fig. 6 is a schematic flow chart of a memory releasing method according to an embodiment of the present disclosure. In this embodiment, an example of applying the memory release method to the terminal is shown, where the memory release method may include the following steps:
s601, setting a plurality of memory release strategies and a plurality of use scenes.
The plurality of memory release strategies may be user-defined or terminal pre-configured, and the plurality of usage scenarios may also be user-defined or terminal pre-configured. The memory release policy represents a policy for releasing a memory space by the terminal, and the memory release policy may be determined according to an applied time locality or space locality principle. The usage scenario represents a scenario in which a user uses the terminal, and generally needs to rely on the internet, for example: the plurality of working scenes comprise game scenes, internet surfing scenes, online video scenes and the like.
S602, one-to-one binding is carried out on a plurality of memory release strategies and a plurality of using scenes to obtain mapping relation information.
The terminal performs one-to-one binding on a plurality of memory release strategies and a plurality of use scenes, the binding relationship is not limited in the embodiment of the application, and can be determined according to the configuration of a user, one use scene is associated with one memory release strategy, mapping relationship information is obtained after binding, and the mapping relationship information can use a mapping table, an array, a stack or other data structures.
For example: the memory release policies are: the method comprises the following steps of a memory release strategy 1, a memory release strategy 2 and a memory release strategy 3, wherein a plurality of use scenes are as follows: the terminal binds the game scene with the memory release strategy 1, binds the internet scene with the memory release strategy 2, and binds the live broadcast scene with the memory release strategy 2, and the mapping relationship information obtained after binding is shown in table 1:
game scene Memory release policy 1
Internet scene Memory release policy 2
Live broadcast scene Memory release policy 3
TABLE 1
S603, judging whether the memory utilization rate is larger than a preset threshold value.
The memory utilization rate represents a ratio of a memory space used by a memory to a whole memory space, for example: the memory space of the memory is 2G, and the currently used memory space is 1G, so that the memory utilization rate is 1G/2G 100% ═ 50%. The larger the memory utilization rate is, the heavier the memory load is, and conversely, the smaller the memory utilization rate is, the lighter the memory load is. The terminal prestores or is preconfigured with a preset threshold value, the terminal compares the memory utilization rate with the preset threshold value, and if the memory utilization rate is greater than the preset threshold value, S604 is executed; if the memory utilization is less than the predetermined threshold, S607 is executed.
For example, if the pre-stored preset threshold of the terminal is 20%, and the terminal determines that the current memory utilization rate is 50%, the current memory utilization rate is greater than the preset threshold, then S604 is executed; the terminal determines that the current memory utilization rate is 10%, and then the current memory utilization rate is smaller than a preset threshold, and executes S607.
And S604, determining the use scene of the terminal.
The terminal can determine a usage scenario according to the type of the application program currently processing the foreground running state, a mapping relation between the application program and the usage scenario is stored in the terminal or the server, the terminal can determine the usage scenario according to the mapping relation, and one usage scenario can correspond to a plurality of application programs.
For example: the mapping relationship between the application programs stored on the terminal and the usage scenarios is shown in table 2:
game scene Wangzi glory and race kart
Internet scene Tencent browser and 360 browser
Video scenes Tremble sound and fast hand
TABLE 2
And when the terminal monitors that the application program currently running in the foreground is a buffeting program, the terminal determines that the current use scene is a game scene according to the mapping relation of the table 2.
And S605, inquiring a target memory release strategy corresponding to the use scene according to the mapping relation information.
And the terminal inquires a target memory release strategy corresponding to the use scene according to the preset mapping relation information.
In one possible implementation, the target memory release policy is: and killing the application program occupying the largest memory space.
The terminal obtains the size of the memory space occupied by each application program which runs in the background at present, determines the application program occupying the largest memory space and kills the process of the application program occupying the largest memory space.
For example: the terminal monitors that the current application program running in the background is as follows: the terminal comprises an application program 1, an application program 2 and an application program 3, wherein the size of a memory space occupied by the application program 1 is 20M, the size of a memory space occupied by the application program 2 is 30M, the size of a memory space occupied by the application program 3 is 50M, and the terminal kills a process corresponding to the application program 3.
In another possible implementation, the target memory release policy is: and killing the application program which is used for the least times within the preset time length.
The terminal obtains the use times of each application program which runs in the background currently in a preset time, the use times represent the times of switching the application program to the foreground running state, and the process corresponding to the application program with the least use times is killed.
For example: the terminal monitors that the current application program running in the background is as follows: the preset time duration of the application program 1, the application program 2 and the application program 3 is a time interval from the starting time to the current time, the use frequency of the application program 1 in the time interval acquired by the terminal is 10 times, the use frequency of the application program 2 is 20 times, the use frequency of the application program 3 is 2 times, and the process of the application program 3 is killed by the terminal.
In another possible implementation, the target memory release policy includes: and when the internal memory meets the internal memory release condition, determining each application program running in the background, and killing the application program occupying the largest internal memory space in the application programs running in the background.
In another possible implementation, the target memory release policy includes: when the unused time of the terminal exceeds the preset time, determining each application program running in the background, and killing the application program with the least use times in the preset time from the application programs running in the background. The method for determining that the terminal is not used may be: and the terminal counts the screen-off duration, and the screen-off duration is taken as the unused duration.
S606, executing the memory releasing operation according to the target memory releasing strategy.
Wherein, the terminal executes the memory release operation according to the target memory release policy determined in S605.
And S607, receiving a selection instruction.
The processor of the terminal receives a selection instruction, wherein the selection instruction can be generated by a user through a touch event, a voice control event or other types of events.
In a possible implementation manner, a plurality of memory release strategies are displayed on a touch display screen of the terminal, a user touches the touch display screen to select one of the plurality of memory release strategies, the touch display screen detects a touch event, the processor generates a selection instruction according to the touch event, and the processor selects one of the plurality of memory release strategies according to the selection instruction.
In another possible implementation, the terminal receives voice data from a user through the audio acquisition device, the terminal continues the voice data to generate a selection instruction, and the terminal selects one of the plurality of pre-stored memory release strategies according to the selection instruction.
For example: the terminal is pre-configured with a memory release strategy 1, a memory release strategy 2 and a memory release strategy 3, receives voice data sent by a user, performs text conversion on the voice data to obtain 'execute memory release according to the memory release strategy 1', generates a corresponding selection instruction according to the converted text, and selects the memory release strategy 1 from the memory release strategies based on the selection instruction.
Furthermore, the terminal stores reference noise data in advance, the reference noise data are generated in advance according to environmental noise, and the terminal performs difference processing on the reference noise data and the received voice data to obtain voice data with noise filtered, so that the environmental noise in the voice data is reduced, and the accuracy of identifying and selecting instructions can be improved.
S608, selecting a memory release strategy from the plurality of memory release strategies according to the selection instruction.
The terminal selects a memory release policy from the plurality of memory release policies according to a selection instruction triggered by the user in S607.
And S609, executing the memory release operation according to the memory release strategy.
When the scheme of the embodiment of the application is executed, when the situation that the terminal meets the memory release condition is detected, the use scene of the terminal is determined, the target memory release strategy corresponding to the use scene is inquired, and the memory release operation is performed on the memory according to the target memory release strategy, so that the problem of low flexibility caused by the fact that a pre-configured fixed memory release strategy is used in the related technology is solved.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 7, a schematic structural diagram of a memory releasing device according to an exemplary embodiment of the present application is shown. Hereinafter referred to as means 7, the means 7 may be implemented by software, hardware or a combination of both as all or part of a terminal. The device 7 comprises a detection unit 701, a query unit 702 and an acquisition unit 703.
A detecting unit 701, configured to determine a usage scenario of a terminal when detecting that the terminal meets a memory release condition;
a querying unit 702, configured to query a target memory release policy corresponding to the usage scenario;
a releasing unit 703 is configured to execute a memory release operation according to the target memory release policy.
In one or more embodiments, the detecting unit 701 is further configured to detect a memory utilization rate of the terminal;
and determining that the terminal meets the memory release condition under the condition that the memory utilization rate is greater than a utilization rate threshold value.
In one or more embodiments, the releasing unit 703 is further configured to receive, by an audio acquisition device, voice data when the memory utilization rate is less than or equal to a utilization rate threshold;
analyzing the voice data to obtain a selection instruction;
determining a memory release strategy corresponding to the selection instruction in a plurality of memory release strategies;
and executing the memory release operation according to the memory release strategy.
In one or more embodiments, the receiving, by an audio capture device, voice data includes:
acquiring pre-stored reference noise data;
and carrying out differential processing on the reference noise data and the voice data to obtain voice data with noise filtered.
In one or more embodiments, the usage scenario is a game scenario;
wherein, the executing the memory releasing operation according to the memory releasing strategy comprises:
counting the memory utilization rate of each application program running in the background in the terminal;
and releasing the memory space corresponding to the application program with the maximum memory utilization rate.
In one or more embodiments, the usage scenario is an online video scenario;
wherein, the executing the memory releasing operation according to the memory releasing strategy comprises:
counting the use times of each application program running in the background in the terminal within a preset time length;
and releasing the memory space occupied by the application program with the least use times.
In one or more embodiments, the apparatus 7 further comprises:
the device comprises a setting unit, a storage unit and a processing unit, wherein the setting unit is used for setting a plurality of memory release strategies and usage scenes associated with the memory release strategies of the memory release strategies;
and storing the plurality of memory release strategies and scenes associated with the memory release strategies.
It should be noted that, when the apparatus 7 provided in the foregoing embodiment executes the memory releasing method, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the embodiments of the memory release method provided by the above embodiments belong to the same concept, and details of implementation processes are found in the embodiments of the method, which are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
When the terminal is detected to meet the memory release condition, the use scene of the terminal is determined, the target memory release strategy corresponding to the use scene is inquired, and the memory release operation is performed on the memory according to the target memory release strategy, so that the problem of low flexibility caused by the fact that a preset fixed memory release strategy is used in the related technology is solved.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executing the method steps in the embodiments shown in fig. 5 to 6, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 5 to 6, which are not described herein again.
The present application further provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the memory release method according to the above embodiments.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (10)

1. A method for releasing a memory, the method comprising:
when detecting that a terminal meets a memory release condition, determining a use scene of the terminal;
inquiring a target memory release strategy corresponding to the use scene;
and executing the memory release operation according to the target memory release strategy.
2. The method according to claim 1, wherein before detecting that the terminal satisfies the memory release condition, the method further comprises:
detecting the memory utilization rate of the terminal;
and determining that the terminal meets the memory release condition under the condition that the memory utilization rate is greater than a utilization rate threshold value.
3. The method of claim 2, further comprising:
when the memory utilization rate is less than or equal to a utilization rate threshold value, receiving voice data through an audio acquisition device;
analyzing the voice data to obtain a selection instruction;
determining a memory release strategy corresponding to the selection instruction in a plurality of memory release strategies;
and executing the memory release operation according to the memory release strategy.
4. The method of claim 3, wherein receiving voice data via an audio capture device comprises:
acquiring pre-stored reference noise data;
and carrying out differential processing on the reference noise data and the voice data to obtain voice data with noise filtered.
5. The method according to claim 1 or 2, wherein the usage scenario is a game scenario;
wherein, the executing the memory releasing operation according to the memory releasing strategy comprises:
counting the memory utilization rate of each application program running in the background in the terminal;
and releasing the memory space corresponding to the application program with the maximum memory utilization rate.
6. The method according to claim 1 or 2, wherein the usage scenario is an online video scenario;
wherein, the executing the memory releasing operation according to the memory releasing strategy comprises:
counting the use times of each application program running in the background in the terminal within a preset time length;
and releasing the memory space occupied by the application program with the least use times.
7. The method according to claim 1, wherein before determining the usage scenario of the terminal when detecting that the terminal satisfies the memory release condition, the method further comprises:
setting a plurality of memory release strategies and a use scene associated with each memory release strategy of the plurality of memory release strategies;
and storing the plurality of memory release strategies and scenes associated with the memory release strategies.
8. A memory release device, the device comprising:
the terminal comprises a detection unit, a judging unit and a judging unit, wherein the detection unit is used for determining a use scene of the terminal when detecting that the terminal meets a memory release condition;
the query unit is used for querying a target memory release strategy corresponding to the use scene;
and the release unit is used for executing the memory release operation according to the target memory release strategy.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 7.
10. A terminal, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 7.
CN201911190959.5A 2019-11-28 2019-11-28 Memory release method, memory release device, storage medium and terminal Active CN111124668B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911190959.5A CN111124668B (en) 2019-11-28 2019-11-28 Memory release method, memory release device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911190959.5A CN111124668B (en) 2019-11-28 2019-11-28 Memory release method, memory release device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN111124668A true CN111124668A (en) 2020-05-08
CN111124668B CN111124668B (en) 2023-09-15

Family

ID=70496963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911190959.5A Active CN111124668B (en) 2019-11-28 2019-11-28 Memory release method, memory release device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN111124668B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666153A (en) * 2020-05-25 2020-09-15 深圳Tcl新技术有限公司 Cache task management method, terminal device and storage medium
CN112217940A (en) * 2020-08-28 2021-01-12 深圳市修远文化创意有限公司 Memory release method and related device
CN112333529A (en) * 2020-11-02 2021-02-05 广州华多网络科技有限公司 Live streaming loading method and device, equipment and medium thereof
WO2022143446A1 (en) * 2021-01-04 2022-07-07 华为技术有限公司 Memory release method and related device
CN116382896A (en) * 2023-02-27 2023-07-04 荣耀终端有限公司 Calling method of image processing algorithm, terminal equipment, medium and product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778086A (en) * 2015-04-15 2015-07-15 天脉聚源(北京)教育科技有限公司 Method and device for releasing resources
CN106201717A (en) * 2016-07-01 2016-12-07 珠海市魅族科技有限公司 A kind of method managing Installed System Memory and terminal
CN107577533A (en) * 2017-08-31 2018-01-12 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN107766211A (en) * 2017-10-31 2018-03-06 努比亚技术有限公司 Freeze screen prevention method, mobile terminal and computer-readable recording medium
CN110221921A (en) * 2019-06-13 2019-09-10 深圳Tcl新技术有限公司 EMS memory management process, terminal and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778086A (en) * 2015-04-15 2015-07-15 天脉聚源(北京)教育科技有限公司 Method and device for releasing resources
CN106201717A (en) * 2016-07-01 2016-12-07 珠海市魅族科技有限公司 A kind of method managing Installed System Memory and terminal
CN107577533A (en) * 2017-08-31 2018-01-12 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN107766211A (en) * 2017-10-31 2018-03-06 努比亚技术有限公司 Freeze screen prevention method, mobile terminal and computer-readable recording medium
CN110221921A (en) * 2019-06-13 2019-09-10 深圳Tcl新技术有限公司 EMS memory management process, terminal and computer readable storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666153A (en) * 2020-05-25 2020-09-15 深圳Tcl新技术有限公司 Cache task management method, terminal device and storage medium
CN111666153B (en) * 2020-05-25 2024-07-05 深圳Tcl新技术有限公司 Cache task management method, terminal device and storage medium
CN112217940A (en) * 2020-08-28 2021-01-12 深圳市修远文化创意有限公司 Memory release method and related device
CN112333529A (en) * 2020-11-02 2021-02-05 广州华多网络科技有限公司 Live streaming loading method and device, equipment and medium thereof
CN112333529B (en) * 2020-11-02 2022-08-05 广州华多网络科技有限公司 Live streaming loading method and device, equipment and medium thereof
WO2022143446A1 (en) * 2021-01-04 2022-07-07 华为技术有限公司 Memory release method and related device
CN116382896A (en) * 2023-02-27 2023-07-04 荣耀终端有限公司 Calling method of image processing algorithm, terminal equipment, medium and product
CN116382896B (en) * 2023-02-27 2023-12-19 荣耀终端有限公司 Calling method of image processing algorithm, terminal equipment, medium and product

Also Published As

Publication number Publication date
CN111124668B (en) 2023-09-15

Similar Documents

Publication Publication Date Title
EP3754490B1 (en) User interface rendering method and apparatus, and terminal
CN111124668B (en) Memory release method, memory release device, storage medium and terminal
CN109343902B (en) Audio processing assembly operation method and device, terminal and storage medium
US20230035047A1 (en) Remote assistance method, device, storage medium, and terminal
CN110413347B (en) Advertisement processing method and device in application program, storage medium and terminal
CN110702346B (en) Vibration testing method and device, storage medium and terminal
CN113268212A (en) Screen projection method and device, storage medium and electronic equipment
CN111127469A (en) Thumbnail display method, device, storage medium and terminal
CN111913614B (en) Multi-picture display control method and device, storage medium and display
CN109522131A (en) Resource allocation method, device and equipment
CN110730300A (en) Camera control method, device, storage medium and terminal
CN112995562A (en) Camera calling method and device, storage medium and terminal
CN112114965A (en) Application program running method and device, terminal and storage medium
CN117555459A (en) Application group processing method and device, storage medium and electronic equipment
CN113098859B (en) Webpage page rollback method, device, terminal and storage medium
CN112612633A (en) Inter-process communication method, device, storage medium and terminal
CN111859999A (en) Message translation method, device, storage medium and electronic equipment
CN113419650A (en) Data moving method and device, storage medium and electronic equipment
CN115220983A (en) Electric quantity display method and device, storage medium and terminal equipment
CN113268414A (en) Distribution method and device of experimental versions, storage medium and computer equipment
CN111538997A (en) Image processing method, image processing device, storage medium and terminal
CN112612487B (en) Application installation method, device, storage medium and terminal
WO2023273936A1 (en) Wallpaper setting method and apparatus, and storage medium and electronic device
CN114443204B (en) Interface content generation method, device, storage medium and computer equipment
CN113778386B (en) Component generation method and device, storage medium and electronic equipment

Legal Events

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