WO2021175187A1 - Data protection method and apparatus, electronic device and computer-readable storage medium - Google Patents

Data protection method and apparatus, electronic device and computer-readable storage medium Download PDF

Info

Publication number
WO2021175187A1
WO2021175187A1 PCT/CN2021/078450 CN2021078450W WO2021175187A1 WO 2021175187 A1 WO2021175187 A1 WO 2021175187A1 CN 2021078450 W CN2021078450 W CN 2021078450W WO 2021175187 A1 WO2021175187 A1 WO 2021175187A1
Authority
WO
WIPO (PCT)
Prior art keywords
restarts
preset
restart threshold
computer
present disclosure
Prior art date
Application number
PCT/CN2021/078450
Other languages
French (fr)
Chinese (zh)
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 WO2021175187A1 publication Critical patent/WO2021175187A1/en

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/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display

Definitions

  • the present disclosure relates to the technical field of system security. Specifically, the present disclosure relates to a data protection method, device, electronic equipment, and computer-readable storage medium.
  • the Data partition is a pre-defined area on the storage medium.
  • Various data of the user are stored in the Data partition, such as photos, videos, downloaded materials, etc.
  • the Data partition Once the Data partition is abnormal, it cannot be mounted, and all user data cannot be read. And some systems will introduce data encryption, even if the entire Data partition is copied to other devices, only the encrypted data can be obtained. Therefore, protecting the data in the Data partition from abnormal damage is an urgent problem to be solved.
  • a data protection method including:
  • the acquisition module is used to acquire the number of restarts from the preset address before the system is started;
  • the display module is used to display failure prompt information when the number of restarts is greater than the preset restart threshold.
  • a memory stores one or more application programs
  • the one or more application programs When executed by one or more processors, they perform operations corresponding to the data protection method shown in the first aspect of the present disclosure.
  • the number of restarts can be accessed before and after the system is started.
  • the system is started without wasting maintenance resources;
  • a fault prompt message is displayed, which prevents repeated restarts from damaging the Data partition, thereby increasing the probability of protecting user data.
  • Fig. 3 is a schematic structural diagram of an electronic device for data protection according to an embodiment of the present disclosure.
  • the data protection method, device, electronic equipment, and computer-readable storage medium provided by the present disclosure are intended to solve the above technical problems in the prior art.
  • An embodiment of the present disclosure provides a data protection method. As shown in FIG. 1, the method includes:
  • Step S101 before the system is started, the number of restarts is obtained from the preset address;
  • Step S102 If the number of restarts is not greater than the preset restart threshold, update the number of restarts, save the updated number of restarts to the preset address, and start the system;
  • the preset restart threshold is stored in a preset address.
  • a fault prompt interface including fault prompt information can also be generated;
  • the fault prompt information can be included in the fault prompt interface.
  • a fault prompt interface can be generated and displayed on the terminal to prompt the user of the cause of the current terminal failure. Users can perform maintenance more accurately based on the displayed fault causes, thereby protecting user data.
  • the preset restart threshold can be displayed in the background, and the current number of restarts can also be displayed.
  • the preset restart threshold can be changed in different scenarios.
  • the preset restart threshold can be changed according to the terminal model or system version, so that The modified preset restart threshold is more suitable for the current terminal, which not only saves subsequent maintenance resources, but also protects user data to the greatest extent.
  • the number of restarts includes a first number of restarts and a second number of restarts
  • the startup of the system can be repeated. For example, the mobile phone shuts down after a period of startup.
  • the startup at this time can be understood to be invalid.
  • the display module 203 further includes:

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The present disclosure provides a data protection method and apparatus, an electronic device and a computer-readable storage medium, and relates to the technical field of data protection. The method comprises: before a system is started, obtaining the number of restarts from a preset address; when the number of restarts is not greater than a preset restart threshold, updating the the number of restarts, storing the updated number of restarts to the preset address, and starting the system; and when the number of restarts is greater than the preset restart threshold, displaying fault prompt information. The present disclosure can automatically enter a protection mode when the system is repeatedly restarted, avoiding Data partition damage due to the repeated restart of the system, and thereby protecting Data partitions and user data.

Description

数据保护方法、装置、电子设备及计算机可读存储介质Data protection method, device, electronic equipment and computer readable storage medium
相关申请的交叉引用Cross-references to related applications
本公开要求于2020年3月4日在中国知识产权局提交的标题为“数据保护方法、装置、电子设备及计算机可读存储介质”中国专利申请No.202010144822.2的优先权,通过引用将该中国专利申请公开的全部内容并入本文。This disclosure claims the priority of the Chinese patent application No. 202010144822.2 filed with the China Intellectual Property Office on March 4, 2020, entitled "Data Protection Methods, Devices, Electronic Equipment, and Computer-readable Storage Media". The entire disclosure of the patent application is incorporated herein.
技术领域Technical field
本公开涉及系统安全技术领域,具体而言,本公开涉及一种数据保护方法、装置、电子设备及计算机可读存储介质。The present disclosure relates to the technical field of system security. Specifically, the present disclosure relates to a data protection method, device, electronic equipment, and computer-readable storage medium.
背景技术Background technique
在现在的Android系统中,Data分区是在存储介质上预先划分设定的一段区域,用户的各种数据都存储在Data分区中,如拍摄的照片,视频,下载的资料等。一旦Data分区发生异常,无法挂载,用户的所有数据都无法读取。并且有的系统中会引入数据加密,即使把整个Data分区全部拷贝到其它设备上也只能获得加密后的数据,因此保护Data分区中的数据不被异常破坏是一个亟待解决的问题。In the current Android system, the Data partition is a pre-defined area on the storage medium. Various data of the user are stored in the Data partition, such as photos, videos, downloaded materials, etc. Once the Data partition is abnormal, it cannot be mounted, and all user data cannot be read. And some systems will introduce data encryption, even if the entire Data partition is copied to other devices, only the encrypted data can be obtained. Therefore, protecting the data in the Data partition from abnormal damage is an urgent problem to be solved.
发明内容Summary of the invention
本公开提供了一种数据保护的方法、装置、电子设备及计算机可读存储介质,可以解决系统由于反复重启导致数据丢失的问题。技术方案如下:The present disclosure provides a data protection method, device, electronic equipment, and computer-readable storage medium, which can solve the problem of data loss caused by repeated restarts of the system. The technical solutions are as follows:
根据本公开的第一方面,提供了一种数据保护的方法,该方法包括:According to a first aspect of the present disclosure, there is provided a data protection method, the method including:
在系统启动前,从预设地址中获取重启次数;Before the system starts, get the number of restarts from the preset address;
在重启次数不大于预设重启阈值时,更新重启次数,并将更新后的重启次数保存至预设地址,并启动系统;When the number of restarts is not greater than the preset restart threshold, update the number of restarts, save the updated number of restarts to the preset address, and start the system;
在重启次数大于预设重启阈值时,显示故障提示信息。When the number of restarts is greater than the preset restart threshold, a fault prompt message is displayed.
根据本公开的第二方面,提供了一种数据保护的装置,该装置包括:According to a second aspect of the present disclosure, there is provided a data protection device, which includes:
获取模块,用于在系统启动前,从预设地址中获取重启次数;The acquisition module is used to acquire the number of restarts from the preset address before the system is started;
更新模块,用于在重启次数不大于预设重启阈值时,更新重启次数,并将更新后的重启次数保存至预设地址,并启动所述系统;The update module is used to update the number of restarts when the number of restarts is not greater than the preset restart threshold, save the updated number of restarts to the preset address, and start the system;
显示模块,用于在重启次数大于预设重启阈值时,显示故障提示信息。The display module is used to display failure prompt information when the number of restarts is greater than the preset restart threshold.
根据本公开的第三方面,提供了一种电子设备,该电子设备包括:According to a third aspect of the present disclosure, there is provided an electronic device including:
一个或多个处理器;以及One or more processors; and
存储器,所述存储器存储有一个或多个应用程序;A memory, the memory stores one or more application programs;
其中所述一个或多个应用程序在由一个或多个处理器执行时,执行如本公开的第一方面所示的数据保护的方法对应的操作。When the one or more application programs are executed by one or more processors, they perform operations corresponding to the data protection method shown in the first aspect of the present disclosure.
根据本公开的第四方面,提供了一种非暂时性计算机可读存储介质,该非暂时性计算机可读存储介质用于存储计算机指令,该计算机指令在计算机上运行时,使得计算机可以实现本公开第一方面所示的数据保护的方法。According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium is used to store computer instructions, and when the computer instructions run on a computer, the computer can implement the present invention. The data protection method shown in the first aspect is disclosed.
本公开提供的技术方案带来的有益效果至少是:The beneficial effects brought about by the technical solution provided by the present disclosure are at least:
本公开实施例通过将重启次数设置在预设地址中,可以使得在系统启动前后均可以访问该重启次数,在重启次数不大于预设重启阈值时,启动系统,无需浪费维修资源;在重启次数大于预设重启阈值时,显示故障提示信息,避免了反复重启破坏Data分区,从而提高了保护用户数据的概率。In the embodiments of the present disclosure, by setting the number of restarts in a preset address, the number of restarts can be accessed before and after the system is started. When the number of restarts is not greater than the preset restart threshold, the system is started without wasting maintenance resources; When it is greater than the preset restart threshold, a fault prompt message is displayed, which prevents repeated restarts from damaging the Data partition, thereby increasing the probability of protecting user data.
附图说明Description of the drawings
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent in conjunction with the accompanying drawings and with reference to the following specific implementations. Throughout the drawings, the same or similar reference signs indicate the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
图1为根据本公开实施例的一种数据保护方法的流程示意图;Fig. 1 is a schematic flowchart of a data protection method according to an embodiment of the present disclosure;
图2为根据本公开实施例的一种数据保护装置的结构示意图;Figure 2 is a schematic structural diagram of a data protection device according to an embodiment of the present disclosure;
图3为根据本公开实施例的一种数据保护的电子设备的结构示意图。Fig. 3 is a schematic structural diagram of an electronic device for data protection according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Hereinafter, embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided for Have a more thorough and complete understanding of this disclosure. It should be understood that the drawings and embodiments of the present disclosure are only used for exemplary purposes, and are not used to limit the protection scope of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps recorded in the method embodiments of the present disclosure may be executed in a different order, and/or executed in parallel. In addition, method implementations may include additional steps and/or omit to perform the illustrated steps. The scope of the present disclosure is not limited in this respect.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。The term "including" and its variations as used herein are open-ended includes, that is, "including but not limited to". The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments." Related definitions of other terms will be given in the following description.
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对装置、模块或单元进行区分,并非用于限定这些装置、模块或单元一定为不同的装置、模块或单元,也并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that the concepts of “first” and “second” mentioned in this disclosure are only used to distinguish devices, modules or units, and are not used to limit these devices, modules or units to be different devices, modules or units. Units are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of “a” and “a plurality of” mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as “one or Multiple".
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。In order to make the objectives, technical solutions, and advantages of the present disclosure clearer, the following further describes the embodiments of the present disclosure in detail with reference to the accompanying drawings.
需要说明的是,本公开导致重启的原因可能是某些硬件发生故障,如供电模块异常,或者某个器件故障短路,在启动过程中导致电流过大引起 手机重启;还可能是由于某些软件错误,启动过程中再次重启,导致陷入无限重启的循环中。It should be noted that the restart of the present disclosure may be caused by some hardware failures, such as an abnormal power supply module, or a short circuit of a device, which causes excessive current during the startup process to cause the phone to restart; it may also be due to some software Error, restarting again during the startup process, resulting in an infinite restart cycle.
因为系统在每次启动的时候都会读写Data分区,如果正在对Data分区进行写操作的时候异常重启就会导致Data分区文件系统出现错误,一般来讲偶尔几次的异常操作都可以被修复工具修复,并不会对Data分区上的数据造成太多的损失。但是如由于硬件或软件故障导致不停的反复重启,这样Data分区会不断的发生错误积累,最终会出现严重的错误,导致用户数据彻底丢失。Because the system reads and writes the Data partition every time it is started, if an abnormal restart while writing to the Data partition will cause an error in the Data partition file system, generally speaking, the occasional abnormal operation can be repaired by the tool. Repairing will not cause too much loss to the data on the Data partition. However, if you restart repeatedly due to hardware or software failures, the Data partition will continue to accumulate errors, and eventually serious errors will occur, resulting in complete loss of user data.
本公开提供的数据保护方法、装置、电子设备和计算机可读存储介质,旨在解决现有技术的如上技术问题。The data protection method, device, electronic equipment, and computer-readable storage medium provided by the present disclosure are intended to solve the above technical problems in the prior art.
下面以具体地实施例对本公开的技术方案以及本公开的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本公开的实施例进行描述。The technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present disclosure will be described below with reference to the accompanying drawings.
本公开实施例中提供了一种数据保护的方法,如图1所示,该方法包括:An embodiment of the present disclosure provides a data protection method. As shown in FIG. 1, the method includes:
步骤S101:在系统启动前,从预设地址中获取重启次数;Step S101: before the system is started, the number of restarts is obtained from the preset address;
可选的,预设地址可以是裸分区特定地址,需要说明的是,裸分区是一种没有经过格式化,不被Unix通过文件系统来读取的特殊块设备文件。由应用程序负责对它进行读写操作。不经过文件系统的缓冲。它是不被操作系统直接管理的设备。因此将重启次数保存至裸分区特定地址可以使得在系统启动前及系统启动后均可以访问该重启次数。Optionally, the preset address may be a specific address of a raw partition. It should be noted that a raw partition is a special block device file that has not been formatted and cannot be read by Unix through the file system. The application is responsible for reading and writing to it. Not buffered by the file system. It is a device that is not directly managed by the operating system. Therefore, saving the number of restarts to a specific address of the raw partition can make the number of restarts accessible before and after the system is started.
可选的,重启次数包括第一重启次数与第二重启次数;Optionally, the number of restarts includes a first number of restarts and a second number of restarts;
若第一重启次数大于第二重启次数,将第一重启次数确定为重启次数;If the first number of restarts is greater than the second number of restarts, the first number of restarts is determined as the number of restarts;
若第一重启次数不大于第二重启次数,将第二重启次数确定为重启次数。If the first number of restarts is not greater than the second number of restarts, the second number of restarts is determined as the number of restarts.
可以理解的是,为了避免数据更新过程中发生异常导致计数发生错误,故可以采用第一重启次数与第二重启次数的双备份模式来交替更新。 具体的,当检测到启动过程中发生重启,如某些硬件发生故障,或者某些软件发生错误时,第一重启次数和第二重启次数均会增加1。采用双备份交替更新机制,可以保证在异常条件下不会导致误判。It is understandable that, in order to avoid an abnormality in the data update process that causes an error in the count, the dual backup mode of the first restart number and the second restart number can be used to alternately update. Specifically, when it is detected that a restart occurs during the startup process, such as some hardware failures, or some software errors, both the first restart times and the second restart times will increase by one. The dual backup alternate update mechanism can ensure that no misjudgment will be caused under abnormal conditions.
步骤S102:若重启次数不大于预设重启阈值,更新重启次数,并将更新后的重启次数保存至预设地址,并启动系统;Step S102: If the number of restarts is not greater than the preset restart threshold, update the number of restarts, save the updated number of restarts to the preset address, and start the system;
可以理解的是,一般偶尔几次的重启可以被修复工具修复,并不会对Data分区上的数据造成太多的损失,因此可以提前设置预设重启阈值,当重启次数并不大于该预设重启阈值时,可以更新重启次数,比如将重启次数增加1,然后将更新后的重启次数再次保存在裸分区的特定地址中。最后启动应用程序。It is understandable that generally the occasional restarts can be repaired by the repair tool and will not cause too much loss to the data on the Data partition. Therefore, the preset restart threshold can be set in advance, when the number of restarts is not greater than the preset When restarting the threshold, you can update the number of restarts, for example, increase the number of restarts by 1, and then save the updated number of restarts in a specific address of the bare partition again. Finally, start the application.
可选的,预设重启阈值保存在预设地址。Optionally, the preset restart threshold is stored in a preset address.
可以理解的是,可以将预设地址保存在裸分区特定地址,裸分区由应用程序负责对它进行读写操作,不经过文件系统的缓冲。将预设重启阈值保存至裸分区特定地址可以使得在系统启动前及在系统无法启动时均可以访问该预设重启阈值。It is understandable that the preset address can be stored in a specific address of the bare partition, and the application program is responsible for reading and writing operations on the bare partition without being buffered by the file system. Saving the preset restart threshold to a specific address of the raw partition can enable the preset restart threshold to be accessed before the system is started and when the system cannot be started.
可选的,在系统启动预设时间后,将保存在预设地址的更新后的重启次数进行清零处理。Optionally, after the system is started for a preset time, the updated number of restarts stored in the preset address is cleared.
可以理解的是,系统的启动可以是反复的,比如手机在启动一段时间后又关机了,此时的启动可以理解是无效的,可以等系统启动预设时间,比如5分钟或者10分钟后,认为此时系统的启动为有效启动,然后可以基于裸分区特定地址,将保存在裸分区特定地址的更新后的第一重启次数与更新后的第二重启次数的值进行清零,实现类似喂狗的功能。然后确保下一个循环的重启次数重新开始。It is understandable that the startup of the system can be repeated. For example, the mobile phone shuts down after a period of startup. The startup at this time can be understood to be invalid. You can wait for the system to start for a preset time, such as 5 minutes or 10 minutes. It is considered that the startup of the system at this time is a valid startup, and then based on the specific address of the bare partition, the values of the updated first restart times and the updated second restart times saved in the specific address of the bare partition can be cleared to achieve similar feeding. The function of the dog. Then make sure that the number of restarts for the next cycle restarts.
步骤S103:若重启次数大于预设重启阈值,显示故障提示信息。Step S103: If the number of restarts is greater than the preset restart threshold, a fault prompt message is displayed.
可以理解的是,如果重启次数大于预设重启阈值,反复重启的次数已经达到了一定的程度,为了防止Data分区出现错误积累,导致用户数据进行丢失,可以显示故障提示信息。此时用户可以将终端进行维修,使得维修后的Data分区得以恢复,从而保护用户数据。It is understandable that if the number of restarts is greater than the preset restart threshold, the number of repeated restarts has reached a certain level. In order to prevent the accumulation of errors in the Data partition and cause the loss of user data, a fault message can be displayed. At this time, the user can repair the terminal so that the repaired Data partition can be restored, thereby protecting user data.
可选的,若重启次数大于预设重启阈值,还可以生成包括故障提示信 息的故障提示界面;Optionally, if the number of restarts is greater than a preset restart threshold, a fault prompt interface including fault prompt information can also be generated;
显示故障提示界面。Display the fault prompt interface.
其中,故障提示信息可以包含在故障提示界面内,具体的,当重启次数大于预设重启阈值时,可以生成并在终端显示故障提示界面,以提示用户当前终端的故障原因。用户可以基于显示的故障原因更精准地进行维修,从而保护用户数据。Among them, the fault prompt information can be included in the fault prompt interface. Specifically, when the number of restarts is greater than the preset restart threshold, a fault prompt interface can be generated and displayed on the terminal to prompt the user of the cause of the current terminal failure. Users can perform maintenance more accurately based on the displayed fault causes, thereby protecting user data.
可选的,还可以更改预设重启阈值。Optionally, the preset restart threshold can also be changed.
可以理解的是,可以在后台显示预设重启阈值,也可以显示当前重启次数,可以在不同的场景下更改预设重启阈值,比如可以根据终端的型号或者系统版本来更改预设重启阈值,使得修改后的预设重启阈值与当前终端更贴切,既节约了后续的维修资源,还可以最大程度保护用户数据。It is understandable that the preset restart threshold can be displayed in the background, and the current number of restarts can also be displayed. The preset restart threshold can be changed in different scenarios. For example, the preset restart threshold can be changed according to the terminal model or system version, so that The modified preset restart threshold is more suitable for the current terminal, which not only saves subsequent maintenance resources, but also protects user data to the greatest extent.
本公开实施例通过将重启次数设置在预设地址中,可以使得在系统启动前后均可以访问该重启次数,在重启次数不大于预设重启阈值时,启动系统,无需浪费维修资源;在重启次数大于预设重启阈值时,显示故障提示信息,避免了反复重启破坏Data分区,从而提高了保护用户数据的概率。In the embodiments of the present disclosure, by setting the number of restarts in a preset address, the number of restarts can be accessed before and after the system is started. When the number of restarts is not greater than the preset restart threshold, the system is started without wasting maintenance resources; When it is greater than the preset restart threshold, a fault prompt message is displayed, which prevents repeated restarts from damaging the Data partition, thereby increasing the probability of protecting user data.
本公开实施例提供了一种数据保护装置,如图2所示,该数据保护装置20可以包括:获取模块201、更新模块202以及显示模块203,其中,The embodiment of the present disclosure provides a data protection device. As shown in FIG. 2, the data protection device 20 may include: an acquisition module 201, an update module 202, and a display module 203, wherein:
获取模块201,用于在系统启动前,从预设地址中获取重启次数;The obtaining module 201 is used to obtain the number of restarts from a preset address before the system is started;
可选的,预设地址可以是裸分区特定地址,需要说明的是,裸分区是一种没有经过格式化,不被Unix通过文件系统来读取的特殊块设备文件。由应用程序负责对它进行读写操作。不经过文件系统的缓冲。它是不被操作系统直接管理的设备。因此将重启次数保存至裸分区特定地址可以使得在系统启动前及系统启动后均可以访问该重启次数。Optionally, the preset address may be a specific address of a raw partition. It should be noted that a raw partition is a special block device file that has not been formatted and cannot be read by Unix through the file system. The application is responsible for reading and writing to it. Not buffered by the file system. It is a device that is not directly managed by the operating system. Therefore, saving the number of restarts to a specific address of the raw partition can make the number of restarts accessible before and after the system is started.
可选的,重启次数包括第一重启次数与第二重启次数;Optionally, the number of restarts includes a first number of restarts and a second number of restarts;
若第一重启次数大于第二重启次数,将第一重启次数确定为重启次数;If the first number of restarts is greater than the second number of restarts, the first number of restarts is determined as the number of restarts;
若第一重启次数不大于第二重启次数,将第二重启次数确定为重启次数。If the first number of restarts is not greater than the second number of restarts, the second number of restarts is determined as the number of restarts.
可以理解的是,为了避免数据更新过程中发生异常导致计数发生错误,故可以采用第一重启次数与第二重启次数的双备份模式来交替更新。具体的,当检测到启动过程中发生重启,如某些硬件发生故障,或者某些软件发生错误时,第一重启次数和第二重启次数均会增加1。采用双备份交替更新机制,可以保证在异常条件下不会导致误判。It is understandable that, in order to avoid an abnormality in the data update process that causes an error in the count, the dual backup mode of the first restart number and the second restart number can be used to alternately update. Specifically, when it is detected that a restart occurs during the startup process, such as some hardware failures, or some software errors, both the first restart times and the second restart times will increase by one. The dual backup alternate update mechanism can ensure that no misjudgment will be caused under abnormal conditions.
更新模块202,用于若重启次数不大于预设重启阈值,更新重启次数,并将更新后的重启次数保存至预设地址,并启动系统;The update module 202 is configured to update the number of restarts if the number of restarts is not greater than the preset restart threshold, save the updated number of restarts to the preset address, and start the system;
可以理解的是,一般偶尔几次的重启可以被修复工具修复,并不会对Data分区上的数据造成太多的损失,因此可以提前设置预设重启阈值,当重启次数并不大于该预设重启阈值时,可以更新重启次数,比如将重启次数增加1,然后将更新后的重启次数再次保存在裸分区的特定地址中。最后启动应用程序。It is understandable that generally the occasional restarts can be repaired by the repair tool and will not cause too much loss to the data on the Data partition. Therefore, the preset restart threshold can be set in advance, when the number of restarts is not greater than the preset When restarting the threshold, you can update the number of restarts, for example, increase the number of restarts by 1, and then save the updated number of restarts in a specific address of the bare partition again. Finally, start the application.
可选的,预设重启阈值保存在预设地址。Optionally, the preset restart threshold is stored in a preset address.
可以理解的是,可以将预设地址保存在裸分区特定地址,裸分区由应用程序负责对它进行读写操作,不经过文件系统的缓冲。将预设重启阈值保存至裸分区特定地址可以使得在系统启动前及在系统无法启动时均可以访问该预设重启阈值。It is understandable that the preset address can be stored in a specific address of the bare partition, and the application program is responsible for reading and writing operations on the bare partition without being buffered by the file system. Saving the preset restart threshold to a specific address of the raw partition can enable the preset restart threshold to be accessed before the system is started and when the system cannot be started.
可选的,数据保护装置,还可以包括:Optionally, the data protection device may also include:
清零模块,用于在系统启动预设时间后,将保存在预设地址的更新后的重启次数进行清零处理。The reset module is used to reset the updated number of restarts stored in the preset address after the system is started for a preset time.
可以理解的是,系统的启动可以是反复的,比如手机在启动一段时间后又关机了,此时的启动可以理解是无效的,可以等系统启动预设时间,比如5分钟或者10分钟后,认为此时系统的启动为有效启动,然后可以基于裸分区特定地址,将保存在裸分区特定地址的更新后的第一重启次数与更新后的第二重启次数的值进行清零,实现类似喂狗的功能。然后确保下一个循环的重启次数重新开始。It is understandable that the startup of the system can be repeated. For example, the mobile phone shuts down after a period of startup. The startup at this time can be understood to be invalid. You can wait for the system to start for a preset time, such as 5 minutes or 10 minutes. It is considered that the startup of the system at this time is a valid startup, and then based on the specific address of the bare partition, the values of the updated first restart times and the updated second restart times saved in the specific address of the bare partition can be cleared to achieve similar feeding. The function of the dog. Then make sure that the number of restarts for the next cycle restarts.
显示模块203,用于若重启次数大于预设重启阈值,显示故障提示信息。The display module 203 is configured to display failure prompt information if the number of restarts is greater than the preset restart threshold.
可以理解的是,如果重启次数大于预设重启阈值,反复重启的次数已 经达到了一定的程度,为了防止Data分区出现错误积累,导致用户数据进行丢失,可以显示故障提示信息。此时用户可以将终端进行维修,使得维修后的Data分区得以恢复,从而保护用户数据。It is understandable that if the number of restarts is greater than the preset restart threshold, the number of repeated restarts has reached a certain level. In order to prevent the accumulation of errors in the Data partition and the loss of user data, a fault message can be displayed. At this time, the user can repair the terminal so that the repaired Data partition can be restored, thereby protecting user data.
可选的,显示模块203还包括:Optionally, the display module 203 further includes:
显示子模块,用于若重启次数大于预设重启阈值,生成包括故障提示信息的故障提示界面;The display sub-module is used to generate a fault prompt interface including fault prompt information if the number of restarts is greater than the preset restart threshold;
显示故障提示界面Display fault prompt interface
其中,故障提示信息可以包含在故障提示界面里内,具体的,当重启次数大于预设重启阈值时,可以生成并在终端显示故障提示界面,以提示用户当前终端的故障原因。用户可以基于显示的故障原因更精准地进行维修,从而保护用户数据。Among them, the fault prompt information can be included in the fault prompt interface. Specifically, when the number of restarts is greater than the preset restart threshold, a fault prompt interface can be generated and displayed on the terminal to prompt the user of the cause of the current terminal failure. Users can perform maintenance more accurately based on the displayed fault causes, thereby protecting user data.
可选的,数据保护装置,还可以包括:Optionally, the data protection device may also include:
更改模块,用于更改预设重启阈值。The change module is used to change the preset restart threshold.
可以理解的是,可以在后台显示预设重启阈值,也可以显示当前重启次数,可以在不同的场景下更改预设重启阈值,比如可以根据终端的型号或者系统版本来更改预设重启阈值,使得修改后的预设重启阈值与当前终端更贴切,既节约了后续的维修资源,还可以最大程度保护用户数据。It is understandable that the preset restart threshold can be displayed in the background, and the current number of restarts can also be displayed. The preset restart threshold can be changed in different scenarios. For example, the preset restart threshold can be changed according to the terminal model or system version, so that The modified preset restart threshold is more suitable for the current terminal, which not only saves subsequent maintenance resources, but also protects user data to the greatest extent.
本公开实施例通过将重启次数设置在预设地址中,可以使得在系统启动前后均可以访问该重启次数,在重启次数不大于预设重启阈值时,启动系统,无需浪费维修资源;在重启次数大于预设重启阈值时,显示故障提示信息,避免了反复重启破坏Data分区,从而提高了保护用户数据的概率。In the embodiments of the present disclosure, by setting the number of restarts in a preset address, the number of restarts can be accessed before and after the system is started. When the number of restarts is not greater than the preset restart threshold, the system is started without wasting maintenance resources; When it is greater than the preset restart threshold, a fault prompt message is displayed, which prevents repeated restarts from damaging the Data partition, thereby increasing the probability of protecting user data.
下面参考图3,其示出了适于用来实现本公开实施例的电子设备300的结构示意图。本公开实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图3示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。3, which shows a schematic structural diagram of an electronic device 300 suitable for implementing the embodiments of the present disclosure. Electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (e.g. Mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG. 3 is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
电子设备包括:存储器以及处理器,其中,这里的处理器可以称为下文所述的处理装置301,存储器可以包括下文中的只读存储器(ROM)302、随机访问存储器(RAM)303以及存储装置308中的至少一项,具体如下所示:The electronic equipment includes a memory and a processor, where the processor here may be referred to as the processing device 301 described below, and the memory may include a read-only memory (ROM) 302, a random access memory (RAM) 303, and a storage device below. At least one of 308, as follows:
如图3所示,电子设备300可以包括处理装置(例如中央处理器、图形处理器等)301,其可以根据存储在只读存储器(ROM)302中的程序或者从存储装置308加载到随机访问存储器(RAM)303中的程序而执行各种适当的动作和处理。在RAM 303中,还存储有电子设备300操作所需的各种程序和数据。处理装置301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。As shown in FIG. 3, the electronic device 300 may include a processing device (such as a central processing unit, a graphics processor, etc.) 301, which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 302 or from a storage device 308 The program in the memory (RAM) 303 executes various appropriate actions and processing. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input/output (I/O) interface 305 is also connected to the bus 304.
通常,以下装置可以连接至I/O接口305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置306;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置307;包括例如磁带、硬盘等的存储装置308;以及通信装置309。通信装置309可以允许电子设备300与其他设备进行无线或有线通信以交换数据。虽然图3示出了具有各种装置的电子设备300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Generally, the following devices can be connected to the I/O interface 305: including input devices 306 such as touch screens, touch pads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; including, for example, liquid crystal displays (LCD), speakers, vibrations An output device 307 such as a device; a storage device 308 such as a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to perform wireless or wired communication with other devices to exchange data. Although FIG. 3 shows an electronic device 300 having various devices, it should be understood that it is not required to implement or have all of the illustrated devices. It may be implemented alternatively or provided with more or fewer devices.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
需要说明的是,本公开上述的计算机介质可以是计算机信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、 硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机信号介质还可以是计算机可读存储介质以外的任何计算机介质,该计算机信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the above-mentioned computer medium in the present disclosure may be a computer signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable removable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer signal medium may also be any computer medium other than a computer-readable storage medium, and the computer signal medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device. The program code contained on the computer medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and server can communicate with any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can communicate with digital data in any form or medium. Communication (e.g., communication network) interconnects. Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (for example, the Internet), and end-to-end networks (for example, ad hoc end-to-end networks), as well as any currently known or future research and development network of.
上述计算机介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
上述计算机介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:The foregoing computer medium carries one or more programs, and when the foregoing one or more programs are executed by the electronic device, the electronic device:
在系统启动前,从预设地址中获取重启次数;Before the system starts, get the number of restarts from the preset address;
若重启次数不大于预设重启阈值,更新重启次数,并将更新后的重启次数保存至预设地址,并启动系统;If the number of restarts is not greater than the preset restart threshold, update the number of restarts, save the updated number of restarts to the preset address, and start the system;
若重启次数大于预设重启阈值,显示故障提示信息。If the number of restarts is greater than the preset restart threshold, a fault prompt message will be displayed.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序 设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。The computer program code used to perform the operations of the present disclosure can be written in one or more programming languages or a combination thereof. The above-mentioned programming languages include but are not limited to object-oriented programming languages such as Java, Smalltalk, C++, and Including conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to pass Internet connection).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions, and operations of the system, method, and computer program product according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logic function. Executable instructions. It should also be noted that, in some alternative implementations, the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown one after another can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的模块或单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块或单元的名称在某种情况下并不构成对该单元本身的限定。The modules or units involved in the embodiments described in the present disclosure can be implemented in software or hardware. Among them, the name of the module or unit does not constitute a limitation on the unit itself under certain circumstances.
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described above in this document may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logical device (CPLD) and so on.
在本公开的上下文中,机器介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器介质可以是机器信号介质或机器储存介质。机器介 质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine medium may be a tangible medium, which may contain or store a program for use by the instruction execution system, apparatus, or device or in combination with the instruction execution system, apparatus, or device. The machine medium may be a machine signal medium or a machine storage medium. The machine medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. More specific examples of machine storage media would include electrical connections based on one or more wires, portable computer disks, hard drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), optical fiber, compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
根据本公开的一个或多个实施例,提供了一种数据保护方法,包括:According to one or more embodiments of the present disclosure, there is provided a data protection method, including:
在系统启动前,从预设地址中获取重启次数;Before the system starts, get the number of restarts from the preset address;
若重启次数不大于预设重启阈值,更新重启次数,并将更新后的重启次数保存至预设地址,并启动系统;If the number of restarts is not greater than the preset restart threshold, update the number of restarts, save the updated number of restarts to the preset address, and start the system;
若重启次数大于预设重启阈值,显示故障提示信息。If the number of restarts is greater than the preset restart threshold, a fault prompt message will be displayed.
可选的,在系统启动预设时间后,将保存在预设地址的更新后的重启次数进行清零处理。Optionally, after the system is started for a preset time, the updated number of restarts stored in the preset address is cleared.
可选的,若重启次数大于预设重启阈值,显示故障提示信息,包括:Optionally, if the number of restarts is greater than the preset restart threshold, a fault prompt message is displayed, including:
若重启次数大于预设重启阈值,生成包括故障提示信息的故障提示界面;If the number of restarts is greater than the preset restart threshold, a fault prompt interface including fault prompt information is generated;
显示故障提示界面。Display the fault prompt interface.
可选的,显示故障提示界面后,包括:Optionally, after displaying the fault prompt interface, it includes:
更改预设重启阈值。Change the preset restart threshold.
可选的,重启次数包括第一重启次数与第二重启次数;Optionally, the number of restarts includes a first number of restarts and a second number of restarts;
若第一重启次数大于第二重启次数,将第一重启次数确定为重启次数;If the first number of restarts is greater than the second number of restarts, the first number of restarts is determined as the number of restarts;
若第一重启次数不大于第二重启次数,将第二重启次数确定为重启次数。If the first number of restarts is not greater than the second number of restarts, the second number of restarts is determined as the number of restarts.
可选的,预设重启阈值保存在预设地址。Optionally, the preset restart threshold is stored in a preset address.
根据本公开的一个或多个实施例,提供了一种数据保护装置,包括:According to one or more embodiments of the present disclosure, there is provided a data protection device, including:
获取模块,用于在系统启动前,从预设地址中获取重启次数;The acquisition module is used to acquire the number of restarts from the preset address before the system is started;
更新模块,用于若重启次数不大于预设重启阈值,更新重启次数,并将更新后的重启次数保存至预设地址,并启动系统;The update module is used to update the number of restarts if the number of restarts is not greater than the preset restart threshold, save the updated number of restarts to the preset address, and start the system;
显示模块,用于若重启次数大于预设重启阈值,显示故障提示界面。The display module is used to display a fault prompt interface if the number of restarts is greater than the preset restart threshold.
可选的,数据保护装置还包括:Optionally, the data protection device also includes:
清零模块,用于在所述系统启动预设时间后,将保存在预设地址的更新后的重启次数进行清零处理。The reset module is used for resetting the updated number of restarts stored in the preset address after the system is started for a preset time.
可选的,显示模块包括:Optionally, the display module includes:
显示子模块,用于若重启次数大于预设重启阈值,生成包括故障提示信息的故障提示界面;The display sub-module is used to generate a fault prompt interface including fault prompt information if the number of restarts is greater than the preset restart threshold;
显示故障提示界面。Display the fault prompt interface.
可选的,数据保护装置还包括:Optionally, the data protection device also includes:
更改模块,用于更改预设重启阈值。The change module is used to change the preset restart threshold.
根据本公开的一个或多个实施例,提供了一种电子设备,包括:According to one or more embodiments of the present disclosure, there is provided an electronic device including:
一个或多个处理器;One or more processors;
存储器;Memory
一个或多个应用程序,其中一个或多个应用程序被存储在存储器中并被配置为由一个或多个处理器执行,一个或多个程序配置用于执行上述数据保护方法。One or more application programs, where one or more application programs are stored in a memory and configured to be executed by one or more processors, and one or more programs are configured to execute the foregoing data protection method.
根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,计算机可读存储介质用于存储计算机指令,当其在计算机上运行时,使得计算机可以执行上述数据保护方法。According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, and the computer-readable storage medium is used to store computer instructions, which when run on a computer, enable the computer to execute the above-mentioned data protection method.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in this disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover the above technical features or technical solutions without departing from the above disclosed concept. Other technical solutions formed by arbitrarily combining the equivalent features. For example, the above-mentioned features and the technical features disclosed in the present disclosure (but not limited to) having similar functions are replaced with each other to form a technical solution.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的 实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, although the operations are depicted in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or performed in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable subcombination.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the subject matter has been described in language specific to structural features and/or logical actions of the method, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely exemplary forms of implementing the claims.

Claims (12)

  1. 一种数据保护方法,包括:A method of data protection, including:
    在系统启动前,从预设地址中获取重启次数;Before the system starts, get the number of restarts from the preset address;
    在所述重启次数不大于预设重启阈值时,更新所述重启次数,并将更新后的重启次数保存至所述预设地址,并启动所述系统;When the number of restarts is not greater than a preset restart threshold, update the number of restarts, save the updated number of restarts to the preset address, and start the system;
    在所述重启次数大于预设重启阈值时,显示故障提示信息。When the number of restarts is greater than the preset restart threshold, a fault prompt message is displayed.
  2. 根据权利要求1所述的方法,还包括:The method according to claim 1, further comprising:
    在所述系统启动预设时间后,将保存在所述预设地址的所述更新后的重启次数进行清零处理。After the system is started for a preset time, the updated number of restarts stored in the preset address is cleared.
  3. 根据权利要求1所述的方法,其中,所述在所述重启次数大于预设重启阈值时,显示故障提示信息,包括:The method according to claim 1, wherein the displaying failure prompt information when the number of restarts is greater than a preset restart threshold comprises:
    在所述重启次数大于预设重启阈值时,生成包括故障提示信息的故障提示界面;When the number of restarts is greater than the preset restart threshold, generating a fault prompt interface including fault prompt information;
    显示所述故障提示界面。The fault prompt interface is displayed.
  4. 根据权利要求3所述的方法,还包括:The method according to claim 3, further comprising:
    更改所述预设重启阈值。Change the preset restart threshold.
  5. 根据权利要求1-4任一项所述的方法,其中,所述重启次数包括第一重启次数与第二重启次数;The method according to any one of claims 1 to 4, wherein the number of restarts includes a first number of restarts and a second number of restarts;
    在所述第一重启次数大于所述第二重启次数时,将所述第一重启次数确定为所述重启次数;When the first number of restarts is greater than the second number of restarts, determining the first number of restarts as the number of restarts;
    在所述第一重启次数不大于所述第二重启次数时,将所述第二重启次数确定为所述重启次数。When the first number of restarts is not greater than the second number of restarts, determining the second number of restarts as the number of restarts.
  6. 根据权利要求5所述的方法,其中,所述预设重启阈值保存在所述预设地址。The method according to claim 5, wherein the preset restart threshold is stored in the preset address.
  7. 一种数据保护装置,包括:A data protection device, including:
    获取模块,用于在系统启动前,从预设地址中获取重启次数;The acquisition module is used to acquire the number of restarts from the preset address before the system is started;
    更新模块,用于在所述重启次数不大于预设重启阈值时,更新所述重启次数,并将更新后的重启次数保存至所述预设地址,并启动所述系统;An update module, configured to update the number of restarts when the number of restarts is not greater than a preset restart threshold, save the updated number of restarts to the preset address, and start the system;
    显示模块,用于在所述重启次数大于预设重启阈值时,显示故障提示信息。The display module is configured to display failure prompt information when the number of restarts is greater than a preset restart threshold.
  8. 根据权利要求7所述的装置,还包括:The device according to claim 7, further comprising:
    清零模块,用于在所述系统启动预设时间后,将保存在所述预设地址的所述更新后的重启次数进行清零处理。The reset module is configured to reset the updated number of restarts stored in the preset address after the system is started for a preset time.
  9. 根据权利要求7所述的装置,其中,所述显示模块包括:The device according to claim 7, wherein the display module comprises:
    显示子模块,用于在所述重启次数大于预设重启阈值时,生成包括故障提示信息的故障提示界面;The display sub-module is used to generate a fault prompt interface including fault prompt information when the number of restarts is greater than a preset restart threshold;
    显示所述故障提示界面。The fault prompt interface is displayed.
  10. 根据权利要求9所述的装置,还包括:The device according to claim 9, further comprising:
    更改模块,用于更改所述预设重启阈值。The change module is used to change the preset restart threshold.
  11. 一种电子设备,包括:An electronic device including:
    一个或多个处理器;以及One or more processors; and
    存储器,所述存储器存储有一个或多个应用程序;A memory, the memory stores one or more application programs;
    其中所述一个或多个应用程序被配置为在由所述一个或多个处理器执行时,执行根据权利要求1~6任一项所述的数据保护方法。The one or more application programs are configured to execute the data protection method according to any one of claims 1 to 6 when being executed by the one or more processors.
  12. 一种非暂时性计算机可读存储介质,所述非暂时性计算机可读存储介质用于存储计算机指令,所述计算机指令在计算机上运行时,使得计算机可以执行上述权利要求1~6中任一项所述的数据保护方法。A non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium is used to store computer instructions, when the computer instructions run on a computer, the computer can execute any one of the above claims 1 to 6 The data protection method described in item.
PCT/CN2021/078450 2020-03-04 2021-03-01 Data protection method and apparatus, electronic device and computer-readable storage medium WO2021175187A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010144822.2A CN111367720A (en) 2020-03-04 2020-03-04 Data protection method and device, electronic equipment and computer readable storage medium
CN202010144822.2 2020-03-04

Publications (1)

Publication Number Publication Date
WO2021175187A1 true WO2021175187A1 (en) 2021-09-10

Family

ID=71208540

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/078450 WO2021175187A1 (en) 2020-03-04 2021-03-01 Data protection method and apparatus, electronic device and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN111367720A (en)
WO (1) WO2021175187A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367720A (en) * 2020-03-04 2020-07-03 北京字节跳动网络技术有限公司 Data protection method and device, electronic equipment and computer readable storage medium
CN112966297B (en) * 2021-02-04 2022-01-14 华为技术有限公司 Data protection method, system, medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150261623A1 (en) * 2014-03-15 2015-09-17 Macronix International Co., Ltd. Method and device for recovering data
CN108055583A (en) * 2017-12-28 2018-05-18 深圳市九洲电器有限公司 set-top box automatic recovery method and system
CN109471670A (en) * 2018-12-21 2019-03-15 迈普通信技术股份有限公司 Equipment starting method and electronic equipment
CN109753411A (en) * 2019-01-17 2019-05-14 Oppo广东移动通信有限公司 Abnormality eliminating method, device, mobile terminal and storage medium
CN111367720A (en) * 2020-03-04 2020-07-03 北京字节跳动网络技术有限公司 Data protection method and device, electronic equipment and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636221B (en) * 2013-11-12 2020-03-17 研祥智能科技股份有限公司 Computer system fault processing method and device
CN104331357B (en) * 2014-10-10 2018-07-10 北京金山安全软件有限公司 Application program abnormity detection method and device and mobile terminal
CN105354131A (en) * 2015-12-11 2016-02-24 北京慧眼智行科技有限公司 Monitoring method for running of service program and device
CN110083493A (en) * 2018-01-25 2019-08-02 厦门雅迅网络股份有限公司 A kind of embedded system failure self-recovery method, terminal device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150261623A1 (en) * 2014-03-15 2015-09-17 Macronix International Co., Ltd. Method and device for recovering data
CN108055583A (en) * 2017-12-28 2018-05-18 深圳市九洲电器有限公司 set-top box automatic recovery method and system
CN109471670A (en) * 2018-12-21 2019-03-15 迈普通信技术股份有限公司 Equipment starting method and electronic equipment
CN109753411A (en) * 2019-01-17 2019-05-14 Oppo广东移动通信有限公司 Abnormality eliminating method, device, mobile terminal and storage medium
CN111367720A (en) * 2020-03-04 2020-07-03 北京字节跳动网络技术有限公司 Data protection method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN111367720A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
WO2021175187A1 (en) Data protection method and apparatus, electronic device and computer-readable storage medium
JP7406010B2 (en) Baseline monitoring methods, devices, readable media, and electronic equipment
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
WO2023273725A1 (en) File downloading method and apparatus, storage medium and electronic device
US20150095644A1 (en) Performing telemetry, data gathering, and failure isolation using non-volatile memory
JP7339425B2 (en) Method and apparatus for executing smart contracts
CN111274503B (en) Data processing method, device, electronic equipment and computer readable medium
WO2021197161A1 (en) Icon updating method and apparatus, and electronic device
CN110727566A (en) Method, device, medium and electronic equipment for acquiring process crash information
WO2020258782A1 (en) Data transmission method applicable to bluetooth card reader, and electronic apparatus
CN112181467B (en) Method and device for upgrading memory firmware of terminal, terminal and storage medium
US20200183705A1 (en) Apparatuses, methods and systems for persisting values in a computing environment
CN111198853B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN116302271A (en) Page display method and device and electronic equipment
US20220269622A1 (en) Data processing methods, apparatuses, electronic devices and computer-readable storage media
CN111930391B (en) Application data processing method and device, server and user terminal
CN111367590A (en) Interrupt event processing method and device
CN113704079A (en) Interface testing method and device based on Protobuf
CN115827415B (en) System process performance test method, device, equipment and computer medium
CN111324888B (en) Verification method and device for application program starting, electronic equipment and storage medium
CN111367555B (en) Assertion method, assertion device, electronic equipment and computer readable medium
CN111626787B (en) Resource issuing method, device, medium and equipment
CN113220507B (en) Version consistency checking method and device for double-master control system
CN115904642A (en) Cloud server control method and device, storage medium and electronic equipment
CN117520062A (en) Method and device for testing file system, readable medium and electronic equipment

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

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 1205 DATED 19/01/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21764929

Country of ref document: EP

Kind code of ref document: A1