Key data self-destruction and automatic restoration method and device based on embedded system

文档序号:1952392 发布日期:2021-12-10 浏览:14次 中文

阅读说明:本技术 基于嵌入式系统的关键数据自毁与自动还原方法及装置 (Key data self-destruction and automatic restoration method and device based on embedded system ) 是由 邓明良 唐峰 韩雪 于 2021-11-11 设计创作,主要内容包括:本发明提供了一种基于嵌入式系统的关键数据自毁与自动还原方法,包括如下步骤:向原始系统的关键数据所在磁盘写入随机数据,破坏关键数据,生成现有系统;判断是否需要还原关键数据,若需要,则进行下面步骤,若不需要,则结束;将现有系统的启动分区指定到恢复程序所在的分区,重启现有系统进入恢复程序所在的分区后,将原始系统的镜像烧写到现有系统所在的分区,现有系统所在的分区与恢复程序所在的分区分离,现有系统所在的分区包括现有系统的启动分区;烧写完成后,将现有系统的启动分区重新指定到系统,以启动原始系统。该方法中的关键数据自毁方法消除数据彻底且不破坏物理结构,自动还原方法不依赖于硬件改动。(The invention provides a key data self-destruction and automatic reduction method based on an embedded system, which comprises the following steps: writing random data into a disk where the key data of the original system are located, destroying the key data and generating the existing system; judging whether the key data needs to be restored, if so, performing the following steps, and if not, ending; assigning a starting partition of the existing system to a partition where a recovery program is located, restarting the existing system to enter the partition where the recovery program is located, and programming a mirror image of the original system to the partition where the existing system is located, wherein the partition where the existing system is located is separated from the partition where the recovery program is located, and the partition where the existing system is located comprises the starting partition of the existing system; and after the programming is completed, reassigning the starting partition of the existing system to the system so as to start the original system. The key data self-destruction method in the method thoroughly eliminates data without destroying physical structure, and the automatic restoration method does not depend on hardware change.)

1. A self-destruction and automatic restoration method of key data based on an embedded system is characterized by comprising the following steps:

s1, writing random data into a disk where the key data of the original system are located, destroying the key data, and generating the existing system;

s2, judging whether the key data need to be restored, if so, performing the step S3 and the step S4, and if not, ending the step;

s3, restoring the key data by restoring the existing system, assigning the starting partition of the existing system to the partition where a recovery program is located, restarting the existing system to enter the partition where the recovery program is located, and programming the mirror image of the original system to the partition where the existing system is located, wherein the partition where the existing system is located is separated from the partition where the recovery program is located, and the partition where the existing system is located comprises the starting partition of the existing system;

and S4, after the programming is completed, reassigning the starting partition of the existing system to the system so as to start the original system.

2. The embedded system-based critical data self-destruction and automatic restoration method of claim 1, wherein the writing of random data to the disk where the critical data of the original system is located is realized by dd commands.

3. The embedded system-based critical data self-destruction and automatic restoration method according to claim 1, wherein the step of assigning the starting partition of the existing system to the partition where the recovery program is located specifically comprises: and modifying the universal unique identification code of the partition where the recovery program is located into the universal unique identification code of the starting partition of the existing system through an sgdisk command.

4. The embedded system-based key data self-destruction and automatic restoration method according to claim 1, wherein the step S3 further comprises displaying a programming progress, specifically comprising:

the recovery program burns and writes the mirror image of the original system to the partition where the existing system is located through dd commands, and stores the burning progress in a file in a pipeline mode, the recovery program comprises a Qt program, and the Qt program is used for automatically reading the burning progress from the pipeline and displaying the burning progress on a screen in a progress bar and percentage mode.

5. The embedded system based critical data self-destruction and automatic restoration method of claim 4, wherein the original system is stored in a USB flash disk, and the recovery program is used for automatically reading the mirror image of the original system in the USB flash disk.

6. A key data self-destruction and automatic restoration device based on an embedded system is characterized by comprising a memory module, a processor module, a USB module and a USB flash disk;

the memory module comprises a first partition and a second partition, wherein the first partition comprises data, application data and binary executable files of a system, the second partition comprises a recovery program, and the first partition further comprises a starting partition of the system;

the U disk is used for storing the mirror image of the original system;

the processor module is used for reading the original system in the USB flash disk through the USB module and executing a restoration step of the system, and specifically comprises the following steps:

the processor module designates a starting partition of a system in a first partition of the memory module as a second partition of the memory module, and after the system is restarted to enter the second partition, the mirror image of the original system in the U disk is programmed into the first partition;

and after the programming is finished, reassigning the starting partition of the system in the first partition to the first partition.

7. The embedded system based critical data self-destruction and automatic restoration device according to claim 6, further comprising a DC power module for supplying power to the device.

8. The embedded system based critical data self-destruction and automatic restoration device of claim 6, wherein the memory module is an MMC memory.

9. The embedded system based critical data self-destruction and automatic restoration device of claim 6, wherein the processor module is a RK3399 processor.

10. The embedded system-based critical data self-destruction and automatic restoration device of claim 7, wherein the dc power module is a 12V dc power.

Technical Field

The invention relates to the technical field of embedded systems, in particular to a method and a device for self-destruction and automatic restoration of key data based on an embedded system.

Background

The embedded type is widely applied in daily life, and the requirement of people for the safety performance is gradually improved, so that the embedded type operating system is used as a carrier of the application of an embedded type system, and the safety of the embedded type operating system is one of the key points of research of a plurality of scientific researchers.

The existing key data self-destruction methods mainly comprise two types: the first method deletes critical data through rm commands or other commands; the second method is that the disk storing the key data is physically destroyed by binding a micro bomb, or the disk storing the key data is destroyed by short-circuiting or boosting the memory chip. The existing one-key restoration method of the embedded system selects the starting device based on the high and low levels of the physical key or the dial switch, and the method is shown in fig. 1.

Firstly, the key data self-destruction method deletes the key data through a deletion method such as an rm command and the like, and the problem is that the deleted data is not thorough, and the original data can be recovered through a technical means; secondly, the method for clearing the data disk by the physical means of the micro bomb and the circuit short circuit is relatively thorough, but also destroys the physical structure of the memory chip and cannot be reused. For the one-key restoration method, the method for restoring the system through the physical keys is really feasible, but in a partially embedded application environment, a user cannot specially reserve a one-key restoration button or a dial switch and cannot realize the function on the basis of not modifying the existing hardware conditions, and the traditional method is not intuitive enough and does not realize the one-key restoration of the system interface buttons.

Therefore, in order to solve the problems in the prior art, it is necessary to provide a data destruction and restoration method, where the data destruction method thoroughly eliminates the data without destroying the physical structure, and the restoration method can avoid hardware modification.

Disclosure of Invention

The invention provides a key data self-destruction and automatic reduction method based on an embedded system, wherein the key data self-destruction method in the method thoroughly eliminates data without destroying a physical structure, and the automatic reduction method does not depend on hardware change.

In order to achieve the above and other related objects, the present invention provides a method for self-destruction and automatic recovery of critical data based on an embedded system, comprising the following steps:

s1, writing random data into a disk where the key data of the original system are located, destroying the key data, and generating the existing system;

s2, judging whether the key data need to be restored, if so, performing the step S3 and the step S4, and if not, ending the step;

s3, restoring the key data by restoring the existing system, assigning the starting partition of the existing system to the partition where a recovery program is located, restarting the existing system to enter the partition where the recovery program is located, and programming the mirror image of the original system to the partition where the existing system is located, wherein the partition where the existing system is located is separated from the partition where the recovery program is located, and the partition where the existing system is located comprises the starting partition of the existing system;

and S4, after the programming is completed, reassigning the starting partition of the existing system to the system so as to start the original system.

Further, the writing of the random data to the disk where the key data is located is realized by dd commands.

Further, the assigning the starting partition of the existing system to the partition where the recovery program is located specifically includes:

and modifying the universal unique identification code of the partition where the recovery program is located into the universal unique identification code of the starting partition of the existing system through an sgdisk command.

Further, step S3 further includes displaying a programming progress, which specifically includes:

the recovery program burns and writes the mirror image of the original system to the partition where the existing system is located through dd commands, and stores the burning progress in a file in a pipeline mode, the recovery program comprises a Qt program, and the Qt program is used for automatically reading the burning progress from the pipeline and displaying the burning progress on a screen in a progress bar and percentage mode.

Further, the original system is stored in the usb disk, and the recovery program is used to automatically read the image of the original system in the usb disk.

Based on the same invention conception, the invention also provides a key data self-destruction and automatic restoration device based on the embedded system, which comprises a memory module, a processor module, a USB module and a USB flash disk;

the memory module comprises a first partition and a second partition, wherein the first partition comprises data, application data and binary executable files of a system, the second partition comprises a recovery program, and the first partition further comprises a starting partition of the system;

the U disk is used for storing the mirror image of the original system;

the processor module is used for reading the original system in the USB flash disk through the USB module and executing a restoration step of the system, and specifically comprises the following steps:

the processor module designates a starting partition of a system in a first partition of the memory module as a second partition of the memory module, and after the system is restarted to enter the second partition, the mirror image of the original system in the U disk is programmed into the first partition;

and after the programming is finished, reassigning the starting partition of the system in the first partition to the first partition.

Further, the device also comprises a direct current power supply module which is used for supplying power to the device.

Further, the memory module is an MMC memory.

Further, the processor module is an RK3399 processor.

Further, the direct current power supply module is a 12V direct current power supply.

In summary, the method for self-destruction and automatic restoration of key data based on the embedded system provided by the invention realizes self-destruction of key data by using a method of randomly sending data to a disk where the key data is located, thereby ensuring the difficult recoverability of data, ensuring that a physical disk is not damaged, and ensuring the reusability of the physical disk; furthermore, the automatic restoration method provided by the invention avoids the change of embedded system hardware, and does not need a specially reserved key or a dial switch; furthermore, the visual recovery system is adopted, so that the recovery progress is displayed on a screen in real time in the process of recovering the system; finally, the invention takes the U disk as a medium for storing the new system image, thereby reducing the reduction difficulty and updating the system image at any time.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.

FIG. 1 is a schematic diagram of a prior art data self-destruction and auto-reduction process;

fig. 2 is a schematic step diagram of a method for self-destruction and automatic restoration of critical data based on an embedded system according to an embodiment of the present invention.

Detailed Description

The following describes the method and apparatus for self-destruction and automatic restoration of key data based on embedded system in detail with reference to fig. 1-2 and the following detailed description. The advantages and features of the present invention will become more apparent from the following description. It is to be noted that the drawings are in a very simplified form and are all used in a non-precise scale for the purpose of facilitating and distinctly aiding in the description of the embodiments of the present invention. To make the objects, features and advantages of the present invention comprehensible, reference is made to the accompanying drawings. It should be understood that the structures, ratios, sizes, and the like shown in the drawings and described in the specification are only used for matching with the disclosure of the specification, so as to be understood and read by those skilled in the art, and are not used to limit the implementation conditions of the present invention, so that the present invention has no technical significance, and any structural modification, ratio relationship change or size adjustment should still fall within the scope of the present invention without affecting the efficacy and the achievable purpose of the present invention.

First, technical terms related to the present invention will be described.

dd command: dd commands refer to commands on a Unix and Unix-like system, with the primary function being to convert and copy files.

sgdisk command: the sgdisk command is a tool for operating the GPT partition under Linux, and the sgdisk program uses a user interface completely based on a command line, so that the sgdisk command is suitable for scripts or experts which want to perform one or two times of quick change on a disk.

The Qt program: qt is a cross-platform C + + gui application development framework. It can be used to develop both GUI and non-GUI programs, such as console tools and servers. Qt is an object-oriented framework that is easily extended using special code generation extensions and some macros, and allows for true component programming.

rm command: i.e., Linux commands, the user can delete unwanted directories and files with rm commands. The function of the command is to delete one or more files or directories in a directory, or it can delete a directory and all the files and sub-directories thereunder. For link files, the link is simply broken and the source file remains unchanged.

The prior art realizes the restoration of a system based on the selection of high and low levels of a physical key or a dial switch as shown in fig. 1.

Referring to fig. 2, an embodiment of the present invention provides a method for self-destruction and automatic restoration of critical data based on an embedded system, including the following steps:

s1, writing random data into a disk where the key data of the original system are located, destroying the key data, and generating the existing system;

s2, judging whether the key data need to be restored, if so, performing the step S3 and the step S4, and if not, ending the step;

s3, restoring the key data by restoring the existing system, assigning the starting partition of the existing system to the partition where a recovery program is located, restarting the existing system to enter the partition where the recovery program is located, and programming the mirror image of the original system to the partition where the existing system is located, wherein the partition where the existing system is located is separated from the partition where the recovery program is located, and the partition where the existing system is located comprises the starting partition of the existing system;

and S4, after the programming is completed, reassigning the starting partition of the existing system to the system so as to start the original system.

In this embodiment, the specific flow of the method is as follows:

1) and starting.

2) And clicking a one-key reduction button in the control center, and adding one-key data self-destruction and system reduction in a setting interface in the system to reduce the operation difficulty.

3) Executing a key data self-destruction and automatic reduction program: random data are written into a disk where the key data of the original system are located through dd commands, the key data of the original system are damaged, and the damaged system is an existing system;

4) and judging whether the existing system needs to be restored or not, and if not, jumping to the step 12.

5) Judging information such as battery power and the like, modifying the universal unique identification code of the starting partition of the existing system through an sgdisk command, modifying the universal unique identification code of the partition where the recovery program is located into the universal unique identification code of the starting partition of the existing system, and starting and restarting, wherein the partition where the existing system is located is different from the partition where the recovery program is located, and the partition where the existing system is located comprises the starting partition;

6) and after the existing system is restarted and enters the kernel, the kernel judges the universal unique identification code of the partition, and selects the starting partition of the existing system to the partition where the recovery program is located according to the starting parameters.

7) And automatically executing the recovery program after the partition where the recovery program is located is started.

8) And the recovery program automatically reads the mirror image of the original system in the USB flash disk.

9) The recovery program writes the programming progress to a partition where the existing system is located through a dd command, and stores the programming progress in a file under a "/tmp" directory in a pipeline mode, wherein the recovery program comprises a Qt program, automatically reads the programming progress from the pipeline, and displays the progress on a screen in a progress bar and percentage mode.

10) After programming is completed, the recovery program modifies the universal unique identification code of the partition through an sgdisk command, and the partition where the recovery program is located is pointed to a normal system.

11) And executing a restart instruction, and enabling the system to enter the restored system, namely the original system.

12) And (6) ending.

The core idea of the invention is that the main method for key data self-destruction is to write random data into the disk where the key data is located by dd command, which not only avoids the defect of easy recovery which may be faced by simple deletion, but also avoids the loss of physically damaged irreversible disk. The method for realizing the one-key restoration is characterized in that a Linux kernel provides a mode of selecting a starting system by identifying a PARTUUID value of a disk partition, then modifying the PARTUUID value of the partition, switching a starting partition of the system to a partition where a recovery system is located by modifying the PARTUUID value of the partition, programming an operating system to the partition where the system is located after entering the recovery system, and finally reassigning the starting partition to the system by modifying the PARTUUID value of the partition. The recovery of the system is realized, and the PARTUUID is the universal unique identification code.

Based on the same invention conception, the invention also provides a key data self-destruction and automatic restoration device based on the embedded system, which comprises a memory module, a processor module, a USB module and a USB flash disk.

The memory module comprises a first partition and a second partition, wherein the first partition comprises data, application data and binary executable files of a system, the second partition comprises a recovery program, and the first partition further comprises a starting partition of the system; the first partition corresponds to a partition where the system is located and a starting partition of the system, and the second partition corresponds to a partition where the recovery program is located. The U disk is used for storing the mirror image of the original system; the processor module is used for reading the original system in the USB flash disk through the USB module and executing a restoration step of the system, and specifically comprises the following steps: the processor module appoints a second partition of the memory module to a starting partition of a system in a first partition of the memory module, and after the system is restarted to enter the second partition, the processor module writes a mirror image of the original system in the U disk to the first partition; and after the programming is finished, reassigning the starting partition of the system in the first partition to the first partition.

In this embodiment, the apparatus further includes a dc power supply module, and the dc power supply module is configured to supply power to the automatic restoring apparatus. And, the memory module is an MMC memory. The MMC mainly aims at products such as digital images, music, mobile phones, PDA, electronic books, toys and the like, the MMC also enables a storage unit and a controller to be clamped together, and the intelligent controller enables the MMC to guarantee compatibility and flexibility. In addition, the processor module is generally an RK3399 processor, and the DC power supply module is generally a 12V DC power supply. Of course, those skilled in the art will appreciate that none of the above options are exclusive.

The method has the advantages that the self-destruction of the key data is realized by using the method of random data to the disk where the key data is located, so that the difficult recovery of the data is ensured, the physical disk is ensured not to be damaged, and the reusability of the data is ensured; furthermore, the automatic restoration method provided by the invention avoids the change of embedded system hardware, and does not need a specially reserved key or a dial switch; furthermore, in the process of restoring the system through the visual recovery system, the restoring progress is displayed on a screen in real time; furthermore, the invention takes the U disk as a medium for storing the mirror image of the new system, thereby reducing the reduction difficulty and updating the mirror image of the system at any time; finally, the invention adds a key data self-destruction and system restoration to the setting interface in the system, and the operation difficulty is low.

While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:时序数据库集群及其故障处理、操作方法、及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!