WO2018233668A1 - 基于Android系统的异常恢复方法、装置、智能设备及存储介质 - Google Patents

基于Android系统的异常恢复方法、装置、智能设备及存储介质 Download PDF

Info

Publication number
WO2018233668A1
WO2018233668A1 PCT/CN2018/092188 CN2018092188W WO2018233668A1 WO 2018233668 A1 WO2018233668 A1 WO 2018233668A1 CN 2018092188 W CN2018092188 W CN 2018092188W WO 2018233668 A1 WO2018233668 A1 WO 2018233668A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
data partition
preset value
available space
data
Prior art date
Application number
PCT/CN2018/092188
Other languages
English (en)
French (fr)
Inventor
田昊
杨志斌
刘成刚
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018233668A1 publication Critical patent/WO2018233668A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1417Boot up procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present disclosure relates to the field of Android (Android) system terminal technologies, and in particular, to an Android-based abnormality recovery method, apparatus, device, and storage medium.
  • Android Android
  • the present disclosure is directed to an abnormality recovery method, apparatus, smart device, and storage medium based on an Android system, to at least partially solve a system defect caused by an insufficient space of a data partition of an Android system-based smart device.
  • an abnormality recovery method based on an Android system is provided, which is applied to a smart device, and the method includes: after detecting that a system or an application writes critical data fails, determining whether a free space of the data partition is smaller than a preset value; if the available space of the data partition is less than the preset value, the file is cleaned according to a preset policy, so that the available space of the data partition reaches the preset value; and the smart device is restarted.
  • an abnormality recovery device based on an Android system
  • the abnormality recovery device includes: a monitoring module configured to monitor whether a system or an application fails to write key data;
  • the setting module is configured to determine whether the available space of the data partition is less than a preset value; and the cleaning module, when the determining module determines that the available space of the data partition is less than the preset value, the cleaning module clears the file according to the preset policy. Making the available space of the data partition reach the preset value; and restarting the module, which is set to restart the smart device.
  • a smart device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the computer program is executed by the processor, causing the processor to execute An Android system based anomaly recovery method according to the present disclosure.
  • a storage medium having stored thereon a computer program that, when executed by a processor, causes a processor to execute an Android system-based anomaly recovery method according to the present disclosure.
  • FIG. 1 schematically shows a hardware configuration diagram in which an abnormality recovery method according to various embodiments of the present disclosure may be applied;
  • FIG. 2 is a flowchart of an abnormality recovery method in accordance with an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a file cleaning method according to an embodiment of the present disclosure.
  • FIG. 4 is a flowchart of an abnormality recovery method for booting a system according to an embodiment of the present disclosure
  • FIG. 5 is a block configuration diagram of an abnormality recovery device according to an embodiment of the present disclosure.
  • Smart devices can be implemented in a variety of forms.
  • the smart device described in the present disclosure may include a set top box such as an Android system based system, a smart phone, a smart phone, a notebook computer, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a portable multimedia player ( A mobile terminal such as a PMP), a navigation device, or the like may further include a fixed terminal such as a digital TV based on an Android system, a desktop computer, or the like.
  • PDA personal digital assistant
  • PAD tablet computer
  • a mobile terminal such as a PMP
  • a navigation device or the like may further include a fixed terminal such as a digital TV based on an Android system, a desktop computer, or the like.
  • the smart device is a mobile terminal.
  • those skilled in the art will appreciate that configurations in accordance with embodiments of the present disclosure can be applied to fixed type terminals in addition to elements that are specifically for mobile purposes.
  • FIG. 1 schematically shows a hardware configuration diagram in which an abnormality recovery method according to various embodiments of the present disclosure may be applied.
  • the mobile terminal 100 may include a processor 110 and a memory 120.
  • a computer program 130 executable on the processor 110 can be stored in the memory 120.
  • the processor 110 is a control center of the mobile terminal that connects various portions of the entire mobile terminal using various interfaces and lines, by running or executing software programs and/or modules (including the computer program 130) stored in the memory 120, And calling the data stored in the memory 120, performing various functions of the mobile terminal and processing data, thereby performing overall monitoring of the mobile terminal.
  • Processor 110 may include one or more processing units, and processor 110 may integrate an application processor and a modem processor.
  • the application processor primarily handles operating systems, user interfaces, applications, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the modem processor may also not be integrated into the processor 110.
  • the processor 110 may be caused to perform the following steps: after detecting that the system or the application fails to write the key data, it is determined whether the available space of the data partition is less than a preset. a value; if the available space of the data partition is less than the preset value, the file is cleaned according to a preset policy such that the available space of the data partition reaches the preset value; and the smart device (eg, the mobile terminal 100) is restarted.
  • the step of cleaning the file according to the preset policy may include: performing file cleaning according to the built-in SD card, application redundancy data, application data directory, application installation directory, and deep cleaning, and cleaning up At the same time, the file determines whether the available space of the data partition reaches the preset value; and if the available space of the data partition reaches the preset value, the file cleaning is ended.
  • file cleaning may be performed in the following order: deleting a file in a preset path in the built-in SD card, and determining whether the available space of the data partition reaches the preset value, if the available space of the data partition reaches the stated value
  • the preset value ends the file cleaning; deletes the application redundant data, and determines whether the available space of the data partition reaches the preset value, and if the available space of the data partition reaches the preset value, the file cleaning is ended; traversing
  • the application data directory deletes a file whose size is greater than the first preset threshold in the application data directory, and determines, after each file deletion, whether the available space of the data partition reaches the preset value, if the available space of the data partition reaches the stated value
  • the preset value ends the file cleaning; traverses the application installation directory, deletes the file whose size is larger than the second preset threshold in the application installation directory, and determines whether the available space of the data partition reaches the preset value after deleting one file.
  • the first preset threshold may be 50 megabytes
  • the second predetermined threshold may be 50 megabytes
  • the preset value may be 5% of the total capacity of the data partition.
  • the mobile terminal 100 may further include, but is not limited to, a radio frequency unit, a WiFi module, an audio output unit, an audio/video input unit, a sensor, a display unit, a user input unit, an interface unit, a Bluetooth module, Power supply, etc., will not be described here.
  • FIG. 2 is a flow chart of an abnormality recovery method in accordance with an embodiment of the present disclosure.
  • the Android system-based abnormality recovery method may include steps S201 to S204.
  • step S201 it is detected that the system or application fails to write the key data.
  • step S202 it is determined whether the available space of the data partition is less than a preset value. If it is less than the preset value, step S203 is performed, otherwise step S204 is performed.
  • step S203 the file is cleaned according to the preset policy, so that the available space of the data partition reaches a preset value.
  • step S204 the smart device is restarted.
  • step S203 may include: performing file cleaning in the order of built-in SD card, application redundancy data, application data directory, application installation directory, and deep cleaning, and determining data partition while cleaning the file. Whether the available space reaches the preset value; and if the available space of the data partition reaches the preset value, the file cleanup is ended.
  • FIG. 3 is a flow chart of a file cleaning method in accordance with an embodiment of the present disclosure.
  • step S203 shown in FIG. 2 may include steps S2031 to S2035.
  • step S2031 the file in the preset path in the built-in SD card is deleted, and it is determined whether the available space of the data partition reaches a preset value. If the preset value is reached, the file cleaning is ended.
  • step S2032 the application redundancy data is deleted, and it is determined whether the available space of the data partition reaches a preset value, and if the preset value is reached, the file cleaning is ended.
  • step S2033 the application data directory is traversed, and the file whose size is larger than the first preset threshold in the application data directory is deleted, and after each file is deleted, it is determined whether the available space of the data partition reaches a preset value, and if the preset value is reached, Then the file is cleaned up.
  • step S2034 the application installation directory is traversed, and the file whose size is larger than the second preset threshold in the application installation directory is deleted, and after each file is deleted, it is determined whether the available space of the data partition reaches a preset value, and if the preset value is reached, Then the file is cleaned up.
  • step S2035 the Recovery service is called for deep cleaning.
  • the file may be cleaned according to the degree of influence of the deleted file on the user.
  • the problem that the system terminal of the Android system terminal is unable to boot due to insufficient space available in the data partition is solved.
  • FIG. 4 is a flow chart of an abnormality recovery method for system booting in accordance with an embodiment of the present disclosure.
  • the smart device is powered on as an example.
  • the method may include steps S401 to S414.
  • step S401 the smart device is powered on.
  • step S402 it is determined whether the writing system key data fails. If the key data writing fails, step S403 is performed; otherwise, the process ends and the smart device is started normally.
  • step S403 it is determined whether the available space of the data partition is greater than 5% of the total capacity of the data partition. If it is greater than 5%, the process goes to step S414, otherwise step S404 is performed.
  • step S404 the file under the path preset in the built-in SD card is deleted.
  • step S405 it is determined whether the available space of the data partition is greater than 5% of the total capacity of the data partition. If it is greater than 5%, the process goes to step S414, otherwise step S406 is performed.
  • step S406 the application redundancy data is cleared.
  • step S407 it is determined whether the available space of the data partition is greater than 5% of the total capacity of the data partition. If it is greater than 5%, the process goes to step S414, otherwise step S408 is performed.
  • step S408 the application data directory is traversed, and the file whose size is larger than the first threshold is deleted.
  • large files for example, files larger than 50M.
  • step S409 it is determined whether the available space of the data partition is greater than 5% of the total capacity of the data partition. If it is greater than 5%, the process goes to step S414, otherwise step S410 is performed.
  • step S410 it is determined whether the application data directory is traversed. If the traversal has been completed, step S411 is performed, otherwise, the process returns to step S408.
  • step S411 the application installation directory is traversed, and the file whose size is larger than the second preset threshold is deleted.
  • step S412 it is determined whether the available space of the data partition is greater than 5% of the total capacity of the data partition. If it is greater than 5%, the process goes to step S414, otherwise step S413 is performed.
  • step S413 the recovery service is called for deep cleaning.
  • step S414 the smart device is restarted.
  • the smart device is powered on as an example, and the actual applicable scenario may include, but is not limited to, the following situations:
  • the system abnormality recovery method can be enabled to repair the system abnormality, thereby enabling the smart device to start normally.
  • the application in the smart device has the right to write data to the data partition. If an application continuously writes data to the data partition, the data partition will be occupied. At this time, if the system is powered on or restarted, it is necessary to write key data to the /data partition, which will cause a system exception due to insufficient data partition space. At this time, the system abnormality recovery method according to the present disclosure can be enabled to repair the system abnormality, thereby enabling the smart device to start normally.
  • the system abnormality recovery method can be enabled to repair the system abnormality, thereby enabling the smart device to start normally.
  • the data partition is occupied. If the system needs to dynamically write critical data to the data partition during the system operation, the data partition space may be insufficient. The system is abnormal. In this case, not only the normal space under the data partition needs to be cleaned, but also the system space needs to be cleaned up, and the root permission file whose system permissions cannot be operated is deleted. At this time, the system abnormality recovery method according to the present disclosure can be enabled to repair the system abnormality, thereby enabling the smart device to start normally.
  • the system abnormality recovery method can be enabled to repair the system abnormality, thereby enabling the smart device to start normally.
  • FIG. 5 is a block configuration diagram of an abnormality recovery device according to an embodiment of the present disclosure.
  • an abnormality recovery device may be applied to a smart device, and the device may include: a monitoring module 501 configured to monitor whether a system or application fails to write critical data; a determination module 502, The setting module 503 is configured to determine whether the available space of the data partition is less than a preset value; the cleaning module 503, when the determining module 502 determines that the available space of the data partition is smaller than the preset value, the cleaning module 503 clears the file according to the preset policy, so that the data is The available space of the partition reaches the preset value; and a restart module 504 is provided to restart the smart device.
  • the cleaning module 503 can perform file cleaning in the order of built-in SD card, application redundancy data, application data directory, application installation directory, and deep cleanup, and determine the availability of the data partition while cleaning the file. Whether the space reaches the preset value, and if the preset value is reached, the file cleaning is ended.
  • the present disclosure also provides a storage medium having stored thereon a computer program that, when executed by a processor, causes the processor to execute an Android system based anomaly recovery method according to the present disclosure.
  • An Android-based anomaly recovery method, apparatus, smart device, and storage medium may follow a deleted file pair by detecting a failure caused by insufficient available space when a system or an application writes key data to a data partition.
  • the degree of influence of the user is sequentially cleaned up to free up space, thereby solving the problem that the system terminal of the Android system is unable to boot due to insufficient space available in the data partition.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Stored Programmes (AREA)
  • Retry When Errors Occur (AREA)
  • Telephone Function (AREA)

Abstract

本公开提供了一种基于Android系统的异常恢复方法、装置、智能设备及存储介质。所述方法包括:在监测到系统或应用程序写入关键数据失败后,判断数据分区的可用空间是否小于预设值;如果数据分区的可用空间小于所述预设值,则根据预设的策略清理文件,使得数据分区的可用空间达到所述预设值;以及重新启动智能设备。

Description

基于Android系统的异常恢复方法、装置、智能设备及存储介质 技术领域
本公开涉及安卓(Android)系统终端技术领域,尤其涉及基于Android的异常恢复方法、装置、设备及存储介质。
背景技术
近年来,基于Android系统的智能设备(如机顶盒、手机、平板电脑等)逐渐成为了智能设备市场的主流。随着第三方应用软件及照片、视频等大尺寸文件的增多,智能设备中存储的数据文件也越来越多,会导致数据(Data)分区被填满。基于Android系统的智能设备在开机或系统升级的时候会将关键数据写入到Data分区。在Data分区空间不足的情况下,如果系统或者应用程序需要将信息或数据写入到Data分区,则会导致系统瘫痪,无法开机。对此问题无法通过使用故障恢复(Recovery)服务进行系统升级的方式来解决,这是因为这一问题往往发生在Android系统还未能正常启动的情况下,此时无法进行网络连接,从而严重影响了用户体验。
发明内容
本公开旨在提供一种基于Android系统的异常恢复方法、装置、智能设备及存储介质,以至少部分地解决基于Android系统的智能设备由于数据分区可用空间不足导致的系统瘫痪问题。
根据本公开的一个方面,提供一种基于Android系统的异常恢复方法,应用于智能设备,所述方法包括:在监测到系统或应用程序写入关键数据失败后,判断数据分区的可用空间是否小于预设值;如果数据分区的可用空间小于所述预设值,则根据预设的策略清理文件,使得数据分区的可用空间达到所述预设值;以及重新启动智能设备。
根据本公开的另一个方面,提供一种基于Android系统的异常恢复装置,应用于智能设备,该异常恢复装置包括:监测模块,其设置为监测系统或应用程序是否写入关键数据失败;判断模块,其设置 为判断数据分区的可用空间是否小于预设值;清理模块,当所述判断模块判断数据分区的可用空间小于所述预设值时,所述清理模块根据预设的策略清理文件,使得数据分区的可用空间达到所述预设值;以及重启模块,其设置为重新启动智能设备。
根据本公开的又一个方面,提供一种智能设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,计算机程序被处理器运行时,使得处理器执行根据本公开的基于Android系统的异常恢复方法。
根据本公开的再一个方面,提供一种存储介质,其上存储有计算机程序,所述计算机程序被处理器运行时,使得处理器执行根据本公开的基于Android系统的异常恢复方法。
附图说明
此处所说明的附图用来提供对本公开的进一步理解,构成本申请的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1示意地示出了可以应用根据本公开各个实施例的异常恢复方法的硬件结构图;
图2为根据本公开实施例的异常恢复方法的流程图;
图3为根据本公开实施例的文件清理方法的流程图;
图4为根据本公开实施例的针对系统开机的异常恢复方法的流程图;以及
图5为根据本公开实施例的异常恢复装置的模块结构图。
本公开的特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
为了使本公开所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图和实施例,对本公开进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本公开,并不用于限定本公开。
智能设备可以以各种形式来实施。例如,本公开中描述的智能设备可以包括诸如基于Android系统的机顶盒、智能手机、智能电话、笔记本电脑、数字广播接收器、个人数字助理(PDA)、平板电脑(PAD)、便携式多媒体播放器(PMP)、导航装置等移动终端,还可以包括诸如基于Android系统的数字TV、台式计算机等固定终端。下文中,假设智能设备是移动终端。然而,本领域技术人员将理解的是,除了特别用于移动目的的元件之外,根据本公开的实施方式的构造也能够应用于固定类型的终端。
图1示意地示出了可以应用根据本公开各个实施例的异常恢复方法的硬件结构图。
请参见图1,移动终端100可以包括处理器110和存储器120。存储器120中可以存储有可在处理器110上运行的计算机程序130。
处理器110是移动终端的控制中心,利用各种接口和线路连接整个移动终端的各个部分,通过运行或执行存储在存储器120中的(包括计算机程序130在内的)软件程序和/或模块,以及调用存储在存储器120内的数据,执行移动终端的各种功能和处理数据,从而对移动终端进行整体监控。处理器110可包括一个或多个处理单元,并且处理器110可集成应用处理器和调制解调处理器。应用处理器主要处理操作系统、用户界面和应用程序等。调制解调处理器主要处理无线通信。可以理解的是,调制解调处理器也可以不集成到处理器110中。
当存储在存储器120中的计算机程序130被处理器110运行时,可以使得处理器110执行如下步骤:在监测到系统或应用程序写入关键数据失败后,判断数据分区的可用空间是否小于预设值;如果数据分区的可用空间小于所述预设值,则根据预设的策略清理文件,使得数据分区的可用空间达到所述预设值;以及重新启动智能设备(例如,移动终端100)。
根据本公开实施例,根据预设的策略清理文件的步骤可以包括:按照内置SD卡、应用程序冗余数据、应用程序数据目录、应用程序安装目录以及深度清理的顺序进行文件清理,并且在清理文件的同时 判断数据分区的可用空间是否达到所述预设值;以及如果数据分区的可用空间达到所述预设值,则结束文件清理。
根据本公开实施例,可以按照以下顺序进行文件清理:删除内置SD卡中预设路径下的文件,并判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;删除应用程序冗余数据,并判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;遍历应用程序数据目录,删除应用程序数据目录中大小大于第一预设阈值的文件,在每删除一个文件后判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;遍历应用程序安装目录,删除应用程序安装目录中大小大于第二预设阈值的文件,在每删除一个文件后判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;以及调用Recovery服务进行深度清理。
根据本公开实施例,所述第一预设阈值可以为50兆,并且所述第二预设阈值可以为50兆。
根据本公开实施例,所述预设值可以为数据分区的总容量的5%。
尽管图1未示出,移动终端100还可以包括(但不限于):射频单元、WiFi模块、音频输出单元、音频/视频输入单元、传感器、显示单元、用户输入单元、接口单元、蓝牙模块、电源等,在此不再赘述。
图2为根据本公开实施例的异常恢复方法的流程图。
如图2所示,根据本公开实施例的基于Android系统的异常恢复方法可以包括步骤S201至S204。
在步骤S201,监测到系统或应用程序写入关键数据失败。
在步骤S202,判断数据分区的可用空间是否小于预设值,如果小于预设值,则执行步骤S203,否则执行步骤S204。
在步骤S203,根据预设的策略清理文件,使得数据分区的可用空间达到预设值。
在步骤S204,重新启动智能设备。
根据本公开实施例,步骤S203可以包括:按照内置SD卡、应用程序冗余数据、应用程序数据目录、应用程序安装目录以及深度清理的顺序进行文件清理,并且在清理文件的同时判断数据分区的可用空间是否达到预设值;以及如果数据分区的可用空间达到预设值,则结束文件清理。
图3为根据本公开实施例的文件清理方法的流程图。
如图3所示,图2所示的步骤S203可以包括步骤S2031至S2035。
在步骤S2031,删除内置SD卡中预设路径下的文件,并判断数据分区的可用空间是否达到预设值,如果达到预设值,则结束文件清理。
在步骤S2032,删除应用程序冗余数据,并判断数据分区的可用空间是否达到预设值,如果达到预设值,则结束文件清理。
在步骤S2033,遍历应用程序数据目录,删除应用程序数据目录中大小大于第一预设阈值的文件,在每删除一个文件后判断数据分区的可用空间是否达到预设值,如果达到预设值,则结束文件清理。
在步骤S2034,遍历应用程序安装目录,删除应用程序安装目录中大小大于第二预设阈值的文件,在每删除一个文件后判断数据分区的可用空间是否达到预设值,如果达到预设值,则结束文件清理。
在步骤S2035,调用Recovery服务进行深度清理。
根据本公开实施例的基于Android的异常恢复方法,通过监测到系统或者应用程序写入关键数据到数据分区时由于可用空间不足导致的失败,可以按照删除的文件对用户的影响程度顺序进行文件清理以释放空间,从而解决了Android系统终端由于数据分区可用空间不足导致的系统瘫痪或无法开机的问题。
图4为根据本公开实施例的针对系统开机的异常恢复方法的流程图。
如图4所示,以智能设备开机为例进行说明,在本实施例中,假设数据分区的可用空间的预设值为数据分区的总容量的5%,该方法可以包括步骤S401至S414。
在步骤S401,智能设备开机。
在步骤S402,判断写入系统关键数据是否失败,如果关键数据写入失败,则执行步骤S403,否则,结束本流程并正常启动智能设备。
在步骤S403,判断数据分区的可用空间是否大于数据分区的总容量的5%,如果大于5%,则转至步骤S414,否则执行步骤S404。
在步骤S404、删除内置SD卡中预设的路径下的文件。
在删除内置SD卡中预设的路径下的文件时,可以依次删除下列路径中的文件:
/data/media/0
/mnt/media_rw/sdcard0
/mnt/shell/emulated
应当认识到,这种情况是对这几个路径下的文件全部进行删除。
在步骤S405,判断数据分区的可用空间是否大于数据分区的总容量的5%,如果大于5%,则转至步骤S414,否则执行步骤S406。
在步骤S406,清除应用程序冗余数据。
可以删除/data/data目录下各应用程序对应私有目录的数据。
在步骤S407,判断数据分区的可用空间是否大于数据分区的总容量的5%,如果大于5%,则转至步骤S414,否则执行步骤S408。
在步骤S408,遍历应用程序数据目录,删除大小大于第一阈值的文件。
可以循环遍历/data目录,并且删除大尺寸文件(比如,尺寸大于50M的文件)。为了对用户数据造成最小修改,在每删除一个大尺寸文件后判断数据分区的可用空间是否大于数据分区的总容量的5%,一旦数据分区的可用空间大于数据分区的总容量的5%就可以准备重启智能设备。
在步骤S409,判断数据分区的可用空间是否大于数据分区的总容量的5%,如果大于5%,则转至步骤S414,否则执行步骤S410。
在步骤S410、判断是否遍历完应用程序数据目录,如果已遍历完,则执行步骤S411,否则返回步骤S408。
在步骤S411,遍历应用程序安装目录,删除大小大于第二预设 阈值的文件。
若应用程序数据目录下的所有大尺寸文件已删除完毕,而数据分区的可用空间仍然小于数据分区的总容量的5%,则可以清理/data/app目录。这项操作会影响用户自己安装的应用。
在步骤S412,判断数据分区的可用空间是否大于数据分区的总容量的5%,如果大于5%,则转至步骤S414,否则执行步骤S413。
在步骤S413,调用recovery服务进行深度清理。
若清理完/data/app目录,数据分区的可用空间大小仍然小于数据分区的总容量的5%,则只能进行深度清理。此过程将会清除系统关键进程等在关键目录中创建的关键文件,并恢复智能设备的出厂设置。这项操作会导致用户信息全部被清除,所以作为最后手段。
在步骤S414,重新启动智能设备。
本实施例以智能设备开机为例进行说明,而实际适用场景可以包括(但不限于)以下几种情况:
1)当智能设备进行系统升级时,若数据分区已经被占满,升级完毕进行系统优化时需要写入关键数据到数据分区,从而会引发由于数据分区空间不足导致的系统异常。此时可以启用根据本公开的系统异常恢复方法,修复系统异常,从而使智能设备能够正常启动。
2)智能设备中应用程序拥有向数据分区写入数据的权限,如果某个应用程序不断写入数据到数据分区,则会导致数据分区被占满。此时,若系统进行开机或重启,需要向/数据分区写入关键数据,从而将会引发由于数据分区空间不足导致的系统异常。此时可以启用根据本公开的系统异常恢复方法,修复系统异常,从而使智能设备能够正常启动。
3)如果智能设备中应用程序向数据分区不断写入数据,导致数据分区被占满,此时若系统在运行过程中需要动态的向数据分区写入关键数据,则会引发由于数据分区空间不足导致的系统异常。此时可以启用根据本公开的系统异常恢复方法,修复系统异常,从而使智能设备能够正常启动。
4)如果智能设备中应用程序向数据分区中重要位置写入数据, 导致数据分区被占满,此时若系统运行中需要动态的向数据分区写入关键数据,则会引发由于数据分区空间不足导致的系统异常,这种情况下不但需要对数据分区下普通空间进行清理,还需要清理系统空间,删除系统权限无法操作的根权限文件。此时可以启用根据本公开的系统异常恢复方法,修复系统异常,从而使智能设备能够正常启动。
5)如果智能设备中系统关键进程向数据分区中写入数据,并生成大型关键文件,从而导致数据分区被占满,此时若系统开机或运行时还需要向数据分区写入关键数据,则会引发由于数据分区空间不足导致的系统异常,这种情况下普通的清理应用程序没有权限清理导致数据分区被占满的关键文件。此时可以启用根据本公开的系统异常恢复方法,修复系统异常,从而使智能设备能够正常启动。
图5为根据本公开实施例的异常恢复装置的模块结构图。
如图5所示,根据本公开实施例的异常恢复装置可以应用于智能设备,并且该装置可以包括:监测模块501,其设置为监测系统或应用程序是否写入关键数据失败;判断模块502,其设置为判断数据分区的可用空间是否小于预设值;清理模块503,当判断模块502判断数据分区的可用空间小于所述预设值时,清理模块503根据预设的策略清理文件,使得数据分区的可用空间达到所述预设值;以及重启模块504,其设置为重新启动智能设备。
根据本公开实施例,清理模块503可以按照内置SD卡、应用程序冗余数据、应用程序数据目录、应用程序安装目录以及深度清理的顺序进行文件清理,并且在清理文件的同时判断数据分区的可用空间是否达到所述预设值,如果达到所述预设值,则结束文件清理。
需要说明的是,上述装置实施例与方法实施例属于同一构思,其具体实现过程可以参见上述方法实施例,并且方法实施例中的技术特征在装置实施例中均对应适用,这里不再赘述。
本公开还提供了一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,使得处理器执行根据本公开的基于Android系统的异常恢复方法。
根据本公开实施例的基于Android的异常恢复方法、装置、智 能设备及存储介质,通过监测到系统或者应用程序写入关键数据到数据分区时由于可用空间不足导致的失败,可以按照删除的文件对用户的影响程度顺序进行文件清理以释放空间,从而解决了Android系统终端由于数据分区可用空间不足导致的系统瘫痪或无法开机的问题。
以上参照附图说明了本公开的各实施例,并非因此局限本公开的权利范围。本领域技术人员不脱离本公开的范围和实质内所作的任何修改、等同替换和改进,均应在本公开的权利范围之内。

Claims (13)

  1. 一种基于Android系统的异常恢复方法,应用于智能设备,所述方法包括:
    在监测到系统或应用程序写入关键数据失败后,判断数据分区的可用空间是否小于预设值;
    如果数据分区的可用空间小于所述预设值,则根据预设的策略清理文件,使得数据分区的可用空间达到所述预设值;以及
    重新启动所述智能设备。
  2. 根据权利要求1所述的异常恢复方法,其中,所述根据预设的策略清理文件的步骤包括:
    按照内置SD卡、应用程序冗余数据、应用程序数据目录、应用程序安装目录以及深度清理的顺序进行文件清理,并且在清理文件的同时判断数据分区的可用空间是否达到所述预设值;以及
    如果数据分区的可用空间达到所述预设值,则结束文件清理。
  3. 根据权利要求2所述的异常恢复方法,其中,所述按照顺序进行文件清理,并且在清理文件的同时判断数据分区的可用空间是否达到所述预设值的步步包括:
    删除内置SD卡中预设路径下的文件,并判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;
    删除应用程序冗余数据,并判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;
    遍历应用程序数据目录,删除所述应用程序数据目录中大小大于第一预设阈值的文件,在每删除一个文件后判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;
    遍历应用程序安装目录,删除所述应用程序安装目录中大小大于第二预设阈值的文件,在每删除一个文件后判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;以及
    调用故障恢复Recovery服务进行深度清理。
  4. 根据权利要求3所述的异常恢复方法,其中,所述第一预设阈值为50兆,并且所述第二预设阈值为50兆。
  5. 根据权利要求1至4中任意一项所述的异常恢复方法,其中,所述预设值为数据分区的总容量的5%。
  6. 一种基于Android系统的异常恢复装置,应用于智能设备,该异常恢复装置包括:
    监测模块,其设置为监测系统或应用程序是否写入关键数据失败;
    判断模块,其设置为判断数据分区的可用空间是否小于预设值;
    清理模块,当所述判断模块判断数据分区的可用空间小于所述预设值时,所述清理模块根据预设的策略清理文件,使得数据分区的可用空间达到所述预设值;以及
    重启模块,其设置为重新启动所述智能设备。
  7. 根据权利要求6所述的异常恢复装置,其中,所述清理模块设置为:
    按照内置SD卡、应用程序冗余数据、应用程序数据目录、应用程序安装目录以及深度清理的顺序进行文件清理,并且在清理文件的同时判断数据分区的可用空间是否达到所述预设值,以及
    如果数据分区的可用空间达到所述预设值,则结束文件清理。
  8. 根据权利要求7所述的异常恢复装置,其中,所述清理模块 设置为:
    删除内置SD卡中预设路径下的文件,并判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;
    删除应用程序冗余数据,并判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;
    遍历应用程序数据目录,删除所述应用程序数据目录中大小大于第一预设阈值的文件,在每删除一个文件后判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;
    遍历应用程序安装目录,删除所述应用程序安装目录中大小大于第二预设阈值的文件,在每删除一个文件后判断数据分区的可用空间是否达到所述预设值,如果数据分区的可用空间达到所述预设值,则结束文件清理;以及
    调用故障恢复Recovery服务进行深度清理。
  9. 根据权利要求8所述的异常恢复装置,其中,所述第一预设阈值为50兆,并且所述第二预设阈值为50兆。
  10. 根据权利要求6至9中任意一项所述的异常恢复装置,其中,所述预设值为数据分区的总容量的5%。
  11. 一种智能设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,
    其中,所述计算机程序被所述处理器运行时,使得所述处理器执行根据权利要求1至5中任一项所述的基于Android系统的异常恢复方法。
  12. 根据权利要求11所述的智能设备,其中,所述智能设备包 括基于Android系统的移动终端或固定终端。
  13. 一种存储介质,其上存储有计算机程序,所述计算机程序被处理器运行时,使得所述处理器执行根据权利要求1至5中任一项所述的基于Android系统的异常恢复方法。
PCT/CN2018/092188 2017-06-21 2018-06-21 基于Android系统的异常恢复方法、装置、智能设备及存储介质 WO2018233668A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710475936.3A CN109101363B (zh) 2017-06-21 2017-06-21 基于Android系统的异常恢复方法、装置、智能设备及存储介质
CN201710475936.3 2017-06-21

Publications (1)

Publication Number Publication Date
WO2018233668A1 true WO2018233668A1 (zh) 2018-12-27

Family

ID=64735502

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/092188 WO2018233668A1 (zh) 2017-06-21 2018-06-21 基于Android系统的异常恢复方法、装置、智能设备及存储介质

Country Status (2)

Country Link
CN (1) CN109101363B (zh)
WO (1) WO2018233668A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110049375A (zh) * 2019-03-25 2019-07-23 深圳市天威视讯股份有限公司 用于智能机顶盒的应用程序安装方法、系统以及机顶盒
CN110083476A (zh) * 2019-04-23 2019-08-02 努比亚技术有限公司 应用程序控制方法、终端及计算机可读存储介质
CN110457136A (zh) * 2019-08-09 2019-11-15 四川虹美智能科技有限公司 一种安卓系统自动清理文件的方法、装置及终端设备
CN113741980A (zh) * 2020-05-29 2021-12-03 青岛海信移动通信技术股份有限公司 基于安卓系统的电子设备开机方法、电子设备及存储介质
CN112182652B (zh) * 2020-09-27 2021-10-08 广州朗国电子科技有限公司 保护数据分区不被写满方法、装置、存储介质及终端设备
CN112333544A (zh) * 2020-11-09 2021-02-05 四川长虹电器股份有限公司 一种用于Android智能电视数据分区保护的方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077122A (zh) * 2013-01-14 2013-05-01 华为终端有限公司 移动终端内置存储空间的管理方法及移动终端
CN104657182A (zh) * 2015-03-05 2015-05-27 北京畅游天下网络技术有限公司 用于移动设备的系统垃圾清理方法和装置
CN105068844A (zh) * 2015-08-26 2015-11-18 广东欧珀移动通信有限公司 一种解决Android终端不开机的方法及装置
CN106383748A (zh) * 2016-09-05 2017-02-08 Tcl集团股份有限公司 一种基于云服务的存储空间清理方法及系统

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7685109B1 (en) * 2005-12-29 2010-03-23 Amazon Technologies, Inc. Method and apparatus for data partitioning and replication in a searchable data service
CN100464307C (zh) * 2006-05-26 2009-02-25 任永坚 一种实现数据备份和恢复的方法及系统
US8074107B2 (en) * 2009-10-26 2011-12-06 Amazon Technologies, Inc. Failover and recovery for replicated data instances
WO2013044785A1 (zh) * 2011-09-29 2013-04-04 北京奇虎科技有限公司 一种用户数据备份方法及装置
CN103064675A (zh) * 2012-12-24 2013-04-24 广东欧珀移动通信有限公司 自动清理移动终端中冗余文件的方法和装置
CN103761306B (zh) * 2014-01-22 2017-08-04 广东欧珀移动通信有限公司 一种智能终端文件清理方法及装置
CN105589663B (zh) * 2015-12-23 2019-01-15 努比亚技术有限公司 移动终端及其数据处理方法
CN106598563A (zh) * 2016-10-19 2017-04-26 广东欧珀移动通信有限公司 智能终端的重启方法、装置及智能终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077122A (zh) * 2013-01-14 2013-05-01 华为终端有限公司 移动终端内置存储空间的管理方法及移动终端
CN104657182A (zh) * 2015-03-05 2015-05-27 北京畅游天下网络技术有限公司 用于移动设备的系统垃圾清理方法和装置
CN105068844A (zh) * 2015-08-26 2015-11-18 广东欧珀移动通信有限公司 一种解决Android终端不开机的方法及装置
CN106383748A (zh) * 2016-09-05 2017-02-08 Tcl集团股份有限公司 一种基于云服务的存储空间清理方法及系统

Also Published As

Publication number Publication date
CN109101363B (zh) 2023-09-22
CN109101363A (zh) 2018-12-28

Similar Documents

Publication Publication Date Title
WO2018233668A1 (zh) 基于Android系统的异常恢复方法、装置、智能设备及存储介质
US10552263B2 (en) System running method and intelligent terminal
US8738883B2 (en) Snapshot creation from block lists
US20190220216A1 (en) Memory reclaiming method and terminal
EP3479243B1 (en) Fault-tolerant variable region repaving during firmware over the air update
EP2998861B1 (en) Implementing and deleting method and device for intelligent terminal multi-operation system
CN104881299A (zh) 一种应用程序冻结方法及装置
CN108241550B (zh) 一种操作系统备份还原方法
JP2014513338A (ja) 仮想ディスクの最適圧縮
CN107526608B (zh) 一种ota升级包升级方法及设备
CN105138362A (zh) 一种linux系统下保存用户配置的方法及装置
CN104035842A (zh) 一种删除和恢复内置应用程序的方法
JP2013530441A (ja) 記憶ボリュームのディスマウント
US10516699B2 (en) Electronic device and method for suggesting response manual in occurrence of denial
US9513928B2 (en) Method of operating multiple operating systems and the electronic device thereof
US20230222080A1 (en) System and method for distributed subscription management
WO2016082450A1 (zh) 一种用户终端的升级方法和用户终端
CN114579055A (zh) 磁盘存储方法、装置、设备及介质
JP2023169287A (ja) コンピューティングデバイス上でアプリケーションを更新するための、メモリ効率のよいソフトウェアパッチング
CN106933604B (zh) 一种系统升级方法及装置
CN104298618A (zh) 一种智能终端的命令处理方法及装置
CN109871334B (zh) 电缆调制解调器及操作方法
US20190004903A1 (en) Data Restoration Method and Apparatus, and Terminal
CN105511904A (zh) 一种自动更新快捷窗口的方法及装置
US11606457B2 (en) Technology and method for selectively providing network function to application of device

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: 18820340

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 06/05/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18820340

Country of ref document: EP

Kind code of ref document: A1