Storage space release method and device

By determining the release mode based on the used status of the storage space and releasing the storage space during the idle period, the problem of electronic devices being unable to respond to user data needs in a timely manner is solved, storage performance is improved, and device life is extended.

CN112162704BActive Publication Date: 2024-09-20VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011032593.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-27
Publication Date
2024-09-20
Estimated Expiration
2040-09-27

AI Technical Summary

Technical Problem

Existing electronic devices cannot respond in time to users' demand for reading and writing data when there is insufficient storage space, resulting in poor storage performance, and frequent background operations will reduce the service life of the device.

Method used

According to the used status of the storage space of the electronic device, the target release mode is determined, and the corresponding release operation is performed during the idle period of the device to ensure that the storage space meets user needs and reduce the impact of the release operation on the user experience.

Benefits of technology

It improves the storage performance of electronic devices, ensures that the device can quickly respond to users' data writing needs, extends the service life of the device, and reduces the impact of storage space release operations on performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112162704B
    Figure CN112162704B
Patent Text Reader

Abstract

The present application discloses a storage space release method and device thereof, belonging to the field of communication technology. The method comprises: determining a target release mode according to the used state of the storage space of the electronic device, wherein the used state of the storage space is determined according to the amount of data written to the storage space within a preset time period; in a target time period, using a release operation corresponding to the target release mode to release the storage space of the electronic device, wherein the target time period is a time period when the electronic device is in an idle state. The method is applied to the scenario of releasing storage space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a storage space release method and device thereof. Background Art

[0002] With the rapid development of communication technology, the storage space of electronic devices is getting larger and larger, and users' requirements for the storage performance of electronic devices are also getting higher and higher.

[0003] At present, the data writing method of electronic devices mostly adopts the off-site update method. Specifically, when an electronic device updates data, the electronic device can mark the original data as invalid, and then write new valid data at the new address. Correspondingly, when an electronic device deletes data, it usually only marks the data to be deleted as invalid, and does not erase the data. Usually, when the storage space of an electronic device is insufficient, which seriously affects the reading and writing of data by the electronic device, the electronic device can release more storage space through the background operation method (such as garbage collection, etc.) specified by the Joint Electronic Device Engineering Council agreement to meet the storage space requirements of the electronic device.

[0004] However, since frequently enabling background operations may reduce the service life of electronic devices, electronic devices usually use background operations to release storage space only when the storage performance of the electronic device drops to a certain threshold. In this way, when a user requires an electronic device to write a large amount of data, if the remaining storage space of the electronic device may not be enough, the electronic device needs to release storage space through background operations first, and then write the data required by the user, so that the electronic device cannot respond to the user's demand for reading and writing data in a timely manner, that is, the speed of reading and writing data by the electronic device is reduced, which leads to poor storage performance of the electronic device. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a storage space release method and device thereof, which can solve the problem that existing electronic devices cannot respond to users' needs to read and write data in a timely manner, resulting in poor storage performance of the electronic devices.

[0006] In order to solve the above technical problems, this application is implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a storage space releasing method, the method comprising: determining a target release mode according to a used status of the storage space of the electronic device, the used status of the storage space being determined according to the amount of data written to the storage space within a preset time period; in a target time period, using a release operation corresponding to the target release mode to release the storage space of the electronic device, the target time period being a time period in which the electronic device is in an idle state.

[0008] In a second aspect, an embodiment of the present application provides a storage space release device, which includes: a determination module and a release module; the determination module is used to determine a target release mode according to the used status of the storage space of the electronic device, and the used status of the storage space is determined according to the amount of data written to the storage space within a preset time period; the release module is used to release the storage space of the electronic device in a target time period by adopting a release operation corresponding to the target release mode determined by the determination module, and the target time period is a time period when the electronic device is in an idle state.

[0009] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

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

[0011] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the method described in the first aspect.

[0012] In the embodiment of the present 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 amount of data written to the storage space within a preset time length); in the target time period (the time period when the electronic device is in an idle state), the release operation corresponding to the target release mode is adopted to release the storage space of the electronic device. Through this scheme, on the one hand, since the amount of data written to the storage space of the electronic device within the preset time length can reflect the user's use demand for the storage space of the electronic device, the target release mode determined according to the used state of the storage space can match the user's use demand for the storage space (such as read and write demand), so that the storage space of the electronic device is released through the release operation corresponding to the target release mode, which can ensure that the remaining storage space of the electronic device meets the user's use demand for the storage space, so that when the user needs to write a large amount of data, the electronic device can directly and quickly respond to the user's needs. 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 an idle state, the impact of the release operation of the storage space on the electronic device's response to the user's use demand for the storage space can be reduced, so the impact on the speed at which the electronic device responds to the user's use demand for the storage space can be reduced. In this way, the storage space release method provided by the embodiment of the present application can improve the storage performance of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A flowchart of a storage space release method provided in an embodiment of the present application;

[0014] Figure 2 A possible structural diagram of a storage space release device provided in an embodiment of the present application;

[0015] Figure 3 A possible structural diagram of an electronic device provided in an embodiment of the present application;

[0016] Figure 4 A hardware schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0018] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0019] The storage space releasing method provided in the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0020] like Figure 1 As shown, an embodiment of the present application provides a storage space releasing method, which may include the following steps 201 and 202.

[0021] It should be noted that the storage space release method provided in the embodiment of the present application can be executed by a storage space release device, or a control module in the storage space release device for executing the storage space release method, or an electronic device (the electronic device can include the storage space release device in the embodiment of the present application, or be externally connected to the storage space release device). The embodiment of the present application takes an electronic device as an example to exemplarily illustrate the storage space release method provided in the embodiment of the present application.

[0022] Step 201: The electronic device determines a target release mode according to a usage status of a storage space of the electronic device.

[0023] The usage status of the storage space of the electronic device may be determined according to the amount of data written into the storage space of the electronic device within a preset time period.

[0024] Step 202: The electronic device releases storage space of the electronic device by using a release operation corresponding to a target release mode during a target time period.

[0025] The target time period may be a time period when the electronic device is in an idle state.

[0026] In an embodiment of the present application, the electronic device can determine a target release mode based on the usage status of the storage space of the electronic device (hereinafter referred to as the usage status of the storage space), and then the electronic device can release the storage space of the electronic device by using a release operation corresponding to the target release mode during a time period when the electronic device is in an idle state (i.e., the above-mentioned target time period).

[0027] Optionally, in an embodiment of the present application, the used state of the above storage space refers to the amount of data written to the storage space within a preset time period. The amount of data written may not include the amount of modification of the original data in the storage space by the electronic device. In other words, the amount of data written is the amount of data newly written by the electronic device in the storage space.

[0028] Optionally, in an embodiment of the present application, the above-mentioned preset duration can be any possible duration such as 24 hours (i.e. one day), 48 hours, 72 hours or one week, which can be determined according to actual usage requirements and is not limited in the embodiment of the present application.

[0029] Optionally, in an embodiment of the present application, the electronic device can determine the time when the user does not use the electronic device, that is, determine the time when the electronic device is in an idle state, based on the user's daily habits and time of using the electronic device, so as to obtain the above-mentioned target time period.

[0030] Exemplarily, the target time period may be 1:00 am to 5:00 am.

[0031] In the embodiment of the present application, since the release operation is relatively time-consuming, if the electronic device releases the storage space of the electronic device through the release operation corresponding to the above target release mode while the user is using the electronic device, the performance of the electronic device may be reduced, such as freezing. In this way, the electronic device can use the release operation corresponding to the target release mode to release the storage space of the electronic device during the time period when the electronic device is in an idle state (i.e., the above target time period), thereby reducing the impact on the user experience.

[0032] In the embodiment of the present application, the target release mode may be different depending on the used status of the storage space; and the release operations corresponding to the target release mode may be different depending on the target release mode.

[0033] Among them, the corresponding relationship between the used status of the storage space and the target release mode, and the corresponding relationship between the target release mode and its corresponding release operation will be described in detail in the following embodiments of the present application and will not be repeated here.

[0034] The embodiment of the present application provides a storage space release method. On the one hand, since the amount of data written to the storage space of the electronic device within a preset time period can reflect the user's demand for the storage space of the electronic device, the target release mode determined according to the used state of the storage space can match the user's demand for the storage space (such as read and write demand). In this way, the storage space of the electronic device is released through the release operation corresponding to the target release mode, which can ensure that the remaining storage space of the electronic device meets the user's demand for the storage space, so that when the user needs to write a large amount of data, the electronic device can directly and quickly respond to the user's needs. On the other hand, since the storage space of the electronic device is released during the target time period when the electronic device is in an idle state, the impact of the storage space release operation on the electronic device's response to the user's demand for the storage space can be reduced, and thus the impact on the speed at which the electronic device responds to the user's demand for the storage space can be reduced. In this way, the storage performance of the electronic device can be improved by the storage space release method provided by the embodiment of the present application.

[0035] Optionally, in an embodiment of the present application, before the electronic device determines the above-mentioned target release mode based on the usage status of the storage space, the electronic device may first determine the amount of data written to the storage space of the electronic device within the above-mentioned preset time period, and thereby determine the usage status of the storage space by comparing the data writing amount with a specific threshold (such as the target threshold in the embodiment of the present application).

[0036] In the embodiment of the present application, before the above step 201, the storage space release method provided in the embodiment of the present application may also include the following steps 203 and 204.

[0037] Step 203: The electronic device determines the amount of data written into the storage space of the electronic device within a preset time period.

[0038] Step 204: The electronic device determines the usage status of the storage space of the electronic device by comparing the data writing amount with the target threshold.

[0039] Among them, if the above-mentioned data writing amount is greater than or equal to the target threshold, the used status of the storage space of the above-mentioned electronic device may be a first state; if the data writing amount is less than the target threshold, the used status of the storage space of the electronic device may be a second state; the method of determining the release mode corresponding to the first state may be different from the method of determining the release mode corresponding to the second state.

[0040] It can be understood that the above-mentioned “the amount of data written into the storage space of the electronic device within the preset time length” refers to the amount of data written into the storage space of the electronic device within the preset time length.

[0041] In an embodiment of the present application, before the electronic device determines the target release mode based on the usage status of the above-mentioned storage space, the electronic device can first determine the amount of data written to the storage space of the electronic device within a preset time, and then the electronic device can determine the usage status of the storage space by comparing the data writing amount with the above-mentioned target threshold.

[0042] In the embodiment of the present application, the electronic device can determine the amount of data written to the storage space within a preset time by obtaining the available storage space in the storage space of the electronic device, for example, the amount of data written to the storage space every day.

[0043] Optionally, in an embodiment of the present application, the above target threshold can be determined based on the benchmark data volume.

[0044] In the embodiment of the present application, the above-mentioned benchmark data volume can be calculated based on the total writing parameter of the storage space of the electronic device and the life of the electronic device.

[0045] For example, assuming that the storage space of the electronic device is 128 gigabytes (GB), the number of TB written is 200TBW, and the electronic device can be used for 5 years, then the average storage space can write data per day (200TB / 5*365)=109GB. That is, the above-mentioned benchmark data volume can be 109GB.

[0046] Exemplarily, in the embodiment of the present application, the target threshold may be 50% of the baseline data volume.

[0047] Optionally, in the embodiment of the present application, the first state may be a light-use state, and the second state may be a regular-use state or a heavy-use state.

[0048] It can be understood that the light usage state means that the amount of data written to the storage space within a preset time is small, and the normal usage state or heavy usage state means that the amount of data written to the storage space within a preset time is large.

[0049] Exemplarily, assuming that the above target threshold is 50% of the baseline data volume, then when the average daily data write volume of the storage space in the past three months is less than 50% of the baseline data volume, the electronic device can determine that the usage status of the storage space is a light usage status (i.e., the first status mentioned above); otherwise, it is a regular usage status or a heavy usage status (i.e., the second status mentioned above).

[0050] In an embodiment of the present application, the electronic device can more accurately determine the used status of the storage space by comparing the amount of data written to the determined storage space within a preset time period with the target threshold, and thus determine the above-mentioned target release mode according to the used status of the storage space by adopting a method of determining the release mode corresponding to the used status of the storage space, thereby making the target release mode determined by the electronic device applicable to the used status of the storage space of the current electronic device, that is, making the target release mode determined by the electronic device meet the user's usage requirements.

[0051] Optionally, in the embodiment of the present application, the usage status of the above-mentioned storage space is different, and the electronic device may determine the above-mentioned target release mode in different ways according to the usage status of the storage space.

[0052] The following specifically describes two possible situations to exemplify how the electronic device determines the target release mode according to the usage status of the storage space.

[0053] The first case: when the used state of the storage space of the electronic device is the first state, the electronic device directly determines the target release mode to be the first release mode.

[0054] In the embodiment of the present application, in the first case above, the above step 201 can be specifically determined by the following step 201a.

[0055] Step 201a: The electronic device determines that the target release mode is the first release mode according to the first state.

[0056] In the embodiment of the present application, when the used state of the storage space is the first state, the electronic device can directly determine that the target release mode is the above-mentioned first release mode.

[0057] The second situation: when the used state of the above-mentioned electronic device is the above-mentioned second state, the electronic device can first determine the user's performance requirements for the electronic device according to the usage pattern of the storage space (that is, determine the usage pattern of the electronic device in the embodiment of the present application), and then determine the above-mentioned target release mode according to the usage pattern of the electronic device.

[0058] In the embodiment of the present application, for the second situation mentioned above, the above step 201 can be specifically implemented through the following steps 201b and 201c.

[0059] Step 201b: The electronic device determines a usage mode of the electronic device according to the usage status of the storage space.

[0060] The usage mode of the electronic device may be used to indicate the user's performance requirements for the electronic device.

[0061] Step 201c: The electronic device determines a target release mode according to a usage mode of the electronic device.

[0062] Among them, the usage mode of the above-mentioned electronic device is a performance priority mode, and the above-mentioned target release mode can be a first release mode; the usage mode of the electronic device is a life priority mode, and the target release mode can be a second release mode, and the release operations corresponding to the first release mode and the second release mode can be different.

[0063] In the embodiment of the present application, when the used state of the above-mentioned storage space is the second state, the electronic device can first determine the use mode of the above-mentioned electronic device, and then determine the above-mentioned target release mode according to the use mode of the electronic device.

[0064] Optionally, in an embodiment of the present application, the electronic device may include a functional control for setting a performance priority mode. If the electronic device turns on the control, the usage mode of the electronic device is the performance priority mode; if the electronic device does not turn on the control, the usage mode of the electronic device is the life priority mode.

[0065] For example, assuming that a user wants to replace a new electronic device, the user can trigger the electronic device to set the usage mode to a performance priority mode; or, some users do not consider the service life of the electronic device (for example, an electronic device that can be used for 5 years is replaced with a new electronic device after only 2 years of use), then the user can choose to trigger the electronic device to set the usage mode to a performance priority mode.

[0066] It is understandable that users have the final say over the usage patterns of electronic devices.

[0067] Optionally, in an embodiment of the present application, the release operation corresponding to the above-mentioned first release mode may include at least one of the following operations: background storage space release operation, defragmentation operation, garbage collection operation; the release operation corresponding to the above-mentioned second release operation may include a background storage space release operation.

[0068] Of course, in actual implementation, the above-mentioned first release mode and second release mode may also correspond to any other possible release operations, which can be specifically determined according to actual usage requirements and are not limited in the embodiments of the present application.

[0069] Optionally, in the embodiment of the present application, for the release operation corresponding to the first release mode, the electronic device can simultaneously perform the release operation corresponding to the first release mode, or can perform the release operation corresponding to the first release mode in sequence. The specific details can be determined according to actual use requirements, and the embodiment of the present application does not limit this.

[0070] In the embodiment of the present application, the above-mentioned background storage space release operation belongs to the operation in the JEDEC protocol function, which can be set to the electronic device manual mode (i.e., the user triggers the electronic device to perform the background storage space release operation) and the storage chip automatic mode (i.e., the storage chip spontaneously performs the background storage space release operation). Among them, the background storage space release operation may include operations such as erasing data and garbage collection.

[0071] In the embodiment of the present application, the above-mentioned defragmentation operation can be an operation in the function customized by the manufacturer of the electronic device. When the storage space of the electronic device is severely fragmented (for example, when a file is modified many times and is relatively discrete, it will cause many small data blocks of the file to be stored in the storage space, resulting in severe storage space fragmentation), the storage performance of the electronic device will be significantly reduced, and the storage performance can be improved by defragmentation. Among them, the defragmentation operation can include putting the data of a file into the same unit or into multiple units in parallel.

[0072] In the embodiment of the present application, the above garbage collection operation may also be an operation in a function customized by the manufacturer of the electronic device. Among them, the garbage collection operation may include deleting data in a file. Specifically, the electronic device may move valid data in a file to other files, and then operate the file.

[0073] In an embodiment of the present application, when an electronic device writes data and causes the electronic device to initiate a garbage collection operation, the write performance of the storage space of the electronic device will be significantly reduced, but if the garbage collection operation is frequently initiated, it will affect the life of the electronic device (specifically, the life of the storage space of the electronic device). Therefore, the electronic device only initiates the garbage collection operation in the first release operation to ensure the service life of the electronic device.

[0074] In an embodiment of the present application, the release operation corresponding to the above-mentioned first release mode can greatly improve the storage performance of the storage space of the electronic device and achieve the best user experience; the release operation corresponding to the second release mode can improve the storage performance of the storage space of the electronic device as much as possible without sacrificing the life of the electronic device, reduce the jamming phenomenon, and make the reading and writing functions of the storage space of the electronic device smoother.

[0075] Optionally, in an embodiment of the present application, when the electronic device adopts a release operation corresponding to the above-mentioned target release mode to release the storage space of the electronic device, if the electronic device determines that the user has a need to use the electronic device (for example, the electronic device receives an operation by the user to light up the screen of the electronic device), then the electronic device can end the release operation to avoid affecting the performance of the electronic device during use.

[0076] It can be understood that in the embodiment of the present application, during the process of releasing storage space of the electronic device, if the electronic device has not received any input from the user, the electronic device can continue to use the release operation corresponding to the target release mode to release the storage space until the release operation is completed.

[0077] In the embodiment of the present application, after the above step 202, the storage space release method provided by the embodiment of the present application may also include the following step 205.

[0078] Step 205: When the electronic device is releasing storage space, if any input is received, the release operation is terminated.

[0079] In an embodiment of the present application, during the process of the electronic device performing the above-mentioned release operation, the electronic device can detect whether the electronic device receives user input, such as input from the user triggering the electronic device to light up the screen of the electronic device. If the electronic device receives user input, the electronic device can determine that the user has a need to use the electronic device, so that the electronic device can end the release operation corresponding to the above-mentioned target release mode to reduce the impact on the user experience.

[0080] Optionally, in an embodiment of the present application, the electronic device may also determine whether the current usage mode of the storage space is consistent with the usage mode previously determined by the electronic device based on information such as the service life of the electronic device and / or historical usage information of the storage space of the electronic device (for example, the target information in an embodiment of the present application); if not, the electronic device may update the usage mode of the storage space.

[0081] Optionally, the storage space releasing method provided in the embodiment of the present application may further include the following step 206.

[0082] Step 206: The electronic device updates the usage status of the storage space of the electronic device according to the target information.

[0083] The target information may include at least one of the following: service life information of the electronic device, and historical usage information of the storage space of the electronic device.

[0084] In an embodiment of the present application, the electronic device may also 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.

[0085] In an embodiment of the present application, after the electronic device determines the used status of the above-mentioned storage space, the electronic device can determine again whether the used status of the storage space needs to be corrected (i.e., updated) based on the service life information of the electronic device and / or the historical usage information of the electronic device (for example, the actual usage of the storage space of the electronic device from the beginning of use of the electronic device to the current use).

[0086] In the embodiment of the present application, the historical usage information of the storage space may include the 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 the storage space is used. If the historical usage of the electronic device is also less than 50% of the reference value, then it can be determined that the used state of the storage space is a lightly used state, otherwise it is a normal or heavy used state.

[0087] In an embodiment of the present application, since the used status of the storage space can be updated based on at least one of the service life information of the electronic device and the historical usage information of the storage space, the electronic device can determine the target release mode based on the most accurate used status of the storage space, so that the release operation adopted by the electronic device is closest to the actual usage needs of the user, thereby making the release operation of the electronic device to release the storage space more reasonable.

[0088] In the embodiment of the present application, a storage space releasing device executing a storage space releasing method is taken as an example to illustrate the storage space releasing device provided in the embodiment of the present application.

[0089] like Figure 2 As shown, an embodiment of the present application provides a storage space release device 300, which may include: a determination module 301 and a release module 302. The determination module 301 is used to determine a target release mode according to the used state of the storage space of the electronic device, where the used state is determined according to the amount of data written to the storage space within a preset time period; the release module 302 is used to release the storage space of the storage space release device by using a release operation corresponding to the target release mode determined by the determination module 301 in a target time period, where the target time period is a time period when the electronic device is in an idle state.

[0090] The storage space release device provided by the embodiment of the present application, on the one hand, because the amount of data written to the storage space of the electronic device within a preset time period can reflect the user's demand for the storage space of the electronic device, the target release mode determined according to the used state of the storage space can match the user's demand for the storage space (such as read and write demand), so that the storage space of the electronic device is released through the release operation corresponding to the target release mode, which can ensure that the remaining storage space of the electronic device meets the user's demand for the storage space, so that when the user needs to write a large amount of data, the electronic device can directly and quickly respond to the user's needs. On the other hand, since the storage space of the electronic device is released during the target time period when the electronic device is in an idle state, the impact of the storage space release operation on the electronic device's response to the user's demand for the storage space can be reduced, and thus the impact on the speed at which the electronic device responds to the user's demand for the storage space can be reduced. In this way, the storage performance of the electronic device can be improved by the storage space release method provided by the embodiment of the present application.

[0091] Optionally, the determination module is also used to determine the amount of data written to the storage space within a preset time length before determining the target release mode according to the used status of the storage space of the electronic device, and determine the used status of the storage space by comparing the data writing amount with the target threshold. If the data writing amount is greater than or equal to the target threshold, the used status of the storage space is a first state; if the data writing amount is less than the target threshold, the used status of the storage space is a second state; wherein the method of determining the release mode corresponding to the first state is different from the method of determining the release mode corresponding to the second state.

[0092] The storage space release device provided in the embodiment of the present application can more accurately determine the used status of the storage space by comparing the amount of data written to the storage space within a preset time period with the target threshold, and thus determine the above-mentioned target release mode according to the used status of the storage space by adopting a method of determining the release mode corresponding to the used status of the storage space, thereby making the target release mode determined by the storage space release device applicable to the used status of the storage space of the current electronic device, that is, making the target release mode determined by the storage space release device able to meet the user's usage requirements.

[0093] Optionally, the determination module is specifically used to determine that the target release mode is the first release mode according to the first state; or, the determination module is specifically used to determine the usage mode of the electronic device according to the second state, and determine the target release mode according to the usage mode of the electronic device, and the usage mode of the electronic device is used to indicate the user's performance requirements for the electronic device; wherein, if the usage mode is a performance priority mode, the target release mode is the first release mode; if the usage mode is a life priority mode, the target release mode is the second release mode, and the release operations corresponding to the first release mode and the second release mode are different.

[0094] Optionally, the release operation corresponding to the first release mode includes at least one of the following operations: a background storage space release operation, a defragmentation operation, and a garbage collection operation; the release operation corresponding to the second release operation includes a background storage space release operation.

[0095] The storage space release device provided in the embodiment of the present application can greatly improve the storage performance of the storage space of the storage space release device through the release operation corresponding to the above-mentioned first release mode, thereby achieving the best user experience; through the release operation corresponding to the second release mode, the storage performance of the storage space of the electronic device can be improved as much as possible without sacrificing the life of the storage space release device, and the jamming phenomenon can be reduced, so that the reading and writing functions of the storage space of the electronic device are smoother.

[0096] In the embodiment of the present application, the storage space releasing device further includes an ending module; the ending module is used to end the releasing operation if any input is received during the process of releasing the storage space.

[0097] The storage space release device provided in the embodiment of the present application can detect whether the electronic device receives user input during the process of the storage space release device performing the above-mentioned release operation, such as the input of the user triggering the electronic device to light up the screen of the electronic device. If the electronic device receives the user input, the storage space release device can determine that the user has a need to use the electronic device, so that the storage space release device can end the release operation corresponding to the above-mentioned target release mode, thereby reducing the impact on the user experience.

[0098] Optionally, the storage space releasing device also includes an update module; the update module is used to update the used status of the storage space according to target information; wherein the target information includes at least one of the following: service life information of the electronic device, historical usage information of the storage space.

[0099] The storage space releasing device provided in the embodiment of the present application can update the used status of the storage space according to at least one of the service life information of the electronic device and the historical usage information of the storage space. Therefore, the storage space releasing device can determine the target release mode according to the most accurate used status of the storage space, so that the release operation adopted by the storage space releasing device is closest to the actual usage needs of the user, thereby making the release operation of the storage space released by the storage space releasing device more reasonable.

[0100] The storage space release device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0101] The storage space release device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0102] The storage space release device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0103] Alternatively, if Figure 3 As shown, an embodiment of the present application also provides an electronic device 400, including a processor 401, a memory 402, and a program or instruction stored in the memory 402 and executable on the processor 401. When the program or instruction is executed by the processor 401, each process of the above-mentioned storage space release method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

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

[0105] Figure 4A schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

[0106] 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 and other components.

[0107] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0108] Among them, processor 1010 is used to determine a target release mode according to the usage status of the storage space of the electronic device, and the usage status is determined according to the amount of data written to the storage space within a preset time period; and in a target time period, a release operation corresponding to the target release mode is used to release the storage space of the electronic device, and the target time period is a time period when the electronic device is in an idle state.

[0109] The electronic device provided by the embodiment of the present application, on the one hand, because the amount of data written to the storage space of the electronic device within a preset time period can reflect the user's demand for the storage space of the electronic device, the target release mode determined according to the used state of the storage space can match the user's demand for the storage space (such as read and write demand), so that the storage space of the electronic device is released through the release operation corresponding to the target release mode, which can ensure that the remaining storage space of the electronic device meets the user's demand for the storage space, so that when the user needs to write a large amount of data, the electronic device can directly and quickly respond to the user's needs. On the other hand, since the storage space of the electronic device is released during the target time period when the electronic device is in an idle state, the impact of the storage space release operation on the electronic device's response to the user's demand for the storage space can be reduced, and thus the impact on the speed at which the electronic device responds to the user's demand for the storage space can be reduced. In this way, the storage space release method provided by the embodiment of the present application can improve the storage performance of the electronic device.

[0110] Optionally, the processor 1010 is further used to determine the amount of data written to the storage space within a preset time period before determining the target release mode based on the used status of the storage space of the electronic device; and determine the used status of the storage space by comparing the data write amount with the target threshold; wherein, if the data write amount is greater than or equal to the target threshold, the used status of the storage space is a first state; if the data write amount is less than the target threshold, the used status of the storage space is a second state; the method of determining the release mode corresponding to the first state is different from the method of determining the release mode corresponding to the second state.

[0111] The electronic device provided in the embodiment of the present application can more accurately determine the used status of the storage space by comparing the amount of data written to the determined storage space within a preset time period with the target threshold, and thus determine the above-mentioned target release mode according to the used status of the storage space by adopting a method of determining the release mode corresponding to the used status of the storage space, so that the target release mode determined by the electronic device can be applicable to the used status of the storage space of the current electronic device, that is, the target release mode determined by the electronic device can meet the user's usage requirements.

[0112] Optionally, processor 1010 is specifically used to determine that the target release mode is the first release mode according to the first state; or, processor 1010 is specifically used to determine the usage mode of the electronic device according to the second state, and determine the target release mode according to the usage mode of the electronic device, and the usage mode of the electronic device is used to indicate the user's performance requirements for the electronic device; wherein, if the usage mode is a performance priority mode, the target release mode is the first release mode; if the usage mode is a life priority mode, the target release mode is the second release mode, and the release operations corresponding to the first release mode and the second release mode are different.

[0113] Optionally, the release operation corresponding to the first release mode includes at least one of the following operations: a background storage space release operation, a defragmentation operation, and a garbage collection operation; and the release operation corresponding to the second release operation includes a background storage space release operation.

[0114] The electronic device provided in the embodiment of the present application can greatly improve the storage performance of the storage space of the electronic device through the release operation corresponding to the above-mentioned first release mode, thereby achieving the best user experience; and through the release operation corresponding to the second release mode, the storage performance of the storage space of the electronic device can be improved as much as possible without sacrificing the life of the electronic device, thereby reducing the jamming phenomenon and making the reading and writing functions of the storage space of the electronic device smoother.

[0115] Optionally, the processor 1010 is further configured to terminate the release operation if any input is received during the process of releasing the storage space.

[0116] The electronic device provided in the embodiment of the present application can detect whether the electronic device receives user input during the process of the electronic device performing the above-mentioned release operation, such as input from the user triggering the electronic device to light up the screen of the electronic device. If the electronic device receives the user input, the electronic device can determine that the user has a need to use the electronic device, so that the electronic device can end the release operation corresponding to the above-mentioned target release mode, thereby reducing the impact on the user experience.

[0117] Optionally, the processor 1010 is further configured to update the used status of the storage space according to target information; wherein the target information includes at least one of the following: service life information of the electronic device, historical usage information of the storage space.

[0118] The electronic device provided in the embodiment of the present application can update the used status of the storage space according to at least one of the service life information of the electronic device and the historical usage information of the storage space. Therefore, the electronic device can determine the target release mode according to the most accurate used status of the storage space, so that the release operation adopted by the electronic device is closest to the actual usage needs of the user, thereby making the release operation of the electronic device to release the storage space more reasonable.

[0119] It should be noted that, in the embodiment of the present application, the structural diagram of the storage space release device (for example, the above Figure 2 ) and the determination module 301 and the release module 302 in the storage space release device, and the end module and the update module in the storage space release device can all be implemented by the above-mentioned processor 1010.

[0120] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture 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, etc. The user input unit 1007 includes a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 1009 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 1010 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 1010.

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

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

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

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

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

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

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

Claims

1. A storage space release method, characterized in that: The method comprises: Determining a target release mode according to a usage status of a storage space of the electronic device, wherein the usage status is determined according to an amount of data written to the storage space within a preset time period; In a target time period, using a release operation corresponding to the target release mode to release the storage space of the electronic device, the target time period being a time period in which the electronic device is in an idle state; The step of determining the target release mode according to the usage status of the storage space of the electronic device includes: Determining a usage mode of the electronic device according to the second state, and determining the target release mode according to the usage mode, wherein the usage mode is used to indicate a user's performance requirement for the electronic device; Among them, the data writing amount is greater than or equal to the target threshold, and the used state is the second state; the usage mode includes: performance priority mode and life priority mode.

2. The method according to claim 1, characterized in that Before determining the target release mode according to the usage status of the storage space of the electronic device, the method further includes: Determine the amount of data written to the storage space within the preset time period; Determining the used state by comparing the data writing amount with the target threshold; Among them, when the data write amount is less than the target threshold, the used state is the first state; when the data write amount is greater than or equal to the target threshold, the used state is the second state; the method of determining the release mode corresponding to the first state is different from the method of determining the release mode corresponding to the second state.

3. The method according to claim 2, characterized in that The step of determining the target release mode according to the usage status of the storage space of the electronic device includes: According to the first state, determining the target release mode to be a first release mode; Among them, the usage mode is a performance priority mode, and the target release mode is a first release mode; the usage mode is a life priority mode, and 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.

4. The method according to claim 3, characterized in that The release operation corresponding to the first release mode includes at least one of the following operations: a background storage space release operation, a fragmentation operation, and a garbage collection operation; The release operation corresponding to the second release operation includes a background storage space release operation.

5. The method according to claim 1, characterized in that The method further comprises: updating the used state according to the target information; The target information includes at least one of the following: service life information of the electronic device and historical usage information of the storage space.

6. A storage space release device, characterized in that: The storage space release device comprises: a determination module and a release module; The determination module is used to determine the target release mode according to the used state of the storage space of the electronic device, wherein the used state is determined according to the amount of data written to the storage space within a preset time period; The release module is used to release the storage space of the electronic device by using 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 in which the electronic device is in an idle state; The determination module is specifically used to determine a usage mode of the electronic device according to the second state; and determine the target release mode according to the usage mode, wherein the usage mode is used to indicate the performance requirements of the user for the electronic device; Among them, the data writing amount is greater than or equal to the target threshold, and the used state is the second state; the usage mode includes: performance priority mode and life priority mode.

7. The device according to claim 6, characterized in that The determination module is further configured to determine the amount of data written to the storage space within the preset time period before determining the target release mode according to the used state of the storage space of the electronic device, and determine the used state by comparing the amount of data written to the storage space with the target threshold value; Among them, when the data write amount is less than the target threshold, the used state is the first state; when the data write amount is greater than or equal to the target threshold, the used state is the second state; the method of determining the release mode corresponding to the first state is different from the method of determining the release mode corresponding to the second state.

8. The device according to claim 7, characterized in that The determining module is specifically configured to determine, according to the first state, that the target release mode is a first release mode; Among them, the usage mode is a performance priority mode, and the target release mode is a first release mode; the usage mode is a life priority mode, and 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.

9. The device according to claim 8, characterized in that The release operation corresponding to the first release mode includes at least one of the following operations: a background storage space release operation, a fragmentation operation, and a garbage collection operation; The release operation corresponding to the second release operation includes a background storage space release operation.

10. The device according to claim 6, characterized in that The storage space release device also includes an update module; The updating module is used to update the used status according to the target information; The target information includes at least one of the following: service life information of the electronic device and historical usage information of the storage space.