Data processing method of storage device, electronic device and storage medium

By obtaining and adjusting the logical mapping table in the storage device, the problem of difficulty in data recovery of flash memory storage devices is solved, efficient data reorganization and recovery is achieved, and the operability of data recovery is improved.

CN118779136APending Publication Date: 2024-10-15ZHONGSHAN JIANGBOLONG ELECTRONICS CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310374334.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Storage devices based on flash storage media have difficulty in data recovery when firmware anomalies, important metadata is lost, or front-end writing anomalies occur. The existing technology has a low degree of automation, cannot restore to an earlier writing state, and cannot distinguish user data from non-user data. User data.

Method used

By obtaining the data and logical mapping table of the storage device, re-adjusting the mapping table according to the user's written logic, performing rollback or deletion operations, reorganizing the data, and achieving data recovery without relying on metadata, the rollback degree can be set according to user needs.

Benefits of technology

It improves the operability of storage device data recovery, can restore to an earlier writing state according to actual needs, distinguish user data and non-user data, and solves the limitations of data recovery in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779136A_ABST
    Figure CN118779136A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method of a storage device, an electronic device and a storage medium. The data processing method comprises the steps of obtaining data and a logic mapping table in the storage device; wherein the logic mapping table is generated based on writing logic of data; readjusting the logic mapping table according to a target operation corresponding to the data recovery instruction, and recombining data by utilizing the adjusted logic mapping table; wherein the target operation comprises a rollback operation and / or a deletion operation. According to the data processing method, a feasible data recombination mode can be provided for the data exception condition in the storage device, and the data stability of the storage device is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method for a storage device, an electronic device, and a storage medium. Background Art

[0002] With the advancement of technology, storage devices using flash memory as storage media have been widely used in various occasions. Compared with traditional storage devices typified by mechanical hard disks, storage devices based on flash memory storage media have better performance in terms of reliability and read and write performance.

[0003] When a storage device based on flash storage media has firmware anomalies, important metadata loss, or front-end write anomalies, the storage device cannot be read normally or data loss occurs. To address this problem, data recovery is required. How to restore the original data of the storage device as much as possible is quite challenging. Summary of the invention

[0004] The present application provides a data processing method for a storage device, an electronic device, and a storage medium.

[0005] A technical solution adopted by the present application is to provide a data processing method for a storage device, the method comprising:

[0006] Acquire data and a logic mapping table in a storage device; wherein the logic mapping table is generated based on the write logic of the data;

[0007] According to the target operation corresponding to the data recovery instruction, the logical mapping table is readjusted, and the data is reorganized using the adjusted logical mapping table; wherein the target operation includes a rollback operation and / or a delete operation.

[0008] Before obtaining the data and the logic mapping table in the storage device, the following steps are included:

[0009] Collect the scan code of the storage device;

[0010] Get the instructions and initialization steps corresponding to the scanned code;

[0011] The step of obtaining the data and logic mapping table in the storage device includes:

[0012] The data and logic mapping table in the storage device are obtained using instructions and initialization steps.

[0013] After obtaining the instructions and initialization steps corresponding to the scan code, the following steps are also included:

[0014] Receive the collocation capacity input by the user and build a virtual storage space corresponding to the storage device.

[0015] The method further includes:

[0016] The master control code is used to obtain the number of identifications and chip selects in the storage device.

[0017] The step of obtaining the data and logic mapping table in the storage device includes:

[0018] Scan all storage blocks in the storage device;

[0019] Using the data storage logic of the firmware in the storage device to distinguish the target storage block corresponding to the data;

[0020] Data is obtained from the target storage block, and a logic mapping table is obtained from redundant information of the target storage block.

[0021] The target storage block of the corresponding data is distinguished by using the data saving logic of the firmware in the storage device, including:

[0022] Determine the judgment value corresponding to each storage block by using the data preservation logic of the firmware in the storage device;

[0023] Taking a storage block whose judgment value is greater than a first threshold as a target storage block;

[0024] The storage block whose judgment value is greater than the second threshold and less than the first threshold is used as a warning storage block, where the warning storage block is used to indicate that the storage block may not be the target storage block;

[0025] The storage blocks whose judgment values ​​are less than the second threshold are regarded as non-target storage blocks.

[0026] Wherein, according to the target operation corresponding to the data recovery instruction, the logical mapping table is readjusted, and before the data is reorganized using the adjusted logical mapping table, the method includes:

[0027] Displaying an operation interface, displaying warning storage block information on the operation interface;

[0028] In response to the selection of the warning memory block information, the warning memory block is taken as a target memory block.

[0029] The logic mapping table is constructed according to the power-on times and writing sequence in the storage device.

[0030] Another technical solution adopted by the present application is to provide an electronic device, which includes a processor and a storage device connected to the processor, and the processor and the storage device cooperate to implement the data processing method as described above.

[0031] Another technical solution adopted by the present application is to provide a computer storage medium, which is used to store program data. When the program data is executed by a computer, it is used to implement the data processing method as described above.

[0032] The beneficial effects of the present application are: obtaining data in a storage device and a logic mapping table generated based on user-written logic, re-adjusting the logic mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizing the data using the adjusted logic mapping table to obtain reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in a storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0034] Figure 1 It is a flowchart of an embodiment of a data processing method for a storage device provided by the present application;

[0035] Figure 2 It is a flowchart of another embodiment of the data processing method of the storage device provided by the present application;

[0036] Figure 3 It is a flowchart of another embodiment of the data processing method of the storage device provided by the present application;

[0037] Figure 4 It is a flowchart of another embodiment of the data processing method of the storage device provided by the present application;

[0038] Figure 5 It is a flowchart of another embodiment of the data processing method of the storage device provided by the present application;

[0039] Figure 6 It is a flowchart of another embodiment of the data processing method of the storage device provided by the present application;

[0040] Figure 7 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;

[0041] Figure 8 It is a structural diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] The inventors of the present application have discovered in long-term research that conventional data recovery methods for storage devices based on flash storage media can only achieve data recovery by manually rolling back the data of the storage device, and the degree of automation is low; at the same time, conventional data recovery methods can only recover to the most recent write state of the storage device, and it is difficult to recover to an earlier write state according to the actual needs of the user; further, conventional data recovery methods also rely on distinguishing between user data and non-user data. If the storage device loses certain metadata, it is impossible to distinguish between user data and non-user data, and thus it is difficult to achieve data recovery.

[0044] This application mainly designs a data processing method for a storage device based on flash memory media. Unlike traditional data recovery methods, this application starts with reconstructing a logical mapping table, distinguishes user data and non-user data based on user write logic without relying on metadata, and can reorganize user data before a certain write state according to the user's actual needs to obtain recovered data.

[0045] Please refer to Figure 1 , Figure 1 It is a flowchart of an embodiment of a data processing method for a storage device provided in the present application.

[0046] like Figure 1 As shown, the data processing method of the storage device in the embodiment of the present application may specifically include the following steps:

[0047] S1, obtaining data and a logic mapping table in a storage device.

[0048] The logic mapping table is generated based on the writing logic of the data.

[0049] The data processing method of the storage device provided in the present application is executed by a data processing device. In some application scenarios, the data processing device may be the storage device itself, wherein the storage device includes a processor. In some application scenarios, the data processing device may be a device that is communicatively connected to the storage device. In some embodiments, the data processing device may be an embedded device, or may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or glasses, helmets, and other products for augmented reality or virtual reality, etc., which are not limited here.

[0050] In some application scenarios, the storage device may be a secure digital memory card (SD card), a compact flash card (CF card), a multimedia card (MMC), a memory stick (Memory Stick) or other flash memory cards. Furthermore, the storage device 52 may also be a solid state drive (SSD), or a storage medium including a flash memory chip such as a USB flash drive (U disk).

[0051] Specifically, the data processing device obtains data and a logical mapping table in the storage device. The logical mapping table includes a mapping relationship between the logical block address of the storage device and the physical block address of the storage device. Since the flash memory in the storage device does not have the characteristic of repeated overwriting, the specific location where the data of a logical block address is stored in the flash memory is not fixed. Therefore, the logical mapping table in the storage device is a logical-physical mapping table (L2P Table). The function of the logical-physical mapping table is to allow the flash translation (FTL) program to determine the location of the data of a certain logical block address stored in the flash memory through at least one parameter such as the flash physical block code (block number), page number (page number), offset (offset) in the mapping table. Furthermore, the logical mapping table is stored in the flash memory of the storage device, so that the storage device can determine the location of the latest data when it is powered on again after power failure.

[0052] The data in the storage device includes user data and non-user data.

[0053] Specifically, in addition to the user data storage area, the storage device also has a non-user data storage area, wherein the logic mapping table is stored in the non-user data storage area.

[0054] S2, readjusting the logic mapping table according to the target operation corresponding to the data recovery instruction, and reorganizing the data using the adjusted logic mapping table.

[0055] The target operation includes a rollback operation and / or a delete operation.

[0056] Specifically, the data processing device receives a rollback operation and / or a delete operation corresponding to the data recovery instruction, readjusts the logic mapping table, and reorganizes the data using the adjusted logic mapping table.

[0057] Exemplarily, the data processing device receives a data recovery instruction for a rollback operation, and uses the logical mapping information of different previous periods stored in the non-user data storage area of ​​the storage device to adjust the current logical mapping table to obtain an adjusted logical mapping table. The adjusted logical mapping table is then used to roll back the user data previously stored in the storage device. It is worth noting that the data processing device rolling back the previous user data is not limited to the most recent state, but can roll back to a state before a certain write of the storage device. For example, the non-user data storage area of ​​the storage device stores the most recent 50 logical mapping information, and the data processing device can roll back to a state before these 50 writes.

[0058] Exemplarily, a data processing device receives a data recovery instruction for an operation of deleting part of the data, uses the logical mapping information of different periods stored in the non-user data storage area of ​​the storage device to determine the area where the part of the data is deleted, adjusts the current logical mapping table, and obtains an adjusted logical mapping table.

[0059] For example, if data loss occurs in the storage device, the data processing device receives a data recovery instruction for a rollback operation, and uses the logical mapping information of different periods stored in the non-user data storage area of ​​the storage device to adjust the current logical mapping table to obtain an adjusted logical mapping table. The adjusted logical mapping table is used to roll back the user data corresponding to the write stage specified by the user. Furthermore, the data processing device outputs the rolled-back user data in the form of a virtual disk.

[0060] The above scheme obtains the data in the storage device and the logical mapping table generated based on the user's written logic, readjusts the logical mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizes the data using the adjusted logical mapping table to obtain the reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in the storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device.

[0061] See also Figure 2 , Figure 2 It is a flowchart of another embodiment of the data processing method of the storage device provided in the present application.

[0062] like Figure 2 As shown, another embodiment of the data processing method of the data device provided by the present application may specifically include:

[0063] S11, collecting the scan code of the storage device.

[0064] Specifically, the data processing apparatus collects a scan code corresponding to the storage device.

[0065] In some application scenarios, the same type of storage device with different shipping solutions may correspond to different flash memory particles and / or main controllers, and the corresponding scanning codes and initialization steps may be different. Therefore, it is necessary to determine the scanning code of the storage device first.

[0066] S12, obtaining instructions and initialization steps corresponding to the scanned code.

[0067] Specifically, the data processing apparatus obtains instructions corresponding to the scanning code of the storage device and initialization steps before scanning.

[0068] In some embodiments, the data processing device confirms that a scan code corresponding to the current storage device is obtained, and uses the scan code to obtain a corresponding scan instruction and initialization steps before scanning.

[0069] S13, using the instruction and initialization steps to obtain the data and logic mapping table in the storage device.

[0070] Specifically, the data processing apparatus obtains the user data in the user data storage area and the logical mapping table in the non-user data storage area of ​​the storage device by using the scanning instruction and the initialization step.

[0071] In some application scenarios, the data scanning device first performs the initialization steps before scanning, and then uses the scanning instruction to obtain the user data and the logical mapping table in the storage device.

[0072] S14, readjusting the logic mapping table according to the target operation corresponding to the data recovery instruction, and reorganizing the data using the adjusted logic mapping table.

[0073] The above scheme obtains the data in the storage device and the logical mapping table generated based on the user's written logic, readjusts the logical mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizes the data using the adjusted logical mapping table to obtain the reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in the storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device.

[0074] Another embodiment of the data processing method of the storage device provided by the present application may specifically include:

[0075] S21, collecting a scan code of the storage device.

[0076] S22, obtaining instructions and initialization steps corresponding to the scanned code.

[0077] S23, receiving the collocation capacity input by the user, and constructing a virtual storage space corresponding to the storage device.

[0078] Specifically, the data processing apparatus receives the collocation capacity input by the user and constructs a virtual storage space corresponding to the storage device.

[0079] The collocation capacity input by the user is greater than or equal to the storage capacity of the storage device. It can be understood that the storage capacity of the virtual storage space corresponding to the storage device is greater than or equal to the storage capacity of the storage device.

[0080] The data processing device constructs a virtual storage space corresponding to the storage device. The data reorganized by the storage device in subsequent steps can be stored in the virtual storage space, which can not only be distinguished from the data currently stored in the storage device, but also can directly extract the reorganized data from the virtual space when the user needs it.

[0081] S24, using the master control code to obtain the number of identifications and chip selects in the storage device.

[0082] Specifically, the data processing device uses the main control code (ROM code) to obtain the number of identifications and the number of flash chip selects (CE) in the storage device.

[0083] In some embodiments, the data processing device uses the master code to sequentially read the identification (ID) in the storage device. If the data processing device can receive an identification once, the number of identifications is accumulated, so as to determine the number of identifications in the storage device. Further, the number of flash chip selects is equal to the number of identifications. When the data processing device determines the number of identifications in the storage device, it also determines the number of chip selects of the storage device.

[0084] S25, obtaining data and a logic mapping table in the storage device using the instruction and the initialization step.

[0085] S26, readjusting the logic mapping table according to the target operation corresponding to the data recovery instruction, and reorganizing the data using the adjusted logic mapping table.

[0086] In some application scenarios, data loss occurs in the storage device. The data processing device receives a data recovery instruction for a rollback operation, first determines the data area in the storage device where data loss occurs, and uses the logical mapping information of different previous periods stored in the non-user data storage area of ​​the storage device to adjust the current logical mapping table to obtain an adjusted logical mapping table. The adjusted logical mapping table is used to roll back to obtain the user data corresponding to the write stage specified by the user, and then the data is spliced ​​with the data in the storage area of ​​the storage device where no data loss has occurred to obtain the recovered data.

[0087] The above scheme obtains the data in the storage device and the logical mapping table generated based on the user's written logic, readjusts the logical mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizes the data using the adjusted logical mapping table to obtain the reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in the storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device.

[0088] See also Figure 3 , Figure 3 It is a flowchart of another embodiment of the data processing method of the storage device provided in the present application.

[0089] like Figure 3 As shown, another embodiment of the data processing method of the storage device provided by the present application may specifically include the following steps:

[0090] S31, scanning all storage blocks in the storage device.

[0091] Specifically, the data processing device scans all storage blocks in the storage device, including scanning storage blocks in the user data storage area and storage blocks in the non-user data storage area.

[0092] In some embodiments, the step of the data processing device scanning all storage blocks in the storage device may further include determining the type of flash memory in the storage device. Optionally, the type of flash memory may be SLC, MLC, TLC, or QLC, etc., which is not limited here. Further, the data processing device may also determine the status of the storage block in the process of scanning all storage blocks, wherein the status of the storage block may be available or faulty.

[0093] S32, using the data storage logic of the firmware in the storage device to distinguish the target storage block corresponding to the data.

[0094] Specifically, the data processing apparatus uses the data preservation logic of the firmware in the storage device to distinguish the target storage block corresponding to the user data.

[0095] The firmware of the storage device is stored in a non-user data storage area in the storage device.

[0096] In some application scenarios, when a user writes a piece of data into the user data storage area of ​​a storage device, there will also be written data information corresponding to the written data, wherein the written data information includes at least one piece of information such as the logical address of the written data, the number of power-on times or the writing order.

[0097] S33, acquiring data from the target storage block, and acquiring a logic mapping table from the redundant information of the target storage block.

[0098] The logic mapping table is constructed according to the power-on times and writing sequence in the storage device.

[0099] Specifically, the data processing device obtains user data from a target storage block (Block) in a user data storage area, and obtains a logical mapping table from redundant information of the target data block.

[0100] In some embodiments, the logic mapping table is constructed according to the power-on times and writing order of the target storage blocks from small to large. If the power-on times and writing order of two storage blocks in the logic sequence table are different, the data processing device arranges the two storage blocks in order of power-on times from small to large. If the power-on times of two storage blocks in the logic mapping table are the same, the data processing device arranges the two storage blocks in order of writing.

[0101] S34, readjusting the logic mapping table according to the target operation corresponding to the data recovery instruction, and reorganizing the data using the adjusted logic mapping table.

[0102] The above scheme obtains the data in the storage device and the logical mapping table generated based on the user's written logic, readjusts the logical mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizes the data using the adjusted logical mapping table to obtain the reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in the storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device.

[0103] See also Figure 4 , Figure 4 It is a flowchart of another embodiment of the data processing method of the storage device provided in the present application.

[0104] like Figure 4 As shown, another embodiment of the data processing method of the storage device provided by the present application may specifically include:

[0105] S41, scanning all storage blocks in the storage device.

[0106] S42, using the data storage logic of the firmware in the storage device to determine the judgment value corresponding to each storage block.

[0107] Specifically, the data processing apparatus determines the judgment value corresponding to each storage block using the data preservation logic of the firmware in the storage device.

[0108] The judgment value is used to indicate whether the storage block is a target storage block.

[0109] In some embodiments, the data processing device determines the judgment value corresponding to each storage block by utilizing the difference between the data storage logic of the user data in the storage device and the data storage logic of the firmware. Exemplarily, the data storage logic of the user data in the storage device includes at least one information of the logical address, the number of power-on times or the writing order, and the data processing device can determine the judgment value by utilizing whether the number of power-on times of each storage block is greater than 1 and / or the order information of the writing order. Generally speaking, the number of power-on times of the storage block corresponding to the firmware is less than the number of power-on times of the target storage unit. For example, if the number of power-on times of a storage block is greater than 1, its judgment value is greater than the judgment value corresponding to the storage block with a power-on time of 1.

[0110] S43, taking a storage block whose judgment value is greater than a first threshold as a target storage block.

[0111] Specifically, the data processing device uses the storage block whose judgment value is greater than the first threshold as the target storage block.

[0112] Exemplarily, the first threshold is 4, and the number of power-on times of the storage block is equal to the judgment value of the storage block. If the number of power-on times of a storage block is greater than 4, the storage block is determined as the target storage block.

[0113] S44, taking a storage block whose judgment value is greater than the second threshold and less than or equal to the first threshold as a warning storage block, where the warning storage block is used to indicate that the storage block may not be a target storage block.

[0114] Specifically, the data processing device uses the storage block whose judgment value is greater than the second threshold and less than or equal to the first threshold as a warning storage block. Since the storage block of the storage device may have data loss, the data processing device may not be able to accurately distinguish all storage blocks as target storage blocks or non-target storage blocks during the process of scanning all storage blocks of the storage device. By adding the function of warning storage blocks, errors in storage block distinction can be avoided.

[0115] Exemplarily, the first threshold is 4, the second threshold is 1, and the number of power-on times of the storage block is equal to the judgment value of the storage block. If the judgment value of a storage block is 3, and the condition that the judgment value is greater than 1 and less than or equal to 4 is met, the data processing device cannot accurately distinguish whether the storage block is a non-target storage block or a target storage block, and therefore determines the storage block as a warning storage block, which is distinguished and processed by the user in the subsequent processing process.

[0116] S45, taking the storage blocks whose judgment values ​​are less than the second threshold as non-target storage blocks.

[0117] Specifically, the data processing device regards the storage blocks whose judgment values ​​are less than or equal to the second threshold as non-target storage blocks.

[0118] Exemplarily, the second threshold is 1, and the number of power-on times of the storage block is equal to the judgment value of the storage block. If the number of power-on times of a storage block is 1, the storage block satisfies the condition that the judgment value is less than or equal to 1, and the data processing device determines that the storage block is a non-target storage block.

[0119] S46, acquiring user data from the target storage block, and acquiring a logic mapping table from the redundant information of the target storage block.

[0120] The logic mapping table is constructed according to the power-on times and writing sequence in the storage device.

[0121] Specifically, the data processing device obtains user data from a target storage block (Block) in a user data storage area, and obtains a logical mapping table from redundant information of the target data block.

[0122] In some embodiments, the logic mapping table is constructed according to the power-on times and writing order of the target storage blocks from small to large. If the power-on times and writing order of two storage blocks in the logic sequence table are different, the data processing device arranges the two storage blocks in order of power-on times from small to large. If the power-on times of two storage blocks in the logic mapping table are the same, the data processing device arranges the two storage blocks in order of writing.

[0123] S47, readjusting the logic mapping table according to the target operation corresponding to the data recovery instruction, and reorganizing the user data using the adjusted logic mapping table.

[0124] The above scheme obtains the data in the storage device and the logical mapping table generated based on the user's written logic, readjusts the logical mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizes the data using the adjusted logical mapping table to obtain the reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in the storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device.

[0125] See also Figure 5 , Figure 5 It is a flowchart of another embodiment of the data processing method of the storage device provided in the present application.

[0126] like Figure 5 As shown, another embodiment of the data processing method of the storage device provided by the present application may specifically include the following steps:

[0127] S51, scanning all storage blocks in the storage device.

[0128] S52: Using the data storage logic of the firmware in the storage device to distinguish the target storage block corresponding to the user data.

[0129] S53, acquiring user data from the target storage block, and acquiring a logic mapping table from redundant information of the target storage block.

[0130] S54, displaying an operation interface, and displaying warning storage block information on the operation interface.

[0131] Specifically, the data processing device displays an operation interface, and the operation interface displays the warning storage block information.

[0132] In some embodiments, the operation interface includes the logical address value and data value of the warning storage block. Exemplarily, the logical address value of the warning storage block can be represented in the form of an offset value.

[0133] S55, in response to the selection of the warning storage block information, taking the warning storage block as the target storage block.

[0134] Specifically, in response to the user's selection of the warning storage block information, the data processing device uses the warning storage block as the target storage block.

[0135] In some embodiments, the user confirms that the warning storage block is the target storage block, and the data processing device sets the warning storage block as the target storage block.

[0136] In some embodiments, the user confirms that the warning storage block is a non-target storage block, and the data processing device sets the clean storage block as a target storage block.

[0137] S56, readjusting the logic mapping table according to the target operation corresponding to the data recovery instruction, and reorganizing the user data using the adjusted logic mapping table.

[0138] The above scheme obtains the data in the storage device and the logical mapping table generated based on the user's written logic, readjusts the logical mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizes the data using the adjusted logical mapping table to obtain the reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in the storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device.

[0139] See also Figure 6 , Figure 6 It is a flowchart of another embodiment of the data processing method of the storage device provided by the present application.

[0140] like Figure 6 As shown, another embodiment of the data processing method of the storage device provided by the present application may specifically include:

[0141] S101, determining a scanning code corresponding to a storage device, and obtaining a matching capacity of the storage device.

[0142] Specifically, the data processing device uses the shipping plan corresponding to the storage device to determine the scanning code corresponding to the storage device and simultaneously obtains the matching capacity of the storage device.

[0143] In some embodiments, the configuration capacity information of the storage device is obtained by user input. It can be understood that the configuration capacity of the storage device is greater than or equal to the actual storage capacity of the storage device.

[0144] S102, using the master control code to confirm the number of chip selects in the storage device, and downloading the scan code to the storage device.

[0145] Specifically, the data processing device uses the main control code (ROM code) in the storage device to determine the number of flash memory chip selects in the storage device, and downloads the confirmed scan code to the storage device.

[0146] In some embodiments, the data processing device uses the master code to sequentially read the identification (ID) in the storage device. If the data processing device can receive an identification once, the number of identifications is accumulated, thereby determining the number of identifications in the storage device. Further, since the number of flash chip selects of the storage device is equal to the number of identifications, the data processing device determines the number of chip selects of the storage device while determining the number of identifications in the storage device.

[0147] S103, traverse all storage blocks of the storage device.

[0148] Specifically, the data processing apparatus traverses all storage blocks in the storage device using the scanning code downloaded to the storage device.

[0149] In some embodiments, in the step of scanning all storage blocks in the storage device, the data processing device also determines the type of flash memory in the storage device. Optionally, the type of flash memory can be SLC, MLC, TLC or QLC, etc., which is not limited here. Further, the data processing device can also determine the status of the storage block in the process of scanning all storage blocks, wherein the status of the storage block can be available or faulty.

[0150] In some embodiments, the data processing device also determines user data, non-user data, and warning storage blocks in the step of scanning all storage blocks. Specifically, the steps of determining user data, non-user data, and warning storage blocks can be found in S42-S45 and S54-S55 above, which will not be repeated here.

[0151] In some embodiments, the data processing device also obtains mapping table information during the step of scanning all storage blocks, wherein the mapping table corresponds to the above logical mapping table. The step of obtaining the mapping table information is described in S33 above and will not be repeated here.

[0152] S104: In response to the user executing a rollback data operation, reconstructing the mapping table.

[0153] S105, connecting user data according to the mapping table to generate a virtual disk.

[0154] Among them, S104-S105 correspond to S2 above and will not be repeated here.

[0155] The above scheme obtains the data in the storage device and the logical mapping table generated based on the user's written logic, readjusts the logical mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizes the data using the adjusted logical mapping table to obtain the reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in the storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device.

[0156] Another embodiment of the data processing method of the storage device provided in the present application may specifically include the following steps:

[0157] S111, selecting a corresponding scanning code according to the storage device configuration.

[0158] Specifically, the data processing device uses the shipping plan corresponding to the storage device to determine the scanning code corresponding to the storage device and simultaneously obtains the matching capacity of the storage device.

[0159] In some embodiments, the configuration capacity information of the storage device is obtained by user input. It can be understood that the configuration capacity of the storage device is greater than or equal to the actual storage capacity of the storage device.

[0160] S112, obtaining the identification quantity and chip selection quantity of the storage device through the master control code.

[0161] Specifically, the data processing device uses the main control code (ROM code) in the storage device to determine the number of flash memory chip selects in the storage device, and downloads the confirmed scan code to the storage device.

[0162] In some embodiments, the data processing device uses the master code to sequentially read the identification (ID) in the storage device. If the data processing device can receive an identification once, the number of identifications is accumulated, thereby determining the number of identifications in the storage device. Further, since the number of flash chip selects of the storage device is equal to the number of identifications, the data processing device determines the number of chip selects of the storage device while determining the number of identifications in the storage device.

[0163] S113, determine the number of coding blocks.

[0164] S114, input the matching capacity of the storage device, and then traverse and search all storage blocks of the storage device to obtain storage block information, warning block information and all mapping tables.

[0165] Specifically, the data processing apparatus traverses all storage blocks in the storage device using the scanning code downloaded to the storage device.

[0166] In some embodiments, in the step of scanning all storage blocks in the storage device, the data processing device also determines the type of flash memory in the storage device. Optionally, the type of flash memory can be SLC, MLC, TLC or QLC, etc., which is not limited here. Further, the data processing device can also determine the status of the storage block in the process of scanning all storage blocks, wherein the status of the storage block can be available or faulty.

[0167] In some embodiments, the data processing device also determines user data, non-user data, and warning storage blocks in the step of scanning all storage blocks. Specifically, the steps of determining user data, non-user data, and warning storage blocks can be found in S42-S45 and S54-S55 above, which will not be repeated here.

[0168] In some embodiments, the data processing device also obtains mapping table information during the step of scanning all storage blocks, wherein the mapping table corresponds to the above logical mapping table. The step of obtaining the mapping table information is described in S33 above and will not be repeated here.

[0169] Specifically, all mapping tables correspond to logical mapping tables obtained by the storage device each time the user performs a write operation on the storage device.

[0170] S115, determining the write status corresponding to the rollback operation, and executing the rollback operation.

[0171] Specifically, the data processing apparatus determines a write state corresponding to the rollback operation, executes a rollback operation on the storage device using a corresponding logic mapping table, and obtains reorganized data.

[0172] In some embodiments, there may be multiple write states, wherein a user may specify a target specified state by inputting instructions to a data processing device, and the data processing device performs a rollback operation based on the target specified state. Specifically, in the step of performing a rollback operation, the data processing device uses the target specified state to determine a corresponding logical mapping table, i.e., a target logical mapping table, and performs a rollback operation using the target logical mapping table to obtain reorganized data. In some application scenarios, the reorganized data may be part of the data of a storage device, and illustratively, this part of the data may be rollback data corresponding to lost data. Furthermore, the data processing device splices the non-lost data with the reorganized data to obtain the restored complete data.

[0173] The above scheme obtains the data in the storage device and the logical mapping table generated based on the user's written logic, readjusts the logical mapping table according to the rollback operation and / or deletion operation corresponding to the data recovery instruction, and reorganizes the data using the adjusted logical mapping table to obtain the reorganized data. The data processing method of the present application can provide a feasible data recovery and reorganization method for data abnormalities in the storage device, and can set the rollback degree according to actual needs, and then perform data recovery according to the rollback degree. Compared with the related art that can only roll back and restore to the data corresponding to the previous state, the present application can improve the operability of data recovery of the storage device.

[0174] Please continue to see Figure 7 , Figure 7 The electronic device 500 of the embodiment of the present application includes a processor 51 and a storage device 52 .

[0175] The processor 51 and the storage device 52 are connected to the bus. The storage device 52 stores program data. The processor 51 is used to execute the program data to implement the data processing method described in the above embodiment.

[0176] In the embodiment of the present application, the processor 51 may also be referred to as a CPU (Central Processing Unit). The processor 51 may be an integrated circuit chip having the ability to process signals. The processor 51 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 gates or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 51 may also be any conventional processor, etc.

[0177] In the embodiment of the present application, the storage device 52 may be a secure digital card (SD card), a compact flash card (CF card), a multimedia card (MMC card), a memory stick (Memory Stick), or other flash memory cards. Furthermore, the storage device 52 may also be a solid state drive (SSD), or a USB flash drive (U disk), etc.

[0178] This application also provides a computer storage medium, please continue to refer to Figure 8 , Figure 8 It is a schematic diagram of the structure of an embodiment of a computer storage medium provided in the present application. The computer storage medium 600 stores program data 61. When the program data 61 is executed by a processor, it is used to implement the data processing method of the above embodiment.

[0179] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is 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 enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0180] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Equivalent structures or equivalent process changes made by utilizing the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A data processing method for a storage device, characterized in that: The method comprises: Acquire data and a logic mapping table in a storage device; wherein the logic mapping table is generated based on the write logic of the data; According to the target operation corresponding to the data recovery instruction, the logic mapping table is readjusted, and the data is reorganized using the adjusted logic mapping table; wherein the target operation includes a rollback operation and / or a delete operation.

2. The method according to claim 1, characterized in that Before obtaining the data and the logic mapping table in the storage device, the method includes: Collecting a scan code of the storage device; Obtaining instructions and initialization steps corresponding to the scan code; The step of obtaining the data and logic mapping table in the storage device includes: The instructions and the initialization steps are used to obtain data and a logic mapping table in the storage device.

3. The method according to claim 2, characterized in that After the instruction and initialization steps corresponding to the scan code are obtained, the method further includes: The collocation capacity input by the user is received, and a virtual storage space corresponding to the storage device is constructed.

4. The method according to claim 2, characterized in that: The method further comprises: The master control code is used to obtain the number of identifications and the number of chip selects in the storage device.

5. The method according to claim 1, characterized in that The step of obtaining the data and logic mapping table in the storage device includes: Scan all storage blocks in the storage device; Using the data storage logic of the firmware in the storage device to distinguish the target storage block corresponding to the data; Data is acquired from the target storage block, and the logic mapping table is acquired from redundant information of the target storage block.

6. The method according to claim 5, characterized in that The method of distinguishing a target storage block corresponding to the data by using the data preservation logic of the firmware in the storage device includes: Determine the judgment value corresponding to each storage block by using the data preservation logic of the firmware in the storage device; Taking the storage block whose judgment value is greater than the first threshold as the target storage block; The storage block whose judgment value is greater than the second threshold and less than the first threshold is used as a warning storage block, wherein the warning storage block is used to indicate that the storage block may not be a target storage block; The storage blocks whose judgment values ​​are smaller than the second threshold are regarded as non-target storage blocks.

7. The method according to claim 5, characterized in that The step of re-adjusting the logic mapping table according to the target operation corresponding to the data recovery instruction and reorganizing the data using the adjusted logic mapping table comprises: Displaying an operation interface, displaying warning storage block information on the operation interface; In response to the selection of the warning memory block information, the warning memory block is used as the target memory block.

8. The method according to claim 5, characterized in that The logic mapping table is constructed according to the power-on times and the writing sequence in the storage device.

9. An electronic device, characterized in that: The electronic device includes a processor and a storage device connected to the processor, and the processor and the storage device cooperate to implement the method according to any one of claims 1 to 8.

10. A computer storage medium, characterized in that: The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Logic address history mapping dictionary, construction method thereof and data rollback method

    CN121979447A