CN112162704A - Storage space releasing method and device - Google Patents

Storage space releasing method and device Download PDF

Info

Publication number
CN112162704A
CN112162704A CN202011032593.1A CN202011032593A CN112162704A CN 112162704 A CN112162704 A CN 112162704A CN 202011032593 A CN202011032593 A CN 202011032593A CN 112162704 A CN112162704 A CN 112162704A
Authority
CN
China
Prior art keywords
storage space
release
target
mode
electronic device
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
CN202011032593.1A
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 CN202011032593.1A priority Critical patent/CN112162704A/en
Publication of CN112162704A publication Critical patent/CN112162704A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The application discloses a storage space releasing method and a device thereof, belonging to the technical field of communication. The method comprises the following steps: determining a target release mode according to the used state of a storage space of the electronic equipment, wherein the used state of the storage space is determined according to the data writing amount of the storage space in a preset time length; and in the target time period, releasing the storage space of the electronic equipment by adopting a releasing operation corresponding to the target releasing mode, wherein the target time period is the time period when the electronic equipment is in an idle state. The method is applied to the scene of releasing the storage space.

Description

Storage space releasing method and device
Technical Field
The present application belongs to the field of communication technologies, and in particular, to a method and an apparatus for releasing a storage space.
Background
With the rapid development of communication technology, the storage space of electronic equipment is larger and larger, and the storage performance requirements of users on the electronic equipment are also higher and higher.
At present, the data writing mode of the electronic device mostly adopts a remote updating mode, specifically, when the electronic device updates data, the electronic device may mark the original data as invalid, and then write new valid data in a new address. Accordingly, when the electronic device deletes data, only the data that needs to be deleted is generally marked as invalid, and the data is not erased. Generally, when the storage space of the electronic device is insufficient and the reading and writing of data by the electronic device is seriously affected, the electronic device may release more storage space through a background operation mode (e.g., garbage collection) specified by a joint electronic device engineering committee (joint electronic device engineering) protocol to meet the storage space requirement of the electronic device.
However, since frequent enabling of the background operation may cause the service life of the electronic device to decrease, the electronic device usually releases the storage space only when the storage performance of the electronic device decreases to a certain threshold. Therefore, when a user demands the electronic equipment to write in a large amount of data, if the remaining storage space of the electronic equipment is possibly insufficient, the electronic equipment needs to release the storage space through a background operation mode firstly and then write in the data required by the user, so that the electronic equipment cannot respond to the requirement of the user for reading and writing the data in time, namely, the speed of the electronic equipment for reading and writing the data is reduced, and the storage performance of the electronic equipment is poor.
Disclosure of Invention
The embodiment of the application aims to provide a storage space release method and a storage space release device, which can solve the problem that the storage performance of the electronic equipment is poor due to the fact that the conventional electronic equipment cannot respond to the requirement of a user for reading and writing data in time.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides a storage space releasing method, where the method includes: determining a target release mode according to the used state of a storage space of the electronic equipment, wherein the used state of the storage space is determined according to the data writing amount of the storage space in a preset time length; and in the target time period, releasing the storage space of the electronic equipment by adopting a releasing operation corresponding to the target releasing mode, wherein the target time period is the time period when the electronic equipment is in an idle state.
In a second aspect, an embodiment of the present application provides a storage space releasing device, including: a determining module and a releasing module; the determining module is used for determining a target release mode according to the used state of the storage space of the electronic equipment, wherein the used state of the storage space is determined according to the data writing amount of the storage space in a preset time length; and the release module is used for releasing the storage space of the electronic equipment by adopting a release operation corresponding to the target release mode determined by the determination module in a target time period, wherein the target time period is a time period when the electronic equipment is in an idle state.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement 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 the processor is configured to execute a program or instructions to implement the steps of the method according to the first aspect.
In the embodiment of the application, the target release mode can be determined according to the used state of the storage space of the electronic device (determined according to the data writing amount of the storage space in the preset time length); in a target time period (a time period in which the electronic device is in an idle state), a release operation corresponding to a target release mode is adopted to release the storage space of the electronic device. Through the scheme, on one hand, the data writing amount of the storage space of the electronic equipment in the preset time can reflect the use requirement of a user on the storage space of the electronic equipment, so that the target release mode determined according to the used state of the storage space can be matched with the use requirement (such as reading and writing requirements) of the user on the storage space, the storage space of the electronic equipment is released through the release operation corresponding to the target release mode, the remaining storage space of the electronic equipment can be ensured to meet the use requirement of the user on the storage space, and therefore when the user needs to write a large amount of data, the electronic equipment can directly and quickly respond to the requirement of the user. On the other hand, since the storage space of the electronic device is released in the target time period when the electronic device is in the idle state, the influence of the release operation of the storage space on the response of the electronic device to the use demand of the user on the storage space can be reduced, and therefore, the influence on the speed of the response of the electronic device to the use demand of the user on the storage space can be reduced. Therefore, the storage space releasing method provided by the embodiment of the application can improve the storage performance of the electronic equipment.
Drawings
Fig. 1 is a schematic flowchart of a method for releasing a storage space according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a storage space releasing apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4 is a hardware schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The following describes in detail a storage space releasing method provided in the embodiments of the present application with reference to the accompanying drawings and specific embodiments and application scenarios thereof.
As shown in fig. 1, an embodiment of the present application provides a storage space releasing method, which may include steps 201 and 202 described below.
It should be noted that, in the storage space releasing method provided in the embodiment of the present application, the executing main body may be a storage space releasing device, or a control module in the storage space releasing device for executing the storage space releasing method, and may also be an electronic device (the electronic device may include the storage space releasing device in the embodiment of the present application, or be externally connected to the storage space releasing device). The embodiment of the present application takes an electronic device as an example, and exemplarily illustrates a method for releasing a storage space provided in the embodiment of the present application.
Step 201, the electronic device determines a target release mode according to the used state of the storage space of the electronic device.
The used state of the storage space of the electronic device may be determined according to the data writing amount of the storage space of the electronic device within a preset time period.
Step 202, the electronic device releases the storage space of the electronic device in the target time period by adopting a release operation corresponding to the target release mode.
The target time period may be a time period when the electronic device is in an idle state.
In this embodiment of the application, the electronic device may determine the target release mode according to a used state of a storage space of the electronic device (hereinafter, referred to as a used state of the storage space), and then the electronic device may release the storage space of the electronic device by using a release operation corresponding to the target release mode in a time period in which the electronic device is in an idle state (i.e., the above-mentioned target time period).
Optionally, in this embodiment of the present application, the used state of the storage space refers to a data writing amount of the storage space within a preset time period. The data writing amount may not include a modification amount of the original data in the storage space by the electronic device. That is, the data writing amount is the amount of data newly written in the storage space by the electronic device.
Optionally, in this embodiment of the application, the preset time period may be any possible time period such as 24 hours (i.e., one day), 48 hours, 72 hours, or a week, and may be determined specifically according to an actual use requirement, and this embodiment of the application is not limited.
Optionally, in this embodiment of the application, the electronic device may determine, according to a habit and time of the user using the electronic device every day, a time when the user does not use the electronic device, that is, a time when the electronic device is in an idle state, so as to obtain the target time period.
Illustratively, the target time period may be 1:00 a.m. to 5:00 a.m.
In the embodiment of the present application, since the release operation is time-consuming, if the electronic device releases the storage space of the electronic device through the release operation corresponding to the target release mode during the period that the user uses the electronic device, the performance of the electronic device may be reduced, for example, a phenomenon such as stuck occurs. In this way, the electronic device may release the storage space of the electronic device by using the release operation corresponding to the target release mode in the time period (i.e., the target time period) in which the electronic device is in the idle state, so that the influence on the user experience may be reduced.
In the embodiment of the application, the used states of the storage spaces are different, and the target release modes can be different; the target release modes are different, and the release operations corresponding to the target release modes can be different.
For the correspondence between the used state of the storage space and the target release mode, and the correspondence between the target release mode and the corresponding release operation, the embodiments of the present application will be described in detail in the following embodiments, which are not described herein again.
The embodiment of the application provides a storage space release method, on one hand, because the data write-in amount of the storage space of an electronic device in a preset time length can reflect the use requirement of a user on the storage space of the electronic device, a target release mode determined according to the used state of the storage space can be matched with the use requirement (such as read-write requirement) of the user on the storage space, so that the storage space of the electronic device can be released through the release operation corresponding to the target release mode, the remaining storage space of the electronic device can be ensured to meet the use requirement of the user on the storage space, and therefore when the user needs to write in a large amount of data, the electronic device can directly and quickly respond to the requirement of the user. On the other hand, since the storage space of the electronic device is released in the target time period when the electronic device is in the idle state, the influence of the release operation of the storage space on the response of the electronic device to the use demand of the user on the storage space can be reduced, and therefore, the influence on the speed of the response of the electronic device to the use demand of the user on the storage space can be reduced. Therefore, the storage space releasing method provided by the embodiment of the application can improve the storage performance of the electronic equipment.
Optionally, in this embodiment of the application, before the electronic device determines the target release mode according to the used state of the storage space, the electronic device may first determine a data writing amount of the storage space of the electronic device within the preset time period, so as to determine the used state of the storage space by comparing the data writing amount with a specific threshold (e.g., a target threshold in this embodiment of the application).
In this embodiment of the present application, before the step 201, the method for releasing a storage space provided in this embodiment of the present application may further include the following step 203 and step 204.
Step 203, the electronic device determines the data writing amount of the storage space of the electronic device within a preset time length.
And step 204, the electronic equipment determines the used state of the storage space of the electronic equipment by comparing the data writing amount with a target threshold.
The data writing amount is greater than or equal to a target threshold, and the used state of the storage space of the electronic equipment can be a first state; the data writing amount is smaller than the target threshold, and the used state of the storage space of the electronic equipment can be a second state; the manner in which the release pattern is determined corresponding to the first state may be different from the manner in which the release pattern is determined corresponding to the second state.
It can be understood that the above "data writing amount of the storage space of the electronic device within the preset time length" refers to the data writing amount of the electronic device within the storage space within the preset time length.
In this embodiment of the application, before the electronic device determines the target release mode according to the used state of the storage space, the electronic device may first determine a data write amount of the storage space of the electronic device within a preset time, and then the electronic device may determine the used state of the storage space by comparing the data write amount with the target threshold.
In the embodiment of the application, the electronic device can determine the data writing amount of the storage space within the preset time by acquiring the available storage space in the storage space of the electronic device. For example, the amount of data written in the storage space per day.
Optionally, in this embodiment of the application, the target threshold may be determined according to a reference data amount.
In this embodiment of the application, the reference data amount may be calculated according to a total write parameter of a storage space of the electronic device and a lifetime of the electronic device.
For example, assuming that the storage space of the electronic device is 128 Gigabytes (GB), the number of written TBs is 200TBW, and the electronic device can be used for 5 years, the average storage space can be written with data of (200TB/5 × 365) ═ 109GB per day. That is, the reference data amount may be 109 GB.
For example, in the embodiment of the present application, the target threshold may be 50% of the reference data amount.
Alternatively, in this embodiment of the present application, the first state may be a light usage state, and the second state may be a normal usage state or a heavy usage state.
It is understood that the light usage state refers to a storage space with a small data writing amount in a preset time period, and the normal usage state or the heavy usage state refers to a storage space with a large data writing amount in the preset time period.
For example, assuming that the target threshold is 50% of the reference data amount, when the average daily data writing amount of the storage space in the last three months is less than 50% of the reference data amount, the electronic device may determine that the usage state of the storage space is a light usage state (i.e., the first state); otherwise, the normal use state or the heavy use state (i.e. the above-mentioned second state) is set.
In the embodiment of the application, the electronic device may determine the used state of the storage space more accurately by comparing the data write-in amount of the determined storage space within the preset time period with the target threshold, so that the target release mode is determined by adopting a release mode determining manner corresponding to the used state of the storage space according to the used state of the storage space, and the target release mode determined by the electronic device may be applicable to the used state of the storage space of the current electronic device, that is, the target release mode determined by the electronic device may meet the use requirement of the user.
Optionally, in this embodiment of the application, the used states of the storage spaces are different, and the electronic device may determine the target release mode according to the used states of the storage spaces in different manners.
The following describes an exemplary manner in which the electronic device determines the target release pattern according to the used state of the storage space, specifically in two possible cases.
In the first case: when the used state of the storage space of the electronic device is the first state, the electronic device directly determines that the target release mode is the first release mode.
In the embodiment of the present application, in the first case, the step 201 may be specifically determined by the step 201a described below.
Step 201a, the electronic device determines that the target release mode is the first release mode according to the first state.
In this embodiment of the application, when the used state of the storage space is the first state, the electronic device may directly determine that the target release mode is the first release mode.
In the second case: when the used state of the electronic device is the second state, the electronic device may determine, according to the usage mode of the storage space, a performance requirement of the user on the electronic device (i.e., determine the usage mode of the electronic device in the embodiment of the present application), and then determine the target release mode according to the usage mode of the electronic device.
In the embodiment of the present application, for the second case, the step 201 can be specifically realized by the following steps 201b and 201 c.
Step 201b, the electronic device determines the usage mode of the electronic device according to the used state of the storage space.
The usage mode of the electronic device can be used for indicating the performance requirement of the user on the electronic device.
Step 201c, the electronic device determines a target release mode according to the usage mode of the electronic device.
The usage mode of the electronic device is a performance priority mode, and the target release mode may be a first release mode; the usage mode of the electronic device is a life priority mode, the target release mode may be a second release mode, and the release operations corresponding to the first release mode and the second release mode may be different.
In this embodiment of the application, when the used state of the storage space is the second state, the electronic device may determine the usage mode of the electronic device first, so as to determine the target release mode according to the usage mode of the electronic device.
Optionally, in this embodiment of the present application, the electronic device may include a function control for setting the performance priority mode, and if the electronic device starts the function control, the usage mode of the electronic device is the performance priority mode; if the control is not started by the electronic equipment, the service mode of the electronic equipment is a life priority mode.
For example, assuming that the user wants to replace the new electronic device, the user may trigger the electronic device to set the usage mode to the performance priority mode; alternatively, some users may not consider the lifetime of the electronic device (e.g., may use the electronic device for 5 years, and replace the electronic device with a new one for only 2 years), and then the user may choose to trigger the electronic device to set the usage mode to the performance priority mode.
It will be appreciated that the user has final decision-making rights with respect to the usage pattern of the electronic device.
Optionally, in this embodiment of the application, the release operation corresponding to the first release mode may include at least one of the following operations: background storage space releasing operation, defragmentation operation and garbage recycling operation; the release operation corresponding to the second release operation may include a background storage space release operation.
Of course, in actual implementation, the first release mode and the second release mode may also correspond to any other possible release operations, which may be determined according to actual usage requirements, and the embodiment of the present application is not limited.
Optionally, in this embodiment of the application, for the release operation corresponding to the first release mode, the electronic device may simultaneously execute the release operation corresponding to the first release mode, or may sequentially execute the release operation corresponding to the first release mode. The method can be determined according to actual use requirements, and the embodiment of the application is not limited.
In this embodiment of the present application, the foregoing background storage space release operation belongs to an operation in the JEDEC protocol function, and may be set to a manual mode of the electronic device (that is, a user triggers the electronic device to perform the background storage space release operation) and an automatic mode of the memory chip (that is, the memory chip performs the background storage space release operation autonomously). The background storage space releasing operation may include operations of erasing data, garbage collection, and the like.
In this embodiment, the defragmentation operation may be an operation in a function defined by a manufacturer of the electronic device. Because when the storage space of the electronic device is fragmented seriously (for example, when the number of times of modifying one file is large and is relatively discrete, a plurality of small data blocks of the file are stored in the storage space, so that the fragmentation of the storage space is serious), the storage performance of the electronic device is significantly reduced, and the storage performance can be improved by defragmentation. Wherein the defragmentation operation may comprise putting data of one file into the same cell or into a plurality of cells in parallel.
In this embodiment, the garbage collection operation may also be an operation in a function defined by a manufacturer of the electronic device. Wherein the garbage collection operation may comprise deleting data in a file. Specifically, the electronic device may move valid data in one file to another file, and then manipulate the file.
In the embodiment of the application, when the electronic device starts the garbage collection operation due to data being written in by the electronic device, the writing performance of the storage space of the electronic device may be obviously reduced, but if the garbage collection operation is frequently started, the service life of the electronic device (specifically, the service life of the storage space of the electronic device) may be affected, so that the electronic device only starts the garbage collection operation in the first release operation to ensure the service life of the electronic device.
In the embodiment of the application, the storage performance of the storage space of the electronic equipment can be improved to a greater extent through the release operation corresponding to the first release mode, so that the best user experience is achieved; the release operation corresponding to the second release mode can improve the storage performance of the storage space of the electronic equipment as much as possible on the premise of not sacrificing the service life of the electronic equipment, and reduce the pause phenomenon, so that the read-write function of the storage space of the electronic equipment is smoother.
Optionally, in this embodiment of the application, in the process that the electronic device releases the storage space of the electronic device by using the release operation corresponding to the target release mode, if the electronic device determines that the user has a need to use the electronic device (for example, the electronic device receives an operation that the user lights up a screen of the electronic device), the electronic device may end the release operation, so as to avoid affecting performance of the electronic device during the use process.
It can be understood that, in the embodiment of the present application, in the process of releasing the storage space by the electronic device, if the electronic device has not received the input of the user all the time, the electronic device may continuously adopt the release operation corresponding to the target release mode to release the storage space until the release operation is completed.
In this embodiment, after step 202, the method for releasing storage space provided in this embodiment may further include step 205 described below.
Step 205, in the process of releasing the storage space, if any input is received by the electronic device, the releasing operation is ended.
In this embodiment of the application, in the process of performing the release operation by the electronic device, the electronic device may detect whether the electronic device receives an input of a user, for example, the user triggers the electronic device to light an input of a screen of the electronic device, and if the electronic device receives the input of the user, the electronic device may determine that the user has a demand for using the electronic device, so that the electronic device may end the release operation corresponding to the target release mode, and reduce an influence on user experience.
Optionally, in this embodiment of the application, the electronic device may further determine, according to information (e.g., target information in this embodiment) such as a service life of the electronic device and/or historical usage information of a storage space of the electronic device, whether a current usage pattern of the storage space is consistent with a usage pattern determined by a previous electronic device, and if not, the electronic device may update the usage pattern of the storage space.
Optionally, the storage space releasing method provided in this embodiment of the present application may further include step 206 described below.
And step 206, the electronic equipment updates the used state of the storage space of the electronic equipment according to the target information.
Wherein, the target information may include at least one of the following: service life information of the electronic device, historical usage information of a storage space of the electronic device.
In this embodiment, the electronic device may further update the usage mode of the storage control according to the target information, so that the electronic device can use the most accurate usage mode of the storage space to determine the target release mode.
In the embodiment of the present application, after the electronic device determines the used state of the storage space, the electronic device may determine again whether the used state of the storage space needs to be modified (i.e., updated) according to the service life information of the electronic device and/or the historical use information of the electronic device (e.g., actual use condition of the storage space from the beginning of using the electronic device to the current electronic device).
In this embodiment of the application, the historical usage information of the storage space may include historical usage of the electronic device. The historical usage may be determined based on the actual life loss of the electronic device (where 10% may be a level) and the number of days of use of the storage space. If the historical usage of the electronic device is also less than 50% of the reference value, the used state of the storage space may be determined to be a light usage state, and vice versa to be a normal or heavy usage state.
In the embodiment of the application, the used state of the storage space can be updated according to at least one of the service life information of the electronic equipment and the historical use information of the storage space, so that the electronic equipment can determine the target release mode according to the used state of the storage space most accurately, the release operation adopted by the electronic equipment is closest to the actual use requirement of a user, and the release operation of the electronic equipment for releasing the storage space is more reasonable.
In the embodiment of the present application, a method for executing a storage space release by a storage space release apparatus is taken as an example, and the storage space release apparatus provided in the embodiment of the present application is described.
As shown in fig. 2, an embodiment of the present application provides a storage space releasing apparatus 300, where the storage space releasing apparatus 300 may include: a determination module 301 and a release module 302. The determining module 301 is configured to determine a target release mode according to a used state of a storage space of the electronic device, where the used state is determined according to a data write amount of the storage space within a preset time duration; a releasing module 302, configured to release the storage space of the storage space releasing apparatus in a target time period by using a releasing operation corresponding to the target releasing mode determined by the determining module 301, where the target time period is a time period when the electronic device is in an idle state.
The storage space releasing device provided by the embodiment of the application, on one hand, because the data writing amount of the storage space of the electronic equipment in the preset time length can reflect the use requirement of a user on the storage space of the electronic equipment, the target release mode determined according to the used state of the storage space can be matched with the use requirement (such as read-write requirement) of the user on the storage space, so that the storage space of the electronic equipment can be released through the release operation corresponding to the target release mode, the remaining storage space of the electronic equipment can be ensured to meet the use requirement of the user on the storage space, and therefore when a large amount of data is written by the user requirement, the electronic equipment can directly and quickly respond to the requirement of the user. On the other hand, since the storage space of the electronic device is released in the target time period when the electronic device is in the idle state, the influence of the release operation of the storage space on the response of the electronic device to the use demand of the user on the storage space can be reduced, and therefore, the influence on the speed of the response of the electronic device to the use demand of the user on the storage space can be reduced. Therefore, the storage space releasing method provided by the embodiment of the application can improve the storage performance of the electronic equipment.
Optionally, the determining module is further configured to determine, before determining the target release mode according to the used state of the storage space of the electronic device, a data write-in amount of the storage space within a preset time period, and determine the used state of the storage space by comparing the data write-in amount with a target threshold, where the data write-in amount is greater than or equal to the target threshold, and the used state of the storage space is a first state; the data writing amount is smaller than the target threshold value, and the used state of the storage space is a second state; and the mode of determining the release mode corresponding to the first state is different from the mode of determining the release mode corresponding to the second state.
According to the storage space releasing device provided by the embodiment of the application, the used state of the storage space can be accurately determined by comparing the data writing amount of the storage space in the preset time with the target threshold value, so that the target releasing mode is determined by adopting a releasing mode determining mode corresponding to the used state of the storage space according to the used state of the storage space, the target releasing mode determined by the storage space releasing device can be suitable for the used state of the storage space of the current electronic equipment, and the target releasing mode determined by the storage space releasing device can meet the use requirement of a user.
Optionally, the determining module is specifically configured to determine, according to the first state, that the target release mode is the first release mode; or the determining module is specifically configured to determine a usage mode of the electronic device according to the second state, and determine a target release mode according to the usage mode of the electronic device, where the usage mode of the electronic device is used to indicate a performance requirement of a user on the electronic device; the use mode is a performance priority mode, and the target release mode is a first release mode; the service mode is a life priority mode, the target release mode is a second release mode, and the release operations corresponding to the first release mode and the second release mode are different.
Optionally, the release operation corresponding to the first release mode includes at least one of the following operations: background storage space releasing operation, defragmentation operation and garbage recycling operation; and the release operation corresponding to the second release operation comprises a background storage space release operation.
According to the storage space release device provided by the embodiment of the application, the storage performance of the storage space release device can be improved to a greater extent through the release operation corresponding to the first release mode, and the best user experience is achieved; the corresponding release operation of the second release mode can improve the storage performance of the storage space of the electronic equipment as much as possible on the premise of not sacrificing the service life of the storage space release device, and reduce the blocking phenomenon, so that the read-write function of the storage space of the electronic equipment is smoother.
In the embodiment of the application, the storage space releasing device further comprises an ending module; and the ending module is used for ending the releasing operation if any input is received in the process of releasing the storage space.
According to the storage space releasing device provided by the embodiment of the application, in the process that the storage space releasing device performs the releasing operation, the storage space releasing device can detect whether the electronic equipment receives the input of a user, for example, the user triggers the electronic equipment to light the screen of the electronic equipment, and if the electronic equipment receives the input of the user, the storage space releasing device can determine that the user has a demand for using the electronic equipment, so that the storage space releasing device can end the releasing operation corresponding to the target releasing mode, and the influence on the user experience is reduced.
Optionally, the storage space releasing apparatus further includes an updating module; the updating module is used for updating the used state of the storage space according to the target information; wherein the target information comprises at least one of: service life information of the electronic equipment and historical use information of the storage space.
According to the storage space releasing device provided by the embodiment of the application, the used state of the storage space can be updated according to at least one item of the service life information of the electronic equipment and the historical use information of the storage space, so that the storage space releasing device can determine the target releasing mode according to the used state of the storage space most accurately, the releasing operation adopted by the storage space releasing device is closest to the actual use requirement of a user, and the releasing operation of the storage space releasing device for releasing the storage space is more reasonable.
The storage space releasing device in the embodiment of the present application may be a device, and may also be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The storage space releasing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The storage space releasing device provided in the embodiment of the present application can implement each process implemented by the above method embodiment, and is not described here again to avoid repetition.
Optionally, as shown in fig. 3, an electronic device 400 is further provided in this embodiment of the present application, and includes a processor 401, a memory 402, and a program or an instruction stored in the memory 402 and executable on the processor 401, where the program or the instruction is executed by the processor 401 to implement each process of the foregoing embodiment of the storage space release method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic device and the non-mobile electronic device described above.
Fig. 4 is a schematic diagram of a hardware structure of an electronic device implementing the embodiment of the present application.
The electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010.
Those skilled in the art will appreciate that the electronic device 1000 may further comprise a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 1010 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 4 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 1010 is configured to determine a target release mode according to a used state of a storage space of the electronic device, where the used state is determined according to a data write amount of the storage space within a preset time duration; and in a target time period, releasing the storage space of the electronic equipment by adopting a release operation corresponding to the target release mode, wherein the target time period is a time period when the electronic equipment is in an idle state.
According to the electronic device provided by the embodiment of the application, on one hand, due to the fact that the data writing amount of the storage space of the electronic device in the preset time length can reflect the use requirement of a user on the storage space of the electronic device, the target release mode determined according to the used state of the storage space can be matched with the use requirement (such as reading and writing requirements) of the user on the storage space, so that the storage space of the electronic device can be released through the release operation corresponding to the target release mode, the remaining storage space of the electronic device can be guaranteed to meet the use requirement of the user on the storage space, and therefore when the user needs to write in a large amount of data, the electronic device can directly and quickly respond to the requirement of the user. On the other hand, since the storage space of the electronic device is released in the target time period when the electronic device is in the idle state, the influence of the release operation of the storage space on the response of the electronic device to the use demand of the user on the storage space can be reduced, and therefore, the influence on the speed of the response of the electronic device to the use demand of the user on the storage space can be reduced. Therefore, the storage space releasing method provided by the embodiment of the application can improve the storage performance of the electronic equipment.
Optionally, the processor 1010 is further configured to determine a data writing amount of the storage space within a preset time period before determining the target release mode according to a used state of the storage space of the electronic device; determining the used state of the storage space by comparing the data writing amount with a target threshold value; the data writing amount is greater than or equal to a target threshold value, and the used state of the storage space is a first state; the data writing amount is smaller than the target threshold value, and the used state of the storage space is a second state; the manner in which the release pattern is determined corresponding to the first state is different from the manner in which the release pattern is determined corresponding to the second state.
According to the electronic device provided by the embodiment of the application, the electronic device can more accurately determine the used state of the storage space by comparing the data writing amount of the determined storage space in the preset time with the target threshold value, so that according to the used state of the storage space, the target release mode is determined by adopting a release mode determining mode corresponding to the used state of the storage space, and further the target release mode determined by the electronic device can be suitable for the used state of the storage space of the current electronic device, that is, the target release mode determined by the electronic device can meet the use requirement of a user.
Optionally, the processor 1010 is specifically configured to determine, according to the first state, that the target release mode is the first release mode; or, the processor 1010 is specifically configured to determine a usage mode of the electronic device according to the second state, and determine a target release mode according to the usage mode of the electronic device, where the usage mode of the electronic device is used to indicate a performance requirement of the user on the electronic device; the use mode is a performance priority mode, and the target release mode is a first release mode; the service mode is a life priority mode, the target release mode is a second release mode, and the release operations corresponding to the first release mode and the second release mode are different.
Optionally, the release operation corresponding to the first release mode includes at least one of the following operations: background storage space releasing operation, defragmentation operation and garbage recycling operation; and the release operation corresponding to the second release operation comprises a background storage space release operation.
According to the electronic device provided by the embodiment of the application, the storage performance of the storage space of the electronic device can be improved to a greater extent through the release operation corresponding to the first release mode, and the optimal user experience is achieved; the release operation corresponding to the second release mode can improve the storage performance of the storage space of the electronic equipment as much as possible on the premise of not sacrificing the service life of the electronic equipment, and reduce the pause phenomenon, so that the read-write function of the storage space of the electronic equipment is smoother.
Optionally, the processor 1010 is further configured to, in the process of releasing the storage space, end the releasing operation if any input is received.
According to the electronic device provided by the embodiment of the application, in the process of the electronic device performing the release operation, the electronic device can detect whether the electronic device receives the input of the user, for example, the user triggers the electronic device to light the screen of the electronic device, and if the electronic device receives the input of the user, the electronic device can determine that the user has a demand for using the electronic device, so that the electronic device can end the release operation corresponding to the target release mode, and the influence on the user experience is reduced.
Optionally, the processor 1010 is further configured to update the used state of the storage space according to the target information; wherein the target information comprises at least one of: service life information of the electronic equipment and historical use information of the storage space.
According to the electronic equipment provided by the embodiment of the application, the used state of the storage space can be updated according to at least one item of the service life information of the electronic equipment and the historical use information of the storage space, so that the electronic equipment can determine the target release mode according to the used state of the storage space most accurately, the release operation adopted by the electronic equipment is closest to the actual use requirement of a user, and the release operation of the electronic equipment for releasing the storage space is more reasonable.
It should be noted that, in this embodiment of the application, the determining module 301 and the releasing module 302 in the structural schematic diagram of the storage space releasing apparatus (for example, fig. 2) and the ending module and the updating module in the storage space releasing apparatus may be implemented by the processor 1010.
It should be understood that in the embodiment of the present application, the input Unit 1004 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, and the Graphics Processing Unit 1041 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 1006 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 1007 includes 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, and a joystick, which are not described in detail herein. The memory 1009 may be used to store software programs as well as various data, including but not limited to application programs and operating systems. Processor 1010 may integrate an application processor that handles primarily operating systems, user interfaces, applications, etc. and a modem processor that handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1010.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the foregoing storage space release method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device in the above embodiment. Readable storage media, including computer-readable storage media, such as Read-Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, etc.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the above embodiment of the memory space release method, and the same technical effect can be achieved.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method of the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for freeing storage space, the method comprising:
determining a target release mode according to a used state of a storage space of electronic equipment, wherein the used state is determined according to a data write-in amount of the storage space within a preset time length;
and in a target time period, releasing the storage space of the electronic equipment by adopting a release operation corresponding to the target release mode, wherein the target time period is a time period when the electronic equipment is in an idle state.
2. The method of claim 1, wherein before determining the target release pattern based on the used state of the storage space of the electronic device, the method further comprises:
determining the data writing amount of the storage space in the preset time length;
determining the used state by comparing the data write amount to a target threshold;
wherein the data writing amount is greater than or equal to the target threshold, and the used state is a first state; the data writing amount is smaller than the target threshold value, and the used state is a second state; the manner of determining the release pattern corresponding to the first state is different from the manner of determining the release pattern corresponding to the second state.
3. The method of claim 2, wherein determining the target release pattern based on the used state of the storage space of the electronic device comprises:
determining the target release mode as a first release mode according to the first state;
alternatively, the first and second electrodes may be,
determining a use mode of the electronic equipment according to the second state, and determining the target release mode according to the use mode, wherein the use mode is used for indicating the performance requirement of a user on the electronic equipment;
wherein, the use mode is a performance priority mode, and the target release mode is a first release mode; the service mode is a life priority mode, the target release mode is a second release mode, and the release operation corresponding to the first release mode is different from that corresponding to the second release mode.
4. The method of claim 3, wherein the release operation corresponding to the first release mode comprises at least one of: background storage space releasing operation, defragmentation operation and garbage recycling operation;
and the release operation corresponding to the second release operation comprises a background storage space release operation.
5. The method of claim 1, further comprising:
updating the used state according to the target information;
wherein the target information comprises at least one of: service life information of the electronic equipment and historical use information of the storage space.
6. A storage space releasing apparatus, comprising: a determining module and a releasing module;
the determining module is used for determining a target release mode according to a used state of a storage space of the electronic equipment, wherein the used state is determined according to the data writing amount of the storage space in a preset time length;
the release module is configured to release the storage space of the electronic device in a target time period by using a release operation corresponding to the target release mode determined by the determination module, where the target time period is a time period in which the electronic device is in an idle state.
7. The apparatus according to claim 6, wherein the determining module is further configured to determine a data writing amount of the storage space within the preset duration before determining a target release mode according to a used state of the storage space of the electronic device, and determine the used state by comparing the data writing amount with a target threshold;
wherein the data writing amount is greater than or equal to the target threshold, and the used state is a first state; the data writing amount is smaller than the target threshold value, and the used state is a second state; the manner of determining the release pattern corresponding to the first state is different from the manner of determining the release pattern corresponding to the second state.
8. The apparatus according to claim 7, wherein the determining module is specifically configured to determine, according to the first state, that the target release pattern is a first release pattern;
alternatively, the first and second electrodes may be,
the determining module is specifically configured to determine a usage mode of the electronic device according to the second state; determining the target release mode according to the use mode, wherein the use mode is used for indicating the performance requirement of the user on the electronic equipment;
wherein, the use mode is a performance priority mode, and the target release mode is a first release mode; the service mode is a life priority mode, the target release mode is a second release mode, and the release operation corresponding to the first release mode is different from that corresponding to the second release mode.
9. The apparatus of claim 8, wherein the release operation corresponding to the first release mode comprises at least one of: background storage space releasing operation, defragmentation operation and garbage recycling operation;
and the release operation corresponding to the second release operation comprises a background storage space release operation.
10. The apparatus of claim 6, wherein the storage space releasing means further comprises an update module;
the updating module is used for updating the used state according to the target information;
wherein the target information comprises at least one of: service life information of the electronic equipment and historical use information of the storage space.
CN202011032593.1A 2020-09-27 2020-09-27 Storage space releasing method and device Pending CN112162704A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011032593.1A CN112162704A (en) 2020-09-27 2020-09-27 Storage space releasing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011032593.1A CN112162704A (en) 2020-09-27 2020-09-27 Storage space releasing method and device

Publications (1)

Publication Number Publication Date
CN112162704A true CN112162704A (en) 2021-01-01

Family

ID=73863000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011032593.1A Pending CN112162704A (en) 2020-09-27 2020-09-27 Storage space releasing method and device

Country Status (1)

Country Link
CN (1) CN112162704A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277926A (en) * 2022-05-18 2022-11-01 深圳传音控股股份有限公司 Resource management method, intelligent terminal and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170286288A1 (en) * 2016-03-30 2017-10-05 Sandisk Technologies Llc Method and System for Blending Data Reclamation and Data Integrity Garbage Collection
CN109614344A (en) * 2018-12-12 2019-04-12 浪潮(北京)电子信息产业有限公司 A kind of spatial cache recovery method, device, equipment and storage system
CN109885255A (en) * 2019-01-07 2019-06-14 北京小米移动软件有限公司 Memory space method for sorting and device
CN111444145A (en) * 2020-03-24 2020-07-24 维沃移动通信有限公司 Data cleaning method and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170286288A1 (en) * 2016-03-30 2017-10-05 Sandisk Technologies Llc Method and System for Blending Data Reclamation and Data Integrity Garbage Collection
CN109614344A (en) * 2018-12-12 2019-04-12 浪潮(北京)电子信息产业有限公司 A kind of spatial cache recovery method, device, equipment and storage system
CN109885255A (en) * 2019-01-07 2019-06-14 北京小米移动软件有限公司 Memory space method for sorting and device
CN111444145A (en) * 2020-03-24 2020-07-24 维沃移动通信有限公司 Data cleaning method and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277926A (en) * 2022-05-18 2022-11-01 深圳传音控股股份有限公司 Resource management method, intelligent terminal and storage medium

Similar Documents

Publication Publication Date Title
CN106484472B (en) Memory recovery method and terminal
KR102295223B1 (en) Storage device and user device including speed mode manager
CN105740078B (en) Memory management method, device and terminal
CN110554999B (en) Cold and hot attribute identification and separation method and device based on log file system and flash memory device and related products
US20070174579A1 (en) Apparatus for collecting garbage block of nonvolatile memory according to power state and method of collecting the same
CN110008141B (en) Fragment sorting method and electronic equipment
CN107861602B (en) Terminal CPU performance control method, terminal and computer readable storage medium
CN110968524B (en) Data storage control method, device, storage medium and electronic device
CN112711387B (en) Buffer capacity adjustment method and device, electronic equipment and readable storage medium
KR20210051873A (en) Controller and memory system
CN115509953A (en) Memory recovery method and device
CN111857497A (en) Operation prompting method and electronic equipment
CN112162704A (en) Storage space releasing method and device
WO2021047398A1 (en) Method and device for storage block reclaiming, storage medium, and electronic device
CN113282239A (en) Data migration method, memory and controller
WO2023236930A1 (en) Memory allocation method and apparatus based on ion allocator, electronic device, and readable storage medium
CN113282546A (en) File processing method and device
CN113032290B (en) Flash memory configuration method, flash memory configuration device, electronic equipment and storage medium
WO2023046107A1 (en) Application icon management method and apparatus and electronic device
WO2022242640A1 (en) Data storage method, data storage apparatus, and electronic device
WO2023284877A1 (en) Detection method and apparatus, and electronic device
CN112965920A (en) Memory management method and device, electronic equipment and storage medium
CN115687270A (en) Data storage sorting method and device, electronic equipment and storage medium
CN111459848B (en) File fragment sorting method and device, storage medium and electronic equipment
CN113485642A (en) Data caching method and device

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