Nothing Special   »   [go: up one dir, main page]

WO2020223950A1 - Method, apparatus and device for preventing data loss and system damage of usb flash disk - Google Patents

Method, apparatus and device for preventing data loss and system damage of usb flash disk Download PDF

Info

Publication number
WO2020223950A1
WO2020223950A1 PCT/CN2019/086145 CN2019086145W WO2020223950A1 WO 2020223950 A1 WO2020223950 A1 WO 2020223950A1 CN 2019086145 W CN2019086145 W CN 2019086145W WO 2020223950 A1 WO2020223950 A1 WO 2020223950A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
read
storage space
time programmable
management table
Prior art date
Application number
PCT/CN2019/086145
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 深圳市德明利技术股份有限公司
Priority to PCT/CN2019/086145 priority Critical patent/WO2020223950A1/en
Publication of WO2020223950A1 publication Critical patent/WO2020223950A1/en

Links

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

Definitions

  • the present invention relates to the field of storage technology, in particular to a method, device and equipment for preventing data loss and system damage of a U disk.
  • USB flash disk (USB flash disk) is composed of main control chip and NF (NAND Flash, NAND flash memory) memory.
  • the main control chip passes through the Boot solidified in ROM (Read-Only Memory) Loader (boot loading) code loads the running code and algorithm management table data stored in NAND Flash into RAM (Random Access Memory, random access memory), and then run the code to execute in RAM random access memory.
  • ROM Read-Only Memory
  • Loader boot loading
  • NAND Flash flash memory Due to the storage characteristics of NAND Flash flash memory, data errors may occur due to the storage environment, excessive storage time or abnormal power failure, Boot Loader boot loading may fail to load the running code or the algorithm management table data load fails. At this time, the U disk will lose the user's original data, or the U disk system may be damaged and unable to run.
  • the purpose of the present invention is to provide a method, device and equipment for preventing data loss and system damage of a U disk, which can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
  • a method for preventing data loss and system damage of a U disk which includes:
  • the stored running code data is read from the one-time programmable storage space, and the running code data is restored based on the read running code data.
  • Run code data read the stored original algorithm management table data from the one-time programmable storage space, and restore the original algorithm management table data according to the read original algorithm management table data Tabular data.
  • the reading the stored running code data from the one-time programmable storage space and restoring the running code data according to the read running code data includes:
  • the stored original algorithm management table data is read from the one-time programmable storage space, and the original algorithm management table data is restored according to the read original algorithm management table data.
  • Data including:
  • the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space
  • the start address and data length of the associated original algorithm management table data in the one-time programmable storage space are read from the address corresponding to the temporary mark;
  • the stored running code data is read from the one-time programmable storage space, and the running code data is read according to the read Code data, restore running code data, read the stored original algorithm management table data from the one-time programmable storage space, and manage the table data according to the read original algorithm, restore After the original algorithm management table data is released, it also includes:
  • the boot load jumps to the restored running code data for execution, so that the U disk is successfully loaded.
  • a device for preventing data loss and system damage of a U disk including:
  • the memory is used to store running code and original algorithm management table data in the one-time programmable storage space
  • the restorer is used to read the stored running code data from the one-time programmable storage space when the boot load normally loads the running code or the algorithm management table data fails, and reads out the running code data according to the read
  • the operating code data is restored, the operating code data is restored, and the stored original algorithm management table data is read from the one-time programmable storage space, and the original algorithm management table data is read out according to the original algorithm , Restore the original algorithm management table data.
  • the restorer is specifically used for:
  • the restorer is specifically used for:
  • the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space
  • the start address and data length of the associated original algorithm management table data in the one-time programmable storage space are read from the address corresponding to the temporary mark;
  • the device for preventing data loss and system damage of U disk further includes:
  • the executor is used to make the boot loading jump to the restored running code data for execution, so that the U disk is successfully loaded.
  • a device for preventing data loss and system damage of a U disk including:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute any of the above-mentioned prevention of U disk data Methods of loss and system damage.
  • a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for preventing data loss and system damage of a U disk as described in any one of the above items.
  • one-time programmable OTP storage space can be added to the main control chip of the U disk, and the running code and original algorithm management table data can be stored in the one-time programmable OTP storage space.
  • the boot loader fails to load the running code or the algorithm management table data normally, the stored running code data is read from the one-time programmable OTP storage space, and the running code data is restored based on the read running code data Code data, and read the stored original algorithm management table data from the one-time programmable OTP storage space, and restore the original algorithm management table data according to the read original algorithm management table data, It can prevent the U disk from losing the user's original data or the U disk system being damaged and unable to run.
  • the stored running code data can be loaded from the one-time programmable OTP storage space
  • the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space
  • the judgment Whether the read temporary flag TempFlag is equal to the flag TableFlg of the loading table in the one-time programmable OTP storage space, after judging that the read temporary flag TempFlag is equal to the loading in the one-time programmable OTP storage space When the table is marked with TableFlg, the start address Code_Add and the data length Code_Len of the associated running code in the one-time programmable OTP storage space are read from the address corresponding to the temporary mark TempFlag, and the start address Code_Add and the data length Code_Len are read from the address corresponding to the temporary mark TempFlag.
  • Start address Code_Add and data length Code_Len read the running code data associated with the start address Code_Add and data length Code_Len from the one-time programmable OTP storage space, and until all fixed offsets in the one-time programmable storage space The running code data pointed to by the address is read out, and the running code data is restored based on the read running code data.
  • the advantage of this is that the running code data can be restored to prevent the user's original data from appearing on the U disk. Lost or damaged U disk system cannot run, etc.
  • the stored original algorithm management table data can be loaded from the one-time programmable OTP storage space, and the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space. , And determine whether the read temporary flag TempFlag is equal to the tag TableFlg of the loading table in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space
  • TableFlg When loading the table flag TableFlg in the table, read the associated original algorithm management table data starting address TableData_Add and data length TableData_Len in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag, and According to the read start address TableData_Add and data length TableData_Len, the original algorithm management table data associated with the start address TableData_Add and the data length TableData_Len is read from the one-time programmable OTP storage space, and until one time The original algorithm management table data pointed to by
  • the above scheme can make the boot loader jump to the restored running code data and execute it, so that the U disk can be successfully loaded.
  • This has the advantage of being able to load the Boot
  • the Boot Loader can jump to the restored running code data to execute, so that the USB flash drive can be successfully loaded, and the USB flash drive can be restored to the normal state of use , To ensure the service life of the U disk.
  • FIG. 1 is a schematic flowchart of an embodiment of a method for preventing U disk data loss and system damage according to the present invention
  • FIG. 2 is a schematic diagram of an example of a one-time programmable OTP storage space in an embodiment of the method for preventing data loss and system damage in a U disk of the present invention
  • FIG. 3 is a schematic diagram of another example of a one-time programmable OTP storage space in an embodiment of the method for preventing data loss and system damage in a U disk of the present invention
  • FIG. 4 is a schematic diagram of another example of a one-time programmable OTP storage space in an embodiment of the method for preventing data loss and system damage in a U disk of the present invention
  • FIG. 5 is a schematic flowchart of another embodiment of a method for preventing data loss and system damage in a U disk according to the present invention.
  • FIG. 6 is a schematic structural diagram of an embodiment of a device for preventing U disk data loss and system damage according to the present invention.
  • FIG. 7 is a schematic structural diagram of another embodiment of the device for preventing U disk data loss and system damage according to the present invention.
  • Fig. 8 is a schematic structural diagram of another embodiment of the system for controlling the installation authority of application programs of the present invention.
  • the invention provides a method for preventing U disk data loss and system damage, which can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
  • FIG. 1 is a schematic flowchart of an embodiment of a method for preventing data loss and system damage of a U disk according to the present invention. It should be noted that, if there is substantially the same result, the method of the present invention is not limited to the sequence of the process shown in FIG. 1. As shown in Figure 1, the method includes the following steps:
  • S102 Store the running code and the original algorithm management table data in the one-time programmable OTP storage space.
  • reading the stored running code data from the one-time programmable OTP storage space, and restoring the running code data according to the read running code data may include:
  • the advantage is that the running code can be restored by The data method can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
  • the stored original algorithm management table data is read from the one-time programmable OTP storage space, and the original algorithm management table data read out is used to restore the original algorithm management table data.
  • the stored running code data is read from the one-time programmable OTP storage space, and the running code read out is Data
  • the running code data is restored
  • the stored original algorithm management table data is read from the one-time programmable OTP storage space, and the original algorithm management table data read is restored to restore the original
  • the algorithm manages the table data it can also include:
  • a 1bit (binary digit, bit) data bus and an OTP with a total capacity of 16KB (Kilobyte) can be preferably used.
  • a 1bit (binary digit, bit) data bus and an OTP with a total capacity of 16KB (Kilobyte) can be preferably used.
  • the selection of the OTP type The present invention is not limited.
  • the reading speed is slow.
  • OTP data all 16KB OTP data will not be read out, but corresponding data will be loaded according to the range given by the OTP loading table.
  • the OTP loading table format can be as follows:
  • TableFlg represents the mark of the OTP loading table.
  • the OTP loading table can be stored at the address aligned with 1KB of the OTP address.
  • the Boot Loader code can read the length of 4Bytes from all 1KB aligned addresses of the OTP to determine whether there is a valid OTP loading table. If the correct TableFlg is read, the entire OTP loading table will continue to be read.
  • Code_Add and Code_Len respectively represent the starting address and data length of the running code in the OTP. It should be noted that in the OTP loading table, TableData_Add and TableData_Len respectively represent the starting address and data length of the original algorithm management table in the OTP.
  • OTP backup data can be composed of OTP loading table (OTP_TABLE), running code (Code) and original algorithm management table data (TableData).
  • the running code and the original algorithm management table data can be updated multiple times in the 16KB OTP space, and the running code and the original algorithm management table data can be updated multiple times in the OTP.
  • the running code and the original algorithm management table data can be updated multiple times in the OTP space through the OTP loading table, which can realize multiple updates of the running code and the original algorithm management table data in the OTP.
  • the one-time programmable OTP storage space can be added to the main control chip of the U disk, and the running code and the original algorithm management table data can be stored in the one-time programmable OTP storage space , And when the boot loader fails to load the running code or the algorithm management table data normally, read the stored running code data from the one-time programmable OTP storage space, and according to the read running code data, Recover running code data, read the stored original algorithm management table data from the one-time programmable OTP storage space, and restore the original algorithm management table data according to the read original algorithm management table data
  • the table data can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
  • the stored running code data can be loaded from the one-time programmable OTP storage space, and the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space.
  • the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space.
  • determine whether the read temporary flag TempFlag is equal to the tag TableFlg of the loading table in the one-time programmable OTP storage space determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space
  • the table flag TableFlg in the table read the start address Code_Add and the data length Code_Len of the associated running code in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag, and read according to the Start address Code_Add and data length Code_Len, read the running code data associated with the start address Code_Add and data length Code_Len from the one-time programmable OTP storage space, and until all the data in
  • the stored original algorithm management table data can be loaded from the one-time programmable OTP storage space, and read from the first fixed offset address in the one-time programmable storage space Temporary flag TempFlag, and judging whether the read temporary flag TempFlag is equal to the label TableFlg of the loading table in the one-time programmable OTP storage space, after judging that the read temporary flag TempFlag is equal to the one-time programmable
  • the stored original algorithm management table data can be loaded from the one-time programmable OTP storage space, and read from the first fixed offset address in the one-time programmable storage space Temporary flag TempFlag, and judging whether the read temporary flag TempFlag is equal to the label TableFlg of the loading table in the one-time programmable OTP storage space, after judging that the read temporary flag TempFlag is equal to the one-time programmable
  • TableData_Add the starting address TableData_Add and the data length in the one-time programmable OTP storage space
  • FIG. 2 is a schematic diagram of an example of a one-time programmable OTP storage space in an embodiment of a method for preventing data loss and system damage of a U disk according to the present invention.
  • OTP_TABLE (1, 1) indicates that the OTP_TABLE points to Code (1) and TableData (1).
  • FIG. 3 is a schematic diagram of another example of a one-time programmable OTP storage space in an embodiment of a method for preventing data loss and system damage in a U disk of the present invention.
  • the current running code Code (1) needs to be updated to Code (2)
  • the 1KB aligned address in OTP here is the nKB address.
  • FIG. 4 is a schematic diagram of another example of a one-time programmable OTP storage space in an embodiment of the method for preventing data loss and system damage of a U disk according to the present invention.
  • TableData(1) needs to be updated to TableData(2)
  • FIG. 5 is a schematic flowchart of another embodiment of a method for preventing data loss and system damage of a U disk according to the present invention.
  • the method includes the following steps:
  • S501 Add one-time programmable OTP storage space to the main control chip of the U disk.
  • S502 Store the running code and the original algorithm management table data in the one-time programmable OTP storage space.
  • the boot loader can be made to jump to the restored running code data for execution, so that the U disk can be successfully loaded.
  • This has the advantage of being able to load the Boot loader during the boot
  • the Boot Loader can jump to the restored running code data to execute, so that the USB flash drive can be successfully loaded, and the USB flash drive can be restored to the normal state of use , To ensure the service life of the U disk.
  • the invention also provides a device for preventing U disk data loss and system damage, which can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
  • FIG. 6 is a schematic structural diagram of an embodiment of a device for preventing U disk data loss and system damage according to the present invention.
  • the device 60 for preventing U disk data loss and system damage includes a memory 61 and a restorer 62.
  • the memory 61 is used to store the running code and the original algorithm management table data in the one-time programmable OTP storage space.
  • the restorer 62 is used to read the stored operating code data from the one-time programmable OTP storage space when the boot loader normally loads the operating code or the algorithm management table data fails, and reads the stored operating code data according to the read.
  • the operating code data is restored, and the stored original algorithm management table data is read from the one-time programmable OTP storage space, and the original algorithm management table data is restored according to the read original algorithm.
  • the original algorithm is used to manage tabular data.
  • the restorer 62 may be specifically used for:
  • the restorer 62 may be specifically used for:
  • FIG. 7 is a schematic structural diagram of another embodiment of a device for preventing data loss and system damage of a U disk according to the present invention.
  • the device 70 for preventing U disk data loss and system damage described in this embodiment further includes an actuator 71.
  • the executor 71 is used to make the boot loader jump to the restored running code data for execution, so that the U disk is successfully loaded.
  • Each unit module of the device 60/70 for preventing U disk data loss and system damage can execute the corresponding steps in the above method embodiment, so each unit module will not be repeated here.
  • each unit module will not be repeated here.
  • the present invention also provides a device for preventing U disk data loss and system damage, as shown in FIG. 8, comprising: at least one processor 81; and a memory 82 communicatively connected with the at least one processor 81; wherein the memory 82 stores There are instructions that can be executed by at least one processor 81, and the instructions are executed by at least one processor 81, so that at least one processor 81 can execute the above-mentioned method for preventing U disk data loss and system damage.
  • the memory 82 and the processor 81 are connected in a bus manner.
  • the bus may include any number of interconnected buses and bridges, and the bus connects one or more various circuits of the processor 81 and the memory 82 together.
  • the bus can also connect various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are all well-known in the art, and therefore, no further description will be given herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium.
  • the data processed by the processor 81 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor 81.
  • the processor 81 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory 82 may be used to store data used by the processor 81 when performing operations.
  • the present invention further provides a computer-readable storage medium storing a computer program.
  • the computer program is executed by the processor, the above method embodiment is realized.
  • one-time programmable OTP storage space can be added to the main control chip of the U disk, and the running code and original algorithm management table data can be stored in the one-time programmable OTP storage space.
  • the boot loader fails to load the running code or the algorithm management table data normally, the stored running code data is read from the one-time programmable OTP storage space, and the running code data is restored based on the read running code data Code data, and read the stored original algorithm management table data from the one-time programmable OTP storage space, and restore the original algorithm management table data according to the read original algorithm management table data, It can prevent the U disk from losing the user's original data or the U disk system being damaged and unable to run.
  • the stored running code data can be loaded from the one-time programmable OTP storage space
  • the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space
  • the judgment Whether the read temporary flag TempFlag is equal to the flag TableFlg of the loading table in the one-time programmable OTP storage space, after judging that the read temporary flag TempFlag is equal to the loading in the one-time programmable OTP storage space When the table is marked with TableFlg, the start address Code_Add and the data length Code_Len of the associated running code in the one-time programmable OTP storage space are read from the address corresponding to the temporary mark TempFlag, and the start address Code_Add and the data length Code_Len are read from the address corresponding to the temporary mark TempFlag.
  • Start address Code_Add and data length Code_Len read the running code data associated with the start address Code_Add and data length Code_Len from the one-time programmable OTP storage space, and until all fixed offsets in the one-time programmable storage space The running code data pointed to by the address is read out, and the running code data is restored based on the read running code data.
  • the advantage of this is that the running code data can be restored to prevent the user's original data from appearing on the U disk. Lost or damaged U disk system cannot run, etc.
  • the stored original algorithm management table data can be loaded from the one-time programmable OTP storage space, and the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space. , And determine whether the read temporary flag TempFlag is equal to the tag TableFlg of the loading table in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space
  • TableFlg When loading the table flag TableFlg in the table, read the associated original algorithm management table data starting address TableData_Add and data length TableData_Len in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag, and According to the read start address TableData_Add and data length TableData_Len, the original algorithm management table data associated with the start address TableData_Add and the data length TableData_Len is read from the one-time programmable OTP storage space, and until one time The original algorithm management table data pointed to by
  • the above scheme can make the boot loader jump to the restored running code data and execute it, so that the U disk can be successfully loaded.
  • This has the advantage of being able to load the Boot
  • the Boot Loader can jump to the restored running code data to execute, so that the USB flash drive can be successfully loaded, and the USB flash drive can be restored to the normal state of use , To ensure the service life of the U disk.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device implementation described above is merely illustrative, for example, the division of modules or units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of this embodiment.
  • the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present invention essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the methods of the various embodiments of the present invention.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

A method, apparatus and device for preventing data loss and system damage of a USB flash disk. The method comprises: adding, to a main control chip of a USB flash disk, a one time programmable (OTP) storage space (S101, S501); storing running code and original algorithm management table data in the one time programmable (OTP) storage space (S102, S502); and when a Boot Loader fails to normally load the running code or original algorithm management table data, reading the stored running code data from the one time programmable (OTP) storage space and recovering the running code data according to the read running code data, and reading the stored original algorithm management table data from the one time programmable (OTP) storage space and recovering the original algorithm management table data according to the read original algorithm management table data (S103, S503). By the above-mentioned means, the USB flash disk can be protected against situations in which original data of a user is lost or the USB flash disk cannot run due to system damage.

Description

一种防止U盘数据丢失和系统损坏的方法和装置以及设备Method, device and equipment for preventing U disk data loss and system damage 技术领域Technical field
本发明涉及存储技术领域,尤其涉及一种防止U盘数据丢失和系统损坏的方法和装置以及设备。The present invention relates to the field of storage technology, in particular to a method, device and equipment for preventing data loss and system damage of a U disk.
背景技术Background technique
U盘(USB flash disk,USB闪存盘)是由主控芯片和NF(NAND Flash,NAND闪存)存储器组成。主控芯片通过固化在ROM(Read-Only Memory,只读存储器)中的Boot Loader(引导加载)代码把存储在NAND Flash闪存中的运行代码和算法管理表格数据加载到RAM(Random Access Memory,随机存取存储器)中,然后运行代码在RAM随机存取存储器中执行。USB flash disk (USB flash disk) is composed of main control chip and NF (NAND Flash, NAND flash memory) memory. The main control chip passes through the Boot solidified in ROM (Read-Only Memory) Loader (boot loading) code loads the running code and algorithm management table data stored in NAND Flash into RAM (Random Access Memory, random access memory), and then run the code to execute in RAM random access memory.
技术问题technical problem
由于NAND Flash闪存的存储特性会由于存储环境或者存储时间过长或者异常掉电等情况导致数据错误,Boot Loader引导加载可能会出现无法加载运行代码或者算法管理表格数据加载失败的情况,此时U盘会出现用户原有数据丢失,或U盘系统损坏无法运行等情况。Due to the storage characteristics of NAND Flash flash memory, data errors may occur due to the storage environment, excessive storage time or abnormal power failure, Boot Loader boot loading may fail to load the running code or the algorithm management table data load fails. At this time, the U disk will lose the user's original data, or the U disk system may be damaged and unable to run.
技术解决方案Technical solutions
有鉴于此,本发明的目的在于提出一种防止U盘数据丢失和系统损坏的方法和装置以及设备,能够实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。In view of this, the purpose of the present invention is to provide a method, device and equipment for preventing data loss and system damage of a U disk, which can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
根据本发明的一个方面,提供一种防止U盘数据丢失和系统损坏的方法,包括:According to one aspect of the present invention, a method for preventing data loss and system damage of a U disk is provided, which includes:
在U盘的主控芯片中加入一次性可编程存储空间;Add one-time programmable storage space to the main control chip of the U disk;
将运行代码和原始的算法管理表格数据存储在所述一次性可编程存储空间中;Storing running code and original algorithm management table data in the one-time programmable storage space;
在引导加载正常加载运行代码或算法管理表格数据失败时,从所述一次性可编程存储空间中读取出所述存储的运行代码数据,并根据所述读取出的运行代码数据,恢复出运行代码数据,和从所述一次性可编程存储空间中读取出所述存储的原始的算法管理表格数据,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。When the boot load fails to load the running code or the algorithm management table data normally, the stored running code data is read from the one-time programmable storage space, and the running code data is restored based on the read running code data. Run code data, read the stored original algorithm management table data from the one-time programmable storage space, and restore the original algorithm management table data according to the read original algorithm management table data Tabular data.
其中,所述从所述一次性可编程存储空间中读取出所述存储的运行代码数据,并根据所述读取出的运行代码数据,恢复出运行代码数据,包括:Wherein, the reading the stored running code data from the one-time programmable storage space and restoring the running code data according to the read running code data includes:
从所述一次性可编程存储空间中加载所述存储的运行代码数据;Loading the stored running code data from the one-time programmable storage space;
从所述一次性可编程存储空间中的第一个固定偏移地址读出临时标记;Reading out the temporary mark from the first fixed offset address in the one-time programmable storage space;
判断所述读取出的临时标记是否于所述一次性可编程存储空间中的加载表格的标记,在判断出所述读取出的临时标记是于所述一次性可编程存储空间中的加载表格的标记时,从对应所述临时标记的地址处读取出关联的运行代码在所述一次性可编程存储空间中的起始地址和数据长度;It is judged whether the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space When the table is marked, the start address and data length of the associated running code in the one-time programmable storage space are read from the address corresponding to the temporary mark;
根据所述读取出的起始地址和数据长度,从所述一次性可编程存储空间中读取出关联所述起始地址和数据长度的运行代码数据;Read out the running code data associated with the start address and the data length from the one-time programmable storage space according to the read start address and data length;
直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据所述读取出的运行代码数据,恢复出运行代码数据。Until all the running code data pointed to by the fixed offset address in the one-time programmable storage space are read, and the running code data is restored according to the read running code data.
其中,所述从所述一次性可编程存储空间中读取出所述存储的原始的算法管理表格数据,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,包括:Wherein, the stored original algorithm management table data is read from the one-time programmable storage space, and the original algorithm management table data is restored according to the read original algorithm management table data. Data, including:
从所述一次性可编程存储空间中加载所述存储的原始的算法管理表格数据;Loading the stored original algorithm management table data from the one-time programmable storage space;
从所述一次性可编程存储空间中的第一个固定偏移地址读出临时标记;Reading out the temporary mark from the first fixed offset address in the one-time programmable storage space;
判断所述读取出的临时标记是否于所述一次性可编程存储空间中的加载表格的标记,在判断出所述读取出的临时标记是于所述一次性可编程存储空间中的加载表格的标记时,从对应所述临时标记的地址处读取出关联的原始的算法管理表格数据在所述一次性可编程存储空间中的起始地址和数据长度;It is judged whether the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space When the table is marked, the start address and data length of the associated original algorithm management table data in the one-time programmable storage space are read from the address corresponding to the temporary mark;
根据所述读取出的起始地址和数据长度,从所述一次性可编程存储空间中读取出关联所述起始地址和数据长度的原始的算法管理表格数据;According to the read start address and data length, read out the original algorithm management table data associated with the start address and data length from the one-time programmable storage space;
直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。Until all the original algorithm management table data pointed to by the fixed offset address in the one-time programmable storage space are read, and the original algorithm management table data is restored according to the read original algorithm management table data.
其中,在所述在引导加载正常加载运行代码或算法管理表格数据失败时,从所述一次性可编程存储空间中读取出所述存储的运行代码数据,并根据所述读取出的运行代码数据,恢复出运行代码数据,和从所述一次性可编程存储空间中读取出所述存储的原始的算法管理表格数据,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据之后,还包括:Wherein, when the boot loading fails to load the running code or the algorithm management table data normally, the stored running code data is read from the one-time programmable storage space, and the running code data is read according to the read Code data, restore running code data, read the stored original algorithm management table data from the one-time programmable storage space, and manage the table data according to the read original algorithm, restore After the original algorithm management table data is released, it also includes:
使引导加载跳转到所述恢复出的运行代码数据中执行,让U盘上盘成功。The boot load jumps to the restored running code data for execution, so that the U disk is successfully loaded.
根据本发明的另一个方面,提供一种防止U盘数据丢失和系统损坏的装置,包括:According to another aspect of the present invention, there is provided a device for preventing data loss and system damage of a U disk, including:
存储器和恢复器;Storage and restorer;
所述存储器,用于将运行代码和原始的算法管理表格数据存储在所述一次性可编程存储空间中;The memory is used to store running code and original algorithm management table data in the one-time programmable storage space;
所述恢复器,用于在引导加载正常加载运行代码或算法管理表格数据失败时,从所述一次性可编程存储空间中读取出所述存储的运行代码数据,并根据所述读取出的运行代码数据,恢复出运行代码数据,和从所述一次性可编程存储空间中读取出所述存储的原始的算法管理表格数据,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。The restorer is used to read the stored running code data from the one-time programmable storage space when the boot load normally loads the running code or the algorithm management table data fails, and reads out the running code data according to the read The operating code data is restored, the operating code data is restored, and the stored original algorithm management table data is read from the one-time programmable storage space, and the original algorithm management table data is read out according to the original algorithm , Restore the original algorithm management table data.
其中,所述恢复器,具体用于:Wherein, the restorer is specifically used for:
从所述一次性可编程存储空间中加载所述存储的运行代码数据;Loading the stored running code data from the one-time programmable storage space;
从所述一次性可编程存储空间中的第一个固定偏移地址读出临时标记;Reading out the temporary mark from the first fixed offset address in the one-time programmable storage space;
判断所述读取出的临时标记是否于所述一次性可编程存储空间中的加载表格的标记,在判断出所述读取出的临时标记是于所述一次性可编程存储空间中的加载表格的标记时,从对应所述临时标记的地址处读取出关联的运行代码在所述一次性可编程存储空间中的起始地址和数据长度;It is judged whether the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space When the table is marked, the start address and data length of the associated running code in the one-time programmable storage space are read from the address corresponding to the temporary mark;
根据所述读取出的起始地址和数据长度,从所述一次性可编程存储空间中读取出关联所述起始地址和数据长度的运行代码数据;Read out the running code data associated with the start address and the data length from the one-time programmable storage space according to the read start address and data length;
直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据所述读取出的运行代码数据,恢复出运行代码数据。Until all the running code data pointed to by the fixed offset address in the one-time programmable storage space are read, and the running code data is restored according to the read running code data.
其中,所述恢复器,具体用于:Wherein, the restorer is specifically used for:
从所述一次性可编程存储空间中加载所述存储的原始的算法管理表格数据;Loading the stored original algorithm management table data from the one-time programmable storage space;
从所述一次性可编程存储空间中的第一个固定偏移地址读出临时标记;Reading out the temporary mark from the first fixed offset address in the one-time programmable storage space;
判断所述读取出的临时标记是否于所述一次性可编程存储空间中的加载表格的标记,在判断出所述读取出的临时标记是于所述一次性可编程存储空间中的加载表格的标记时,从对应所述临时标记的地址处读取出关联的原始的算法管理表格数据在所述一次性可编程存储空间中的起始地址和数据长度;It is judged whether the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space When the table is marked, the start address and data length of the associated original algorithm management table data in the one-time programmable storage space are read from the address corresponding to the temporary mark;
根据所述读取出的起始地址和数据长度,从所述一次性可编程存储空间中读取出关联所述起始地址和数据长度的原始的算法管理表格数据;According to the read start address and data length, read out the original algorithm management table data associated with the start address and data length from the one-time programmable storage space;
直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。Until all the original algorithm management table data pointed to by the fixed offset address in the one-time programmable storage space are read, and the original algorithm management table data is restored according to the read original algorithm management table data.
其中,所述防止U盘数据丢失和系统损坏的装置,还包括:Wherein, the device for preventing data loss and system damage of U disk further includes:
执行器,用于使引导加载跳转到所述恢复出的运行代码数据中执行,让U盘上盘成功。The executor is used to make the boot loading jump to the restored running code data for execution, so that the U disk is successfully loaded.
根据本发明的又一个方面,提供一种防止U盘数据丢失和系统损坏的设备,包括:According to another aspect of the present invention, there is provided a device for preventing data loss and system damage of a U disk, including:
至少一个处理器;以及,At least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述任一项所述的防止U盘数据丢失和系统损坏的方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute any of the above-mentioned prevention of U disk data Methods of loss and system damage.
根据本发明的再一个方面,提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的防止U盘数据丢失和系统损坏的方法。According to another aspect of the present invention, there is provided a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for preventing data loss and system damage of a U disk as described in any one of the above items.
有益效果Beneficial effect
可以发现,以上方案,可以在U盘的主控芯片中加入一次性可编程OTP存储空间,和可以将运行代码和原始的算法管理表格数据存储在该一次性可编程OTP存储空间中,以及在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,从该一次性可编程OTP存储空间中读取出该存储的运行代码数据,并根据该读取出的运行代码数据,恢复出运行代码数据,和从该一次性可编程OTP存储空间中读取出该存储的原始的算法管理表格数据,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,能够实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。It can be found that in the above solution, one-time programmable OTP storage space can be added to the main control chip of the U disk, and the running code and original algorithm management table data can be stored in the one-time programmable OTP storage space. When the boot loader fails to load the running code or the algorithm management table data normally, the stored running code data is read from the one-time programmable OTP storage space, and the running code data is restored based on the read running code data Code data, and read the stored original algorithm management table data from the one-time programmable OTP storage space, and restore the original algorithm management table data according to the read original algorithm management table data, It can prevent the U disk from losing the user's original data or the U disk system being damaged and unable to run.
进一步的,以上方案,可以从该一次性可编程OTP存储空间中加载该存储的运行代码数据,从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag,和判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的运行代码在该一次性可编程OTP存储空间中的起始地址Code_Add和数据长度Code_Len,和根据该读取出的起始地址Code_Add和数据长度Code_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址Code_Add和数据长度Code_Len的运行代码数据,以及直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据该读取出的运行代码数据,恢复出运行代码数据,这样的好处是能够通过恢复出运行代码数据的方式,实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。Further, in the above solution, the stored running code data can be loaded from the one-time programmable OTP storage space, the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space, and the judgment Whether the read temporary flag TempFlag is equal to the flag TableFlg of the loading table in the one-time programmable OTP storage space, after judging that the read temporary flag TempFlag is equal to the loading in the one-time programmable OTP storage space When the table is marked with TableFlg, the start address Code_Add and the data length Code_Len of the associated running code in the one-time programmable OTP storage space are read from the address corresponding to the temporary mark TempFlag, and the start address Code_Add and the data length Code_Len are read from the address corresponding to the temporary mark TempFlag. Start address Code_Add and data length Code_Len, read the running code data associated with the start address Code_Add and data length Code_Len from the one-time programmable OTP storage space, and until all fixed offsets in the one-time programmable storage space The running code data pointed to by the address is read out, and the running code data is restored based on the read running code data. The advantage of this is that the running code data can be restored to prevent the user's original data from appearing on the U disk. Lost or damaged U disk system cannot run, etc.
进一步的,以上方案,可以从该一次性可编程OTP存储空间中加载该存储的原始的算法管理表格数据,从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag,和判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的原始的算法管理表格数据在该一次性可编程OTP存储空间中的起始地址TableData_Add和数据长度TableData_Len,和根据该读取出的起始地址TableData_Add和数据长度TableData_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址TableData_Add和数据长度TableData_Len的原始的算法管理表格数据,以及直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,这样的好处是能够通过恢复出原始的算法管理表格数据的方式,实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。Further, in the above solution, the stored original algorithm management table data can be loaded from the one-time programmable OTP storage space, and the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space. , And determine whether the read temporary flag TempFlag is equal to the tag TableFlg of the loading table in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space When loading the table flag TableFlg in the table, read the associated original algorithm management table data starting address TableData_Add and data length TableData_Len in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag, and According to the read start address TableData_Add and data length TableData_Len, the original algorithm management table data associated with the start address TableData_Add and the data length TableData_Len is read from the one-time programmable OTP storage space, and until one time The original algorithm management table data pointed to by all fixed offset addresses in the flexible programmable storage space are read, and the original algorithm management table data read out is used to restore the original algorithm management table data. The advantage is By recovering the original algorithm to manage the table data, it can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
进一步的,以上方案,可以使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功,这样的好处是能够在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,能够使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功,能够实现U盘能够恢复到正常的使用状态,保障了U盘的使用寿命。Furthermore, the above scheme can make the boot loader jump to the restored running code data and execute it, so that the U disk can be successfully loaded. This has the advantage of being able to load the Boot When the Loader fails to load the running code or the algorithm management table data normally, the Boot Loader can jump to the restored running code data to execute, so that the USB flash drive can be successfully loaded, and the USB flash drive can be restored to the normal state of use , To ensure the service life of the U disk.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1是本发明防止U盘数据丢失和系统损坏的方法一实施例的流程示意图;FIG. 1 is a schematic flowchart of an embodiment of a method for preventing U disk data loss and system damage according to the present invention;
图2是本发明防止U盘数据丢失和系统损坏的方法一实施例中一次性可编程OTP存储空间的一举例示意图;2 is a schematic diagram of an example of a one-time programmable OTP storage space in an embodiment of the method for preventing data loss and system damage in a U disk of the present invention;
图3是本发明防止U盘数据丢失和系统损坏的方法一实施例中一次性可编程OTP存储空间的另一举例示意图;3 is a schematic diagram of another example of a one-time programmable OTP storage space in an embodiment of the method for preventing data loss and system damage in a U disk of the present invention;
图4是本发明防止U盘数据丢失和系统损坏的方法一实施例中一次性可编程OTP存储空间的又一举例示意图;4 is a schematic diagram of another example of a one-time programmable OTP storage space in an embodiment of the method for preventing data loss and system damage in a U disk of the present invention;
图5是本发明防止U盘数据丢失和系统损坏的方法另一实施例的流程示意图;5 is a schematic flowchart of another embodiment of a method for preventing data loss and system damage in a U disk according to the present invention;
图6是本发明防止U盘数据丢失和系统损坏的装置一实施例的结构示意图;6 is a schematic structural diagram of an embodiment of a device for preventing U disk data loss and system damage according to the present invention;
图7是本发明防止U盘数据丢失和系统损坏的装置另一实施例的结构示意图;FIG. 7 is a schematic structural diagram of another embodiment of the device for preventing U disk data loss and system damage according to the present invention;
图8是本发明应用程序安装权限控制的系统又一实施例的结构示意图。Fig. 8 is a schematic structural diagram of another embodiment of the system for controlling the installation authority of application programs of the present invention.
本发明的最佳实施方式The best mode of the invention
在此处键入本发明的最佳实施方式描述段落。Type here a paragraph describing the best mode of the invention.
本发明的实施方式Embodiments of the invention
下面结合附图和实施例,对本发明作进一步的详细描述。特别指出的是,以下实施例仅用于说明本发明,但不对本发明的范围进行限定。同样的,以下实施例仅为本发明的部分实施例而非全部实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The present invention will be further described in detail below in conjunction with the drawings and embodiments. It is particularly pointed out that the following examples are only used to illustrate the present invention, but do not limit the scope of the present invention. Similarly, the following embodiments are only part of the embodiments of the present invention, but not all of them. All other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
本发明提供一种防止U盘数据丢失和系统损坏的方法,能够实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。The invention provides a method for preventing U disk data loss and system damage, which can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
请参见图1,图1是本发明防止U盘数据丢失和系统损坏的方法一实施例的流程示意图。需注意的是,若有实质上相同的结果,本发明的方法并不以图1所示的流程顺序为限。如图1所示,该方法包括如下步骤:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of an embodiment of a method for preventing data loss and system damage of a U disk according to the present invention. It should be noted that, if there is substantially the same result, the method of the present invention is not limited to the sequence of the process shown in FIG. 1. As shown in Figure 1, the method includes the following steps:
S101:在U盘的主控芯片中加入OTP(One Time Programmable,一次性可编程)存储空间。S101: Add OTP (One Time Programmable) storage space to the main control chip of the U disk.
S102:将运行代码和原始的算法管理表格数据存储在该一次性可编程OTP存储空间中。S102: Store the running code and the original algorithm management table data in the one-time programmable OTP storage space.
S103:在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,从该一次性可编程OTP存储空间中读取出该存储的运行代码数据,并根据该读取出的运行代码数据,恢复出运行代码数据,和从该一次性可编程OTP存储空间中读取出该存储的原始的算法管理表格数据,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。S103: When the boot loader fails to load the running code normally or the algorithm management table data fails, read the stored running code data from the one-time programmable OTP storage space, and according to the read running code data, Recover running code data, read the stored original algorithm management table data from the one-time programmable OTP storage space, and restore the original algorithm management table data according to the read original algorithm management table data Tabular data.
其中,该从该一次性可编程OTP存储空间中读取出该存储的运行代码数据,并根据该读取出的运行代码数据,恢复出运行代码数据,可以包括:Wherein, reading the stored running code data from the one-time programmable OTP storage space, and restoring the running code data according to the read running code data, may include:
从该一次性可编程OTP存储空间中加载该存储的运行代码数据;Load the stored running code data from the one-time programmable OTP storage space;
从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag;Read the temporary flag TempFlag from the first fixed offset address in the one-time programmable storage space;
判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记(TableFlg),在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的运行代码在该一次性可编程OTP存储空间中的起始地址(Code_Add)和数据长度(Code_Len);Determine whether the read temporary flag TempFlag is equal to the load table flag (TableFlg) in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space When loading the table flag TableFlg in the table, read the start address (Code_Add) and data length (Code_Len) of the associated running code in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag;
根据该读取出的起始地址Code_Add和数据长度Code_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址Code_Add和数据长度Code_Len的运行代码数据;According to the read start address Code_Add and data length Code_Len, read the running code data associated with the start address Code_Add and the data length Code_Len from the one-time programmable OTP storage space;
直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据该读取出的运行代码数据,恢复出运行代码数据,这样的好处是能够通过恢复出运行代码数据的方式,实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。Until all the running code data pointed to by the fixed offset address in the one-time programmable storage space is read, and the running code data is restored based on the read running code data, the advantage is that the running code can be restored by The data method can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
其中,该从该一次性可编程OTP存储空间中读取出该存储的原始的算法管理表格数据,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,可以包括:Wherein, the stored original algorithm management table data is read from the one-time programmable OTP storage space, and the original algorithm management table data read out is used to restore the original algorithm management table data. include:
从该一次性可编程OTP存储空间中加载该存储的原始的算法管理表格数据;Load the stored original algorithm management table data from the one-time programmable OTP storage space;
从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag;Read the temporary flag TempFlag from the first fixed offset address in the one-time programmable storage space;
判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的原始的算法管理表格数据在该一次性可编程OTP存储空间中的起始地址(TableData_Add)和数据长度(TableData_Len);Determine whether the read temporary flag TempFlag is equal to the flag TableFlg of the loaded table in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space When loading the table flag TableFlg, read the associated original algorithm management table data starting address (TableData_Add) and data length (TableData_Len) in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag ;
根据该读取出的起始地址TableData_Add和数据长度TableData_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址TableData_Add和数据长度TableData_Len的原始的算法管理表格数据;According to the read start address TableData_Add and data length TableData_Len, read the original algorithm management table data associated with the start address TableData_Add and the data length TableData_Len from the one-time programmable OTP storage space;
直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,这样的好处是能够通过恢复出原始的算法管理表格数据的方式,实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。Until all the original algorithm management table data pointed to by the fixed offset address in the one-time programmable storage space are read, and the original algorithm management table data is restored according to the read original algorithm management table data, so The advantage is that it can restore the original algorithm to manage the table data to prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
其中,在该在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,从该一次性可编程OTP存储空间中读取出该存储的运行代码数据,并根据该读取出的运行代码数据,恢复出运行代码数据,和从该一次性可编程OTP存储空间中读取出该存储的原始的算法管理表格数据,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据之后,还可以包括:Wherein, when the boot loader normally loads the running code or the algorithm management table data fails, the stored running code data is read from the one-time programmable OTP storage space, and the running code read out is Data, the running code data is restored, and the stored original algorithm management table data is read from the one-time programmable OTP storage space, and the original algorithm management table data read is restored to restore the original After the algorithm manages the table data, it can also include:
使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功,这样的好处是能够在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,能够使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功,能够实现U盘能够恢复到正常的使用状态,保障了U盘的使用寿命。Make the boot loader jump to the restored running code data and execute it, so that the USB flash drive can be successfully loaded. This has the advantage of being able to boot the boot loader when the boot loader fails to load the running code or the algorithm management table data. Load the Boot Loader to jump to the restored running code data to execute, so that the U disk can be successfully loaded, and the U disk can be restored to the normal state of use, which ensures the service life of the U disk.
在本实施例中,由于加入主控芯片的OTP需要考虑芯片面积,可以优选选用1bit(binary digit,比特)数据总线,16KB(Kilobyte,千字节)总容量的OTP,关于该OTP类型的选用,本发明不加以限定。In this embodiment, since the OTP added to the main control chip needs to consider the chip area, a 1bit (binary digit, bit) data bus and an OTP with a total capacity of 16KB (Kilobyte) can be preferably used. Regarding the selection of the OTP type , The present invention is not limited.
在本实施例中,由于使用1bit数据总线,导致读速度慢,在加载OTP数据时,不会将16KB的OTP数据全部读出,而是根据OTP 加载表格给定的范围加载对应的数据。In this embodiment, due to the use of a 1-bit data bus, the reading speed is slow. When loading OTP data, all 16KB OTP data will not be read out, but corresponding data will be loaded according to the range given by the OTP loading table.
在本实施例中,OTP加载表格格式,可以如下所示:In this embodiment, the OTP loading table format can be as follows:
typedef   struct  OTP_TABLEtypedef struct OTP_TABLE
{{
long     TableFlg;                   long TableFlg; , ...
long     Code_Add;         long Code_Add;
long     Code_Len;     long Code_Len;
long     TableData_Add;    long TableData_Add;
long     TableData_Len;        long TableData_Len;
}}
需要说明的是,TableFlg表示OTP加载表格的标记。OTP加载表格可以存放在OTP地址1KB对齐的地址处。Boot Loader代码可以通过对OTP所有1KB对齐地址处读出4Byte的长度,判断是否存在有效的OTP加载表格,如果读出正确TableFlg则继续读出整个OTP加载表格。It should be noted that TableFlg represents the mark of the OTP loading table. The OTP loading table can be stored at the address aligned with 1KB of the OTP address. The Boot Loader code can read the length of 4Bytes from all 1KB aligned addresses of the OTP to determine whether there is a valid OTP loading table. If the correct TableFlg is read, the entire OTP loading table will continue to be read.
需要说明的是,OTP加载表格中,Code_Add和Code_Len分别代表运行代码在OTP中的起始地址和数据长度。需要说明的是,OTP加载表格中,TableData_Add和TableData_Len分别代表原始算法管理表格在OTP中的起始地址和数据长度。It should be noted that in the OTP loading table, Code_Add and Code_Len respectively represent the starting address and data length of the running code in the OTP. It should be noted that in the OTP loading table, TableData_Add and TableData_Len respectively represent the starting address and data length of the original algorithm management table in the OTP.
在本实施例中,由于OTP每一个bit只能被编程一次,而 OTP中的备份数据例如运行代码和原始的算法管理表格数据可能会更新,所以本实施例中可以通过更新OTP加载表格的方式,更新备份数据中的运行代码或原始的算法管理表格数据。In this embodiment, since each bit of OTP can only be programmed once, and the backup data in OTP, such as running code and original algorithm management table data, may be updated, so in this embodiment, you can update the OTP to load the table. , Update the running code in the backup data or the original algorithm management table data.
需要说明的是,一份OTP备份数据可以由OTP加载表格(OTP_TABLE),运行代码(Code)和原始的算法管理表格数据(TableData)三部分组成。It should be noted that an OTP backup data can be composed of OTP loading table (OTP_TABLE), running code (Code) and original algorithm management table data (TableData).
在本实施例中,使用该OTP存储方式,能够在16KB的OTP空间中多次更新运行代码和原始的算法管理表格数据,能够实现运行代码和原始的算法管理表格数据在OTP中多次更新。In this embodiment, using this OTP storage method, the running code and the original algorithm management table data can be updated multiple times in the 16KB OTP space, and the running code and the original algorithm management table data can be updated multiple times in the OTP.
在本实施例中,能够通过OTP加载表格的方式,在OTP空间中多次更新运行代码和原始的算法管理表格数据,能够实现运行代码和原始的算法管理表格数据在OTP中的多次更新。In this embodiment, the running code and the original algorithm management table data can be updated multiple times in the OTP space through the OTP loading table, which can realize multiple updates of the running code and the original algorithm management table data in the OTP.
可以发现,在本实施例中,可以在U盘的主控芯片中加入一次性可编程OTP存储空间,和可以将运行代码和原始的算法管理表格数据存储在该一次性可编程OTP存储空间中,以及在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,从该一次性可编程OTP存储空间中读取出该存储的运行代码数据,并根据该读取出的运行代码数据,恢复出运行代码数据,和从该一次性可编程OTP存储空间中读取出该存储的原始的算法管理表格数据,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,能够实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。It can be found that in this embodiment, the one-time programmable OTP storage space can be added to the main control chip of the U disk, and the running code and the original algorithm management table data can be stored in the one-time programmable OTP storage space , And when the boot loader fails to load the running code or the algorithm management table data normally, read the stored running code data from the one-time programmable OTP storage space, and according to the read running code data, Recover running code data, read the stored original algorithm management table data from the one-time programmable OTP storage space, and restore the original algorithm management table data according to the read original algorithm management table data The table data can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
进一步的,在本实施例中,可以从该一次性可编程OTP存储空间中加载该存储的运行代码数据,从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag,和判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的运行代码在该一次性可编程OTP存储空间中的起始地址Code_Add和数据长度Code_Len,和根据该读取出的起始地址Code_Add和数据长度Code_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址Code_Add和数据长度Code_Len的运行代码数据,以及直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据该读取出的运行代码数据,恢复出运行代码数据,这样的好处是能够通过恢复出运行代码数据的方式,实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。Further, in this embodiment, the stored running code data can be loaded from the one-time programmable OTP storage space, and the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space. , And determine whether the read temporary flag TempFlag is equal to the tag TableFlg of the loading table in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space When loading the table flag TableFlg in the table, read the start address Code_Add and the data length Code_Len of the associated running code in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag, and read according to the Start address Code_Add and data length Code_Len, read the running code data associated with the start address Code_Add and data length Code_Len from the one-time programmable OTP storage space, and until all the data in the one-time programmable storage space The running code data pointed to by the fixed offset address is read out, and the running code data is restored based on the read running code data. The advantage of this is that the running code data can be restored to prevent users from appearing on the U disk. The original data is lost or the U disk system is damaged and cannot run.
进一步的,在本实施例中,可以从该一次性可编程OTP存储空间中加载该存储的原始的算法管理表格数据,从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag,和判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的原始的算法管理表格数据在该一次性可编程OTP存储空间中的起始地址TableData_Add和数据长度TableData_Len,和根据该读取出的起始地址TableData_Add和数据长度TableData_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址TableData_Add和数据长度TableData_Len的原始的算法管理表格数据,以及直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,这样的好处是能够通过恢复出原始的算法管理表格数据的方式,实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。Further, in this embodiment, the stored original algorithm management table data can be loaded from the one-time programmable OTP storage space, and read from the first fixed offset address in the one-time programmable storage space Temporary flag TempFlag, and judging whether the read temporary flag TempFlag is equal to the label TableFlg of the loading table in the one-time programmable OTP storage space, after judging that the read temporary flag TempFlag is equal to the one-time programmable When loading the table flag TableFlg in the OTP storage space, read the associated original algorithm management table data from the address corresponding to the temporary flag TempFlag, the starting address TableData_Add and the data length in the one-time programmable OTP storage space TableData_Len, and according to the read start address TableData_Add and data length TableData_Len, read the original algorithm management table data associated with the start address TableData_Add and the data length TableData_Len from the one-time programmable OTP storage space, and Until all the original algorithm management table data pointed to by the fixed offset address in the one-time programmable storage space are read, and the original algorithm management table data is restored according to the read original algorithm management table data, so The advantage is that it can restore the original algorithm to manage the table data to prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
下面进行举例说明本实施例:The following examples illustrate this embodiment:
请参见图2,图2是本发明防止U盘数据丢失和系统损坏的方法一实施例中一次性可编程OTP存储空间的一举例示意图。如图2所示,OTP_TABLE(1,1)表示该OTP_TABLE指向了Code(1)和TableData(1)。Please refer to FIG. 2. FIG. 2 is a schematic diagram of an example of a one-time programmable OTP storage space in an embodiment of a method for preventing data loss and system damage of a U disk according to the present invention. As shown in Figure 2, OTP_TABLE (1, 1) indicates that the OTP_TABLE points to Code (1) and TableData (1).
请参见图3,图3是本发明防止U盘数据丢失和系统损坏的方法一实施例中一次性可编程OTP存储空间的另一举例示意图。如图3所示,假设当前运行代码Code(1)需要被更新为Code(2),则可以在OTP中写入新的OTP_TABLE(2,1),其中OTP_TABLE(2,1)只能被写在OTP中1KB对齐地址处,此处为nKB地址处。Please refer to FIG. 3, which is a schematic diagram of another example of a one-time programmable OTP storage space in an embodiment of a method for preventing data loss and system damage in a U disk of the present invention. As shown in Figure 3, assuming that the current running code Code (1) needs to be updated to Code (2), you can write a new OTP_TABLE (2, 1) in OTP, where OTP_TABLE (2, 1) can only be written The 1KB aligned address in OTP, here is the nKB address.
请参见图4,图4是本发明防止U盘数据丢失和系统损坏的方法一实施例中一次性可编程OTP存储空间的又一举例示意图。如图4所示,假设当前原始的算法管理表格数据TableData(1)需要被更新为TableData(2),则可以在OTP中写入新的OTP_TABLE(1,2),其中OTP_TABLE(1,2)只能被写在OTP中1KB对齐地址处,此处为nKB地址处。Please refer to FIG. 4, which is a schematic diagram of another example of a one-time programmable OTP storage space in an embodiment of the method for preventing data loss and system damage of a U disk according to the present invention. As shown in Figure 4, assuming that the current original algorithm management table data TableData(1) needs to be updated to TableData(2), you can write a new OTP_TABLE(1, 2) in OTP, where OTP_TABLE(1, 2) It can only be written at the 1KB aligned address in OTP, here is the nKB address.
请参见图5,图5是本发明防止U盘数据丢失和系统损坏的方法另一实施例的流程示意图。本实施例中,该方法包括以下步骤:Please refer to FIG. 5, which is a schematic flowchart of another embodiment of a method for preventing data loss and system damage of a U disk according to the present invention. In this embodiment, the method includes the following steps:
S501:在U盘的主控芯片中加入一次性可编程OTP存储空间。S501: Add one-time programmable OTP storage space to the main control chip of the U disk.
S502:将运行代码和原始的算法管理表格数据存储在该一次性可编程OTP存储空间中。S502: Store the running code and the original algorithm management table data in the one-time programmable OTP storage space.
S503:在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,从该一次性可编程OTP存储空间中读取出该存储的运行代码数据,并根据该读取出的运行代码数据,恢复出运行代码数据,和从该一次性可编程OTP存储空间中读取出该存储的原始的算法管理表格数据,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。S503: When the boot loader fails to load the running code or the algorithm management table data normally, read the stored running code data from the one-time programmable OTP storage space, and according to the read running code data, Recover running code data, read the stored original algorithm management table data from the one-time programmable OTP storage space, and restore the original algorithm management table data according to the read original algorithm management table data Tabular data.
可如上S103所述,在此不作赘述。It can be as described in S103 above, and will not be repeated here.
S504:使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功。S504: Make the boot loader jump to the restored running code data for execution, so that the U disk is successfully loaded.
可以发现,在本实施例中,可以使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功,这样的好处是能够在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,能够使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功,能够实现U盘能够恢复到正常的使用状态,保障了U盘的使用寿命。It can be found that in this embodiment, the boot loader can be made to jump to the restored running code data for execution, so that the U disk can be successfully loaded. This has the advantage of being able to load the Boot loader during the boot When the Loader fails to load the running code or the algorithm management table data normally, the Boot Loader can jump to the restored running code data to execute, so that the USB flash drive can be successfully loaded, and the USB flash drive can be restored to the normal state of use , To ensure the service life of the U disk.
本发明还提供一种防止U盘数据丢失和系统损坏的装置,能够实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。The invention also provides a device for preventing U disk data loss and system damage, which can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
请参见图6,图6是本发明防止U盘数据丢失和系统损坏的装置一实施例的结构示意图。本实施例中,该防止U盘数据丢失和系统损坏的装置60包括存储器61和恢复器62。Please refer to FIG. 6. FIG. 6 is a schematic structural diagram of an embodiment of a device for preventing U disk data loss and system damage according to the present invention. In this embodiment, the device 60 for preventing U disk data loss and system damage includes a memory 61 and a restorer 62.
该存储器61,用于将运行代码和原始的算法管理表格数据存储在该一次性可编程OTP存储空间中。The memory 61 is used to store the running code and the original algorithm management table data in the one-time programmable OTP storage space.
该恢复器62,用于在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,从该一次性可编程OTP存储空间中读取出该存储的运行代码数据,并根据该读取出的运行代码数据,恢复出运行代码数据,和从该一次性可编程OTP存储空间中读取出该存储的原始的算法管理表格数据,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。The restorer 62 is used to read the stored operating code data from the one-time programmable OTP storage space when the boot loader normally loads the operating code or the algorithm management table data fails, and reads the stored operating code data according to the read The operating code data is restored, and the stored original algorithm management table data is read from the one-time programmable OTP storage space, and the original algorithm management table data is restored according to the read original algorithm. The original algorithm is used to manage tabular data.
可选地,该恢复器62,可以具体用于:Optionally, the restorer 62 may be specifically used for:
从该一次性可编程OTP存储空间中加载该存储的运行代码数据;Load the stored running code data from the one-time programmable OTP storage space;
从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag;Read the temporary flag TempFlag from the first fixed offset address in the one-time programmable storage space;
判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的运行代码在该一次性可编程OTP存储空间中的起始地址Code_Add和数据长度Code_Len;Determine whether the read temporary flag TempFlag is equal to the flag TableFlg of the loaded table in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space When loading the table flag TableFlg, read the start address Code_Add and the data length Code_Len of the associated running code in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag;
根据该读取出的起始地址Code_Add和数据长度Code_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址Code_Add和数据长度Code_Len的运行代码数据;According to the read start address Code_Add and data length Code_Len, read the running code data associated with the start address Code_Add and the data length Code_Len from the one-time programmable OTP storage space;
直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据该读取出的运行代码数据,恢复出运行代码数据。Until all the running code data pointed to by the fixed offset address in the one-time programmable storage space is read, and the running code data is restored according to the read running code data.
可选地,该恢复器62,可以具体用于:Optionally, the restorer 62 may be specifically used for:
从该一次性可编程OTP存储空间中加载该存储的原始的算法管理表格数据;Load the stored original algorithm management table data from the one-time programmable OTP storage space;
从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag;Read the temporary flag TempFlag from the first fixed offset address in the one-time programmable storage space;
判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的原始的算法管理表格数据在该一次性可编程OTP存储空间中的起始地址TableData_Add和数据长度TableData_Len;Determine whether the read temporary flag TempFlag is equal to the flag TableFlg of the loaded table in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space When loading the tag TableFlg of the table, read the initial address TableData_Add and the data length TableData_Len of the associated original algorithm management table data in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag;
根据该读取出的起始地址TableData_Add和数据长度TableData_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址TableData_Add和数据长度TableData_Len的原始的算法管理表格数据;According to the read start address TableData_Add and data length TableData_Len, read the original algorithm management table data associated with the start address TableData_Add and the data length TableData_Len from the one-time programmable OTP storage space;
直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。Until all the original algorithm management table data pointed to by the fixed offset address in the one-time programmable storage space are read, and the original algorithm management table data is restored according to the read original algorithm management table data.
请参见图7,图7是本发明防止U盘数据丢失和系统损坏的装置另一实施例的结构示意图。区别于上一实施例,本实施例所述防止U盘数据丢失和系统损坏的装置70还包括:执行器71。Please refer to FIG. 7, which is a schematic structural diagram of another embodiment of a device for preventing data loss and system damage of a U disk according to the present invention. Different from the previous embodiment, the device 70 for preventing U disk data loss and system damage described in this embodiment further includes an actuator 71.
该执行器71,用于使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功。The executor 71 is used to make the boot loader jump to the restored running code data for execution, so that the U disk is successfully loaded.
该防止U盘数据丢失和系统损坏的装置60/70的各个单元模块可分别执行上述方法实施例中对应步骤,故在此不对各单元模块进行赘述,详细请参见以上对应步骤的说明。Each unit module of the device 60/70 for preventing U disk data loss and system damage can execute the corresponding steps in the above method embodiment, so each unit module will not be repeated here. For details, please refer to the description of the corresponding steps above.
本发明又提供一种防止U盘数据丢失和系统损坏的设备,如图8所示,包括:至少一个处理器81;以及,与至少一个处理器81通信连接的存储器82;其中,存储器82存储有可被至少一个处理器81执行的指令,指令被至少一个处理器81执行,以使至少一个处理器81能够执行上述的防止U盘数据丢失和系统损坏的方法。The present invention also provides a device for preventing U disk data loss and system damage, as shown in FIG. 8, comprising: at least one processor 81; and a memory 82 communicatively connected with the at least one processor 81; wherein the memory 82 stores There are instructions that can be executed by at least one processor 81, and the instructions are executed by at least one processor 81, so that at least one processor 81 can execute the above-mentioned method for preventing U disk data loss and system damage.
其中,存储器82和处理器81采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器81和存储器82的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器81处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器81。The memory 82 and the processor 81 are connected in a bus manner. The bus may include any number of interconnected buses and bridges, and the bus connects one or more various circuits of the processor 81 and the memory 82 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are all well-known in the art, and therefore, no further description will be given herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium. The data processed by the processor 81 is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor 81.
处理器81负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器82可以被用于存储处理器81在执行操作时所使用的数据。The processor 81 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 82 may be used to store data used by the processor 81 when performing operations.
本发明再提供一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。The present invention further provides a computer-readable storage medium storing a computer program. When the computer program is executed by the processor, the above method embodiment is realized.
可以发现,以上方案,可以在U盘的主控芯片中加入一次性可编程OTP存储空间,和可以将运行代码和原始的算法管理表格数据存储在该一次性可编程OTP存储空间中,以及在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,从该一次性可编程OTP存储空间中读取出该存储的运行代码数据,并根据该读取出的运行代码数据,恢复出运行代码数据,和从该一次性可编程OTP存储空间中读取出该存储的原始的算法管理表格数据,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,能够实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。It can be found that in the above solution, one-time programmable OTP storage space can be added to the main control chip of the U disk, and the running code and original algorithm management table data can be stored in the one-time programmable OTP storage space. When the boot loader fails to load the running code or the algorithm management table data normally, the stored running code data is read from the one-time programmable OTP storage space, and the running code data is restored based on the read running code data Code data, and read the stored original algorithm management table data from the one-time programmable OTP storage space, and restore the original algorithm management table data according to the read original algorithm management table data, It can prevent the U disk from losing the user's original data or the U disk system being damaged and unable to run.
进一步的,以上方案,可以从该一次性可编程OTP存储空间中加载该存储的运行代码数据,从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag,和判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的运行代码在该一次性可编程OTP存储空间中的起始地址Code_Add和数据长度Code_Len,和根据该读取出的起始地址Code_Add和数据长度Code_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址Code_Add和数据长度Code_Len的运行代码数据,以及直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据该读取出的运行代码数据,恢复出运行代码数据,这样的好处是能够通过恢复出运行代码数据的方式,实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。Further, in the above solution, the stored running code data can be loaded from the one-time programmable OTP storage space, the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space, and the judgment Whether the read temporary flag TempFlag is equal to the flag TableFlg of the loading table in the one-time programmable OTP storage space, after judging that the read temporary flag TempFlag is equal to the loading in the one-time programmable OTP storage space When the table is marked with TableFlg, the start address Code_Add and the data length Code_Len of the associated running code in the one-time programmable OTP storage space are read from the address corresponding to the temporary mark TempFlag, and the start address Code_Add and the data length Code_Len are read from the address corresponding to the temporary mark TempFlag. Start address Code_Add and data length Code_Len, read the running code data associated with the start address Code_Add and data length Code_Len from the one-time programmable OTP storage space, and until all fixed offsets in the one-time programmable storage space The running code data pointed to by the address is read out, and the running code data is restored based on the read running code data. The advantage of this is that the running code data can be restored to prevent the user's original data from appearing on the U disk. Lost or damaged U disk system cannot run, etc.
进一步的,以上方案,可以从该一次性可编程OTP存储空间中加载该存储的原始的算法管理表格数据,从一次性可编程存储空间中的第一个固定偏移地址读取出临时标记TempFlag,和判断该读取出的临时标记TempFlag是否等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg,在判断出该读取出的临时标记TempFlag是等于该一次性可编程OTP存储空间中的加载表格的标记TableFlg时,从对应该临时标记TempFlag的地址处读取出关联的原始的算法管理表格数据在该一次性可编程OTP存储空间中的起始地址TableData_Add和数据长度TableData_Len,和根据该读取出的起始地址TableData_Add和数据长度TableData_Len,从该一次性可编程OTP存储空间中读取出关联该起始地址TableData_Add和数据长度TableData_Len的原始的算法管理表格数据,以及直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据该读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,这样的好处是能够通过恢复出原始的算法管理表格数据的方式,实现防止U盘出现用户原有数据丢失或U盘系统损坏无法运行等情况。Further, in the above solution, the stored original algorithm management table data can be loaded from the one-time programmable OTP storage space, and the temporary flag TempFlag can be read from the first fixed offset address in the one-time programmable storage space. , And determine whether the read temporary flag TempFlag is equal to the tag TableFlg of the loading table in the one-time programmable OTP storage space, and determine whether the read temporary flag TempFlag is equal to the one-time programmable OTP storage space When loading the table flag TableFlg in the table, read the associated original algorithm management table data starting address TableData_Add and data length TableData_Len in the one-time programmable OTP storage space from the address corresponding to the temporary flag TempFlag, and According to the read start address TableData_Add and data length TableData_Len, the original algorithm management table data associated with the start address TableData_Add and the data length TableData_Len is read from the one-time programmable OTP storage space, and until one time The original algorithm management table data pointed to by all fixed offset addresses in the flexible programmable storage space are read, and the original algorithm management table data read out is used to restore the original algorithm management table data. The advantage is By recovering the original algorithm to manage the table data, it can prevent the U disk from losing the user's original data or the U disk system is damaged and unable to run.
进一步的,以上方案,可以使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功,这样的好处是能够在引导加载Boot Loader正常加载运行代码或算法管理表格数据失败时,能够使引导加载Boot Loader跳转到该恢复出的运行代码数据中执行,让U盘上盘成功,能够实现U盘能够恢复到正常的使用状态,保障了U盘的使用寿命。Furthermore, the above scheme can make the boot loader jump to the restored running code data and execute it, so that the U disk can be successfully loaded. This has the advantage of being able to load the Boot When the Loader fails to load the running code or the algorithm management table data normally, the Boot Loader can jump to the restored running code data to execute, so that the USB flash drive can be successfully loaded, and the USB flash drive can be restored to the normal state of use , To ensure the service life of the U disk.
在本发明所提供的几个实施方式中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施方式仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several implementation manners provided by the present invention, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device implementation described above is merely illustrative, for example, the division of modules or units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of this embodiment.
另外,在本发明各个实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
以上所述仅为本发明的部分实施例,并非因此限制本发明的保护范围,凡是利用本发明说明书及附图内容所作的等效装置或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only part of the embodiments of the present invention, and do not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made by using the content of the description and drawings of the present invention, or directly or indirectly applied to other related The technical field is also included in the scope of patent protection of the present invention.
工业实用性Industrial applicability
在此处键入工业实用性描述段落。Type a paragraph describing industrial applicability here.
序列表自由内容Sequence Listing Free Content
在此处键入序列表自由内容描述段落。Type here the free content description paragraph of the sequence listing.

Claims (10)

  1. 一种防止U盘数据丢失和系统损坏的方法,其特征在于,包括:A method for preventing U disk data loss and system damage, characterized in that it includes:
    在U盘的主控芯片中加入一次性可编程存储空间;Add one-time programmable storage space to the main control chip of the U disk;
    将运行代码和原始的算法管理表格数据存储在所述一次性可编程存储空间中;Storing running code and original algorithm management table data in the one-time programmable storage space;
    在引导加载正常加载运行代码或算法管理表格数据失败时,从所述一次性可编程存储空间中读取出所述存储的运行代码数据,并根据所述读取出的运行代码数据,恢复出运行代码数据,和从所述一次性可编程存储空间中读取出所述存储的原始的算法管理表格数据,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。When the boot load fails to load the running code or the algorithm management table data normally, the stored running code data is read from the one-time programmable storage space, and the running code data is restored based on the read running code data. Run code data, read the stored original algorithm management table data from the one-time programmable storage space, and restore the original algorithm management table data according to the read original algorithm management table data Tabular data.
  2. 如权利要求1所述的防止U盘数据丢失和系统损坏的方法,其特征在于,所述从所述一次性可编程存储空间中读取出所述存储的运行代码数据,并根据所述读取出的运行代码数据,恢复出运行代码数据,包括:The method for preventing U disk data loss and system damage according to claim 1, characterized in that, the stored running code data is read from the one-time programmable storage space, and according to the read The running code data taken out, the running code data is restored, including:
    从所述一次性可编程存储空间中加载所述存储的运行代码数据;Loading the stored running code data from the one-time programmable storage space;
    从所述一次性可编程存储空间中的第一个固定偏移地址读出临时标记;Reading out the temporary mark from the first fixed offset address in the one-time programmable storage space;
    判断所述读取出的临时标记是否于所述一次性可编程存储空间中的加载表格的标记,在判断出所述读取出的临时标记是于所述一次性可编程存储空间中的加载表格的标记时,从对应所述临时标记的地址处读取出关联的运行代码在所述一次性可编程存储空间中的起始地址和数据长度;It is judged whether the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space When the table is marked, the start address and data length of the associated running code in the one-time programmable storage space are read from the address corresponding to the temporary mark;
    根据所述读取出的起始地址和数据长度,从所述一次性可编程存储空间中读取出关联所述起始地址和数据长度的运行代码数据;Read out the running code data associated with the start address and the data length from the one-time programmable storage space according to the read start address and data length;
    直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据所述读取出的运行代码数据,恢复出运行代码数据。Until all the running code data pointed to by the fixed offset address in the one-time programmable storage space are read, and the running code data is restored according to the read running code data.
  3. 如权利要求1所述的防止U盘数据丢失和系统损坏的方法,其特征在于,所述从所述一次性可编程存储空间中读取出所述存储的原始的算法管理表格数据,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据,包括:The method for preventing U disk data loss and system damage according to claim 1, wherein the stored original algorithm management table data is read from the one-time programmable storage space, and the data is managed according to The original algorithm management table data read out and the original algorithm management table data are restored, including:
    从所述一次性可编程存储空间中加载所述存储的原始的算法管理表格数据;Loading the stored original algorithm management table data from the one-time programmable storage space;
    从所述一次性可编程存储空间中的第一个固定偏移地址读出临时标记;Reading out the temporary mark from the first fixed offset address in the one-time programmable storage space;
    判断所述读取出的临时标记是否于所述一次性可编程存储空间中的加载表格的标记,在判断出所述读取出的临时标记是于所述一次性可编程存储空间中的加载表格的标记时,从对应所述临时标记的地址处读取出关联的原始的算法管理表格数据在所述一次性可编程存储空间中的起始地址和数据长度;It is judged whether the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space When the table is marked, the start address and data length of the associated original algorithm management table data in the one-time programmable storage space are read from the address corresponding to the temporary mark;
    根据所述读取出的起始地址和数据长度,从所述一次性可编程存储空间中读取出关联所述起始地址和数据长度的原始的算法管理表格数据;According to the read start address and data length, read out the original algorithm management table data associated with the start address and data length from the one-time programmable storage space;
    直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。Until all the original algorithm management table data pointed to by the fixed offset address in the one-time programmable storage space are read, and the original algorithm management table data is restored according to the read original algorithm management table data.
  4. 如权利要求1所述的防止U盘数据丢失和系统损坏的方法,其特征在于,在所述在引导加载正常加载运行代码或算法管理表格数据失败时,从所述一次性可编程存储空间中读取出所述存储的运行代码数据,并根据所述读取出的运行代码数据,恢复出运行代码数据,和从所述一次性可编程存储空间中读取出所述存储的原始的算法管理表格数据,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据之后,还包括:The method for preventing U disk data loss and system damage according to claim 1, wherein when the boot loading fails to load the running code or the algorithm management table data normally, the one-time programmable storage space Read the stored operating code data, restore the operating code data based on the read operating code data, and read the stored original algorithm from the one-time programmable storage space Manage the table data, and manage the table data according to the read original algorithm management table data. After the original algorithm management table data is restored, it also includes:
    使引导加载跳转到所述恢复出的运行代码数据中执行,让U盘上盘成功。The boot load jumps to the restored running code data for execution, so that the U disk is successfully loaded.
  5. 一种防止U盘数据丢失和系统损坏的装置,其特征在于,包括:A device for preventing U disk data loss and system damage is characterized in that it includes:
    存储器和恢复器;Storage and restorer;
    所述存储器,用于将运行代码和原始的算法管理表格数据存储在所述一次性可编程存储空间中;The memory is used to store running code and original algorithm management table data in the one-time programmable storage space;
    所述恢复器,用于在引导加载正常加载运行代码或算法管理表格数据失败时,从所述一次性可编程存储空间中读取出所述存储的运行代码数据,并根据所述读取出的运行代码数据,恢复出运行代码数据,和从所述一次性可编程存储空间中读取出所述存储的原始的算法管理表格数据,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。The restorer is used to read the stored running code data from the one-time programmable storage space when the boot load normally loads the running code or the algorithm management table data fails, and reads out the running code data according to the read The operating code data is restored, the operating code data is restored, and the stored original algorithm management table data is read from the one-time programmable storage space, and the original algorithm management table data is read out according to the original algorithm , Restore the original algorithm management table data.
  6. 如权利要求5所述的防止U盘数据丢失和系统损坏的装置,其特征在于,所述恢复器,具体用于:The device for preventing U disk data loss and system damage according to claim 5, wherein the restorer is specifically used for:
    从所述一次性可编程存储空间中加载所述存储的运行代码数据;Loading the stored running code data from the one-time programmable storage space;
    从所述一次性可编程存储空间中的第一个固定偏移地址读出临时标记;Reading out the temporary mark from the first fixed offset address in the one-time programmable storage space;
    判断所述读取出的临时标记是否于所述一次性可编程存储空间中的加载表格的标记,在判断出所述读取出的临时标记是于所述一次性可编程存储空间中的加载表格的标记时,从对应所述临时标记的地址处读取出关联的运行代码在所述一次性可编程存储空间中的起始地址和数据长度;It is judged whether the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space When the table is marked, the start address and data length of the associated running code in the one-time programmable storage space are read from the address corresponding to the temporary mark;
    根据所述读取出的起始地址和数据长度,从所述一次性可编程存储空间中读取出关联所述起始地址和数据长度的运行代码数据;Read out the running code data associated with the start address and the data length from the one-time programmable storage space according to the read start address and data length;
    直到在一次性可编程存储空间中所有固定偏移地址指向的运行代码数据被读出,并根据所述读取出的运行代码数据,恢复出运行代码数据。Until all the running code data pointed to by the fixed offset address in the one-time programmable storage space are read, and the running code data is restored according to the read running code data.
  7. 如权利要求5所述的防止U盘数据丢失和系统损坏的装置,其特征在于,所述恢复器,具体用于:The device for preventing U disk data loss and system damage according to claim 5, wherein the restorer is specifically used for:
    从所述一次性可编程存储空间中加载所述存储的原始的算法管理表格数据;Loading the stored original algorithm management table data from the one-time programmable storage space;
    从所述一次性可编程存储空间中的第一个固定偏移地址读出临时标记;Reading out the temporary mark from the first fixed offset address in the one-time programmable storage space;
    判断所述读取出的临时标记是否于所述一次性可编程存储空间中的加载表格的标记,在判断出所述读取出的临时标记是于所述一次性可编程存储空间中的加载表格的标记时,从对应所述临时标记的地址处读取出关联的原始的算法管理表格数据在所述一次性可编程存储空间中的起始地址和数据长度;It is judged whether the read temporary mark is the mark of the loading table in the one-time programmable storage space, and after judging that the read temporary mark is the loading in the one-time programmable storage space When the table is marked, the start address and data length of the associated original algorithm management table data in the one-time programmable storage space are read from the address corresponding to the temporary mark;
    根据所述读取出的起始地址和数据长度,从所述一次性可编程存储空间中读取出关联所述起始地址和数据长度的原始的算法管理表格数据;According to the read start address and data length, read out the original algorithm management table data associated with the start address and data length from the one-time programmable storage space;
    直到在一次性可编程存储空间中所有固定偏移地址指向的原始的算法管理表格数据被读出,并根据所述读取出的原始的算法管理表格数据,恢复出原始的算法管理表格数据。Until all the original algorithm management table data pointed to by the fixed offset address in the one-time programmable storage space are read, and the original algorithm management table data is restored according to the read original algorithm management table data.
  8. 如权利要求5所述的防止U盘数据丢失和系统损坏的装置,其特征在于,所述防止U盘数据丢失和系统损坏的装置,还包括:The device for preventing data loss and system damage of a U disk according to claim 5, wherein the device for preventing data loss and system damage of a U disk further comprises:
    执行器,用于使引导加载跳转到所述恢复出的运行代码数据中执行,让U盘上盘成功。The executor is used to make the boot loading jump to the restored running code data for execution, so that the U disk is successfully loaded.
  9. 一种防止U盘数据丢失和系统损坏的设备,其特征在于,包括:A device for preventing U disk data loss and system damage is characterized in that it includes:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至4中任一项所述的防止U盘数据丢失和系统损坏的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute any one of claims 1 to 4 The method described to prevent data loss and system damage of U disk.
  10. 一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至4中任一项所述的防止U盘数据丢失和系统损坏的方法。A computer-readable storage medium storing a computer program, wherein the computer program implements the method for preventing data loss and system damage of a U disk according to any one of claims 1 to 4 when the computer program is executed by a processor.
PCT/CN2019/086145 2019-05-09 2019-05-09 Method, apparatus and device for preventing data loss and system damage of usb flash disk WO2020223950A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/086145 WO2020223950A1 (en) 2019-05-09 2019-05-09 Method, apparatus and device for preventing data loss and system damage of usb flash disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/086145 WO2020223950A1 (en) 2019-05-09 2019-05-09 Method, apparatus and device for preventing data loss and system damage of usb flash disk

Publications (1)

Publication Number Publication Date
WO2020223950A1 true WO2020223950A1 (en) 2020-11-12

Family

ID=73051274

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/086145 WO2020223950A1 (en) 2019-05-09 2019-05-09 Method, apparatus and device for preventing data loss and system damage of usb flash disk

Country Status (1)

Country Link
WO (1) WO2020223950A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103279705A (en) * 2013-05-14 2013-09-04 上海华为技术有限公司 Validation method and validation device of chip with secure booting function
US20150067313A1 (en) * 2013-08-30 2015-03-05 Asim A. Zaidi Systems and methods for secure boot rom patch
CN104981778A (en) * 2013-02-22 2015-10-14 马维尔国际贸易有限公司 Patching boot code of read-only memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104981778A (en) * 2013-02-22 2015-10-14 马维尔国际贸易有限公司 Patching boot code of read-only memory
CN103279705A (en) * 2013-05-14 2013-09-04 上海华为技术有限公司 Validation method and validation device of chip with secure booting function
US20150067313A1 (en) * 2013-08-30 2015-03-05 Asim A. Zaidi Systems and methods for secure boot rom patch

Similar Documents

Publication Publication Date Title
JP3233079B2 (en) Data processing system and data processing method
US20070055969A1 (en) System and method for updating firmware
US8812910B2 (en) Pilot process method for system boot and associated apparatus
CN109032632B (en) FOTA upgrading method, wireless communication terminal and storage medium
WO2011024688A1 (en) Firmware update system, and information apparatus, as well as program
US20090094450A1 (en) Firmware image update and management
CN113626256B (en) Virtual machine disk data backup method, device, terminal and storage medium
CN109062600B (en) Method and system for realizing online upgrade of firmware in solid state disk
JP2004234052A (en) Storage device
US10235048B2 (en) Data processing method and smart device
CN101373433A (en) Method for updating BIOS and computer and system using the same
CN107566169A (en) A kind of firmware upgrade method and router based on openwrt
US7257030B2 (en) Operating a storage component
WO2020223950A1 (en) Method, apparatus and device for preventing data loss and system damage of usb flash disk
CN110333967B (en) Method, device and equipment for preventing USB flash disk data loss and system damage
CN107422987B (en) Method and device for storing data in nonvolatile memory
JP7004033B1 (en) Storage equipment, storage systems, control methods and programs
JP3620478B2 (en) Storage device, data processing system using the storage device, and data read method
JP3376331B2 (en) Storage method using flash memory and storage medium storing storage control program
CN115562593A (en) Abnormal RAID member disk processing method, device and medium
JP4127307B2 (en) Data storage device, data processing system, data processing method, and data processing device
CN112905112B (en) Data processing method and system of embedded equipment
CN110554934B (en) Embedded equipment and system partitioning and upgrading method thereof
CN110321073B (en) Data storage method, device and equipment of flash memory
CN102023906A (en) Microprocessor of portable terminal as well as portable terminal and repair method thereof

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19927621

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19927621

Country of ref document: EP

Kind code of ref document: A1

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 200722)

122 Ep: pct application non-entry in european phase

Ref document number: 19927621

Country of ref document: EP

Kind code of ref document: A1