Data protection method, electronic equipment and storage medium

By backing up important data in the hidden space of storage devices, the problem that the prior art cannot target the reliability of individual data is solved, efficient protection of individual data is achieved, and the impact on the performance and capacity of storage devices is reduced.

CN120046206APending Publication Date: 2025-05-27SHENZHEN LONGSYS ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311611100.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-27
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The prior art cannot target the reliability of individual important data in storage devices, and when adding redundant space to improve protection capabilities, it will lead to significant losses in performance and capacity.

Method used

By backing up data that needs key protection in the hidden space of the storage device, and using the data backup instructions sent by the control terminal to store the data in a hidden space that is inaccessible to the user, targeted protection of individual data is achieved.

Benefits of technology

It realizes targeted protection of individual data in storage devices, reduces the impact on the performance and capacity of storage devices, ensures the normal operation of storage devices, and avoids the overhead caused by redundant space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046206A_ABST
    Figure CN120046206A_ABST
Patent Text Reader

Abstract

The invention discloses a data protection method, electronic equipment and a storage medium. The data protection method comprises the steps that the storage device receives a data backup instruction of first data sent by the control terminal; and backing up the first data to a hidden space of the storage device for protection based on the data backup instruction. According to the scheme, specific protection of individual data in the storage equipment can be realized, and the overhead influence on the storage equipment is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technology, and particularly to a method for protecting data, an electronic device, and a storage medium. Background Art

[0002] Data reliability has always been an issue that storage devices need to address. Due to the characteristics of the storage device's particles, there is always a certain probability that the data stored therein will be incorrect.

[0003] To improve the data reliability of storage devices, the mainstream method in the market is to exclusively allocate a part of the physical capacity in the storage device to store parity check information of the data written in other spaces. When data errors occur, the damaged data can be attempted to be reconstructed through the parity check information.

[0004] However, the global data protection ability of the above method is equal, and for individual crucial data stored in the storage device, its reliability cannot be specifically improved. If the overall protection ability is improved by increasing the redundant space, the loss of performance and capacity will increase significantly, resulting in a huge overhead, but the improvement in the protection effect obtained is not significant. Summary of the Invention

[0005] The main technical problem to be solved by this application is to provide a method for protecting data, an electronic device, and a storage medium to solve the problem of being unable to specifically protect individual data in a storage device.

[0006] To solve the above problem, in the first aspect of this application, a method for protecting data is provided, including that a storage device receives a data backup instruction of first data sent by a control terminal; and based on the data backup instruction, the first data is backed up to a hidden space in the storage device for protection.

[0007] Wherein, the data backup instruction of the first data includes: the original storage start address of the first data, the logical length of the first data, and the backup mode of the first data; the step of backing up the first data to a hidden space in the storage device for protection includes: based on the original storage start address and the logical length of the first data, storing the first data in the hidden space according to the backup mode.

[0008] Wherein, after the step of storing the first data in the hidden space according to the backup mode, it includes: creating a file of the first data in the backup table of the hidden space, and the file includes the original storage start address of the first data, the backup storage address, the backup mode, the logical length, and the sequence number in the backup table.

[0009] Among them, the step that the storage device receives the data backup instruction of the first data sent by the control terminal further includes: The storage device receives the backup space query instruction of the first data sent by the control terminal, and queries whether the hidden space of the storage device is sufficient to store the first data; if it is sufficient, the storage device sends a storage available instruction to the control terminal and receives the data backup instruction of the first data sent by the control terminal.

[0010] Among them, the step of querying whether the hidden space of the storage device is sufficient to store the first data includes: traversing the backup table and accumulating the total logical length of all data in the backup table; subtracting the length of the necessary space and the total logical length from the length of the hidden space to obtain the available space length; when the available space length is greater than or equal to the logical length of the first data, it is determined that the hidden space is sufficient to store the first data; when the available space length is less than the logical length of the first data, it is determined that the hidden space is not sufficient to store the first data.

[0011] Among them, the step of querying whether the hidden space of the storage device is sufficient to store the first data further includes: if it is not sufficient, the storage device sends a non-storage available instruction to the control terminal and receives the query backup table instruction sent by the control terminal, obtains the backup table and sends the backup table to the control terminal; receives the deletion instruction of the second data sent by the control terminal based on the backup table, obtains the backup storage address of the second data from the backup table, deletes the second data stored in the hidden space, and receives the data backup instruction of the first data sent by the control terminal.

[0012] Among them, the step of obtaining the backup storage address of the second data from the backup table and deleting the second data stored in the hidden space includes: obtaining the backup storage address and logical length of the second data from the backup table, releasing the backup space corresponding to the second data based on the backup storage address and logical length of the second data, and deleting the arrangement serial number corresponding to the second data in the backup table.

[0013] Among them, the data protection method further includes: receiving the read instruction of the target data sent by the control terminal; if the target data reading fails, querying from the backup table whether the target data has been backed up, if the target data has been backed up, then querying the backup storage address of the target data from the backup table, reading the target data from the backup storage address and sending it to the control terminal.

[0014] To solve the above problems, the second aspect of the present application provides a data protection method, including: the control terminal determines to protect the first data; sends a data backup instruction of the first data to the storage device, so that the first data is backed up into the hidden space for protection based on the data backup instruction.

[0015] To solve the above technical problems, a third aspect of the present invention further provides an electronic device, including a memory and a processor coupled to each other. The processor is configured to execute program instructions stored in the memory to implement the data protection method as described in any one of the above.

[0016] To solve the above technical problems, a fourth aspect of the present invention further provides a computer-readable storage medium, on which program instructions are stored. When the program instructions are executed by a processor, the data protection method as described in any one of the above is implemented.

[0017] The beneficial effects of the present invention are as follows: Different from the prior art, the present application receives a data backup instruction of the first data sent by the control terminal through a storage device; based on the data backup instruction, the first data is backed up to a hidden space of the storage device for protection, so as to achieve targeted protection of the first data. And backing up the first data to a hidden space that is inaccessible to the user can reduce the impact on the performance and capacity of the storage device, ensure the normal operation of the storage device, so that both targeted protection of individual data in the storage device can be achieved and the overhead impact on the storage device can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a schematic flowchart of a first embodiment of the data protection method of the present application;

[0019] Figure 2 is a schematic flowchart of a second embodiment of the data protection method of the present application;

[0020] Figure 3 is a schematic flowchart of a third embodiment of the data protection method of the present application;

[0021] Figure 4 is a schematic diagram of an implementation manner of a space for storing backup data in a hidden space;

[0022] Figure 5 is Figure 3 a schematic diagram of the structure of a transmission network in an implementation manner in an embodiment;

[0023] Figure 6 is Figure 5 a data flow diagram of data transmission among terminals in a transmission network in an application scenario;

[0024] Figure 7 is a schematic framework diagram of an embodiment of the electronic device of the present application;

[0025] Figure 8 is a schematic framework diagram of an embodiment of the computer-readable storage medium of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] The following will describe in detail the solutions of the embodiments of the present application with reference to the accompanying drawings of the specification.

[0027] In the following description, specific details such as specific system structures, interfaces, and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the present application.

[0028] The terms "system" and "network" in this article are often used interchangeably in this article. The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: the existence of A alone, the simultaneous existence of A and B, and the existence of B alone. In addition, the character " / " in this article generally represents an "or" relationship between the preceding and following associated objects. In addition, "multiple" in this article means two or more than two.

[0029] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the first embodiment of the data protection method of the present application. This embodiment is applied to the storage device side. The data protection method in this embodiment specifically includes the following steps:

[0030] Step S11: The storage device receives a data backup instruction for the first data sent by the control terminal.

[0031] The storage device includes but is not limited to a solid-state drive SSD, a storage device with the Universal Flash Storage (UFS) standard, a storage device with the Embedded Multi Media Card (eMMC) standard specification, an SD memory card, a USB flash drive, and so on.

[0032] The control terminal is the host side, and the control terminal can include but is not limited to host devices such as a PC computer, a camera, a game console, a video recorder, or a mobile terminal.

[0033] The first data is the data that needs to be protected with emphasis in the storage device, and it can currently be stored in the user space of the storage device. The first data can specifically include but is not limited to partition table information, OS logs, office documents, bank card passwords, and so on.

[0034] This embodiment performs targeted protection by backing up the first data separately.

[0035] Step S12: Based on the data backup instruction, back up the first data to the hidden space of the storage device for protection.

[0036] The hidden space of the storage device is the over-provisioning (OP) space reserved for the network of the storage device, which refers to the hidden space inside the storage device that is controlled by firmware and inaccessible to users. The user space refers to the dedicated storage space accessible to users within the storage device.

[0037] When it is necessary to protect the first data with high priority, in this embodiment, the first data is protected by separately backing it up in the hidden space. The storage device receives the data backup instruction of the first data sent by the control terminal, and based on the data backup instruction, backs up the first data into the hidden space for protection. Thus, by separately backing up the first data already stored in the user space into the hidden space, when the first data in the user space cannot be read, the first data backed up in the hidden space can be used to achieve its reading, thereby realizing the targeted protection of the first data. Moreover, backing up the first data into the hidden space inaccessible to users can reduce the impact on the performance and capacity of the storage device and ensure the normal operation of the storage device.

[0038] Through the above steps, the data protection method in this embodiment is as follows: the storage device receives the data backup instruction of the first data sent by the control terminal; based on the data backup instruction, backs up the first data into the hidden space of the storage device for protection, thereby realizing the targeted protection of the first data. Moreover, backing up the first data into the hidden space inaccessible to users can reduce the impact on the performance and capacity of the storage device and ensure the normal operation of the storage device, so that both the targeted protection of individual data in the storage device can be realized and the overhead impact on the storage device can be reduced.

[0039] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the second embodiment of the data protection method of this application. This embodiment is applied to the control terminal. The data protection method in this embodiment specifically includes the following steps:

[0040] Step S21: The control terminal determines to protect the first data.

[0041] The control terminal is the host terminal, and the control terminal may include, but is not limited to, host devices such as a PC computer, a camera, a game console, a video recorder, or a mobile terminal.

[0042] Step S22: Send a data backup instruction of the first data to the storage device, so that based on the data backup instruction, the first data is backed up into the hidden space for protection.

[0043] When it is necessary to protect the first data with high priority, in this embodiment, the first data is protected by separately backing it up in a hidden space. Specifically, a data backup instruction for the first data is sent to the storage device, so that based on the data backup instruction, the first data is backed up to the hidden space for protection.

[0044] The control terminal sends a data backup instruction for the first data to the storage device, so that based on the data backup instruction, the first data is backed up to the hidden space for protection. Thus, by separately backing up the first data that has been stored in the user space to the hidden space, when the first data in the user space cannot be read, it can be read through the first data backed up in the hidden space, thereby achieving targeted protection of the first data. And backing up the first data to a hidden space that is inaccessible to users can reduce the impact on the performance and capacity of the storage device and ensure the normal operation of the storage device.

[0045] Through the above steps, the data protection method in this embodiment determines to protect the first data through the control terminal; sends a data backup instruction for the first data to the storage device, so that based on the data backup instruction, the first data is backed up to the hidden space for protection, thereby achieving targeted protection of the first data. And backing up the first data to a hidden space that is inaccessible to users can reduce the impact on the performance and capacity of the storage device and ensure the normal operation of the storage device, so that both targeted protection of individual data in the storage device can be achieved and the impact on the storage device overhead can be reduced.

[0046] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of the third embodiment of the data protection method of this application. This embodiment is applied to the storage device side. The data protection method in this embodiment specifically includes the following steps:

[0047] Step S31: The storage device receives a backup space query instruction for the first data sent by the control terminal, traverses the backup table, and accumulates the total logical length of all data in the backup table; subtracts the length of the necessary space from the length of the hidden space, and then subtracts the total logical length to obtain the available space length.

[0048] The storage device in this embodiment provides available physical space for backup data by consuming the surplus hidden space. The hidden space is the OP reserved space, with the English name Over-provisioning (network reserved space), which refers to the hidden space inside the storage device that is controlled by the firmware and is inaccessible to users.

[0049] Please refer to Figure 4 , Figure 4 which is a schematic diagram of an implementation manner of the space in the hidden space for storing backup data.

[0050] The entire storage space 40 of the storage device includes a user space 41 and a hidden space 42. Among them, when the storage device is just out of the factory, the available user space 41 is CAP_DEFAULT, and the size of the hidden space 42 is OP_TOTAL. The initial size OP_TOTAL of the equipped hidden space 42 enables the storage device to have the best performance. In fact, by using the OP space of the storage device, a larger available logical space can be obtained for the storage device for backup. There is a minimum OP threshold (command: OP_MIN), that is, the necessary space 44, in the storage device to ensure the basic functions of the hidden space 42 of the storage device. As long as the necessary space 44 in the hidden space 42 of the storage device is equal to OP_MIN, then a backup space 43 can be vacated in the hidden space 42 for data backup. Based on this theory, it can be obtained that the backup space 43 available for data backup in the storage device is the hidden space 42 minus the necessary space 44.

[0051] That is, in this embodiment, the backup data is stored through the backup space 43, while the user space 41 remains unchanged, thereby reducing the impact of data backup on the performance and capacity of the storage device and ensuring that the storage function of the storage device is not affected.

[0052] After determining the backup space for data backup, when the control terminal attempts to back up the first data, the control terminal sends a backup space query instruction for the first data to the storage device. The storage device receives the backup space query instruction for the first data sent by the control terminal, traverses the backup table, and accumulates the total logical length of all data in the backup table.

[0053] In a specific application scenario, there is a backup table (BACKUP_LIST_INSIDE) in the firmware of the storage device, which records the currently effective backup data. The format and content can be as follows:

[0054]

[0055] The backup table stores the original storage start address, backup storage address, backup mode, logical length, and arrangement serial number in the backup table of the backup data. Among them, the original storage start address refers to the storage start address of the data in the user space 41, and the backup address refers to the storage address of the backup of the data in the backup space 43. The backup mode refers to the protection ability of the data, whether it is saved in the SLC (Single-Level Cell) mode or the XLC mode. The XLC mode includes but is not limited to MLC (Multi-Level Cell), TLC (Triple-Level Cell), QLC (Quadruple-Level Cell), etc. It is selected according to the desired backup quality. If the data needs to be backed up with the highest reliability, the SLC mode is selected, but the storage device will consume twice the backup space (2 times for MLC, 3 times for TLC, 4 times for QLC, etc.). However, as long as the backup space is sufficient, the data at the same address is allowed to be backed up multiple times. In other embodiments, the backup table may further include other parameters, but at least the original storage address and backup address of the data need to be included, which are not specifically limited here. The backup table can be stored in the backup space or in the firmware.

[0056] The storage device receives the backup space query instruction of the first data sent by the control terminal, traverses the backup table, and accumulates the total logical length of all data in the backup table. In a specific application scenario, if the backed-up data includes Data 1 with a length of LENGTH_X, Data 2 with a length of LENGTH_Y, and Data 3 with a length of LENGTH_Z, then the total logical length LS of all data in the backup table is LS = LENGTH_X + LENGTH_Y + LENGTH_Z. Then the available logical block number AVAILBLE_SPACE in the current backup space is equal to the difference between the backup space 43 and the total logical length LS. The calculation method of the total logical length LS is similar to this and is not limited here.

[0057] After obtaining the total logical length LS, subtract the length of the necessary space 44 from the length of the hidden space 42, and then subtract the total logical length LS to obtain the available space length.

[0058] Step S32: When the available space length is greater than or equal to the logical length of the first data, it is determined that the hidden space is sufficient to store the first data; when the available space length is less than the logical length of the first data, it is determined that the hidden space is not sufficient to store the first data.

[0059] Step S33: If it is sufficient, the storage device sends a storage available instruction to the control terminal, receives the data backup instruction of the first data sent by the control terminal, and stores the first data into the hidden space according to the backup mode based on the original storage start address and logical length of the first data.

[0060] If the hidden space is sufficient to store the first data, the storage device sends a storable instruction to the control terminal. After receiving the storable instruction, the control terminal sends a data backup instruction for the first data to the storage device. The data backup instruction for the first data includes: the original storage start address of the first data, the logical length of the first data, and the backup mode of the first data.

[0061] After receiving the data backup instruction for the first data sent by the control terminal, the storage device stores the first data into the hidden space according to the backup mode based on the original storage start address and the logical length of the first data. Specifically, the firmware of the storage device reads the first data from the user space 41 based on the original storage start address of the first data, then reallocates a new logical address (backup storage address) in the backup space 43, and calls the write interface to write the data to the new address according to the backup mode, realizing data backup. If backing up in the SLC mode, the data is written to the SLC physical block. If backing up in the XLC mode, the data is written to the XLC physical block, thus completing the backup of the first data.

[0062] Step S34: Create a file for the first data in the backup table in the hidden space. The file includes the original storage start address of the first data, the backup storage address, the backup mode, the logical length, and the sequence number in the backup table.

[0063] After the backup of the first data is completed, create a file for the first data in the backup table in the hidden space. The file includes the original storage start address of the first data, the backup storage address, the backup mode, the logical length, and the sequence number in the backup table.

[0064] In a specific application scenario, after the file is created, the sequence number of the first data in the backup table can be sent to the control terminal for management.

[0065] Step S35: If not sufficient, the storage device sends a non-storable instruction to the control terminal, and receives the query backup table instruction sent by the control terminal, obtains the backup table and sends the backup table to the control terminal.

[0066] If the hidden space is not sufficient to store the first data, the storage device sends a non-storable instruction to the control terminal. After receiving the non-storable instruction, the control terminal sends a query backup table instruction to the storage device. The storage device receives the query backup table instruction sent by the control terminal, obtains the backup table and sends the backup table to the control terminal.

[0067] Among them, since the information of the backup storage address in the backup table is only meaningful to the firmware inside the storage device, therefore, after deleting the "backup storage address" column in the backup table, it can be returned to the control terminal.

[0068] After the control terminal receives the backup table, it determines the second data that can be deleted in the backup table, and releases space by deleting the second data so that the first data can be backed up and stored. Among them, the determination of the second data can be determined manually, by the logical length of the data, or by the storage time. For example: determining the data with the longest logical length as the second data, determining the data with the longest storage time as the second data, etc., which are not limited here. Among them, the logical length of the second data needs to be greater than or equal to the logical length of the first data in order to free up enough space for the first data to be backed up and stored.

[0069] After the second data is determined, the control terminal sends a deletion instruction for the second data to the storage device.

[0070] Step S36: Receive the deletion instruction for the second data sent by the control terminal based on the backup table, obtain the backup storage address of the second data from the backup table, and delete the second data stored in the hidden space.

[0071] The storage device receives the deletion instruction for the second data sent by the control terminal based on the backup table. Among them, the deletion instruction for the second data may include the arrangement serial number of the second data or the original storage start address, etc. The storage device obtains the backup storage address of the second data from the backup table based on the arrangement serial number or the original storage start address of the second data, and deletes the second data stored in the hidden space.

[0072] Specifically, the storage device obtains the backup storage address and logical length of the second data from the backup table, releases the backup space corresponding to the second data based on the backup storage address and logical length of the second data, and deletes the arrangement serial number corresponding to the second data in the backup table.

[0073] In a specific application scenario, before the storage device receives the deletion instruction for the second data with the arrangement serial number of 0, a backup table of an implementation method is as follows:

[0074]

[0075] The firmware of the storage device obtains the backup storage address LBA_A and logical length LENGTH_X of the second data with the arrangement serial number of 0 from the backup table, initiates a TRIM operation on this position, and can release the corresponding logical space and physical space. Then delete the row corresponding to the serial number, and re-arrange the remaining arrangement serial numbers in sequence. Among them, the TRIM operation can map the corresponding mapping and release the physical space.

[0076] The updated backup table is as follows:

[0077]

[0078]

[0079] After deleting the second data stored in the hidden space, the control terminal sends a data backup instruction for the first data to the storage device. The storage device receives the data backup instruction for the first data sent by the control terminal and backs up the first data to the hidden space for protection based on the data backup instruction. Thus, the first data can be backed up to the hidden space. For the specific backup method of the first data, refer to the foregoing step S33, which will not be elaborated here.

[0080] Step S37: Receive the data backup instruction for the first data sent by the control terminal; based on the data backup instruction, back up the first data to the hidden space of the storage device for protection.

[0081] For the specific backup method of this embodiment, refer to steps S33 - S34, which will not be elaborated here.

[0082] In a specific application scenario, the definitions of the instructions are as follows: The data backup instruction is SET_DATA_BACKUP. The original storage start address is LBA_START, the logical length is LBA_LENGTH, and the backup mode is BACKUP_MODE. Among them, the non - storable instruction can be represented by - 1, and the storable instruction can be represented by 0. The backup space query instruction is GET_BACKUP_SPACE, the available space length is AVAILBLE_SPACE, the query backup table instruction is GET_BACKUP_LIST, the backup table is BACKUP_LIST, the delete instruction is DELETE_BACKUP_SECTION, and the second data is SECTION_SEL.

[0083] In a specific application scenario, the data protection method further includes: receiving a read instruction for the target data sent by the control terminal; if the read of the target data fails, query the backup table to check if the target data has been backed up. If the target data has been backed up, query the backup storage address of the target data from the backup table, read the target data from the backup storage address, and send it to the control terminal. By backing up the data, when the read of the target data in the user space fails, the read of the target data in the backup space can be used to complete this read, thereby achieving targeted protection of the target data.

[0084] In a specific application scenario, when the storage device reads a logical address, such as LBA_Y, and a read failure occurs, a data recovery process is triggered: the storage device searches in the backup table (BACKUP_LIST_INSIDE) to check if the data at the LBA_Y address has ever been backed up. If so, it finds the reallocated address LBA_B in the table and then reads the data at LBA_B. If the read of LBA_B is successful, the data recovery is successful, and the storage device returns the data at LBA_B to the control terminal as the content of LBA_Y. If the read of LBA_B also fails, it continues to search the backup table (BACKUP_LIST_INSIDE) until no available segment can be found. After the data recovery takes effect, the storage device rewrites the data at the original storage address to ensure the reliability of the original data.

[0085] Please refer to Figure 5-6 , Figure 5 is Figure 3 The structural schematic diagram of the transmission network of an embodiment in the embodiments. Figure 6 is Figure 5 The data flow diagram of data transmission among terminals in the transmission network in the application scenario.

[0086] The transmission network 40 of this embodiment includes a control terminal 41 and a storage device 42, and the control terminal 41 is signal-connected to the storage device 42.

[0087] When protecting the first data, the control terminal 41 sends a backup space query instruction for the first data to the storage device 42. After receiving the backup space query instruction, the storage device 42 checks if the hidden space of the storage device 42 is sufficient to store the first data.

[0088] If it is sufficient, the storage device 42 sends a storable instruction to the control terminal 41. After receiving the storable instruction, the control terminal 41 sends a data backup instruction for the first data to the storage device 42. After receiving the data backup instruction, the storage device 42 stores the first data in the hidden space based on the data backup instruction for the first data and creates a file for the first data in the backup table in the hidden space.

[0089] If it is not sufficient, the storage device 42 sends a non-storable instruction to the control terminal 41. After receiving the non-storable instruction, the control terminal 41 sends a query backup table instruction to the storage device 42. After receiving the query backup table instruction, the storage device 42 obtains the backup table and sends the backup table to the control terminal 41. After receiving the backup table, the control terminal 41 sends a deletion instruction for the second data to the storage device 42 based on the backup table. After receiving the deletion instruction, the storage device obtains the backup storage address of the second data from the backup table and deletes the second data stored in the hidden space.

[0090] After deleting the second data, the control terminal 41 sends a data backup instruction of the first data to the storage device 42. The storage device 42 stores the first data in the hidden space based on the data backup instruction of the first data, and creates a file of the first data in the backup table in the hidden space.

[0091] For the specific details of this embodiment, reference can be made to the foregoing embodiments, which will not be elaborated herein.

[0092] Through the above steps, the data protection method of this embodiment stores the data backup in the hidden space of the storage device, so that it can not only protect the backup data specifically, but also affect the performance and capacity of the storage device, ensuring the normal operation of the storage device. Thus, it can not only achieve the specific protection of individual data in the storage device, but also reduce the overhead impact on the storage device. And in the case where the backup space is full, this embodiment determines the second data that can be deleted by traversing the backup table, and deletes the second data to free up space for backing up and storing the first data, which can fully guarantee the protection of the first data. After the first data is backed up and protected, when the first data in the user space cannot be read, the first data can be read by reading the first data in the hidden space, and the first data in the hidden space can also be rewritten into the user space, thereby further ensuring the reliability of the first data.

[0093] Please refer to Figure 7 , Figure 7 is a schematic framework diagram of an embodiment of an electronic device of the present application. The electronic device 700 includes a memory 701 and a processor 702 that are coupled to each other. The processor 702 is configured to execute program instructions stored in the memory 701 to implement the steps of the above method embodiment. In a specific implementation scenario, the electronic device 700 may include, but is not limited to: a microcomputer, a server. In addition, the electronic device 700 may also include a laptop computer, a tablet computer, a Nand Flash, etc., which are not limited herein.

[0094] Specifically, the processor 702 is used to control itself and the memory 701 to implement the steps of any of the above method embodiments. The processor 702 may also be referred to as a CPU (Central Processing Unit). The processor 702 may be an integrated circuit chip with signal processing capabilities. The processor 702 may also be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Additionally, the processor 702 may be implemented jointly by integrated circuit chips.

[0095] The above solution can not only achieve targeted protection of individual data in the storage device, but also reduce the overhead impact on the storage device.

[0096] Please refer to Figure 8 , Figure 8 which is a schematic framework diagram of an embodiment of the computer-readable storage medium of the present application. The computer-readable storage medium 800 stores program instructions 801 that can be run by a processor, and the program instructions 801 are used to implement the steps of any of the above method embodiments.

[0097] In several embodiments provided by the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0098] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place or distributed to network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0099] In addition, in each embodiment of the present application, each functional unit can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0100] 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 application, in essence, 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. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0101] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A method for protecting data, characterized in that, the method for protecting data includes: The storage device receives a data backup instruction of the first data sent by the control terminal; Based on the data backup instruction, the first data is backed up to a hidden space of the storage device for protection.

2. The method for protecting data according to claim 1, characterized in that, the data backup instruction of the first data includes: the original storage start address of the first data, the logical length of the first data, and the backup mode of the first data; The step of backing up the first data to a hidden space of the storage device for protection based on the data backup instruction includes: Based on the original storage start address and logical length of the first data, the first data is stored in the hidden space according to the backup mode.

3. The method for protecting data according to claim 2, characterized in that, after the step of storing the first data in the hidden space according to the backup mode, it includes: Create a file of the first data in the backup table of the hidden space, and the file includes the original storage start address, backup storage address, backup mode, logical length of the first data, and the arrangement serial number in the backup table.

4. The method for protecting data according to claim 3, characterized in that, The step that the storage device receives the data backup instruction of the first data sent by the control terminal further includes: The storage device receives a backup space query instruction of the first data sent by the control terminal, and queries whether the hidden space of the storage device is sufficient to store the first data; If sufficient, the storage device sends a storage available instruction to the control terminal and receives the data backup instruction of the first data sent by the control terminal.

5. The method for protecting data according to claim 4, characterized in that, The step of querying whether the hidden space of the storage device is sufficient to store the first data includes: Traverse the backup table and accumulate the total logical length of all data in the backup table; Subtract the length of the necessary space of the storage device from the length of the hidden space, and then subtract the total logical length to obtain the available space length; When the available space length is greater than or equal to the logical length of the first data, it is determined that the hidden space is sufficient to store the first data; when the available space length is less than the logical length of the first data, it is determined that the hidden space is not sufficient to store the first data.

6. The method for protecting data according to claim 4, characterized in that, The step of querying whether the hidden space of the storage device is sufficient to store the first data further includes: If not sufficient, the storage device sends a storage unavailable instruction to the control terminal and receives a query backup table instruction sent by the control terminal, obtains the backup table and sends the backup table to the control terminal; Receive the deletion instruction of the second data sent by the control terminal based on the backup table, obtain the backup storage address of the second data from the backup table, delete the second data stored in the hidden space, and receive the data backup instruction of the first data sent by the control terminal.

7. The data protection method according to claim 6, wherein, the step of obtaining the backup storage address of the second data from the backup table and deleting the second data stored in the hidden space includes: Obtain the backup storage address and logical length of the second data from the backup table, based on the backup storage address and logical length of the second data, release the backup space corresponding to the second data, and delete the arrangement serial number corresponding to the second data in the backup table.

8. The data protection method according to claim 3, wherein, the data protection method further includes: Receive the read instruction of the target data sent by the control terminal; If the read of the target data fails, query the backup table to check if the target data has been backed up. If the target data has been backed up, query the backup storage address of the target data from the backup table, read the target data from the backup storage address, and send it to the control terminal.

9. A data protection method, wherein, the data protection method includes: The control terminal determines to protect the first data; Send the data backup instruction of the first data to the storage device, so that based on the data backup instruction, the first data is backed up in the hidden space for protection.

10. An electronic device, wherein, comprises a memory and a processor coupled to each other, and the processor is configured to execute program instructions stored in the memory to implement the data protection method according to any one of claims 1 to 8 or the data protection method according to claim 9.

11. A computer-readable storage medium, on which program instructions are stored, wherein, when the program instructions are executed by a processor, the data protection method according to any one of claims 1 to 8 or the data protection method according to claim 9 is implemented.