[go: up one dir, main page]

WO2018028121A1 - Method and device for managing storage space of data partition - Google Patents

Method and device for managing storage space of data partition Download PDF

Info

Publication number
WO2018028121A1
WO2018028121A1 PCT/CN2016/112266 CN2016112266W WO2018028121A1 WO 2018028121 A1 WO2018028121 A1 WO 2018028121A1 CN 2016112266 W CN2016112266 W CN 2016112266W WO 2018028121 A1 WO2018028121 A1 WO 2018028121A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage space
data partition
preset threshold
data
preset
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.)
Ceased
Application number
PCT/CN2016/112266
Other languages
French (fr)
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.)
Shenzhen TCL Digital Technology Co Ltd
Original Assignee
Shenzhen TCL Digital Technology 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 Shenzhen TCL Digital Technology Co Ltd filed Critical Shenzhen TCL Digital Technology Co Ltd
Publication of WO2018028121A1 publication Critical patent/WO2018028121A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3034Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a storage system, e.g. DASD based or network based
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing

Definitions

  • the present invention relates to the field of data storage technologies, and in particular, to a storage space management method and apparatus for data partitioning.
  • the partition of the android device includes the system partition and the data partition.
  • Data partitions are used to store various types of user data and applications that users can read and write. Erasing this partition is equivalent to restoring the factory settings, which is the state when the android system was first started, or the state after the last installation of the official or third-party ROM. It is generally necessary to set a capacity limit for data partitions, and to prevent hackers from illegally writing data to the data partition, or to prevent malicious files from being maliciously destroyed by creating illegal files.
  • Android system generally uses DSMS (Device Storage Monitor Service) to monitor the status of the internal storage space of the system. If the remaining storage space of the device is less than a certain threshold (the default is 10% of the storage space, this value can be set), the user will be sent a warning of insufficient remaining space. The user releases some space.
  • DSMS Device Storage Monitor Service
  • the DSMS detects the remaining space of the data partition every 1 minute.
  • the cache When the available space of the data partition is less than the threshold (between 10% and 500M of the total partition size), the cache will be automatically cleared; the cache is cleared and then calculated.
  • the free space of the data partition if it is still less than the threshold, will send a warning notice to the notification bar and send an ACTION_DEVICE_STORAGE_LOW broadcast.
  • the user can open the application manager and manually clear the application data to increase the available space of the data partition.
  • the application itself can also listen to the ACTION_DEVICE_STORAGE_LOW broadcast to do some special processing. For example, the email application will stop when it receives the broadcast. The current operation of sending and receiving mail.
  • the DSMS service When the DSMS service detects that the space is full, it will send a broadcast with full space; if the remaining space is detected to be greater than the threshold, and the previous low space or insufficient space is issued, the above prompt will be canceled and the ACTION_DEVICE_STORAGE_OK broadcast will be sent. If the amount of data downloaded during this minute is very large, it is possible that the full-filled broadcast has not yet been sent, and the data partition is full, causing the application to fail to function properly.
  • the invention provides a storage space management method and device for data partitioning, which aims to timely discover that the storage space of the data partition is insufficient, and prevent the storage space from being insufficient from full to full and causing the application to fail to operate normally.
  • the present invention provides a storage space management method for a data partition, and the storage space management method of the data partition includes:
  • the remaining storage space in the data partition is detected according to the second preset frequency, where the second preset frequency is greater than the first preset frequency;
  • the warning information that the storage space is full and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space, where
  • the second preset threshold is smaller than the first preset threshold
  • the warning information indicating that the storage space is insufficient and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space;
  • the storage space management method of the data partition further includes:
  • the value of the preset attribute is set to mark the storage amount of the data partition to be greater than or equal to the second preset threshold.
  • the present invention provides a storage space management method for a data partition, and the storage space management method of the data partition includes:
  • the remaining storage space in the data partition is detected according to the second preset frequency, where the second preset frequency is greater than the first preset frequency;
  • the warning information that the storage space is full and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space, where
  • the second preset threshold is smaller than the first preset threshold.
  • the storage space management method of the data partition further includes:
  • the write function is called to write data to the data partition.
  • the storage space management method of the data partition further includes:
  • the warning information indicating that the storage space is insufficient and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space.
  • the storage space management method of the data partition further includes:
  • the step of setting the value of the preset attribute to mark the remaining storage space of the data partition as being smaller than the second preset threshold is performed.
  • the storage space management method of the data partition further includes:
  • the value of the preset attribute is set to mark the storage amount of the data partition to be greater than or equal to the second preset threshold.
  • the present invention further provides a storage space management device for a data partition, where the storage space management device of the data partition includes:
  • a partition monitoring module configured to detect a remaining storage space of the data partition according to the first preset frequency
  • the information prompting module is configured to display, when the remaining storage space is less than the second preset threshold, the warning information that the storage space is full, wherein the second preset threshold is smaller than the first preset threshold;
  • the interface display module is configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space is less than a second preset threshold.
  • the storage space management device of the data partition further includes:
  • a system attribute module configured to: when detecting that the remaining storage space is less than a second preset threshold, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold;
  • a data reading and writing module configured to determine, according to the value of the preset attribute, whether a remaining storage space of the data partition is smaller than a second preset threshold, before each write write function writes data to the data partition; Sending the prompt information of the read/write abnormality to the application layer if the remaining storage space is less than the second preset threshold; if the remaining storage space is greater than or equal to the second preset threshold, calling the write function to write to the data partition data.
  • the information prompting module is further configured to: when detecting that the remaining storage space amount is less than a first preset threshold, displaying warning information that the storage space is insufficient;
  • the interface display module is further configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space amount is less than the first preset threshold.
  • the storage space management device of the data partition further includes:
  • a state determining module configured to determine, when the remaining storage space is less than a second preset threshold, whether the system is currently in a startup state
  • the system attribute module is further configured to: if the system is currently in a state of completing startup, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold.
  • system attribute module is further configured to: when detecting that the remaining storage space is greater than or equal to a second preset threshold, set a value of the preset attribute to mark a storage quantity of the data partition It is greater than or equal to the second preset threshold.
  • the storage space management method and device for data partitioning detects the remaining storage space of the data partition according to a certain frequency in the process of writing data to the data partition, and when detecting that the remaining storage space is smaller than the first preset threshold The frequency of the remaining storage space in the detection data partition is increased, the frequency of detecting the remaining storage space is optimized, and the remaining storage space of the partition is found to be insufficient.
  • the remaining storage space is detected to be smaller than the second preset threshold, the data is indicated.
  • the remaining storage space of the partition is not much. If a certain amount of data is written, the data partition may be filled, which may affect the normal operation of the application. Therefore, when it is detected that the remaining storage space is less than the second preset threshold.
  • a warning message is issued, and an application data management interface is displayed at the same time, so that the user can perform data clearing based on the application data management interface to release the storage space, which can prevent the storage space from being quickly insufficient to full and causing the application to fail to operate normally. .
  • FIG. 1 is a flowchart of a first embodiment of a storage space management method for a data partition according to the present invention
  • FIG. 2 is a flowchart of a second embodiment of a storage space management method for a data partition according to the present invention
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of a storage space management device for a data partition according to the present invention
  • FIG. 4 is a schematic diagram of functional modules of a second embodiment of a storage space management device for a data partition according to the present invention.
  • FIG. 5 is a schematic diagram of functional modules of a third embodiment of a storage space management apparatus for a data partition according to the present invention.
  • the invention provides a storage space management method for data partitioning.
  • FIG. 1 a flowchart of a first embodiment of a storage space management method for a data partition of the present invention is shown.
  • the storage space management method of the data partition includes:
  • Step S10 detecting a remaining storage space of the data partition according to the first preset frequency
  • step S20 when it is detected that the remaining storage space is smaller than the first preset threshold, the remaining storage space in the data partition is detected according to the second preset frequency, where the second preset frequency is greater than the first preset frequency.
  • the method provided in this embodiment is applicable to a mobile terminal such as a mobile phone or a tablet computer with an intelligent operating system.
  • a mobile terminal such as a mobile phone or a tablet computer with an intelligent operating system.
  • the following is an example of a mobile phone with an android operating system installed.
  • the various steps in the method proposed by this embodiment can be implemented by different functional modules.
  • the detection of the size of the remaining storage space of the data partition is performed periodically. For example, the detection may be performed according to the first preset frequency. When it is detected that the remaining storage space is less than the first preset threshold, the current remaining storage space is considered to be insufficient.
  • the module for detecting the amount of remaining storage space can send an ACTION_DEVICE_STORAGE_LOW broadcast to inform other function modules that the current storage space is insufficient. In order to prevent the application from running incorrectly during the process of writing data, the remaining operation is accelerated.
  • the detection of the storage space that is, detecting the remaining storage space of the data partition according to the second preset frequency.
  • the size of the first preset threshold may be set according to the total size of the data partition of the mobile phone, for example, may be set to be between 10% and 500M of the total size of the data partition; the first preset frequency may be every 40 Detected once every second to 1 minute, the second preset frequency is less than the first preset frequency, for example, it can be detected every 10-30 seconds.
  • Step S30 when it is detected that the remaining storage space is less than the second preset threshold, displaying warning information that the storage space is full and an application data management interface, so that the user performs data clearing based on the application data management interface to release the storage space.
  • the second preset threshold is smaller than the first preset threshold.
  • the user may clear the application data based on the data management interface of the application, to The storage space is released.
  • the warning information is sent in the notification bar, and the user does not easily notice that the method proposed in this embodiment can make the user intuitively see the warning that the space is full, and the user can intuitively see the warning that the space is full. Quickly clean up application data, without requiring the user to manually open the data management application and clean up the data in a timely manner.
  • the module for detecting the amount of remaining storage space sends an ACTION_DEVICE_STORAGE_NOT_FULL broadcast to inform other function modules that the current storage space is full.
  • the second preset threshold is smaller than the first preset threshold, and optionally, the second preset threshold is 1/4 of the first preset threshold.
  • the warning information indicating that the storage space is insufficient and the application data management interface are issued.
  • the remaining storage space still has a margin, as the write data proceeds, the remaining The amount of information will be smaller and smaller, in order to enable the user to clean the application data early to release the storage space, and when the remaining storage space is detected to be less than the first preset threshold, the warning information indicating insufficient storage space and the application data management interface are displayed. For the user to perform data cleaning based on the application data management interface to release the storage space.
  • the storage space management method for the data partition proposed in this embodiment detects the remaining storage space of the data partition according to a certain frequency in the process of writing data to the data partition, and when detecting that the remaining storage space is smaller than the first preset threshold, Increase the frequency of the remaining storage space in the detection data partition, optimize the frequency of detecting the remaining storage space, and find out that the remaining storage space of the partition is insufficient.
  • the data partition is indicated at this time. The remaining storage space is not much. If a certain amount of data is written, the data partition may be filled, which may affect the normal operation of the application.
  • the storage space management method of the data partition of the present invention further includes:
  • Step S40 when it is detected that the remaining storage space is less than the second preset threshold, setting a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold;
  • Step S50 before each write to the write function to write data to the data partition, determine, according to the value of the preset attribute, whether the remaining storage space of the data partition is smaller than a second preset threshold;
  • Step S60 Send the prompt information of the read/write abnormality to the application layer if the remaining storage space is smaller than the second preset threshold.
  • Step S70 If the remaining storage space is greater than or equal to the second preset threshold, the write function is called to write data to the data partition.
  • the method in this embodiment provides a preset attribute and a module for setting a value of the preset attribute.
  • the preset attribute is sys.device.storage.low, and the default value is false, when detecting When the remaining storage space is less than the second preset threshold, set the value of sys.device.storage.low to true, that is, the current storage space is insufficient.
  • the storage space is released. Therefore, when it is detected that the remaining storage space is greater than or equal to a second preset threshold, setting a value of the preset attribute to use the data.
  • the amount of storage of the partition is marked as greater than or equal to the second predetermined threshold. That is, when it is detected that the remaining storage space is greater than or equal to the second preset threshold, the value of sys.device.storage.low is set to false, that is, the current remaining storage space is sufficient.
  • the function Posix.write is called to continue the write operation.
  • the module for setting the value of the preset attribute is shared to the shared memory after setting the attribute value. Therefore, for the data read/write module, the method for obtaining the preset attribute value is used to determine whether the available space of the data partition is smaller than the second.
  • the preset threshold greatly improves efficiency compared to directly calculating the available space of the data partition.
  • a third embodiment of the storage space management method of the data partition of the present invention is proposed based on the first embodiment or the second embodiment.
  • the value of the system attribute sys.boot_completed is set to indicate whether the system has been started. If the system is confirmed to be in the running state after the startup is completed, the preset attribute sys.device.storage.low is set to true, and vice versa. Set to false.
  • the mobile phone may restart the system due to the setting of the application during the process of writing data, and setting the value of the preset attribute needs to be set when the system is started up and running normally, therefore, in this case
  • the system property sys.boot_completed will be obtained before then. The value of the value to determine whether the system is currently in the running state after the completion of the startup. After confirming that the system is running after the startup is completed, set the default attribute sys.device.storage.low.
  • the invention also proposes a storage space management device for data partitioning.
  • FIG. 3 it is a schematic diagram of functional modules of a first embodiment of a storage space management apparatus for data partitioning according to the present invention.
  • the storage space management device of the data partition includes:
  • the partition monitoring module 10 is configured to detect a remaining storage space of the data partition according to the first preset frequency
  • the device proposed in this embodiment may be a mobile terminal such as a mobile phone or a tablet computer with a smart operating system.
  • the following is an example of a mobile phone with an android operating system installed.
  • the various functional modules included in the device proposed by this embodiment are used to perform different functions.
  • the partition monitoring module 10 periodically detects the size of the remaining storage space of the data partition. For example, the detection may be performed according to the first preset frequency. When it is detected that the remaining storage space is less than the first preset threshold, the current remaining storage space is considered. At this time, the partition monitoring module 10 can send an ACTION_DEVICE_STORAGE_LOW broadcast to inform other functional modules that the current storage space is insufficient. In order to prevent the application from running wrong during the process of writing data, the remaining storage is accelerated. The detection of the space, that is, detecting the remaining storage space of the data partition according to the second preset frequency.
  • the size of the first preset threshold may be set according to the total size of the data partition of the mobile phone, for example, may be set to be between 10% and 500M of the total size of the data partition; the first preset frequency may be every 40 Detected once every second to 1 minute, the second preset frequency is less than the first preset frequency, for example, it can be detected every 10-30 seconds.
  • the information prompting module 20 is configured to display, when the remaining storage space is less than the second preset threshold, the warning information that the storage space is full, wherein the second preset threshold is smaller than the first preset threshold;
  • the interface display module 30 is configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space is less than a second preset threshold.
  • the information prompting module 20 displays the warning information that the storage space is full, and the interface display module 30 displays the application data management interface, and the user can use the data based on the application.
  • the management interface clears the application data to release the storage space.
  • the warning information is sent in the notification bar, and the user does not easily notice that the method proposed in this embodiment can make the user intuitively view relative to the existing notification mode.
  • the warning that the space is full, and the application data is quickly cleaned up, the user does not need to manually open the data management application, and the data is cleaned in time.
  • the partition monitoring module 10 sends an ACTION_DEVICE_STORAGE_NOT_FULL broadcast to inform other functional modules that the current storage space is full.
  • the second preset threshold is smaller than the first preset threshold, and optionally, the second preset threshold is 1/4 of the first preset threshold.
  • the information prompting module 20 issues a warning message that the storage space is insufficient when the remaining storage space is insufficient, and the interface display module 30 displays the application data management interface.
  • the margin will become smaller and smaller, in order to enable the user to clean the application data early to release the storage space, and display the storage space when detecting that the remaining storage space is less than the first preset threshold. Insufficient warning information and an application data management interface for the user to perform data cleaning based on the application data management interface to release storage space.
  • the storage space management device of the data partition proposed in this embodiment detects the remaining storage space of the data partition according to a certain frequency in the process of writing data to the data partition, and when detecting that the remaining storage space is smaller than the first preset threshold, Increase the frequency of the remaining storage space in the detection data partition, optimize the frequency of detecting the remaining storage space, and find out that the remaining storage space of the partition is insufficient.
  • the data partition is indicated at this time. The remaining storage space is not much. If a certain amount of data is written, the data partition may be filled, which may affect the normal operation of the application.
  • the storage space management device of the data partition further includes:
  • the system attribute module 40 is configured to: when detecting that the remaining storage space is less than a second preset threshold, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold;
  • the data reading and writing module 50 is configured to determine, according to the value of the preset attribute, whether the remaining storage space of the data partition is smaller than a second preset threshold, before each write to the data function is written to the data partition;
  • the data reading and writing module 50 is further configured to: if the remaining storage space is less than the second preset threshold, send the prompt information of the read/write abnormality to the application layer; and if the remaining storage space is greater than or equal to the second preset threshold, A write function is called to write data to the data partition.
  • This embodiment provides a preset attribute.
  • the preset attribute is sys.device.storage.low, and the default value is false.
  • the sys.device is used.
  • the value of .storage.low is set to true, that is, the current storage space is insufficient.
  • the system attribute module 40 sets the value of the preset attribute to The storage amount of the data partition is marked as being greater than or equal to the second predetermined threshold. That is, when it is detected that the remaining storage space is greater than or equal to the second preset threshold, the system attribute module 40 sets the value of sys.device.storage.low to false, that is, the current remaining storage space is sufficient.
  • the data read/write module 50 adds the value judgment of the preset attribute before each time the function Posix.write is called to write data to the partition. Determining, according to the value of the preset attribute, whether the remaining storage space of the current data partition is less than a second preset threshold. If the value of sys.device.storage.low is true, the data read/write module 50 sends a read/write exception to the application layer. If the value of sys.device.storage.low is false, the data read/write module 50 calls the function Posix.
  • the system attribute module 40 shares the shared memory. Therefore, for the data read/write module 50, the method for obtaining the preset attribute value determines whether the available space of the data partition is smaller than the second preset threshold than the direct calculation. The usable space of the data partition greatly improves efficiency.
  • a third embodiment of the storage space management apparatus of the data partition of the present invention is proposed based on the first embodiment or the second embodiment.
  • the storage space management device of the data partition further includes:
  • the state determining module 60 is configured to determine, when the remaining storage space is less than the second preset threshold, whether the system is currently in the state of completing the startup;
  • the system attribute module 40 is further configured to: if the system is currently in the state of completing the startup, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold.
  • the system attribute module 40 sets the preset attribute sys.device.storage.low by setting the value of the system attribute sys.boot_completed to indicate whether the system has been started. True, otherwise it is set to false.
  • the state judging module 60 will acquire the system before this.
  • the value of the attribute sys.boot_completed to determine whether the system is currently in the running state after the startup is completed.
  • the system property module 40 sets the preset attribute sys.device.storage.low.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A method and device for managing storage space of a data partition. The method comprises: detecting remaining storage space of a data partition according to a first preset frequency (S10); when the remaining storage space is detected to be less than a first preset threshold, detecting the remaining storage space in the data partition according to a second preset frequency, where the second preset frequency is greater than the first preset frequency (S20); when the remaining space is detected to be less than a second preset threshold, displaying storage space full alert information and an application data management interface, thus allowing a user to clear data on the basis of the application data management interface so as to free up storage space, where the second preset threshold is less than the first preset threshold (S30). The method and device discover insufficiency in the storage space of the data partition in a timely manner and prevent the occurrence of a case in which applications cannot operate normally as a result of the storage space turns rapidly from being insufficient to completely full.

Description

数据分区的存储空间管理方法及装置  Data partition storage space management method and device

技术领域Technical field

本发明涉及数据存储技术领域,尤其涉及一种数据分区的存储空间管理方法及装置。The present invention relates to the field of data storage technologies, and in particular, to a storage space management method and apparatus for data partitioning.

背景技术Background technique

android设备的分区包括系统分区,数据分区。数据分区用于存储各类用户数据与应用程序,是用户可以读写的。擦除这个分区,等同于恢复出厂设置,也就是android系统第一次启动时的状态,或者是最后一次安装官方或第三方ROM后的状态。一般需要对数据分区设定容量限额,并且防止黑客向数据分区非法写入数据,或者防止创建非法文件对数据分区进行恶意破坏。The partition of the android device includes the system partition and the data partition. Data partitions are used to store various types of user data and applications that users can read and write. Erasing this partition is equivalent to restoring the factory settings, which is the state when the android system was first started, or the state after the last installation of the official or third-party ROM. It is generally necessary to set a capacity limit for data partitions, and to prevent hackers from illegally writing data to the data partition, or to prevent malicious files from being maliciously destroyed by creating illegal files.

因为运行中的android系统大部分用户操作的数据都会默认保存在数据分区,如新下载安装的应用数据、应用运行的缓存数据、应用下载的图片视频等文件,使数据分区容易被填满而导致android系统异常。各个应用可以都有检测数据分区可用空间的措施,但大多数情况下应用只是在进行下载任务之前检测一下数据分区的可用空间,并不会在下载过程中间歇的检测。当多个应用同时下载数据时,他们在下载前检测data可用空间都是够用的,但可能会出现多个应用同时下载时,数据分区被“填满”的问题。Because most of the user-operated data of the running android system will be saved in the data partition by default, such as the newly downloaded application data, the cache data of the application running, the image video downloaded by the application, etc., so that the data partition is easily filled up. Android system is abnormal. Each application can have measures to detect the available space in the data partition, but in most cases the application only detects the available space of the data partition before the download task, and does not detect intermittently during the download process. When multiple applications download data at the same time, they can detect the available data space before downloading, but there may be a problem that the data partition is "filled up" when multiple applications are downloaded at the same time.

android系统一般使用DSMS(Device Storage Monitor Service)服务来监测系统内部存储空间的状态,如果设备的剩余存储空间小于某一个阀值(默认是存储空间的10%,这个值可以设置)时将会向用户发送剩余空间不足的警告,让用户释放一些空间。下面以数据分区为例,说明一下这个流程:Android system generally uses DSMS (Device Storage Monitor Service) to monitor the status of the internal storage space of the system. If the remaining storage space of the device is less than a certain threshold (the default is 10% of the storage space, this value can be set), the user will be sent a warning of insufficient remaining space. The user releases some space. Let's take a data partition as an example to illustrate this process:

DSMS每隔1分钟检测一下数据分区剩余空间的大小,当数据分区可用空间小于阀值(分区总大小的10%到500M之间)时,会自动进行一次清缓存的操作;清除缓存后再计算数据分区的可用空间,如果还是小于阀值,则会给通知栏发送一个警告通知,并发送ACTION_DEVICE_STORAGE_LOW广播。用户可以开启应用管理器,手动对各个应用数据进行清除以达到增加数据分区可用空间的目的,同时应用自身也可以监听ACTION_DEVICE_STORAGE_LOW广播来做一些特殊的处理,例如,Email应用接受到此广播时会停止当前的收发邮件的操作。DSMS服务检测到空间已满,会发送空间已满的广播;检测到剩余空间已经大于阀值,而之前发出过存储空间低或者空间不足的提示,会取消上述提示并发送ACTION_DEVICE_STORAGE_OK广播。如果这一分钟内下载的数据量非常大,有可能空间已满的广播还没有发出,数据分区就已经满了,导致应用无法正常运行。The DSMS detects the remaining space of the data partition every 1 minute. When the available space of the data partition is less than the threshold (between 10% and 500M of the total partition size), the cache will be automatically cleared; the cache is cleared and then calculated. The free space of the data partition, if it is still less than the threshold, will send a warning notice to the notification bar and send an ACTION_DEVICE_STORAGE_LOW broadcast. The user can open the application manager and manually clear the application data to increase the available space of the data partition. The application itself can also listen to the ACTION_DEVICE_STORAGE_LOW broadcast to do some special processing. For example, the email application will stop when it receives the broadcast. The current operation of sending and receiving mail. When the DSMS service detects that the space is full, it will send a broadcast with full space; if the remaining space is detected to be greater than the threshold, and the previous low space or insufficient space is issued, the above prompt will be canceled and the ACTION_DEVICE_STORAGE_OK broadcast will be sent. If the amount of data downloaded during this minute is very large, it is possible that the full-filled broadcast has not yet been sent, and the data partition is full, causing the application to fail to function properly.

发明内容Summary of the invention

本发明提供一种数据分区的存储空间管理方法及装置,旨在及时发现数据分区的存储空间不足,预防出现存储空间快速从不足到全满而导致应用无法正常运行的情况。The invention provides a storage space management method and device for data partitioning, which aims to timely discover that the storage space of the data partition is insufficient, and prevent the storage space from being insufficient from full to full and causing the application to fail to operate normally.

为实现上述目的,本发明提供一种数据分区的存储空间管理方法,该数据分区的存储空间管理方法包括:To achieve the above object, the present invention provides a storage space management method for a data partition, and the storage space management method of the data partition includes:

按照第一预设频率检测数据分区的剩余存储空间; Detecting a remaining storage space of the data partition according to the first preset frequency;

当检测到所述剩余存储空间小于第一预设阈值时,按照第二预设频率检测数据分区中剩余存储空间,其中,所述第二预设频率大于所述第一预设频率;When the remaining storage space is detected to be smaller than the first preset threshold, the remaining storage space in the data partition is detected according to the second preset frequency, where the second preset frequency is greater than the first preset frequency;

当检测到所述剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间,其中,所述第二预设阈值小于所述第一预设阈值;When the remaining storage space is detected to be smaller than the second preset threshold, the warning information that the storage space is full and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space, where The second preset threshold is smaller than the first preset threshold;

当检测到所述剩余存储空间量小于第一预设阈值时,显示存储空间不足的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间;When it is detected that the amount of the remaining storage space is less than the first preset threshold, the warning information indicating that the storage space is insufficient and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space;

当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;When it is detected that the remaining storage space is less than a second preset threshold, determining whether the system is currently in a state of completing startup;

若系统当前处于完成启动的状态,则执行设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值的步骤;If the system is currently in the state of completing the startup, performing a step of setting a value of the preset attribute to mark the remaining storage space of the data partition as being smaller than a second preset threshold;

所述按照第二预设频率检测数据分区中剩余存储空间的步骤之后,所述数据分区的存储空间管理方法还包括:After the step of detecting the remaining storage space in the data partition according to the second preset frequency, the storage space management method of the data partition further includes:

当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。And when the remaining storage space is greater than or equal to the second preset threshold, the value of the preset attribute is set to mark the storage amount of the data partition to be greater than or equal to the second preset threshold.

为实现上述目的,本发明提供一种数据分区的存储空间管理方法,该数据分区的存储空间管理方法包括:To achieve the above object, the present invention provides a storage space management method for a data partition, and the storage space management method of the data partition includes:

按照第一预设频率检测数据分区的剩余存储空间; Detecting a remaining storage space of the data partition according to the first preset frequency;

当检测到所述剩余存储空间小于第一预设阈值时,按照第二预设频率检测数据分区中剩余存储空间,其中,所述第二预设频率大于所述第一预设频率;When the remaining storage space is detected to be smaller than the first preset threshold, the remaining storage space in the data partition is detected according to the second preset frequency, where the second preset frequency is greater than the first preset frequency;

当检测到所述剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间,其中,所述第二预设阈值小于所述第一预设阈值。When the remaining storage space is detected to be smaller than the second preset threshold, the warning information that the storage space is full and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space, where The second preset threshold is smaller than the first preset threshold.

可选地,所述数据分区的存储空间管理方法还包括:Optionally, the storage space management method of the data partition further includes:

当检测到所述剩余存储空间小于第二预设阈值时,设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值;When it is detected that the remaining storage space is less than a second preset threshold, setting a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold;

在每次调用写函数向所述数据分区写入数据之前,根据所述预设属性的值判断所述数据分区的剩余存储空间是否小于第二预设阈值;Determining, according to the value of the preset attribute, whether the remaining storage space of the data partition is smaller than a second preset threshold, before each of the write function is written to the data partition;

若剩余存储空间小于第二预设阈值,则向应用层发送读写异常的提示信息;Sending the prompt information of the read/write abnormality to the application layer if the remaining storage space is less than the second preset threshold;

若剩余存储空间大于或者等于所述第二预设阈值,则调用写函数向所述数据分区写入数据。If the remaining storage space is greater than or equal to the second predetermined threshold, the write function is called to write data to the data partition.

可选地,所述数据分区的存储空间管理方法还包括:Optionally, the storage space management method of the data partition further includes:

当检测到所述剩余存储空间量小于第一预设阈值时,显示存储空间不足的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。When it is detected that the amount of the remaining storage space is less than the first preset threshold, the warning information indicating that the storage space is insufficient and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space.

可选地,所述数据分区的存储空间管理方法还包括:Optionally, the storage space management method of the data partition further includes:

当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;When it is detected that the remaining storage space is less than a second preset threshold, determining whether the system is currently in a state of completing startup;

若系统当前处于完成启动的状态,则执行设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值的步骤。If the system is currently in the state of completing the startup, the step of setting the value of the preset attribute to mark the remaining storage space of the data partition as being smaller than the second preset threshold is performed.

可选地,所述按照第二预设频率检测数据分区中剩余存储空间的步骤之后,所述数据分区的存储空间管理方法还包括:Optionally, after the step of detecting the remaining storage space in the data partition according to the second preset frequency, the storage space management method of the data partition further includes:

当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。And when the remaining storage space is greater than or equal to the second preset threshold, the value of the preset attribute is set to mark the storage amount of the data partition to be greater than or equal to the second preset threshold.

此外,为实现上述目的,本发明还提供一种数据分区的存储空间管理装置,该数据分区的存储空间管理装置包括:In addition, in order to achieve the above object, the present invention further provides a storage space management device for a data partition, where the storage space management device of the data partition includes:

分区监测模块,用于按照第一预设频率检测数据分区的剩余存储空间; a partition monitoring module, configured to detect a remaining storage space of the data partition according to the first preset frequency;

以及,当检测到所述剩余存储空间小于第一预设阈值时,按照第二预设频率检测数据分区中剩余存储空间,其中,所述第二预设频率大于所述第一预设频率;And detecting, when the remaining storage space is less than the first preset threshold, detecting a remaining storage space in the data partition according to the second preset frequency, wherein the second preset frequency is greater than the first preset frequency;

信息提示模块,用于当检测到所述剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息,其中,所述第二预设阈值小于所述第一预设阈值;The information prompting module is configured to display, when the remaining storage space is less than the second preset threshold, the warning information that the storage space is full, wherein the second preset threshold is smaller than the first preset threshold;

界面显示模块,用于当检测到所述剩余存储空间小于第二预设阈值时,显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。The interface display module is configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space is less than a second preset threshold.

可选地,所述数据分区的存储空间管理装置还包括:Optionally, the storage space management device of the data partition further includes:

系统属性模块,用于当检测到所述剩余存储空间小于第二预设阈值时,设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值;a system attribute module, configured to: when detecting that the remaining storage space is less than a second preset threshold, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold;

数据读写模块,用于在每次调用写函数向所述数据分区写入数据之前,根据所述预设属性的值判断所述数据分区的剩余存储空间是否小于第二预设阈值;以及 ,若剩余存储空间小于第二预设阈值,则向应用层发送读写异常的提示信息;若剩余存储空间大于或者等于所述第二预设阈值,则调用写函数向所述数据分区写入数据。a data reading and writing module, configured to determine, according to the value of the preset attribute, whether a remaining storage space of the data partition is smaller than a second preset threshold, before each write write function writes data to the data partition; Sending the prompt information of the read/write abnormality to the application layer if the remaining storage space is less than the second preset threshold; if the remaining storage space is greater than or equal to the second preset threshold, calling the write function to write to the data partition data.

可选地,所述信息提示模块还用于:当检测到所述剩余存储空间量小于第一预设阈值时,显示存储空间不足的警告信息;Optionally, the information prompting module is further configured to: when detecting that the remaining storage space amount is less than a first preset threshold, displaying warning information that the storage space is insufficient;

所述界面显示模块还用于:当检测到所述剩余存储空间量小于第一预设阈值时,显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。The interface display module is further configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space amount is less than the first preset threshold.

可选地,所述数据分区的存储空间管理装置还包括:Optionally, the storage space management device of the data partition further includes:

状态判断模块,用于当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;a state determining module, configured to determine, when the remaining storage space is less than a second preset threshold, whether the system is currently in a startup state;

所述系统属性模块还用于:若系统当前处于完成启动的状态,则设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值。The system attribute module is further configured to: if the system is currently in a state of completing startup, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold.

可选地,所述系统属性模块还用于:当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。Optionally, the system attribute module is further configured to: when detecting that the remaining storage space is greater than or equal to a second preset threshold, set a value of the preset attribute to mark a storage quantity of the data partition It is greater than or equal to the second preset threshold.

本发明提出的数据分区的存储空间管理方法及装置,在向数据分区写入数据的过程中,按照一定的频率检测数据分区的剩余存储空间,当检测到剩余存储空间小于第一预设阈值时,增大检测数据分区中剩余存储空间的频率,优化检测剩余存储空间大小的频率,及早发现分区剩余存储空间不足的情况,当检测到剩余存储空间小于第二预设阈值时,说明此时数据分区的剩余存储空间已经不多,如果再有一定量的数据写入,可能会导致数据分区被写满,进而影响到应用的正常运行,因此,在检测到剩余存储空间小于第二预设阈值时,即发出警告信息,同时显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间,能够预防出现存储空间快速从不足到全满而导致应用无法正常运行的情况。The storage space management method and device for data partitioning provided by the present invention detects the remaining storage space of the data partition according to a certain frequency in the process of writing data to the data partition, and when detecting that the remaining storage space is smaller than the first preset threshold The frequency of the remaining storage space in the detection data partition is increased, the frequency of detecting the remaining storage space is optimized, and the remaining storage space of the partition is found to be insufficient. When the remaining storage space is detected to be smaller than the second preset threshold, the data is indicated. The remaining storage space of the partition is not much. If a certain amount of data is written, the data partition may be filled, which may affect the normal operation of the application. Therefore, when it is detected that the remaining storage space is less than the second preset threshold. That is, a warning message is issued, and an application data management interface is displayed at the same time, so that the user can perform data clearing based on the application data management interface to release the storage space, which can prevent the storage space from being quickly insufficient to full and causing the application to fail to operate normally. .

附图说明DRAWINGS

图1为本发明数据分区的存储空间管理方法第一实施例的流程图;1 is a flowchart of a first embodiment of a storage space management method for a data partition according to the present invention;

图2为本发明数据分区的存储空间管理方法第二实施例的流程图;2 is a flowchart of a second embodiment of a storage space management method for a data partition according to the present invention;

图3为本发明数据分区的存储空间管理装置第一实施例的功能模块示意图;3 is a schematic diagram of functional modules of a first embodiment of a storage space management device for a data partition according to the present invention;

图4为本发明数据分区的存储空间管理装置第二实施例的功能模块示意图;4 is a schematic diagram of functional modules of a second embodiment of a storage space management device for a data partition according to the present invention;

图5为本发明数据分区的存储空间管理装置第三实施例的功能模块示意图。FIG. 5 is a schematic diagram of functional modules of a third embodiment of a storage space management apparatus for a data partition according to the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.

具体实施方式detailed description

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

本发明提供一种数据分区的存储空间管理方法。参照图1所示,为本发明数据分区的存储空间管理方法第一实施例的流程图。The invention provides a storage space management method for data partitioning. Referring to FIG. 1, a flowchart of a first embodiment of a storage space management method for a data partition of the present invention is shown.

在本实施例中,该数据分区的存储空间管理方法包括:In this embodiment, the storage space management method of the data partition includes:

步骤S10,按照第一预设频率检测数据分区的剩余存储空间; Step S10, detecting a remaining storage space of the data partition according to the first preset frequency;

步骤S20,当检测到所述剩余存储空间小于第一预设阈值时,按照第二预设频率检测数据分区中剩余存储空间,其中,所述第二预设频率大于所述第一预设频率;In step S20, when it is detected that the remaining storage space is smaller than the first preset threshold, the remaining storage space in the data partition is detected according to the second preset frequency, where the second preset frequency is greater than the first preset frequency. ;

本实施例提出的方法适用于具有智能操作系统的手机、平板电脑等移动终端,以下以安装有android操作系统的手机为例进行说明。该实施例提出的方法中的各个步骤可以由不同的功能模块来实现。The method provided in this embodiment is applicable to a mobile terminal such as a mobile phone or a tablet computer with an intelligent operating system. The following is an example of a mobile phone with an android operating system installed. The various steps in the method proposed by this embodiment can be implemented by different functional modules.

手机上安装有各种各样的应用,这些应用在运行过程中,会出现向数据分区,即手机的存储空间,写入数据的情况,例如下载图片、下载文件等。There are a variety of applications installed on the mobile phone. During the running process, there will be data partitioning, that is, the storage space of the mobile phone, and writing data, such as downloading pictures, downloading files, and the like.

定时地对数据分区的剩余存储空间的大小进行检测,例如,可以按照第一预设频率进行检测,当检测到剩余存储空间小于第一预设阈值时,认为当前的剩余存储空间已经不足,此时,用于检测剩余存储空间量的模块可以发送ACTION_DEVICE_STORAGE_LOW广播,以告知其他的功能模块,当前的存储空间已经不足,为了防止在写入数据的过程中发生空间已满导致应用运行出错,加快剩余存储空间的检测,即按照第二预设频率对数据分区的剩余存储空间进行检测。The detection of the size of the remaining storage space of the data partition is performed periodically. For example, the detection may be performed according to the first preset frequency. When it is detected that the remaining storage space is less than the first preset threshold, the current remaining storage space is considered to be insufficient. The module for detecting the amount of remaining storage space can send an ACTION_DEVICE_STORAGE_LOW broadcast to inform other function modules that the current storage space is insufficient. In order to prevent the application from running incorrectly during the process of writing data, the remaining operation is accelerated. The detection of the storage space, that is, detecting the remaining storage space of the data partition according to the second preset frequency.

一般情况下,第一预设阈值的大小可以根据手机的数据分区的总大小来设置,例如,可以设置为数据分区的总大小的10%到500M之间;第一预设频率可以是每40秒至1分钟检测一次,第二预设频率小于第一预设频率,例如,可以是每10-30秒检测一次。In general, the size of the first preset threshold may be set according to the total size of the data partition of the mobile phone, for example, may be set to be between 10% and 500M of the total size of the data partition; the first preset frequency may be every 40 Detected once every second to 1 minute, the second preset frequency is less than the first preset frequency, for example, it can be detected every 10-30 seconds.

步骤S30,当检测到所述剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间,其中,所述第二预设阈值小于所述第一预设阈值。Step S30, when it is detected that the remaining storage space is less than the second preset threshold, displaying warning information that the storage space is full and an application data management interface, so that the user performs data clearing based on the application data management interface to release the storage space. The second preset threshold is smaller than the first preset threshold.

当按照第二预设频率检测到剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息,以及应用数据管理界面,用户可以基于该应用该数据管理界面,清除应用数据,以释放存储空间,现有技术中,在通知栏发送警示信息,用户不容易注意到,本实施例提出的方式相对于现有的通知方式,能够使用户直观的看到空间已满的警告,并且快速地对应用数据进行清理,不需要用户再手动去开启数据管理应用,及时地进行数据的清理。When detecting that the remaining storage space is less than the second preset threshold according to the second preset frequency, displaying warning information that the storage space is full, and an application data management interface, the user may clear the application data based on the data management interface of the application, to The storage space is released. In the prior art, the warning information is sent in the notification bar, and the user does not easily notice that the method proposed in this embodiment can make the user intuitively see the warning that the space is full, and the user can intuitively see the warning that the space is full. Quickly clean up application data, without requiring the user to manually open the data management application and clean up the data in a timely manner.

此时,用于检测剩余存储空间量的模块发送ACTION_DEVICE_STORAGE_NOT_FULL广播,以告知其他的功能模块,当前的存储空间已满。At this time, the module for detecting the amount of remaining storage space sends an ACTION_DEVICE_STORAGE_NOT_FULL broadcast to inform other function modules that the current storage space is full.

本实施例中,第二预设阈值小于第一预设阈值,可选地,第二预设阈值为第一预设阈值的1/4。In this embodiment, the second preset threshold is smaller than the first preset threshold, and optionally, the second preset threshold is 1/4 of the first preset threshold.

进一步地,作为一种实施方式,在剩余存储空间不足时,发出存储空间不足的警告信息以及应用数据管理界面,此时,虽然剩余存储空间仍有余量,但是随着写数据的进行,余量会越来越小,为了使用户能够及早地对应用数据进行清理,以释放存储空间,在检测到剩余存储空间小于第一预设阈值时,显示存储空间不足的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清理以释放存储空间。Further, as an implementation manner, when the remaining storage space is insufficient, the warning information indicating that the storage space is insufficient and the application data management interface are issued. At this time, although the remaining storage space still has a margin, as the write data proceeds, the remaining The amount of information will be smaller and smaller, in order to enable the user to clean the application data early to release the storage space, and when the remaining storage space is detected to be less than the first preset threshold, the warning information indicating insufficient storage space and the application data management interface are displayed. For the user to perform data cleaning based on the application data management interface to release the storage space.

本实施例提出的数据分区的存储空间管理方法,在向数据分区写入数据的过程中,按照一定的频率检测数据分区的剩余存储空间,当检测到剩余存储空间小于第一预设阈值时,增大检测数据分区中剩余存储空间的频率,优化检测剩余存储空间大小的频率,及早发现分区剩余存储空间不足的情况,当检测到剩余存储空间小于第二预设阈值时,说明此时数据分区的剩余存储空间已经不多,如果再有一定量的数据写入,可能会导致数据分区被写满,进而影响到应用的正常运行,因此,在检测到剩余存储空间小于第二预设阈值时,即发出警告信息,同时显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间,能够预防出现存储空间快速从不足到全满而导致应用无法正常运行的情况。The storage space management method for the data partition proposed in this embodiment detects the remaining storage space of the data partition according to a certain frequency in the process of writing data to the data partition, and when detecting that the remaining storage space is smaller than the first preset threshold, Increase the frequency of the remaining storage space in the detection data partition, optimize the frequency of detecting the remaining storage space, and find out that the remaining storage space of the partition is insufficient. When it is detected that the remaining storage space is less than the second preset threshold, the data partition is indicated at this time. The remaining storage space is not much. If a certain amount of data is written, the data partition may be filled, which may affect the normal operation of the application. Therefore, when it is detected that the remaining storage space is less than the second preset threshold, That is, a warning message is issued, and an application data management interface is displayed at the same time, so that the user can perform data clearing based on the application data management interface to release the storage space, which can prevent the storage space from being quickly insufficient to full and causing the application to fail to operate normally.

基于第一实施例提出本发明数据分区的存储空间管理方法的第二实施例。参照图2所示,在本实施例中,在步骤S10之后,该数据分区的存储空间管理方法还包括:A second embodiment of the storage space management method of the data partition of the present invention is proposed based on the first embodiment. Referring to FIG. 2, in the embodiment, after the step S10, the storage space management method of the data partition further includes:

步骤S40,当检测到所述剩余存储空间小于第二预设阈值时,设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值;Step S40, when it is detected that the remaining storage space is less than the second preset threshold, setting a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold;

步骤S50,在每次调用写函数向所述数据分区写入数据之前,根据所述预设属性的值判断所述数据分区的剩余存储空间是否小于第二预设阈值;Step S50, before each write to the write function to write data to the data partition, determine, according to the value of the preset attribute, whether the remaining storage space of the data partition is smaller than a second preset threshold;

步骤S60,若剩余存储空间小于第二预设阈值,则向应用层发送读写异常的提示信息;Step S60: Send the prompt information of the read/write abnormality to the application layer if the remaining storage space is smaller than the second preset threshold.

步骤S70,若剩余存储空间大于或者等于所述第二预设阈值,则调用写函数向所述数据分区写入数据。Step S70: If the remaining storage space is greater than or equal to the second preset threshold, the write function is called to write data to the data partition.

本实施例的方法中提供一预设属性和一用于设置该预设属性的值的模块,可选地,该预设属性为sys.device.storage.low,其默认值为false,当检测到剩余存储空间小于第二预设阈值时,将sys.device.storage.low的值设置为true,即当前存储空间不足。The method in this embodiment provides a preset attribute and a module for setting a value of the preset attribute. Optionally, the preset attribute is sys.device.storage.low, and the default value is false, when detecting When the remaining storage space is less than the second preset threshold, set the value of sys.device.storage.low to true, that is, the current storage space is insufficient.

进一步地,由于用户对应用数据清理后,存储空间被释放,因此,当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。也就是说,在检测到剩余存储空间大于或者等于第二预设阈值时,将sys.device.storage.low的值设置为false,即当前剩余存储空间充足。Further, after the user clears the application data, the storage space is released. Therefore, when it is detected that the remaining storage space is greater than or equal to a second preset threshold, setting a value of the preset attribute to use the data. The amount of storage of the partition is marked as greater than or equal to the second predetermined threshold. That is, when it is detected that the remaining storage space is greater than or equal to the second preset threshold, the value of sys.device.storage.low is set to false, that is, the current remaining storage space is sufficient.

由于绝大部分的Android应用写文件都是通过FileOutputStream、OutputStreamWriter、FileWriter等java io类来实现的,而这些类最终会调用到IoBridge.java的write函数,对于用于向数据分区中写入数据的数据读写模块来说,在每次调用函数Posix.write往分区写数据时之前,增加对上述预设属性的值判断,根据该预设属性的值来判断当前的数据分区的剩余存储空间是否小于第二预设阈值。若sys.device.storage.low的值为true,则向应用层发送读写异常,若sys.device.storage.low的值为false,则调用函数Posix.write继续执行写操作。用于设置该预设属性的值的模块在设置属性值后,会分享至共享内存,因此,对于数据读写模块来说,使用获取预设属性值的方式判断数据分区可用空间是否小于第二预设阈值比直接计算数据分区的可用空间来说,极大地提高了效率。Because most Android applications write files through Java, such as FileOutputStream, OutputStreamWriter, and FileWriter. The io class is implemented, and these classes will eventually call the write function of IoBridge.java. For the data read/write module used to write data to the data partition, write the data to the partition every time the function Posix.write is called. Before the time, the value of the preset attribute is determined, and the remaining storage space of the current data partition is determined to be smaller than the second preset threshold according to the value of the preset attribute. If the value of sys.device.storage.low is true, a read/write exception is sent to the application layer. If the value of sys.device.storage.low is false, the function Posix.write is called to continue the write operation. The module for setting the value of the preset attribute is shared to the shared memory after setting the attribute value. Therefore, for the data read/write module, the method for obtaining the preset attribute value is used to determine whether the available space of the data partition is smaller than the second. The preset threshold greatly improves efficiency compared to directly calculating the available space of the data partition.

基于第一实施例或者第二实施例提出本发明数据分区的存储空间管理方法的第三实施例。在本实施例中,在检测到剩余存储空间小于第二预设阈值时,判断系统是否处于完成启动状态;若系统当前处于完成启动的状态,则执行设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值的步骤。A third embodiment of the storage space management method of the data partition of the present invention is proposed based on the first embodiment or the second embodiment. In this embodiment, when it is detected that the remaining storage space is less than the second preset threshold, it is determined whether the system is in the completed startup state; if the system is currently in the completed startup state, performing a setting of the preset attribute value to The remaining storage space of the data partition is marked as being less than a second predetermined threshold.

本实施例中通过设置系统属性sys.boot_completed的值来表示系统是否已经启动完成,如果确认系统是在启动完成后的运行状态,则设置预设属性sys.device.storage.low为true,反之则置为false。In this embodiment, the value of the system attribute sys.boot_completed is set to indicate whether the system has been started. If the system is confirmed to be in the running state after the startup is completed, the preset attribute sys.device.storage.low is set to true, and vice versa. Set to false.

由于手机在写数据的过程中可能由于应用的设置等原因出现系统重新启动的情况,而设置预设属性的值则需要在系统启动完成,并且正常运行时,才能够进行设置,因此,在本实施中,在设置系统属性之前,无论是将sys.device.storage.low的值设置为true,还是将sys.device.storage.low的值设置为false,在此之前都会获取系统属性sys.boot_completed的值,以判断系统是否当前处于完成启动的后的运行状态。在确认系统是在启动完成后的运行状态时,再对预设属性sys.device.storage.low进行设置。Since the mobile phone may restart the system due to the setting of the application during the process of writing data, and setting the value of the preset attribute needs to be set when the system is started up and running normally, therefore, in this case In the implementation, before setting the system property, whether the value of sys.device.storage.low is set to true or the value of sys.device.storage.low is set to false, the system property sys.boot_completed will be obtained before then. The value of the value to determine whether the system is currently in the running state after the completion of the startup. After confirming that the system is running after the startup is completed, set the default attribute sys.device.storage.low.

本发明还提出一种数据分区的存储空间管理装置。The invention also proposes a storage space management device for data partitioning.

参照图3所示,为本发明数据分区的存储空间管理装置第一实施例的功能模块示意图。Referring to FIG. 3, it is a schematic diagram of functional modules of a first embodiment of a storage space management apparatus for data partitioning according to the present invention.

在该实施例中,该数据分区的存储空间管理装置包括:In this embodiment, the storage space management device of the data partition includes:

分区监测模块10,用于按照第一预设频率检测数据分区的剩余存储空间; The partition monitoring module 10 is configured to detect a remaining storage space of the data partition according to the first preset frequency;

以及,当检测到所述剩余存储空间小于第一预设阈值时,按照第二预设频率检测数据分区中剩余存储空间,其中,所述第二预设频率大于所述第一预设频率;And detecting, when the remaining storage space is less than the first preset threshold, detecting a remaining storage space in the data partition according to the second preset frequency, wherein the second preset frequency is greater than the first preset frequency;

本实施例提出的装置可以是具有智能操作系统的手机、平板电脑等移动终端,以下以安装有android操作系统的手机为例进行说明。该实施例提出的装置所包含的各个功能模块用于执行不同的功能。The device proposed in this embodiment may be a mobile terminal such as a mobile phone or a tablet computer with a smart operating system. The following is an example of a mobile phone with an android operating system installed. The various functional modules included in the device proposed by this embodiment are used to perform different functions.

手机上安装有各种各样的应用,这些应用在运行过程中,会出现向数据分区,即手机的存储空间,写入数据的情况,例如下载图片、下载文件等。分区监测模块10定时地对数据分区的剩余存储空间的大小进行检测,例如,可以按照第一预设频率进行检测,当检测到剩余存储空间小于第一预设阈值时,认为当前的剩余存储空间已经不足,此时,分区监测模块10可以发送ACTION_DEVICE_STORAGE_LOW广播,以告知其他的功能模块,当前的存储空间已经不足,为了防止在写入数据的过程中发生空间已满导致应用运行出错,加快剩余存储空间的检测,即按照第二预设频率对数据分区的剩余存储空间进行检测。There are a variety of applications installed on the mobile phone. During the running process, there will be data partitioning, that is, the storage space of the mobile phone, and writing data, such as downloading pictures, downloading files, and the like. The partition monitoring module 10 periodically detects the size of the remaining storage space of the data partition. For example, the detection may be performed according to the first preset frequency. When it is detected that the remaining storage space is less than the first preset threshold, the current remaining storage space is considered. At this time, the partition monitoring module 10 can send an ACTION_DEVICE_STORAGE_LOW broadcast to inform other functional modules that the current storage space is insufficient. In order to prevent the application from running wrong during the process of writing data, the remaining storage is accelerated. The detection of the space, that is, detecting the remaining storage space of the data partition according to the second preset frequency.

一般情况下,第一预设阈值的大小可以根据手机的数据分区的总大小来设置,例如,可以设置为数据分区的总大小的10%到500M之间;第一预设频率可以是每40秒至1分钟检测一次,第二预设频率小于第一预设频率,例如,可以是每10-30秒检测一次。In general, the size of the first preset threshold may be set according to the total size of the data partition of the mobile phone, for example, may be set to be between 10% and 500M of the total size of the data partition; the first preset frequency may be every 40 Detected once every second to 1 minute, the second preset frequency is less than the first preset frequency, for example, it can be detected every 10-30 seconds.

信息提示模块20,用于当检测到所述剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息,其中,所述第二预设阈值小于所述第一预设阈值;The information prompting module 20 is configured to display, when the remaining storage space is less than the second preset threshold, the warning information that the storage space is full, wherein the second preset threshold is smaller than the first preset threshold;

界面显示模块30,用于当检测到所述剩余存储空间小于第二预设阈值时,显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。The interface display module 30 is configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space is less than a second preset threshold.

当按照第二预设频率检测到剩余存储空间小于第二预设阈值时,信息提示模块20显示存储空间已满的警告信息,界面显示模块30显示应用数据管理界面,用户可以基于该应用该数据管理界面,清除应用数据,以释放存储空间,现有技术中,在通知栏发送警示信息,用户不容易注意到,本实施例提出的方式相对于现有的通知方式,能够使用户直观的看到空间已满的警告,并且快速地对应用数据进行清理,不需要用户再手动去开启数据管理应用,及时地进行数据的清理。When the remaining storage space is detected to be less than the second preset threshold according to the second preset frequency, the information prompting module 20 displays the warning information that the storage space is full, and the interface display module 30 displays the application data management interface, and the user can use the data based on the application. The management interface clears the application data to release the storage space. In the prior art, the warning information is sent in the notification bar, and the user does not easily notice that the method proposed in this embodiment can make the user intuitively view relative to the existing notification mode. The warning that the space is full, and the application data is quickly cleaned up, the user does not need to manually open the data management application, and the data is cleaned in time.

此时,分区监测模块10发送ACTION_DEVICE_STORAGE_NOT_FULL广播,以告知其他的功能模块,当前的存储空间已满。At this time, the partition monitoring module 10 sends an ACTION_DEVICE_STORAGE_NOT_FULL broadcast to inform other functional modules that the current storage space is full.

本实施例中,第二预设阈值小于第一预设阈值,可选地,第二预设阈值为第一预设阈值的1/4。In this embodiment, the second preset threshold is smaller than the first preset threshold, and optionally, the second preset threshold is 1/4 of the first preset threshold.

进一步地,作为一种实施方式,信息提示模块20在剩余存储空间不足时,发出存储空间不足的警告信息,界面显示模块30显示应用数据管理界面,此时,虽然剩余存储空间仍有余量,但是随着写数据的进行,余量会越来越小,为了使用户能够及早地对应用数据进行清理,以释放存储空间,在检测到剩余存储空间小于第一预设阈值时,显示存储空间不足的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清理以释放存储空间。Further, as an implementation manner, the information prompting module 20 issues a warning message that the storage space is insufficient when the remaining storage space is insufficient, and the interface display module 30 displays the application data management interface. At this time, although the remaining storage space still has a margin, However, as the write data proceeds, the margin will become smaller and smaller, in order to enable the user to clean the application data early to release the storage space, and display the storage space when detecting that the remaining storage space is less than the first preset threshold. Insufficient warning information and an application data management interface for the user to perform data cleaning based on the application data management interface to release storage space.

本实施例提出的数据分区的存储空间管理装置,在向数据分区写入数据的过程中,按照一定的频率检测数据分区的剩余存储空间,当检测到剩余存储空间小于第一预设阈值时,增大检测数据分区中剩余存储空间的频率,优化检测剩余存储空间大小的频率,及早发现分区剩余存储空间不足的情况,当检测到剩余存储空间小于第二预设阈值时,说明此时数据分区的剩余存储空间已经不多,如果再有一定量的数据写入,可能会导致数据分区被写满,进而影响到应用的正常运行,因此,在检测到剩余存储空间小于第二预设阈值时,即发出警告信息,同时显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间,能够预防出现存储空间快速从不足到全满而导致应用无法正常运行的情况。The storage space management device of the data partition proposed in this embodiment detects the remaining storage space of the data partition according to a certain frequency in the process of writing data to the data partition, and when detecting that the remaining storage space is smaller than the first preset threshold, Increase the frequency of the remaining storage space in the detection data partition, optimize the frequency of detecting the remaining storage space, and find out that the remaining storage space of the partition is insufficient. When it is detected that the remaining storage space is less than the second preset threshold, the data partition is indicated at this time. The remaining storage space is not much. If a certain amount of data is written, the data partition may be filled, which may affect the normal operation of the application. Therefore, when it is detected that the remaining storage space is less than the second preset threshold, That is, a warning message is issued, and an application data management interface is displayed at the same time, so that the user can perform data clearing based on the application data management interface to release the storage space, which can prevent the storage space from being quickly insufficient to full and causing the application to fail to operate normally.

基于第一实施例提出本发明数据分区的存储空间管理装置的第二实施例。参照图4所示,在本实施例中,该数据分区的存储空间管理装置还包括:A second embodiment of the storage space management apparatus of the data partition of the present invention is proposed based on the first embodiment. Referring to FIG. 4, in the embodiment, the storage space management device of the data partition further includes:

系统属性模块40,用于当检测到所述剩余存储空间小于第二预设阈值时,设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值;The system attribute module 40 is configured to: when detecting that the remaining storage space is less than a second preset threshold, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold;

数据读写模块50,用于在每次调用写函数向所述数据分区写入数据之前,根据所述预设属性的值判断所述数据分区的剩余存储空间是否小于第二预设阈值;The data reading and writing module 50 is configured to determine, according to the value of the preset attribute, whether the remaining storage space of the data partition is smaller than a second preset threshold, before each write to the data function is written to the data partition;

数据读写模块50还用于:若剩余存储空间小于第二预设阈值,则向应用层发送读写异常的提示信息;以及,若剩余存储空间大于或者等于所述第二预设阈值,则调用写函数向所述数据分区写入数据。The data reading and writing module 50 is further configured to: if the remaining storage space is less than the second preset threshold, send the prompt information of the read/write abnormality to the application layer; and if the remaining storage space is greater than or equal to the second preset threshold, A write function is called to write data to the data partition.

本实施例提供一预设属性,可选地,该预设属性为sys.device.storage.low,其默认值为false,当检测到剩余存储空间小于第二预设阈值时,将sys.device.storage.low的值设置为true,即当前存储空间不足。This embodiment provides a preset attribute. Optionally, the preset attribute is sys.device.storage.low, and the default value is false. When the remaining storage space is detected to be less than the second preset threshold, the sys.device is used. The value of .storage.low is set to true, that is, the current storage space is insufficient.

进一步地,由于用户对应用数据清理后,存储空间被释放,因此,当检测到所述剩余存储空间大于或者等于第二预设阈值时,系统属性模块40设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。也就是说,在检测到剩余存储空间大于或者等于第二预设阈值时,系统属性模块40将sys.device.storage.low的值设置为false,即当前剩余存储空间充足。Further, after the user clears the application data, the storage space is released. Therefore, when detecting that the remaining storage space is greater than or equal to a second preset threshold, the system attribute module 40 sets the value of the preset attribute to The storage amount of the data partition is marked as being greater than or equal to the second predetermined threshold. That is, when it is detected that the remaining storage space is greater than or equal to the second preset threshold, the system attribute module 40 sets the value of sys.device.storage.low to false, that is, the current remaining storage space is sufficient.

由于绝大部分的Android应用写文件都是通过FileOutputStream、OutputStreamWriter、FileWriter等java io类来实现的,而这些类最终会调用到IoBridge.java的write函数,数据读写模块50在每次调用函数Posix.write往分区写数据时之前,增加对上述预设属性的值判断,根据该预设属性的值来判断当前的数据分区的剩余存储空间是否小于第二预设阈值。若sys.device.storage.low的值为true,则数据读写模块50向应用层发送读写异常,若sys.device.storage.low的值为false,则数据读写模块50调用函数Posix.write继续执行写操作。系统属性模块40在设置属性值后,会分享至共享内存,因此,对于数据读写模块50来说,使用获取预设属性值的方式判断数据分区可用空间是否小于第二预设阈值比直接计算数据分区的可用空间来说,极大地提高了效率。Because most Android applications write files through Java, such as FileOutputStream, OutputStreamWriter, and FileWriter. The io class is implemented, and these classes will eventually call the write function of IoBridge.java. The data read/write module 50 adds the value judgment of the preset attribute before each time the function Posix.write is called to write data to the partition. Determining, according to the value of the preset attribute, whether the remaining storage space of the current data partition is less than a second preset threshold. If the value of sys.device.storage.low is true, the data read/write module 50 sends a read/write exception to the application layer. If the value of sys.device.storage.low is false, the data read/write module 50 calls the function Posix. Write continues to perform write operations. After the attribute value is set, the system attribute module 40 shares the shared memory. Therefore, for the data read/write module 50, the method for obtaining the preset attribute value determines whether the available space of the data partition is smaller than the second preset threshold than the direct calculation. The usable space of the data partition greatly improves efficiency.

基于第一实施例或者第二实施例提出本发明数据分区的存储空间管理装置的第三实施例。参照图5所示,在本实施例中,该数据分区的存储空间管理装置还包括:A third embodiment of the storage space management apparatus of the data partition of the present invention is proposed based on the first embodiment or the second embodiment. Referring to FIG. 5, in the embodiment, the storage space management device of the data partition further includes:

状态判断模块60,用于当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;The state determining module 60 is configured to determine, when the remaining storage space is less than the second preset threshold, whether the system is currently in the state of completing the startup;

系统属性模块40还用于:若系统当前处于完成启动的状态,则设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值。The system attribute module 40 is further configured to: if the system is currently in the state of completing the startup, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold.

本实施例中通过设置系统属性sys.boot_completed的值来表示系统是否已经启动完成,如果确认系统是在启动完成后的运行状态,则系统属性模块40设置预设属性sys.device.storage.low为true,反之则置为false。In this embodiment, the system attribute module 40 sets the preset attribute sys.device.storage.low by setting the value of the system attribute sys.boot_completed to indicate whether the system has been started. True, otherwise it is set to false.

由于手机在写数据的过程中可能由于应用的设置等原因出现系统重新启动的情况,而设置预设属性的值则需要在系统启动完成,并且正常运行时,才能够进行设置,因此,在本实施中,在设置系统属性之前,无论是将sys.device.storage.low的值设置为true,还是将sys.device.storage.low的值设置为false,在此之前状态判断模块60都会获取系统属性sys.boot_completed的值,以判断系统是否当前处于完成启动的后的运行状态。在确认系统是在启动完成后的运行状态时,系统属性模块40再对预设属性sys.device.storage.low进行设置。Since the mobile phone may restart the system due to the setting of the application during the process of writing data, and setting the value of the preset attribute needs to be set when the system is started up and running normally, therefore, in this case In the implementation, before setting the system property, whether the value of sys.device.storage.low is set to true or the value of sys.device.storage.low is set to false, the state judging module 60 will acquire the system before this. The value of the attribute sys.boot_completed to determine whether the system is currently in the running state after the startup is completed. After confirming that the system is in the running state after the startup is completed, the system property module 40 sets the preset attribute sys.device.storage.low.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.

Claims (17)

一种数据分区的存储空间管理方法,其特征在于,所述数据分区的存储空间管理方法包括: A storage space management method for a data partition, wherein the storage space management method of the data partition includes: 按照第一预设频率检测数据分区的剩余存储空间; Detecting a remaining storage space of the data partition according to the first preset frequency; 当检测到所述剩余存储空间小于第一预设阈值时,按照第二预设频率检测数据分区中剩余存储空间,其中,所述第二预设频率大于所述第一预设频率;When the remaining storage space is detected to be smaller than the first preset threshold, the remaining storage space in the data partition is detected according to the second preset frequency, where the second preset frequency is greater than the first preset frequency; 当检测到所述剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间,其中,所述第二预设阈值小于所述第一预设阈值;When the remaining storage space is detected to be smaller than the second preset threshold, the warning information that the storage space is full and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space, where The second preset threshold is smaller than the first preset threshold; 当检测到所述剩余存储空间量小于第一预设阈值时,显示存储空间不足的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间;When it is detected that the amount of the remaining storage space is less than the first preset threshold, the warning information indicating that the storage space is insufficient and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space; 当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;When it is detected that the remaining storage space is less than a second preset threshold, determining whether the system is currently in a state of completing startup; 若系统当前处于完成启动的状态,则执行设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值的步骤;If the system is currently in the state of completing the startup, performing a step of setting a value of the preset attribute to mark the remaining storage space of the data partition as being smaller than a second preset threshold; 所述按照第二预设频率检测数据分区中剩余存储空间的步骤之后,所述数据分区的存储空间管理方法还包括:After the step of detecting the remaining storage space in the data partition according to the second preset frequency, the storage space management method of the data partition further includes: 当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。And when the remaining storage space is greater than or equal to the second preset threshold, the value of the preset attribute is set to mark the storage amount of the data partition to be greater than or equal to the second preset threshold. 一种数据分区的存储空间管理方法,其特征在于,所述数据分区的存储空间管理方法包括:A storage space management method for a data partition, wherein the storage space management method of the data partition includes: 按照第一预设频率检测数据分区的剩余存储空间; Detecting a remaining storage space of the data partition according to the first preset frequency; 当检测到所述剩余存储空间小于第一预设阈值时,按照第二预设频率检测数据分区中剩余存储空间,其中,所述第二预设频率大于所述第一预设频率;When the remaining storage space is detected to be smaller than the first preset threshold, the remaining storage space in the data partition is detected according to the second preset frequency, where the second preset frequency is greater than the first preset frequency; 当检测到所述剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间,其中,所述第二预设阈值小于所述第一预设阈值。When the remaining storage space is detected to be smaller than the second preset threshold, the warning information that the storage space is full and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space, where The second preset threshold is smaller than the first preset threshold. 根据权利要求2所述的数据分区的存储空间管理方法,其特征在于,所述数据分区的存储空间管理方法还包括:The storage space management method for a data partition according to claim 2, wherein the storage space management method of the data partition further comprises: 当检测到所述剩余存储空间小于第二预设阈值时,设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值;When it is detected that the remaining storage space is less than a second preset threshold, setting a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold; 在每次调用写函数向所述数据分区写入数据之前,根据所述预设属性的值判断所述数据分区的剩余存储空间是否小于第二预设阈值;Determining, according to the value of the preset attribute, whether the remaining storage space of the data partition is smaller than a second preset threshold, before each of the write function is written to the data partition; 若剩余存储空间小于第二预设阈值,则向应用层发送读写异常的提示信息;Sending the prompt information of the read/write abnormality to the application layer if the remaining storage space is less than the second preset threshold; 若剩余存储空间大于或者等于所述第二预设阈值,则调用写函数向所述数据分区写入数据。If the remaining storage space is greater than or equal to the second predetermined threshold, the write function is called to write data to the data partition. 根据权利要求2所述的数据分区的存储空间管理方法,其特征在于,所述数据分区的存储空间管理方法还包括:The storage space management method for a data partition according to claim 2, wherein the storage space management method of the data partition further comprises: 当检测到所述剩余存储空间量小于第一预设阈值时,显示存储空间不足的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。When it is detected that the amount of the remaining storage space is less than the first preset threshold, the warning information indicating that the storage space is insufficient and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space. 根据权利要求3所述的数据分区的存储空间管理方法,其特征在于,所述数据分区的存储空间管理方法还包括:The storage space management method for a data partition according to claim 3, wherein the storage space management method of the data partition further comprises: 当检测到所述剩余存储空间量小于第一预设阈值时,显示存储空间不足的警告信息以及应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。When it is detected that the amount of the remaining storage space is less than the first preset threshold, the warning information indicating that the storage space is insufficient and the application data management interface are displayed, so that the user performs data clearing based on the application data management interface to release the storage space. 根据权利要求3所述的数据分区的存储空间管理方法,其特征在于,所述数据分区的存储空间管理方法还包括:The storage space management method for a data partition according to claim 3, wherein the storage space management method of the data partition further comprises: 当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;When it is detected that the remaining storage space is less than a second preset threshold, determining whether the system is currently in a state of completing startup; 若系统当前处于完成启动的状态,则执行设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值的步骤。If the system is currently in the state of completing the startup, the step of setting the value of the preset attribute to mark the remaining storage space of the data partition as being smaller than the second preset threshold is performed. 根据权利要求4所述的数据分区的存储空间管理方法,其特征在于,所述数据分区的存储空间管理方法还包括:The storage space management method for a data partition according to claim 4, wherein the storage space management method of the data partition further comprises: 当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;When it is detected that the remaining storage space is less than a second preset threshold, determining whether the system is currently in a state of completing startup; 若系统当前处于完成启动的状态,则执行设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值的步骤。If the system is currently in the state of completing the startup, the step of setting the value of the preset attribute to mark the remaining storage space of the data partition as being smaller than the second preset threshold is performed. 根据权利要求3所述的数据分区的存储空间管理方法,其特征在于,所述按照第二预设频率检测数据分区中剩余存储空间的步骤之后,所述数据分区的存储空间管理方法还包括:The storage space management method of the data partition according to claim 3, wherein after the step of detecting the remaining storage space in the data partition according to the second preset frequency, the storage space management method of the data partition further comprises: 当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。And when the remaining storage space is greater than or equal to the second preset threshold, the value of the preset attribute is set to mark the storage amount of the data partition to be greater than or equal to the second preset threshold. 根据权利要求4所述的数据分区的存储空间管理方法,其特征在于,所述按照第二预设频率检测数据分区中剩余存储空间的步骤之后,所述数据分区的存储空间管理方法还包括:The storage space management method of the data partition according to claim 4, wherein after the step of detecting the remaining storage space in the data partition according to the second preset frequency, the storage space management method of the data partition further comprises: 当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。And when the remaining storage space is greater than or equal to the second preset threshold, the value of the preset attribute is set to mark the storage amount of the data partition to be greater than or equal to the second preset threshold. 一种数据分区的存储空间管理装置,其特征在于,所述数据分区的存储空间管理装置包括:A storage space management device for data partitioning, wherein the storage space management device of the data partition comprises: 分区监测模块,用于按照第一预设频率检测数据分区的剩余存储空间; a partition monitoring module, configured to detect a remaining storage space of the data partition according to the first preset frequency; 以及,当检测到所述剩余存储空间小于第一预设阈值时,按照第二预设频率检测数据分区中剩余存储空间,其中,所述第二预设频率大于所述第一预设频率;And detecting, when the remaining storage space is less than the first preset threshold, detecting a remaining storage space in the data partition according to the second preset frequency, wherein the second preset frequency is greater than the first preset frequency; 信息提示模块,用于当检测到所述剩余存储空间小于第二预设阈值时,显示存储空间已满的警告信息,其中,所述第二预设阈值小于所述第一预设阈值;The information prompting module is configured to display, when the remaining storage space is less than the second preset threshold, the warning information that the storage space is full, wherein the second preset threshold is smaller than the first preset threshold; 界面显示模块,用于当检测到所述剩余存储空间小于第二预设阈值时,显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。The interface display module is configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space is less than a second preset threshold. 根据权利要求10所述的数据分区的存储空间管理装置,其特征在于,所述数据分区的存储空间管理装置还包括:The storage space management device of the data partition according to claim 10, wherein the storage space management device of the data partition further comprises: 系统属性模块,用于当检测到所述剩余存储空间小于第二预设阈值时,设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值;a system attribute module, configured to: when detecting that the remaining storage space is less than a second preset threshold, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold; 数据读写模块,用于在每次调用写函数向所述数据分区写入数据之前,根据所述预设属性的值判断所述数据分区的剩余存储空间是否小于第二预设阈值;以及 ,若剩余存储空间小于第二预设阈值,则向应用层发送读写异常的提示信息;若剩余存储空间大于或者等于所述第二预设阈值,则调用写函数向所述数据分区写入数据。a data reading and writing module, configured to determine, according to the value of the preset attribute, whether a remaining storage space of the data partition is smaller than a second preset threshold, before each write write function writes data to the data partition; Sending the prompt information of the read/write abnormality to the application layer if the remaining storage space is less than the second preset threshold; if the remaining storage space is greater than or equal to the second preset threshold, calling the write function to write to the data partition data. 根据权利要求10所述的数据分区的存储空间管理装置,其特征在于,所述信息提示模块还用于:当检测到所述剩余存储空间量小于第一预设阈值时,显示存储空间不足的警告信息;The storage space management device of the data partition according to claim 10, wherein the information prompting module is further configured to display insufficient storage space when detecting that the remaining storage space amount is less than a first preset threshold Warning message 所述界面显示模块还用于:当检测到所述剩余存储空间量小于第一预设阈值时,显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。The interface display module is further configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space amount is less than the first preset threshold. 根据权利要求11所述的数据分区的存储空间管理装置,其特征在于,所述信息提示模块还用于:当检测到所述剩余存储空间量小于第一预设阈值时,显示存储空间不足的警告信息;The storage space management device of the data partition according to claim 11, wherein the information prompting module is further configured to: when detecting that the remaining storage space amount is less than a first preset threshold, displaying insufficient storage space Warning message 所述界面显示模块还用于:当检测到所述剩余存储空间量小于第一预设阈值时,显示应用数据管理界面,以供用户基于所述应用数据管理界面进行数据清除以释放存储空间。The interface display module is further configured to display an application data management interface for the user to perform data clearing based on the application data management interface to release the storage space when detecting that the remaining storage space amount is less than the first preset threshold. 根据权利要求11所述的数据分区的存储空间管理装置,其特征在于,所述数据分区的存储空间管理装置还包括:The storage space management device of the data partition according to claim 11, wherein the storage space management device of the data partition further comprises: 状态判断模块,用于当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;a state determining module, configured to determine, when the remaining storage space is less than a second preset threshold, whether the system is currently in a startup state; 所述系统属性模块还用于:若系统当前处于完成启动的状态,则设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值。The system attribute module is further configured to: if the system is currently in a state of completing startup, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold. 根据权利要求12所述的数据分区的存储空间管理装置,其特征在于,所述数据分区的存储空间管理装置还包括:The storage space management device of the data partition according to claim 12, wherein the storage space management device of the data partition further comprises: 状态判断模块,用于当检测到所述剩余存储空间小于第二预设阈值时,判断系统当前是否处于完成启动的状态;a state determining module, configured to determine, when the remaining storage space is less than a second preset threshold, whether the system is currently in a startup state; 所述系统属性模块还用于:若系统当前处于完成启动的状态,则设置预设属性的值,以将所述数据分区的剩余存储空间标记为小于第二预设阈值。The system attribute module is further configured to: if the system is currently in a state of completing startup, set a value of the preset attribute to mark the remaining storage space of the data partition to be smaller than a second preset threshold. 根据权利要求11所述的数据分区的存储空间管理装置,其特征在于,所述系统属性模块还用于:当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。 The storage space management device of the data partition according to claim 11, wherein the system attribute module is further configured to: when the remaining storage space is detected to be greater than or equal to a second preset threshold, A value of the attribute is set to mark the amount of storage of the data partition to be greater than or equal to the second predetermined threshold. 根据权利要求12所述的数据分区的存储空间管理装置,其特征在于,所述系统属性模块还用于:当检测到所述剩余存储空间大于或者等于第二预设阈值时,设置所述预设属性的值,以将所述数据分区的存储量标记为大于或者等于所述第二预设阈值。The storage space management device of the data partition according to claim 12, wherein the system attribute module is further configured to: when the remaining storage space is detected to be greater than or equal to a second preset threshold, A value of the attribute is set to mark the amount of storage of the data partition to be greater than or equal to the second predetermined threshold.
PCT/CN2016/112266 2016-08-12 2016-12-27 Method and device for managing storage space of data partition Ceased WO2018028121A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610665783.4 2016-08-12
CN201610665783.4A CN106354601A (en) 2016-08-12 2016-08-12 Storage space management method and device for data partition

Publications (1)

Publication Number Publication Date
WO2018028121A1 true WO2018028121A1 (en) 2018-02-15

Family

ID=57843908

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/112266 Ceased WO2018028121A1 (en) 2016-08-12 2016-12-27 Method and device for managing storage space of data partition

Country Status (2)

Country Link
CN (1) CN106354601A (en)
WO (1) WO2018028121A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710489A (en) * 2018-12-17 2019-05-03 北京无线电计量测试研究所 A kind of system and method for real-time monitoring computer memory space state
CN115988271A (en) * 2022-12-12 2023-04-18 阿里巴巴(中国)有限公司 Video playing method, data processing method and electronic device

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951195A (en) * 2017-04-07 2017-07-14 上海联影医疗科技有限公司 The processing method and medical image system of the memory capacity of medical image system
CN107182151A (en) * 2017-07-25 2017-09-19 安徽荣旭信息科技有限公司 A kind of power plant lamp control system with speech recognition
CN107948671A (en) * 2017-11-23 2018-04-20 莫宝兰 A kind of streaming media control device and method
CN108121783A (en) * 2017-12-19 2018-06-05 深圳创维数字技术有限公司 A kind of automatic cleaning method, device, computer and storage medium for storing data
CN108282690A (en) * 2018-01-26 2018-07-13 广东欧珀移动通信有限公司 Network video downloading method and device and computer readable storage medium
CN108959597A (en) * 2018-07-12 2018-12-07 深圳Tcl新技术有限公司 User's space guard method, device, equipment and display terminal storage medium
CN113296681B (en) * 2020-02-24 2024-07-26 合肥杰发科技有限公司 Storage space management method, terminal and device with storage function
CN111970678B (en) * 2020-08-06 2023-04-28 Oppo(重庆)智能科技有限公司 Method and device for capturing air interface data packet, electronic equipment and storage medium
CN112182652B (en) * 2020-09-27 2021-10-08 广州朗国电子科技有限公司 Method and device for protecting data partition from being fully written, storage medium and terminal equipment
CN114297635B (en) * 2021-12-24 2025-02-07 奇安盘古(上海)信息技术有限公司 Evidence collection method, device and electronic device based on mobile storage device
CN115562867B (en) * 2022-10-18 2025-09-05 厦门四信通信科技有限公司 A face recognition device and memory cleaning method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101447207A (en) * 2008-12-30 2009-06-03 深圳华为通信技术有限公司 Media recording method and device thereof
US20130326146A1 (en) * 2012-05-30 2013-12-05 Toshiba Solutions Corporation Information processing apparatus, memory apparatus, and data management method
CN103577348A (en) * 2013-10-09 2014-02-12 广东欧珀移动通信有限公司 Method and mobile device for automatically counting application cache size and reminding user
CN104035769A (en) * 2014-05-30 2014-09-10 北京金山安全软件有限公司 Processing method and device for space shortage
CN104850487A (en) * 2015-04-27 2015-08-19 小米科技有限责任公司 Information display method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101447207A (en) * 2008-12-30 2009-06-03 深圳华为通信技术有限公司 Media recording method and device thereof
US20130326146A1 (en) * 2012-05-30 2013-12-05 Toshiba Solutions Corporation Information processing apparatus, memory apparatus, and data management method
CN103577348A (en) * 2013-10-09 2014-02-12 广东欧珀移动通信有限公司 Method and mobile device for automatically counting application cache size and reminding user
CN104035769A (en) * 2014-05-30 2014-09-10 北京金山安全软件有限公司 Processing method and device for space shortage
CN104850487A (en) * 2015-04-27 2015-08-19 小米科技有限责任公司 Information display method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710489A (en) * 2018-12-17 2019-05-03 北京无线电计量测试研究所 A kind of system and method for real-time monitoring computer memory space state
CN115988271A (en) * 2022-12-12 2023-04-18 阿里巴巴(中国)有限公司 Video playing method, data processing method and electronic device

Also Published As

Publication number Publication date
CN106354601A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
WO2018028121A1 (en) Method and device for managing storage space of data partition
WO2013131444A1 (en) Content sharing method, terminal, server, and system, and computer storage medium
WO2018053963A1 (en) Method and apparatus for upgrading system of smart television
WO2015135443A1 (en) Method and apparatus for simulating sound in virtual scenario, and terminal
WO2018233370A1 (en) Mirror synchronization method, system, device and computer readable storage medium
WO2018223418A1 (en) Display panel testing method, device and system
WO2017092268A1 (en) Terminal failure processing method, device and system
WO2017190450A1 (en) Process closing method and apparatus
WO2017219485A1 (en) Smart television and control method therefor
WO2017063368A1 (en) Method and device for intercutting video advertisement
WO2013143341A1 (en) Method and device for updating application information of mobile terminal
WO2017063366A1 (en) Method and system for starting application
WO2017036204A1 (en) Focus positioning method and device for application switching
WO2018090452A1 (en) Method and apparatus for protecting root permission
WO2019205272A1 (en) Virtual machine service providing method, device and equipment and computer readable storage medium
WO2017206601A1 (en) Client data processing method and apparatus
WO2018126888A1 (en) Method and apparatus for configuring a shortcut for a television function
WO2017215233A1 (en) Terminal power button control method and system
WO2019061530A1 (en) Method and apparatus for automatically adjusting brightness of display, and storage medium
WO2019019249A1 (en) Method, apparatus and device for executing network request, and computer-readable storage medium
WO2017059686A1 (en) Desktop displaying method and device
WO2019062109A1 (en) Method of mounting disk array, android device and storage medium
WO2017084305A1 (en) Terminal control method and system
WO2019061042A1 (en) Exposure compensation method, device and computer readable storage medium
WO2019024472A1 (en) Data operation method and device and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16912574

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.07.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16912574

Country of ref document: EP

Kind code of ref document: A1