CN116069552A - Data recovery method, data recovery device and computer readable storage medium - Google Patents

Data recovery method, data recovery device and computer readable storage medium Download PDF

Info

Publication number
CN116069552A
CN116069552A CN202111284231.6A CN202111284231A CN116069552A CN 116069552 A CN116069552 A CN 116069552A CN 202111284231 A CN202111284231 A CN 202111284231A CN 116069552 A CN116069552 A CN 116069552A
Authority
CN
China
Prior art keywords
data
storage device
storage
data recovery
stored data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111284231.6A
Other languages
Chinese (zh)
Inventor
陈镇星
尹慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongshan Longsys Electronics Co ltd
Original Assignee
Zhongshan Longsys Electronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongshan Longsys Electronics Co ltd filed Critical Zhongshan Longsys Electronics Co ltd
Priority to CN202111284231.6A priority Critical patent/CN116069552A/en
Publication of CN116069552A publication Critical patent/CN116069552A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data recovery method, a data recovery device and a computer readable storage medium, wherein the data recovery method comprises the following steps: establishing a communication connection with a first storage device; reading the stored data of the first storage device in response to the first storage device operating in the engineering mode; responding to the stored data as logic data, and acquiring a logic address of the stored data; the stored data is written to the second storage device based on the logical address. Through the scheme, the data recovery method and the data recovery device can autonomously, safely and reliably recover the data of the storage device which cannot normally work, and the loss of key sensitive data is effectively avoided.

Description

Data recovery method, data recovery device and computer readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data recovery method, a data recovery device, and a computer readable storage medium.
Background
Nowadays, due to the immaturity of firmware technology in a storage device, NAND (NAND flash memory, computer flash memory device) has poor particle quality, and the firmware is failed to start, or the main control works abnormally, etc., inevitably, the SSD (Solid State Disk) cannot work normally.
The general manufacturer only needs to select to return the goods to the customer within the range allowed by the RMA (Return Material Authorization, main process of returning and checking and handling bad products of the customer), but the method can cause the original data of the customer to be lost; or the bad SSD is sent back to technicians in the original factory for data recovery, but the method is complex in steps, long in period and related to the problem of data confidentiality. Some critical sensitive data within the SSD may be compromised during return to the factory and there is a significant risk.
Disclosure of Invention
The technical problem that the application mainly solves is to provide a data recovery method, a data recovery device and a computer readable storage medium, so as to solve the problems that the data recovery method in the prior art is complex in steps, long in period and high in risk of key sensitive information leakage.
In order to solve the above problem, a first aspect of the present application provides a method for recovering writing of a storage device, where the method for recovering data includes: establishing a communication connection with a first storage device; reading the stored data of the first storage device in response to the first storage device operating in the engineering mode; responding to the stored data as logic data, and acquiring a logic address of the stored data; the stored data is written to the second storage device based on the logical address.
Wherein the step of reading the stored data of the first storage device comprises: transmitting the data recovery firmware to the first storage device to enable the first storage device to operate the data recovery firmware; and sending a data reading instruction to a first storage device running the data recovery firmware to read the storage data.
Wherein after the step of reading the stored data of the first storage device in response to the first storage device operating in the engineering mode, the step of obtaining the logical address and the writing order of the stored data in response to the stored data being logical data includes: reading metadata of the stored data; and judging whether the stored data is logic data or not based on the data attribute of the stored data correspondingly recorded in the metadata.
Wherein the step of obtaining the logical address of the stored data comprises: and obtaining the logical address of the storage data corresponding to the record in the metadata.
Wherein the step of writing the stored data to the second storage device based on the logical address comprises: and writing the storage data into a storage position corresponding to the logic address in the second storage device.
Wherein the step of writing the stored data to the second storage device based on the logical address comprises: acquiring a writing sequence of the stored data; and writing the last written data in the storage data with the same logical address written into the first storage device for multiple times into a storage position corresponding to the logical address in the second storage device according to the writing sequence.
Wherein the step of writing the stored data to the second storage device based on the logical address comprises: writing the stored data into the corresponding offset position of the set mirror image file according to the logic address; and storing the setting image file in a second storage device.
The step of writing the storage data into the corresponding offset position of the set mirror image file according to the logic address comprises the following steps: acquiring a writing sequence of the stored data; and writing the last written data in the storage data with the same logical address written into the first storage device for multiple times into the offset position corresponding to the logical address in the set mirror image file according to the writing sequence.
Wherein after the step of establishing a communication connection with the first storage device, before the step of reading the stored data of the first storage device in response to the first storage device operating in the engineering mode, further comprises: acquiring characteristic parameters of a first storage device; judging whether the first storage device is in a preset support list or not based on the characteristic parameters; in response to the first storage device operating in the engineering mode, the step of reading the stored data of the first storage device, comprising: and responding to the first storage device in the preset support list, and the first storage device operates in the engineering mode, and reading the storage data in the first storage device.
Wherein after the step of writing the storage data to the second storage device based on the logical address, the method further comprises: acquiring the model number of the first storage device and the number of the storage chips included in the first storage device; judging whether all storage spaces of the first storage device are traversed currently or not based on the model numbers and the quantity; and ending the current data recovery flow in response to traversing all the storage spaces of the first storage device.
In order to solve the above-mentioned problem, a second aspect of the present application provides a data recovery device, wherein the data recovery device includes a memory and a processor coupled to each other; the memory stores program data; the processor is configured to execute program data to implement a data recovery method as claimed in any one of the preceding claims.
In order to solve the above-described problems, a third aspect of the present application provides a computer-readable storage medium having stored thereon program instructions, wherein the program instructions, when executed by a processor, implement the resume write method of any of the above.
The beneficial effects of the invention are as follows: compared with the prior art, the data recovery method in the application is characterized in that when the first storage device is in communication connection with the first storage device and the first storage device is determined to operate in an engineering mode, the stored data of the first storage device can be read, so that when the stored data is logic data, the logic address of the stored data is obtained, the stored data can be written into the appointed second storage device based on the logic address, the first storage device which cannot normally work can be automatically, safely and reliably recovered, and the problems that the recovery period is long, the steps are complicated and some key sensitive data are leaked and lost due to the fact that the first storage device is sent back to a manufacturing factory to recover the data are effectively avoided.
Drawings
FIG. 1 is a flow chart of a first embodiment of a data recovery method of the present application;
FIG. 2 is a flow chart of an embodiment of S12 in FIG. 1;
FIG. 3 is a flow chart of an embodiment of S14 in FIG. 1;
FIG. 4 is a schematic flow chart of a further embodiment of S14 in FIG. 1;
FIG. 5 is a flow chart of a further embodiment of S1411 in FIG. 4;
FIG. 6 is a flow chart of a second embodiment of a data recovery method of the present application;
FIG. 7 is a flowchart of a third embodiment of a data recovery method according to the present application;
FIG. 8 is a flowchart of a fourth embodiment of a data recovery method of the present application;
FIG. 9 is a flowchart of a data recovery method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of an embodiment of a memory device of the present application;
FIG. 11 is a schematic diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The following describes the embodiments of the present application in detail with reference to the drawings.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, interfaces, techniques, etc., in order to provide a thorough understanding of the present application.
The terms "system" and "network" are often used interchangeably herein. The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship. Further, "a plurality" herein means two or more than two.
Referring to fig. 1, fig. 1 is a flowchart of a first embodiment of a data recovery method according to the present application. It should be noted that the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion. Specifically, the present embodiment includes the steps of:
s11: a communication connection is established with the first storage device.
The data recovery method provided by the application can be particularly applied to an intelligent terminal, for example, a data recovery application program running on a user terminal is used for reading data of a storage device which cannot normally work so as to recover the data written in the storage device before abnormal work. Of course, in other embodiments, the data recovery method may be applied to a cloud server, or a background computer of a storage device manufacturing factory, which is not limited in this embodiment.
Specifically, the first storage device which cannot normally work can establish communication connection with the intelligent terminal aiming at recovering data of the first storage device by plugging an interface of the first storage device into a corresponding interface of the intelligent terminal.
It can be understood that the intelligent terminal can be a user terminal specifically, and the first storage device is connected with the communication connection realized by the user terminal locally in an interface plugging manner without networking, so as to request network services, and specifically, the data recovery of the first storage device is realized through a data recovery application program running on the user terminal without professional operation, so that the safety and reliability of corresponding data information in the data recovery process can be effectively ensured.
In another embodiment, the intelligent terminal may further include a cloud server and a user terminal that are communicatively connected to each other, for example, the corresponding data recovery application operates on an official website of the factory, so as to enable data recovery of the first storage device connected to the user terminal by way of network communication; or, the intelligent terminal specifically may further include a background computer and a user terminal of the manufacturing factory that are in communication connection with each other, and the corresponding recovery application program runs on the background computer, where the first storage device interface is connected to the user terminal, and the background computer is capable of sending a corresponding program control instruction to the first storage device through the user terminal, so as to perform data recovery on the first storage device.
It should be noted that, the data interaction between the cloud server or the background computer and the user terminal only involves the transmission of the program control instruction, but the interaction and the acquisition of the data information cannot be performed.
Optionally, the first storage device may specifically be one of any reasonable storage devices such as SSD (Solid State Disk), UFS (Universal Flash Storage, universal flash memory storage), eMMC (embedded Multi Media Card ), and the application is not limited thereto.
Optionally, the intelligent terminal may be any reasonable intelligent terminal capable of running an application program, such as a computer, a tablet computer, a smart phone, a server, and the like, which is not limited in this application.
S12: and in response to the first storage device operating in the engineering mode, reading the stored data of the first storage device.
It can be understood that the first storage device cannot normally work currently, and is different from a storage device which normally works, and the first storage device which cannot normally work is ensured to be subjected to data interaction, and special treatment needs to be performed on the first storage device, for example, a user needs to make the first storage device which cannot normally work enter an engineering mode by shorting a reserved pin or any other reasonable mode according to operation guidance.
Specifically, when the intelligent terminal detects that the first storage device which is currently in communication connection with the intelligent terminal runs in an engineering mode, it can be determined that the first storage device cannot work normally, and a data recovery program needs to be started so as to further read the stored data before the first storage device works abnormally.
S13: and responding to the stored data as logic data, and acquiring a logic address of the stored data.
It can be understood that after the intelligent terminal obtains the current stored data in the first storage device, the stored data needs to be identified and distinguished, for example, the program data in the stored data does not relate to private data of a user, and recovery is not needed.
Specifically, when detecting that the currently acquired storage data is logic data, the intelligent terminal can sequentially restore and save the logic data, and further acquire the logic address of the logic data, for example, by reading a mapping table stored in the first storage device, so as to acquire the logic address of the logic data; or, the metadata space of the first storage device is read to obtain the logical address of the logical data recorded by the corresponding firmware.
It should be noted that the logic data is an operand type, and is data used to represent two states of "yes" and "no" or "true" and "false" in the binary logic. The logical address refers to an address of a memory cell (memory cell), a storage unit (storage element), or a network host (network host) from the viewpoint of an application program in the computer architecture. The logical addresses often differ from physical addresses (physical addresses) that can be converted to physical addresses by an address translator (address translator) or mapping function.
Firmware (Firmware) is a program written in EPROM (erasable programmable read only memory) or EEPROM (electrically erasable programmable read only memory). The firmware refers to a device "driver" stored in the device, through which an operating system can implement operation of a specific machine according to a standard device driver, for example, an optical drive, a recorder, and the like all have internal firmware. Firmware is software that serves as the bottommost layer of the system's most basic. In the hardware device, the firmware is the soul of the hardware device, and because some hardware devices have no other software components except the firmware, the firmware also determines the functions and performances of the hardware device.
S14: the stored data is written to the second storage device based on the logical address.
Specifically, after obtaining the logical address of the storage data to be recovered, the storage data can be written into a storage position corresponding to the logical address in the second storage device according to the logical address; or when the storage data is to be restored to the set mirror image file, the corresponding offset position of the storage data written to the set mirror image file can be obtained according to the logic address, so that the set mirror image file is further stored in the second storage device after the storage data is correspondingly restored to the set mirror image file.
It can be understood that the second storage device is a storage device different from the first storage device and capable of working normally, and specifically may be a storage space in the intelligent terminal for data recovery, or may be any other reasonable storage device connected to the intelligent terminal in a communication manner, which is not limited in this application.
According to the scheme, when the communication connection is established with the first storage device which cannot normally work, and the first storage device is determined to operate in the engineering mode, the storage data of the first storage device is read, so that when the storage data is logic data, the logic address of the storage data is obtained, the storage data can be written into the appointed second storage device based on the logic address, the first storage device which cannot normally work can be automatically, safely and reliably recovered, and the problems that the recovery period is long, the steps are complicated, and some key sensitive data are leaked and lost due to the fact that the first storage device is sent back to a manufacturing factory to recover the data are effectively avoided.
Referring to fig. 2 in combination, fig. 2 is a flow chart of an embodiment of S12 in fig. 1. In one embodiment, the first embodiment of the data writing method of the memory device of the present application further includes some more specific steps in addition to S11-S14 described above. Specifically, the step S12 may specifically further include the following steps:
S121: the data recovery firmware is sent to the first storage device to cause the first storage device to run the data recovery firmware.
It can be understood that, because the first storage device cannot normally operate, in order to ensure that the first storage device can perform effective data reading or acquiring, the intelligent terminal specifically sends the data recovery firmware to the first storage device so as to cover the original firmware in the first storage device, so that the first storage device runs the data recovery firmware.
S122: and sending a data reading instruction to a first storage device running the data recovery firmware to read the storage data.
Further, after the first storage device runs the data recovery firmware, the intelligent terminal can send a data reading instruction which can be recognized and responded by the first storage device to the first storage device, so that the stored data in the first storage device can be read.
In a specific application scenario, after the first storage device adjusted to the engineering mode is plugged into the user terminal through the interface, the data recovery application program running on the user terminal identifies the first storage device in the engineering mode, specifically, downloads a firmware for data recovery to the main control of the first storage device, so that a special data reading instruction capable of being identified and responded by the first storage device can be sent to the first storage device based on the data recovery firmware.
Further, in an embodiment, the step S13 may specifically further include: and obtaining the logical address of the storage data corresponding to the record in the metadata.
It will be appreciated that in the metadata space of the first storage device, e.g., NAND, the response firmware will record the write sequence, logical address, and data attribute of each 4K logical data sent from the host.
Specifically, the intelligent terminal may obtain the logical address of the storage data corresponding to the record in the metadata by reading the metadata space of the first storage device. In other embodiments, the intelligent terminal may further obtain the logical address of the logical data by reading the mapping table stored in the first storage device, which is not limited in this application.
Further, in an embodiment, the step S14 may specifically further include: and writing the storage data into a storage position corresponding to the logic address in the second storage device.
It can be understood that after the logical address of the logical data is obtained, the storage data to be recovered can be written into the storage position corresponding to the logical address in the second storage device correspondingly.
Referring to fig. 3 in combination, fig. 3 is a flow chart of an embodiment of S14 in fig. 1. In an embodiment, the step S14 may specifically further include the following steps:
S1401: the writing order of the stored data is acquired.
It will be appreciated that in the data storage of the storage device, the same storage data is generally unavoidable, for example, when the storage data with the same logical address is written into the first storage device multiple times, and in order to ensure that the occupation of the storage space of the second storage device by the invalid data is reduced as much as possible, the writing sequence of the same storage data needs to be identified.
Specifically, the intelligent terminal may obtain the writing sequence of the storage data corresponding to the record in the metadata by reading the metadata space of the first storage device. In other embodiments, the intelligent terminal may further directly obtain the writing sequence of each storage data written into the first storage device by reading any reasonable information such as a time stamp of the storage data, which is not limited in this application.
S1402: and writing the last written data in the storage data with the same logical address written into the first storage device for multiple times into a storage position corresponding to the logical address in the second storage device according to the writing sequence.
It can be understood that the recovery of the corresponding storage data by the intelligent terminal is performed sequentially according to the reading sequence, so that the currently acquired storage data is written into the storage position corresponding to the logic address in the second storage device sequentially. And when the corresponding logic addresses of the front and rear storage data are the same in the recovery process, the storage data which is finally written into the first storage device can be covered with the same storage data which is written before, so that the last written data in the storage data which is written into the first storage device for multiple times and has the same logic address can be reserved.
The restoring of the storage data may be sequentially performed according to the position sequence of the storage space of the first storage device, for example, from the storage data in the first storage page to the last storage page, where when the storage data to be restored in the third storage page appears in the first storage page, that is, the logical address of the storage data in the third storage page is the same as the logical address of the storage data in the first storage page, and the storage data in the third storage page is restored to the second storage device, if the storage data in the third storage page is written into the first storage device after the storage data is written before, the same storage data in the third storage page is restored to the storage position corresponding to the corresponding logical address in the second storage device, the restored storage data in the first storage page is covered; when the stored data in the third storage page is earlier than the previous stored data, the stored data in the first storage page which is restored to the second storage device is reserved, the stored data in the third storage page is not restored, and so on until the stored data in each storage page of the first storage device is restored to the second storage device, and the stored data which is written to the first storage device last with the same logical address is reserved.
Referring to fig. 4 in combination, fig. 4 is a flowchart of a further embodiment of S14 in fig. 1. In an embodiment, the step S14 may specifically further include the following steps:
s1411: and writing the storage data into the corresponding offset position of the set mirror image file according to the logic address.
Specifically, when the stored data is to be restored to the setting image file, the corresponding offset position of the stored data written to the setting image file is calculated according to the obtained logical address of the stored data, so as to restore the stored data to the setting image file correspondingly.
S1412: and storing the setting image file in a second storage device.
Further, after the stored data is correspondingly restored to the set image file, the set image file can be stored in the second storage device.
Referring to fig. 5 in combination, fig. 5 is a flowchart of a further embodiment of S1411 in fig. 4.
In an embodiment, the step S1411 may specifically further include the following steps:
s14111: the writing order of the stored data is acquired.
It will be appreciated that the same storage data will generally inevitably exist in the data storage of the storage device, for example, when the storage data with the same logical address is written into the first storage device many times, and in order to ensure that the occupation of the storage space of the second storage device by the invalid data is reduced as much as possible, the writing sequence of the same storage data needs to be identified.
Specifically, the intelligent terminal may obtain the writing sequence of the storage data corresponding to the record in the metadata by reading the metadata space of the first storage device. In other embodiments, the intelligent terminal may further directly obtain the writing sequence of each storage data written into the first storage device by reading any reasonable information such as a time stamp of the storage data, which is not limited in this application.
S14112: and writing the last written data in the storage data with the same logical address written into the first storage device for multiple times into the offset position corresponding to the logical address in the set mirror image file according to the writing sequence.
Specifically, when the stored data is to be restored to the set mirror image file, the corresponding offset position of the stored data written to the set mirror image file is calculated according to the obtained logical address of the stored data, so as to restore the stored data to the set mirror image file correspondingly, and according to the obtained writing sequence of the stored data, it is ensured that the last written data in the stored data with the same logical address written to the first storage device for multiple times is restored to the set mirror image file.
Referring to fig. 6, fig. 6 is a flowchart of a second embodiment of the data recovery method of the present application. The data recovery method of the present embodiment is a flowchart of a refinement embodiment of the data recovery method in fig. 1, and includes the following steps:
S21: a communication connection is established with the first storage device.
S22: and in response to the first storage device operating in the engineering mode, reading the stored data of the first storage device.
The S21 and S22 are the same as S11 and S12 in fig. 1, and specific reference is made to S11 and S12 and the related text descriptions thereof, which are not repeated here.
S23: metadata of the stored data is read.
It will be appreciated that in the metadata space of the first storage device, e.g., NAND, the response firmware will record the write sequence, logical address, and data attribute of each 4K logical data sent from the host.
Wherein the data attribute is used for distinguishing whether the 4K data is program data or logic data of firmware.
Specifically, when the intelligent terminal determines that the first storage device is operated in the engineering mode, the first storage device metadata space is further read to read metadata of the storage data, that is, a writing sequence, a logic address and a data attribute of each logic data.
S24: and judging whether the stored data is logic data or not based on the data attribute of the stored data correspondingly recorded in the metadata.
Therefore, by reading the metadata of the storage data, whether the storage data is logic data can be further judged according to the data attribute of the storage data correspondingly recorded in the metadata.
If it is determined that the storage data is logic data, S25 is executed, and if it is determined that the storage data is not logic data, S22 is executed again until all storage spaces of the first storage device are traversed.
S25: a logical address of the stored data is obtained.
S26: the stored data is written to the second storage device based on the logical address.
The S25 and S26 are the same as S13 and S14 in fig. 1, and specific reference is made to S13 and S14 and the related text descriptions thereof, which are not repeated here.
Referring to fig. 7, fig. 7 is a flowchart of a third embodiment of a data recovery method according to the present application. The data recovery method of the present embodiment is a flowchart of a refinement embodiment of the data recovery method in fig. 3, and includes the following steps:
s31: a communication connection is established with the first storage device.
The S31 is the same as S11 in fig. 1, please refer to S11 and the related text descriptions thereof, and the detailed description is omitted herein.
S32: and acquiring the characteristic parameters of the first storage device.
It can be understood that in order to distinguish products of different companies and protect user data privacy, when recovering data in the first storage device which cannot normally work, whether the corresponding intelligent terminal has data recovery authority to the current first storage device is also required to be judged.
Specifically, the feature code or signal corresponding to the first storage device and sent to the intelligent terminal is detected, so as to obtain the feature parameter of the first storage device, for example, any reasonable feature parameter such as the model number or the product serial number of the first storage device, so that the first storage device is identified and distinguished through the feature parameter.
S33: and judging whether the first storage device is in a preset support list or not based on the characteristic parameters.
Further, a preset support list with data recovery authority is established in advance according to the characteristic parameters of the first storage device in the intelligent terminal, so that when the characteristic parameters of the first storage device are acquired, whether the first storage device currently connected to the intelligent terminal has the data recovery authority can be judged based on whether the characteristic parameters exist in the preset support list.
Wherein, if the first storage device is in the preset support list of the intelligent terminal, S34 is performed, and if the first storage device is not in the preset support list of the intelligent terminal, S37 is performed.
S34: and in response to the first storage device operating in the engineering mode, reading the stored data of the first storage device.
S35: and responding to the stored data as logic data, and acquiring a logic address of the stored data.
S36: the stored data is written to the second storage device based on the logical address.
The S34, S35 and S36 are the same as S12, S13 and S14 in fig. 1, and refer to S12, S13 and S14 and their related text descriptions, and are not repeated here.
S37: the current recovery procedure is ended.
Specifically, when it is determined that the first storage device does not exist in the preset support list of the intelligent terminal, it is indicated that the intelligent terminal does not have data recovery authority on the first storage device, the current data recovery program needs to be ended, and corresponding prompt information is popped up to inform the user.
Referring to fig. 8, fig. 8 is a flowchart of a fourth embodiment of the data recovery method of the present application. The data recovery method of the present embodiment is a flowchart of a refinement embodiment of the data recovery method in fig. 1, and includes the following steps:
s41: a communication connection is established with the first storage device.
S42: and in response to the first storage device operating in the engineering mode, reading the stored data of the first storage device.
S43: and responding to the stored data as logic data, and acquiring a logic address of the stored data.
S44: the stored data is written to the second storage device based on the logical address.
The S41, S42, S43 and S44 are the same as S11, S12, S13 and S14 in fig. 1, and specific reference is made to S11, S12, S13 and S14 and the related text descriptions thereof, and are not repeated here.
S45: the model number of the first storage device and the number of storage chips included in the first storage device are acquired.
It can be understood that, since the data recovery of the stored data in the first storage device is specifically performed sequentially, the specific storage space of the first storage device needs to be determined, so as to prevent the data recovery program from ending in advance, and ensure that important data is not missed.
Since mass production mode is a mainstream production mode in the industry, industrial products of the same model will generally have the same functional parameters, for example, storage devices of the same model will generally have the same storage space size.
Specifically, to obtain a specific storage space size of the first storage device, before or during data recovery of the first storage device, the model number of the first storage device and the number of storage chips included in the first storage device need to be obtained, so as to further determine the storage space size of the first storage device.
S46: and judging whether all storage spaces of the first storage device are traversed currently or not based on the model numbers and the quantity.
Further, after the model number of the first storage device and the number of the storage chips included in the first storage device are obtained, the storage space size of the first storage device can be further determined, so as to determine whether the currently performed data recovery has traversed all storage spaces of the first storage device.
If all the storage spaces of the first storage device have been traversed currently, S47 is executed, and if all the storage spaces of the first storage device have not been traversed currently, S42 is executed again until all the storage spaces of the first storage device have been traversed.
S47: and ending the current data recovery flow in response to traversing all the storage spaces of the first storage device.
Specifically, when it is determined that all the storage spaces of the first storage device have been traversed, it indicates that the data originally stored in the first storage device has been completely restored to the specified image file or the specified second storage device for restoration, and the current data restoration process may be ended.
Referring to fig. 9, fig. 9 is a flowchart of an embodiment of a data recovery method of the present application. The embodiment comprises the following steps:
S51: a storage device is selected.
Specifically, a storage device that has failed to function properly is selected to connect to the intelligent terminal loaded with the restore application.
S52: and judging whether the storage device is in a preset support list of the recovery application program.
And acquiring characteristic parameters of the storage device, such as a product model, so as to determine whether the product model exists in a preset support list preset in a recovery application program of the intelligent terminal.
Wherein S53 is performed if the storage device is in the preset support list of the resume application, and S54 is performed if the storage device is not in the preset support list of the resume application.
S53: whether to enter an engineering mode.
Further, it is detected whether the memory device enters an engineering mode, for example, whether a preset pin of the memory device is shorted.
Wherein S55 is performed if the storage device enters the engineering mode, and S54 is performed if the storage device does not enter the engineering mode.
S54: recovery failed.
Specifically, when it is determined that the storage device is not in a preset support list of the recovery application program or the storage device does not enter the engineering mode, it is determined that the recovery fails, and corresponding prompt information is popped up to remind a user.
S55: and downloading special data recovery firmware.
Specifically, because the storage device cannot normally work, in order to ensure that the storage device can be effectively read or obtained data, the intelligent terminal specifically sends the data recovery firmware to the storage device so as to cover the original firmware in the first storage device, so that the storage device runs the data recovery firmware.
S56: and acquiring characteristic parameters of the storage device.
It can be understood that, in order to distinguish products of different companies and protect privacy of user data, when recovering data in the first storage device which cannot normally work, it is also required to determine whether the first storage device has a right to recover the data.
Specifically, the feature code or signal corresponding to the first storage device and sent to the intelligent terminal is detected, so as to obtain the feature parameter of the first storage device, for example, any reasonable feature parameter such as the model number or the product serial number of the first storage device, so as to identify and distinguish the first storage device.
S57: traversing all storage space of the storage device.
Specifically, the storage space of the storage device is traversed to sequentially acquire the storage data in the storage device until all the storage spaces of the storage device are traversed.
S58: whether the data type of the metadata record of the currently acquired storage data is logic data or not.
It will be appreciated that when the storage device, for example, an SSD, programs data written in the host to its NAND FLASH (flash memory), its corresponding data attribute, logical address, and writing order, that is, metadata, are recorded in the metadata of each 4K data.
When data recovery is needed, the SSD can enter an engineering mode through a preset method, and then the main control operation special data recovery firmware is downloaded and enabled. The private data recovery firmware may be responsive to a vendor provided private data recovery application. The dedicated data recovery tool traverses all NAND FLASH spaces in the SSD through commands, namely traverses from Page 0 (0 th sequence number storage Page) of Block 0 (the 0 th sequence number of the minimum storage and processing unit in the database) to the last Page of the last Block in sequence, and decides whether to recover the data, the recovered logical address and other operations according to the content of the metadata of each 4K. After the traversing is completed, the content of the original disk is completely backed up to the appointed mirror image file or the appointed new disk.
Wherein S59 is performed if the current storage data is logic data, and S57 is performed if the current storage data is not logic data.
S59: whether the data writing order of the metadata record is the latest.
It will be appreciated that it is generally unavoidable that the same memory data will be present in the data storage of the memory device, for example, where memory data having the same logical address is written to the memory device multiple times.
Specifically, the intelligent terminal may obtain the writing sequence of the storage data corresponding to the record in the metadata by reading the metadata space of the storage device, and determine whether the currently restored storage data is the storage data that is newly written into the storage device according to the writing sequence, that is, the writing sequence is the storage data that is finally written into the storage device.
Wherein S510 is performed if the current writing order is up-to-date, and S57 is performed if the current writing order is not up-to-date.
S510: restore to an image file or restore to a specified hard disk.
Further, determining whether the current restore and storage mode restores the stored data to an image file or to a specified hard disk, specifically, may be determined by program setting or receiving a selection instruction input by a user.
Wherein S511 is performed if it is determined to restore the current storage data to the image file, and S512 is performed if it is determined to restore the current storage data to the specified hard disk.
S511: and writing the data just read out into the offset position of the appointed mirror image file according to the logical address of the metadata record, and completing the recovery of one data.
And when the current stored data is restored to the mirror image file, writing the data which is just read out into the offset position of the appointed mirror image file according to the logic address of the metadata record so as to finish the restoration of one data.
S512: and writing the data just read out into the same logical address of the appointed hard disk according to the logical address of the metadata record, and completing the recovery of one data.
When the current stored data is restored to the appointed hard disk, the data which is just read out is written into the same logic address of the appointed hard disk according to the logic address recorded by the metadata, and the restoration of one data is completed.
S513: it is detected whether all storage space has been traversed.
Specifically, whether all storage spaces have been traversed is detected, for example, by determining whether all storage spaces have been traversed currently through a predetermined storage space size of the storage device.
Wherein, if all the storage spaces have been currently traversed, S514 is performed, and if all the storage spaces have not been currently traversed, S57 is performed.
S514: the recovery is completed.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an embodiment of a memory device of the present application. The data recovery device 61 comprises a memory 611 and a processor 612 coupled to each other; the memory 611 stores program data; processor 612 is configured to execute program data to implement a data recovery method as described in any of the above.
In one embodiment, the data recovery device 61 specifically includes an interface (not shown), a first storage space (not shown), a second storage space (not shown), and a processor 612 that are coupled to each other; the interface is used for connecting a storage device to be restored, the first storage space stores program data, and the processor 612 is used for executing the program data to implement any one of the data restoring methods above, so as to store the storage data in the storage device into the second storage space.
Optionally, the storage device may specifically be one of any reasonable storage devices such as SSD (Solid State Disk), UFS (Universal Flash Storage, universal flash memory), eMMC (embedded Multi Media Card ), and the like, which is not limited in this application.
Optionally, the data recovery device 61 may be any reasonable intelligent terminal capable of running an application program, such as a computer, a tablet computer, a smart phone, and a server, which is not limited in this application.
Specifically, the processor 612 may also be referred to as a CPU (Central Processing Unit ). The processor 612 may be an integrated circuit chip having signal processing capabilities. The processor 612 may also be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a Field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 612 may be commonly implemented by an integrated circuit chip.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an embodiment of a computer readable storage medium of the present application. The computer-readable storage medium 71 stores program instructions 711 executable by a processor, the program instructions 711 for implementing the data recovery method according to any one of the above.
In the several embodiments provided in the present application, it should be understood that the disclosed methods and apparatuses may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical, or other forms.
The elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over network elements. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all or part of the technical solution contributing to the prior art or in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.

Claims (12)

1. A data recovery method for a storage device, the data recovery method comprising:
establishing a communication connection with a first storage device;
reading stored data of the first storage device in response to the first storage device operating in an engineering mode;
responding to the stored data as logic data, and acquiring a logic address of the stored data;
the stored data is written to a second storage device based on the logical address.
2. The data recovery method according to claim 1, wherein the step of reading the stored data of the first storage device includes:
transmitting data recovery firmware to the first storage device to enable the first storage device to run the data recovery firmware;
and sending a data reading instruction to the first storage device running the data recovery firmware so as to read the storage data.
3. The data recovery method according to claim 1, wherein after the step of reading the stored data of the first storage device in response to the first storage device operating in the engineering mode, the step of acquiring the logical address and the writing order of the stored data in response to the stored data being logical data includes:
Reading metadata of the stored data;
and judging whether the stored data is logic data or not based on the data attribute of the stored data which is correspondingly recorded in the metadata.
4. A data recovery method according to claim 3, wherein the step of obtaining the logical address of the stored data comprises:
and acquiring the logic address of the storage data corresponding to the record in the metadata.
5. The data recovery method of claim 1, wherein the step of writing the stored data to a second storage device based on the logical address comprises:
and writing the storage data into the second storage device at a storage position corresponding to the logic address.
6. The data recovery method of claim 1, wherein the step of writing the stored data to a second storage device based on the logical address comprises:
acquiring the writing sequence of the storage data;
and writing the last written data in the storage data which is written into the first storage device for multiple times and has the same logical address into a storage position corresponding to the logical address in the second storage device according to the writing sequence.
7. The data recovery method of claim 1, wherein the step of writing the stored data to a second storage device based on the logical address comprises:
writing the storage data into a corresponding offset position of a set mirror image file according to the logic address;
and storing the setting image file to the second storage device.
8. The data recovery method according to claim 7, wherein the step of writing the stored data to the corresponding offset position of the set image file according to the logical address includes:
acquiring the writing sequence of the storage data;
and writing the last written data in the storage data with the same logical address written into the first storage device for multiple times into the offset position corresponding to the logical address in the setting mirror image file according to the writing sequence.
9. The data recovery method of claim 1, wherein after the step of establishing a communication connection with a first storage device, the step of reading the stored data of the first storage device in response to the first storage device operating in an engineering mode further comprises:
Acquiring characteristic parameters of the first storage device;
judging whether the first storage device is in a preset support list or not based on the characteristic parameters;
the step of reading the stored data of the first storage device in response to the first storage device operating in the engineering mode, comprises:
and in response to the first storage device being in the preset support list and the first storage device being operating in the engineering mode, reading the stored data in the first storage device.
10. The data recovery method according to claim 1, further comprising, after the step of writing the stored data to a second storage device based on the logical address:
acquiring the model number of the first storage device and the number of the storage chips included in the first storage device;
judging whether all storage spaces of the first storage device are traversed currently or not based on the model number and the number;
and ending the current data recovery flow in response to traversing all the storage spaces of the first storage device.
11. A data recovery device, wherein the data recovery device comprises a memory and a processor coupled to each other;
The memory stores program data;
the processor is configured to execute the program data to implement the data recovery method according to any one of claims 1-10.
12. A computer readable storage medium having stored thereon program instructions, which when executed by a processor implement the data recovery method of any of claims 1-10.
CN202111284231.6A 2021-11-01 2021-11-01 Data recovery method, data recovery device and computer readable storage medium Pending CN116069552A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111284231.6A CN116069552A (en) 2021-11-01 2021-11-01 Data recovery method, data recovery device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111284231.6A CN116069552A (en) 2021-11-01 2021-11-01 Data recovery method, data recovery device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116069552A true CN116069552A (en) 2023-05-05

Family

ID=86168600

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111284231.6A Pending CN116069552A (en) 2021-11-01 2021-11-01 Data recovery method, data recovery device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116069552A (en)

Similar Documents

Publication Publication Date Title
JP6585072B2 (en) Safe reading of data into non-volatile memory or secure elements
CN110838953B (en) Test method, test system, electronic equipment and storage medium
JPS6150354B2 (en)
CN112596672B (en) Storage processing method and device of main control chip, processor and electronic equipment
CN109582332B (en) System upgrading method and device for Internet camera
CN113835729B (en) Upgrading method, upgrading device, terminal equipment and computer readable storage medium
CN113672306B (en) Server component self-checking abnormity recovery method, device, system and medium
CN112015587B (en) Method and device for enhancing reliability of operating system
CN110505225B (en) Terminal card locking method and device and computer readable storage medium
CN116069552A (en) Data recovery method, data recovery device and computer readable storage medium
JP3028055B2 (en) PC card system and program rewriting method
CN111372235A (en) Identification card configuration information determination method and device, computer equipment and storage medium
CN116483416A (en) Firmware online upgrading method, server and storage medium
CN112631965A (en) Method and device for controlling hard disk access
CN114546537A (en) Starting sequence deployment method of multiple operating systems and related device
CN112052125A (en) Dump processing method and device for operating system kernel and electronic equipment
CN110297455B (en) Programmable logic controller and self-checking and recovery method thereof
CN105511848A (en) Method and device for detecting DLL
CN114726407B (en) Method, device, controller and storage medium for acquiring abnormal information
JP5786702B2 (en) Security token, instruction execution method in security token, and computer program
CN112667269A (en) Firmware upgrading method and device for water heater and water heater
CN109802846A (en) USB Key certificate environment detection method and device
CN114554531B (en) eSIM card failure recovery method, device, equipment and storage medium
CN117609262A (en) Chip serial number updating method, device, equipment and storage medium
CN108846300B (en) Information processing method and first electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination