Method and device for erasing and verifying data of SSD and HDD, computer equipment and storage medium

By detecting hard disk tray information, configuring erase policies, performing erase operations and verifying reports, the problems of inefficiency of existing hard disk erase tools and difficult to ensure data security are solved, and efficient and secure hard disk data erase and verification are achieved.

CN119806428APending Publication Date: 2025-04-11成都芯忆联信息技术有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510015252.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Existing hard disk erasing tools are inefficient and difficult to guarantee data security. They cannot be accurately processed when facing complex RAID connection methods, and do not consider hard disk health factors, resulting in hidden dangers in erasing operations.

Method used

By obtaining and detecting disk information of non-system disks in the hard disk, configure the final erase policy, perform the erase operation and generate an erase log, and finally verify the log and generate a report. The method includes disk information detection, erase policy configuration, erase operation execution and verification report generation, ensuring the accuracy and security of erase operation.

Benefits of technology

It enables users to flexibly select or customize erase strategies based on scenarios and needs, ensures that data is completely deleted and cannot be recovered, improves the execution efficiency of large-scale data destruction tasks, and reduces user manual operations through automated disk detection and health status judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806428A_ABST
    Figure CN119806428A_ABST
Patent Text Reader

Abstract

The invention provides an erasing and checking method and device for SSD and HDD hard disk data, computer equipment and a storage medium. The erasing and checking method comprises the following steps that disk information of a non-system disk in a hard disk is obtained and detected; configuring a final erasing strategy according to the disk information; executing an erasing operation according to the configured final erasing strategy, and generating an erasing log; and verifying the erasure log, and generating an erasure report. The technical problems that an existing hard disk erasing mode is low in efficiency, and data safety is difficult to guarantee are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of solid state hard disk testing, and more specifically to a method, device, computer equipment and storage medium for erasing and verifying SSD and HDD hard disk data. Background Art

[0002] As the digitalization process accelerates, the amount of data storage is growing explosively. SSDs are widely used in the field of data storage due to their advantages such as fast read and write speeds. In the management of data centers, enterprise servers and storage devices, it is crucial to ensure the safe deletion of data when data storage devices are reused, leased or scrapped. However, traditional data erasure tools have many defects. For example, when faced with complex RAID connection methods, the tools are often at a loss and cannot handle them accurately. At the same time, the health of the hard disk is not considered, which makes the erasure operation have hidden dangers. A single erasure method cannot adapt to diverse needs, the efficiency of multi-disk processing is low, and the verification and reporting functions are missing. These deficiencies seriously affect data security and management efficiency, and new technical solutions are urgently needed to solve them. Summary of the invention

[0003] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, computer equipment and storage medium for erasing and verifying SSD and HDD hard disk data, which aims to solve the technical problems that the existing hard disk erasing method is inefficient and data security is difficult to ensure.

[0004] To achieve the above object, the present invention adopts the following technical solutions:

[0005] A method for erasing and verifying SSD and HDD hard disk data, comprising the following steps:

[0006] Obtain and detect disk information of non-system disks in the hard disk;

[0007] Configure a final erase strategy according to the disk information;

[0008] Execute an erasure operation according to the configured final erasure policy and generate an erasure log;

[0009] The erasure log is verified and an erasure report is generated.

[0010] In one embodiment, the step of acquiring and detecting disk information of a non-system disk in the hard disk includes:

[0011] Scan the RAID configuration in non-system disks to identify and convert the connection method of the hard disks;

[0012] Under the connection mode, read the basic information of the disk;

[0013] The health status of the disk is determined based on the basic information of the disk.

[0014] In one embodiment, the step of configuring the final erasure strategy according to the disk information includes:

[0015] Pre-constructing an erasure strategy table, and storing available erasure modes in the erasure strategy table;

[0016] Determine and display the corresponding erasure method in the erasure strategy table based on the disk information;

[0017] Configure a preliminary erasure strategy based on the displayed erasure method;

[0018] A final erasure strategy is generated based on matching the preliminary erasure strategy with the disk information.

[0019] In one embodiment, the step of performing an erasure operation according to the configured final erasure policy and generating an erasure log includes:

[0020] According to the configured final erasure strategy, execute the corresponding erasure operation;

[0021] Obtain and integrate progress information during the erase operation;

[0022] An erasure log is generated according to the progress information.

[0023] In one embodiment, the step of generating an erase log according to the progress information includes:

[0024] Determining whether the erasing operation is completed;

[0025] If yes, the erasure operation has been completed, then checking the erasure log;

[0026] If not, the erasing operation is not completed, and then it is determined whether the erasing operation has timed out.

[0027] In one embodiment, the step of determining whether the erasing operation has timed out includes:

[0028] If yes, it is determined that the erasure operation fails, and the determination result is stored in the erasure report;

[0029] If not, return to the step of performing the erasure operation according to the configured final erasure policy.

[0030] In one embodiment, the step of verifying the erasure log and generating an erasure report includes:

[0031] Based on the erasure log, obtaining erasure information of the disk on which the erasure operation has been performed;

[0032] Comparing the erase information with the disk information of the non-system disk to obtain a data verification result;

[0033] An erasure report is constructed, and the data verification result is stored in the erasure report.

[0034] In one embodiment, a device for erasing and verifying SSD and HDD hard disk data includes:

[0035] The disk information detection module is used to scan and detect the disk information of the non-system disk in the hard disk;

[0036] The erasing mode selection module is used to judge and display the available erasing modes according to the disk information provided by the disk information detection module, and generate the final erasing strategy;

[0037] An erasure execution module, used for executing an erasure operation according to the final erasure strategy;

[0038] A data verification module, used to verify the disk that has been erased;

[0039] The report generation module is used to collect and integrate the working information of the disk information detection module, the erasure mode selection module, the erasure execution module and the data verification module to generate an erasure report.

[0040] A computer device comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.

[0041] A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the above method can be implemented.

[0042] Compared with the prior art, the present invention has the following advantages: (1) Users can flexibly select or customize erasure strategies according to scenarios and needs, and automatically verify after erasure, effectively preventing sensitive information leakage and ensuring that data is completely deleted and cannot be recovered. (2) Through automated disk detection and health status judgment, manual operations of users in complex storage environments are reduced. (3) Through customized erasure strategies, parallel erasure of multiple disks can be configured, significantly improving the execution efficiency of large-scale data destruction tasks, and being able to process multiple disks at the same time, shortening the total erasure time.

[0043] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram of a method for erasing and verifying SSD and HDD hard disk data provided by an embodiment of the present invention Figure 1 ;

[0045] Figure 2 A schematic diagram of a method for erasing and verifying SSD and HDD hard disk data provided by an embodiment of the present invention Figure 2 ;

[0046] Figure 3 A schematic diagram of a method for erasing and verifying SSD and HDD hard disk data provided by an embodiment of the present invention Figure 3 ;

[0047] Figure 4 A schematic diagram of a method for erasing and verifying SSD and HDD hard disk data provided by an embodiment of the present invention Figure 4 ;

[0048] Figure 5 A schematic diagram of a method for erasing and verifying SSD and HDD hard disk data provided by an embodiment of the present invention Figure 5 ;

[0049] Figure 6 A schematic diagram of a method for erasing and verifying SSD and HDD hard disk data provided by an embodiment of the present invention Figure 6 ;

[0050] Figure 7 A schematic diagram of a method for erasing and verifying SSD and HDD hard disk data provided by an embodiment of the present invention Figure 7 ;

[0051] Figure 8 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

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

[0054] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0055] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0056] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0057] See also Figure 1 As shown, the embodiment of the present invention discloses a method for erasing and verifying SSD and HDD hard disk data, comprising the following steps:

[0058] S100, obtaining and detecting disk information of a non-system disk in a hard disk;

[0059] Specifically, first, it is necessary to use a specific tool or program interface to scan the hard disk in the server or storage device. In this embodiment, the non-system disk is identified by the disk information detection module 510 to avoid misoperation of the disk necessary for system operation. For the identified non-system disk, it is necessary to further obtain its key information through the disk information detection module 510, including but not limited to the serial number of the disk, the protocol type (such as SATA, NVMe, etc.), the manufacturer information, and possible health status indicators (such as by reading SMART data), etc. Through the collection of this information, the basic situation of the disk can be fully understood, providing a basis for the subsequent erase strategy configuration. For example, if the protocol type of the disk is NVMe, then a specific erase method or tool compatible with the protocol may need to be used in subsequent erase operations.

[0060] S200, configuring a final erasure strategy according to the disk information;

[0061] Specifically, according to the disk information obtained in the first step, the appropriate erasing method and parameters are further determined. If the disk is an SSD, there may be different erasing methods such as block erasing and overwriting to choose from. Different erasing methods may differ in the thoroughness and efficiency of data clearing. For example, block erasing may be more suitable for quickly clearing a large amount of data, while overwriting can ensure the complete deletion of data by writing random data multiple times. At the same time, it is also possible to decide whether to perform the erasing operation based on the health status of the disk. If the disk has a serious fault, it may need to be repaired or marked as non-erasable first. In addition, the user's specific needs, such as whether multiple erasing is required, can also be considered, and the final erasing strategy can be configured based on these factors. By obtaining disk information and configuring a suitable erasing strategy, accurate data erasure can be performed according to different disk characteristics and user needs, which improves the effect of data erasure, ensures that the data is completely deleted, and reduces the risk of data leakage.

[0062] S300, performing an erasure operation according to the configured final erasure strategy, and generating an erasure log;

[0063] Specifically, according to the final erasing strategy determined in the previous step, the corresponding erasing tool or program module is called to perform the actual erasing operation. If it is multi-disk erasing, it may be necessary to coordinate multiple erasing processes at the same time to improve efficiency. During the erasing process, the progress of the erasing, the problems encountered, and other information should be recorded in real time to generate an erasing log. For example, record the time when each disk starts erasing, the amount of data that has been erased, whether an error occurs, and the type of error. This log information is very important for subsequent analysis and troubleshooting, and can also be used to monitor the execution of the erasing operation to ensure that the erasing process proceeds as expected.

[0064] S400: Verify the erasure log and generate an erasure report.

[0065] Specifically, after the erasure operation is completed, the erasure log needs to be analyzed and verified to check whether all data has been successfully erased as expected, whether there are any unhandled abnormal situations, etc. By verifying the log, the integrity and reliability of data erasure can be ensured. Then, an erasure report is generated based on the verification results and relevant information during the erasure process. The report should include basic information about the disk, the erasure strategy adopted, the erasure result (successful or failed), and possible suggestions (such as whether further processing is required for the failed disk). Such a report can help users and administrators understand the situation of the erasure operation, and also help meet compliance requirements and data security audits. The generated erasure logs and reports can record each link of the erasure process in detail, which is convenient for users and administrators to view and analyze at any time, which helps to trace the operation history, troubleshoot problems and monitor the execution of operations, and improve the controllability of the entire data erasure process.

[0066] See also Figure 2 As shown, in one embodiment, the step of acquiring and detecting the disk information of the non-system disk in the hard disk includes:

[0067] S110, scanning the RAID configuration in the non-system disk to identify and convert the connection mode of the hard disk;

[0068] Specifically, in a server or storage device environment, hard disks may exist in a variety of connection modes, among which RAID configuration is more common. First, the tool is run through Python to automatically detect the storage disks on the server and exclude the system disks; then the non-system disks are scanned through special tools or algorithms to detect whether there is a RAID group. If a RAID configuration is detected, the connection mode of the hard disk is converted to a mode that is more suitable for single-disk operation according to actual needs and the convenience of subsequent erase operations. In this embodiment, the RAID mode is converted to JBOD (Just a Bunch Of Disks) mode through an external tool. For example, in some RAID configurations, data may be stored in a dispersed manner on multiple hard disks, and there is redundant information. In this case, direct erasure may encounter difficulties or cause data residue; after converting it to JBOD mode, subsequent disk information reading and erasing operations can be performed like operating a single independent hard disk, which simplifies the operation process and improves the feasibility of the operation.

[0069] It is understandable that in this embodiment, the management and conversion of RAID configuration are realized through external tools Storcli and Sas3ircu, so as to convert the RAID group disk into JBOD mode. The two tools Storcli and Sas3ircu are necessary for processing RAID environment, and they interact with the storage controller through the command line interface. The problem of data erasure under complex RAID configuration is solved by identifying and converting the hard disk connection mode through external tools, so that subsequent disk information reading and erasing operations can be carried out smoothly, and the accuracy and success rate of the operation are improved. The health status and properties of the storage disk are read through Smartctl, including serial number, manufacturer information, interface type and other information. Reading the basic information of the disk provides detailed disk parameters for the entire data erasure process, which helps to select the most appropriate erasure strategy and tools according to different disk characteristics, and improves the pertinence and effectiveness of data erasure.

[0070] S120, reading basic information of the disk in the connection mode;

[0071] Specifically, after the connection method of the hard disk is determined, the basic information of the disk is read using the corresponding interface and tools. This information includes but is not limited to the serial number of the disk, which is the unique identifier of the disk and is used to distinguish different disks in the entire storage system; the protocol interface type of the disk, such as SATA (Serial Advanced Technology Attachment), NVMe (Non-Volatile Memory Express), etc. Different protocol interfaces have differences in data transmission speed, command set, etc. Understanding the protocol interface type helps to choose the appropriate erasing method and tool; manufacturer information, disks from different manufacturers may differ in performance, reliability and compatibility, and manufacturer information can provide a reference for subsequent operations; and information such as the capacity of the hard disk. By accurately obtaining this basic information, a comprehensive data foundation is provided for subsequent operations.

[0072] S130: Determine the health status of the disk according to the basic information of the disk.

[0073] Specifically, based on the basic information of the disk read, especially using the serial number and other information of the disk, the SMART (Self-Monitoring, Analysis and Reporting Technology) data of the disk can be further obtained. SMART data contains various health indicators of the disk, such as the hard disk's read and write error rate, temperature, motor start / stop times, etc. The health status of the disk can be evaluated by analyzing these indicators and judging the threshold. For example, if the read and write error rate exceeds the normal range, or the hard disk temperature continues to be too high, it may indicate that the disk has a potential failure risk. Based on the judgment result of the health status, it can be decided whether to continue the data erasure operation. If the disk is in poor health, it may be necessary to repair it first or take other measures to avoid problems such as data loss or erasure failure during the erasure process.

[0074] It can be understood that in this embodiment, Smartctl is used to read the health status and properties of the storage disk, including serial number, manufacturer information, interface type, etc. Reading the basic information of the disk provides detailed disk parameters for the entire data erasure process, which helps to select the most appropriate erasure strategy and tool according to different disk characteristics, thereby improving the pertinence and effectiveness of data erasure.

[0075] See also Figure 3 As shown, in one embodiment, the step of configuring the final erasure strategy according to the disk information includes:

[0076] S210, pre-constructing an erasure strategy table, and storing available erasure modes in the erasure strategy table;

[0077] Specifically, during the system design phase, developers sort out various feasible erasure methods based on different types of storage disks (such as SSDs and HDDs) and common data erasure requirements and standards, and organize them into an erasure strategy table. For example, for SSDs, it mainly includes block erasure, multiple overwrite erasure, etc., while for HDDs, it mainly includes overwrite erasure, etc. This strategy table can be stored in the system's database or configuration file for subsequent query and call. By pre-building such a table, it provides a basis for quickly selecting the appropriate erasure method according to the specific situation of the disk.

[0078] S220, judging and displaying a corresponding erasure method in an erasure strategy table based on the disk information;

[0079] Specifically, after obtaining the disk information, the system will search for available erasure methods that match the disk in the erase strategy table based on factors such as the disk type (such as determining whether it is an SSD or HDD through the read protocol interface or other identification information), health status, etc. Then, these eligible erasure methods are displayed to the user or the relevant operation interface. For example, if the disk is a healthy SSD, options such as block erase and a specific number of overwrite erases may be displayed for the user to further select. This ensures that the user or system can operate within the scope of legal and valid erasure methods, and avoids selecting an erasure method that is not suitable for the current disk.

[0080] S230, configuring a preliminary erasure strategy according to the displayed erasure mode;

[0081] Specifically, the user or system selects one or more erasure methods based on the displayed erasure methods and actual needs, such as the sensitivity of the data and the urgency of erasure, and sets relevant parameters, such as the number of erasures and whether verification is required, so as to form a preliminary erasure strategy. For example, for highly sensitive data, the user may choose to overwrite and erase multiple times and add a verification link; for general data, a simple block erase method may be selected. This preliminary erasure strategy is the basis for further optimization and determination of the final strategy. By pre-building a strategy table and a screening and matching process based on disk information, it can ensure that the selected erasure method meets the actual situation of the disk and data security requirements, avoid arbitrary or incorrect selection of erasure methods, and improve the effect and security of data erasure.

[0082] S240 . Generate a final erasure strategy based on matching the preliminary erasure strategy with the disk information.

[0083] Specifically, the system will check the compatibility of the preliminary erasure strategy with the disk information again. For example, check whether the selected erasure method is fully compatible with the protocol interface of the disk, whether the health status of the disk can support the selected number of erasures, etc. If a mismatch is found, the system will automatically adjust or prompt the user to modify the policy. After such verification and adjustment, the final erasure strategy is generated to ensure that there will be no problems caused by unreasonable strategies when the erasure operation is actually performed, effectively reducing erasure failures, data corruption or residues caused by incompatibility between the strategy and the disk, and ensuring the stability and reliable results of the data erasure process. Users can choose from the displayed erasure methods according to different needs, and customize the erasure strategy through parameter settings. At the same time, the system can ensure the feasibility of the strategy, so that the entire data erasure operation can adapt to various complex scenarios and different types of data processing requirements.

[0084] See also Figure 4 As shown, in one embodiment, the step of performing an erasure operation according to the configured final erasure policy and generating an erasure log includes:

[0085] S310, executing a corresponding erasure operation according to the configured final erasure strategy;

[0086] Specifically, when the final erasure strategy is determined, the system will call the corresponding erasure tool or execution module to implement data erasure. If the final strategy is to perform block erasure on the SSD, the system will start the program code or command specifically for SSD block erasure, and clear the data blocks on the hard disk according to the predetermined rules and procedures. For situations involving multi-disk erasure, the erasure process of multiple disks will be coordinated according to the strategy to ensure that each disk deletes data in the prescribed manner and order. For example, in the storage device decommissioning scenarios of some large-scale data centers, it may be necessary to erase dozens or even hundreds of hard disks at the same time. At this time, the system will efficiently allocate resources and schedule erasure tasks to ensure that the erasure operation is carried out in an orderly manner. Accurately executing the erasure operation according to the final erasure strategy ensures the pertinence and effectiveness of data erasure, can meet the requirements for complete data deletion in different scenarios, and reduces the risk of data leakage.

[0087] It can be understood that in this embodiment, through the integration of the external tool Python script and the Scrub tool, data erasure commands can be issued to multiple storage disks at the same time, thereby realizing parallel data erasure operations on multiple storage disks. Specifically, for the erasure strategy configured by the user, if multiple disks are configured in the strategy, during the erasure process, the tool will display the erasure progress in real time and provide the erasure status of each disk. Detailed logs during the erasure process are automatically generated to ensure the transparency of the operation process. The system will first automatically identify all storage devices connected to the computer and pass a list of these devices to the Python script. Then, the script uses multi-process technology to create multiple parallel tasks, and simultaneously issues multiple erasure commands to start multiple Scrub processes, overwriting the original data on the storage disks, realizing multi-disk parallel erasure, and ensuring that the data cannot be restored after erasure. Through multi-disk parallel erasure, the execution efficiency of large-scale data destruction tasks is significantly improved, and the total erasure time is shortened. It is particularly suitable for scenarios such as data centers and server management that need to process a large number of hard disks.

[0088] S320, obtaining and integrating progress information of the erasing operation process;

[0089] Specifically, during the execution of the erase operation, the system will monitor the progress of each erase process in real time through various technical means. For single-disk erasure, information such as the proportion of erased data to the total data volume, the current erasure speed, and the estimated remaining erasure time may be obtained. For multi-disk erasure, in addition to the above-mentioned single-disk progress information, the number of disks that have been erased, the disks being erased and their progress will also be counted. This progress information will be collected and summarized from different erasure processes and hardware devices for unified management and analysis.

[0090] S330: Generate an erasure log according to the progress information.

[0091] Specifically, based on the collected and integrated progress information, the system will generate an erasure log in a certain format and specification. The log will record the erasure status at each time point in detail, including the start time, current time, progress details of each disk (such as disk serial number, erased ratio, whether there are any abnormalities, etc.) and the overall progress of the entire erasure task. These log information will be stored in the local file system or database for subsequent viewing and analysis.

[0092] See also Figure 5 As shown, in one embodiment, the step of generating an erase log according to the progress information includes:

[0093] S331, determining whether the erasing operation is completed;

[0094] Specifically, the system determines whether the erasing operation has reached the completion state by continuously monitoring the erasing progress information based on the comparison between the amount of erased data and the total amount of data. When the amount of erased data is equal to the total amount of data, it is preliminarily determined that the erasing operation is completed. Alternatively, the end signal of each erasing process is used to comprehensively determine whether the entire erasing task is completed. For example, for multi-disk erasing, if the erasing processes corresponding to all disks have sent a completion signal, then the erasing operation is considered to be completed. In this process, it is necessary to accurately track and count various data and signals to ensure the accuracy of the judgment.

[0095] S3311. If yes, the erasure operation is completed, verifying the erasure log;

[0096] Specifically, when it is determined that the erase operation is completed, the verification procedure for the erase log is immediately started. The verification process may include checking the integrity of the log to ensure that all erase records exist and no data is lost or damaged. For example, verify whether the erase process records of each disk are continuous and whether there are any missing time points or key information. At the same time, it will also check whether the data in the log is consistent with the expected results of the actual erase operation, such as whether all disks have successfully completed the erase according to the predetermined erase strategy, whether any abnormal situations are correctly recorded in the log, etc. Through this verification, the reliability of the erase log can be guaranteed, providing an accurate data basis for subsequent analysis and report generation.

[0097] S3312: If no, the erasing operation is not completed, then determine whether the erasing operation has timed out.

[0098] Specifically, if the erasure operation has not been completed, the system will further determine whether it has exceeded the preset time limit. This time limit may be set based on experience or specific performance requirements. For example, for some large-scale data erasure tasks, a total erasure time limit may be set. If the erasure is not completed within this time, a timeout judgment is required. In this way, possible problems can be discovered in a timely manner, such as insufficient system resources, hard disk failure, or inefficient erasure algorithm, so that corresponding measures can be taken, such as increasing resources, checking hardware, or adjusting the erasure strategy.

[0099] Further, the step of determining whether the erasing operation has timed out includes:

[0100] S33121. If yes, determine that the erasure operation fails, and store the determination result in the erasure report;

[0101] Specifically, when it is determined that the erase operation has timed out, the system will clearly mark the erase operation as a failed state. This determination result will be recorded by the system and integrated into the erase report in a predetermined format. In the erase report, the reason for the failure of the erase operation will be detailed as a timeout, and the relevant time information, the disk information involved, etc. will also be recorded. Such records provide key clues for subsequent processing and help determine whether the timeout is caused by insufficient system resources, hard disk performance problems, or other factors.

[0102] S300: If not, return to executing the erasure operation according to the configured final erasure strategy.

[0103] Specifically, if it is determined that the erasing operation has not timed out, the system will automatically switch back to continue the erasing operation. This means that the system will continue to advance according to the final erasing strategy configured previously, based on the current erasing progress and remaining tasks. For example, if during the erasing process a disk progresses a little slower due to a large amount of data, but does not meet the timeout criteria, the system will continue to call the corresponding erasing tool or program to clear the data on the disk, ensuring that the entire erasing task can continue until it is finally completed or it is determined to have timed out again.

[0104] By accurately determining the erase operation that has timed out and recording the results in the report, comprehensive management of the erase operation is achieved. Whether the erase operation is successfully completed or fails due to timeout or other reasons, there are clear records and feedback, which makes it convenient for users and administrators to control and analyze the overall situation of data erasure. If the erase operation does not time out, it can automatically return to continue execution, ensuring that the erase task will not be easily interrupted when encountering some temporary minor problems (such as slowdowns caused by short-term system resource fluctuations), improving the system's fault tolerance and overall stability, and helping to ensure the smooth completion of data erasure work.

[0105] See also Figure 6 As shown, in one embodiment, the step of verifying the erasure log and generating an erasure report includes:

[0106] S410, based on the erasure log, obtaining erasure information of the disk on which the erasure operation has been performed;

[0107] Specifically, the erase log records detailed information about each disk during the erase process, including but not limited to the start erase time, end erase time, erase method, and whether there are any abnormalities during the erase process. The system summarizes and organizes the information related to the erased disk by parsing and extracting the erase log. For example, the system selects the record with the disk serial number [X] from the log, obtains the block erase method used, and the information that the erase was completed within [specific time interval] without abnormalities, and forms an erase information set for the disk, in preparation for subsequent data verification and report generation.

[0108] S420, comparing the erase information with the disk information of the non-system disk to obtain a data verification result;

[0109] Specifically, the erase information obtained from the erase log is compared with the disk information of the non-system disk obtained initially. First, check whether the disk serial number is consistent to ensure the accuracy of the data source. Then, compare whether the erasure method is as expected, for example, for a specific SSD disk, whether it is operated according to the predetermined block erase or overwrite erase method. In addition, a comprehensive analysis is performed based on the completion status and other information in the erase log and the initial status of the disk. If the erase log shows that the disk has been successfully erased without abnormalities, and it matches the initial information and erase strategy of the disk, then the data verification result is successful; conversely, if there is inconsistent information or an abnormality occurs in the erasure process that is not reasonably explained in the log, the data verification result is a failure.

[0110] S430: Construct an erasure report, and store the data verification result in the erasure report.

[0111] Specifically, an erase report is constructed based on the data verification results and other related information. The report structure includes a header, such as fields such as disk serial number, disk type, erase method, erase time, data verification results, etc. For each erased disk, fill in the corresponding information in the corresponding fields in turn.

[0112] Figure 7 1 is a schematic block diagram of a device for erasing and verifying SSD and HDD hard disk data provided by an embodiment of the present application. Figure 7 As shown, corresponding to the above-mentioned method for erasing and verifying SSD and HDD hard disk data, the present application also provides an SSD and HDD hard disk data erasing and verifying device 500. The SSD and HDD hard disk data erasing and verifying device 500 includes a unit for executing the above-mentioned method for erasing and verifying SSD and HDD hard disk data, and the device can be configured in a desktop computer, a tablet computer, a laptop computer, and other terminals.

[0113] Specifically, see Figure 7 As shown, the SSD and HDD hard disk data erasing and verification device 500 includes:

[0114] The disk information detection module 510 is used to scan and detect the disk information of the non-system disk in the hard disk;

[0115] Specifically, the disk information detection module 510 undertakes the key task of scanning the hard disk in the server or storage device. It must first accurately distinguish between system disks and non-system disks to avoid unnecessary operations on disks necessary for system operation. For the identified non-system disks, in-depth detection is performed using specific tools and technical means. At the same time, it is necessary to determine the protocol type of the disk, such as SATA, NVMe, etc. Different protocol types determine the mode and efficiency of subsequent data transmission and erasure operations. In addition, the connection method of the disk will also be detected, especially for possible RAID configurations, to identify its RAID level and structure for subsequent appropriate conversion or processing. By reading the SMART data of the disk and analyzing the health status of the disk, such as the hard disk's read and write error rate, temperature, motor start / stop times and other indicators, potential hardware problems can be discovered in advance to ensure that data erasure operations are performed under reliable hardware conditions.

[0116] The erasing mode selection module 520 is used to determine and display available erasing modes according to the disk information provided by the disk information detection module 510, and generate a final erasing strategy;

[0117] Specifically, based on the comprehensive disk information provided by the disk information detection module 510, the erasure mode selection module 520 plays a key decision-making role. It first accesses the pre-built erasure strategy table, which stores the available erasure modes for different types of disks (SSD and HDD) and various scenarios. For example, for SSD, there may be block erasure, multiple overwrite erasure, etc., while for HDD, the main overwrite erasure mode is overwrite erasure, but the applicability of each mode is different under different health status and data security requirements. According to the type and health status of the disk and the specific needs of the user (such as the sensitivity of the data, the urgency of erasure, etc.), the appropriate erasure mode is selected from the erasure strategy table and displayed to the user or the system operation interface. The user can further select and adjust according to the actual situation, or the system automatically determines the final erasure strategy according to the preset rules. In the process of determining the final erasure strategy, the compatibility of the disk information and the erasure mode should be fully considered to ensure that the selected erasure mode can be effectively executed on the current disk to avoid erasure failure or data damage caused by incompatibility.

[0118] An erasure execution module 530, configured to execute an erasure operation according to the final erasure strategy;

[0119] Specifically, once the erasure execution module 530 receives the final erasure strategy determined by the erasure mode selection module 520, it will quickly start the corresponding erasure tool or program code. If the SSD is to be block erased, it will call the underlying driver or algorithm specifically for SSD block erase to quickly clear the data blocks on the hard disk according to the predetermined rules and procedures. In the process of executing the erasure operation, for the case of multi-disk erasure, it is necessary to efficiently coordinate the erasure process of multiple disks to ensure that each disk can delete data in the prescribed order and time interval, make full use of system resources, and improve the erasure efficiency. At the same time, it is necessary to monitor the execution of the erasure process in real time, including information such as the amount of erased data, the amount of remaining data, and the erasure speed, to provide an accurate data source for subsequent data verification and log generation.

[0120] The data verification module 540 is used to verify the disk that has been erased;

[0121] Specifically, the data verification module 540 assumes important quality inspection responsibilities after the erasure operation is completed. It first obtains the execution result information of the erasure execution module 530, including the erasure status of each disk, whether an abnormality occurs, etc. Then, by sampling and checking the random positions of the erased disk, it verifies whether the original data has been completely overwritten or deleted. For example, for disks that use an overwrite erasure method, check whether the new data written is complete and there is no residual trace of the original data. For block-erased disks, confirm whether all data blocks have been correctly cleared. During the verification process, data security standards and algorithms must be strictly followed to ensure the accuracy and reliability of the verification results. If it is found that the data verification fails, the detailed error information must be recorded in time for subsequent analysis and processing.

[0122] The report generation module 550 is used to collect and integrate the working information of the disk information detection module 510, the erasure mode selection module 520, the erasure execution module 530 and the data verification module 540 to generate an erasure report.

[0123] Specifically, the report generation module 550 is used to collect key data such as the disk initial information provided by the disk information detection module 510, the erasure strategy determined by the erasure mode selection module 520, the execution process information of the erasure execution module 530, and the verification result of the data verification module 540. These data are sorted and integrated according to the predetermined format and specification to generate a detailed erasure report. The content of the report includes the disk serial number, disk type, initial capacity, adopted erasure mode, erasure time, erasure result (success or failure), data verification result and possible suggestions (such as whether the failed disk needs further processing).

[0124] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned SSD and HDD hard disk data erasing and verification device and each unit can refer to the corresponding description in the aforementioned method embodiment. For the convenience and conciseness of the description, it will not be repeated here.

[0125] The above-mentioned SSD and HDD hard disk data erasing and verification device 500 can be implemented in the form of a computer program, and the computer program can be run on the computer device as shown in the figure.

[0126] See also Figure 8 , Figure 8 600 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 600 can be a terminal or a server, wherein the terminal can be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server can be an independent server or a server cluster composed of multiple servers.

[0127] See also Figure 8 As shown, the computer device 600 includes a processor 620 , a memory, and a network interface 650 connected via a system bus 610 , wherein the memory may include a non-volatile storage medium 630 and an internal memory 640 .

[0128] The non-volatile storage medium 630 can store an operating system 631 and a computer program 632. The computer program 632 includes program instructions, and when the program instructions are executed, the processor 320 can execute a method for erasing and verifying SSD and HDD hard disk data.

[0129] The processor 620 is used to provide computing and control capabilities to support the operation of the entire computer device 600 .

[0130] The internal memory 640 provides an environment for the operation of the computer program 632 in the non-volatile storage medium 630. When the computer program 632 is executed by the processor 620, the processor 620 can execute a method for erasing and verifying SSD and HDD hard disk data.

[0131] The network interface 650 is used to communicate with other devices through a network. Figure 8 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 600 to which the solution of the present application is applied. The specific computer device 600 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0132] It should be understood that in the embodiment of the present application, the processor 620 may be a central processing unit (CPU), and the processor 620 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0133] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0134] Therefore, the present application also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the following steps:

[0135] S100, obtaining and detecting disk information of a non-system disk in a hard disk;

[0136] S200, configuring a final erasure strategy according to the disk information;

[0137] S300, performing an erasure operation according to the configured final erasure strategy, and generating an erasure log;

[0138] S400: Verify the erasure log and generate an erasure report.

[0139] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0140] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0141] The non-Company software tools or components appearing in the embodiments of this application are merely examples and do not represent actual use.

[0142] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0143] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0144] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a 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 a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present application.

[0145] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for erasing and verifying SSD and HDD hard disk data, characterized in that: The following steps are involved: Obtain and detect disk information of non-system disks in the hard disk; Configure a final erase strategy according to the disk information; Execute an erasure operation according to the configured final erasure policy and generate an erasure log; The erasure log is verified and an erasure report is generated.

2. A method for erasing and verifying SSD and HDD hard disk data according to claim 1, characterized in that: The step of acquiring and detecting the disk information of the non-system disk in the hard disk comprises: Scan the RAID configuration in non-system disks to identify and convert the connection method of the hard disks; Under the connection mode, read the basic information of the disk; The health status of the disk is determined based on the basic information of the disk.

3. The method for erasing and verifying SSD and HDD hard disk data according to claim 1, characterized in that: The step of configuring the final erasure strategy according to the disk information comprises: Pre-constructing an erasure strategy table, and storing available erasure modes in the erasure strategy table; Determine and display the corresponding erasure method in the erasure strategy table based on the disk information; Configure a preliminary erasure strategy based on the displayed erasure method; A final erasure strategy is generated based on matching the preliminary erasure strategy with the disk information.

4. The method for erasing and verifying SSD and HDD hard disk data according to claim 1, characterized in that: The step of performing an erasure operation according to the configured final erasure policy and generating an erasure log comprises: According to the configured final erasure strategy, execute the corresponding erasure operation; Obtain and integrate progress information during the erase operation; An erasure log is generated according to the progress information.

5. A method for erasing and verifying SSD and HDD hard disk data according to claim 4, characterized in that: The step of generating an erasure log according to the progress information comprises: Determining whether the erasing operation is completed; If yes, the erasure operation has been completed, then checking the erasure log; If not, the erasing operation is not completed, and then it is determined whether the erasing operation has timed out.

6. A method for erasing and verifying SSD and HDD hard disk data according to claim 5, characterized in that: The step of determining whether the erasing operation has timed out comprises: If yes, it is determined that the erasure operation fails, and the determination result is stored in the erasure report; If not, return to the step of performing the erasure operation according to the configured final erasure policy.

7. The method for erasing and verifying SSD and HDD hard disk data according to claim 1, characterized in that: The step of verifying the erasure log and generating an erasure report includes: Based on the erasure log, obtaining erasure information of the disk on which the erasure operation has been performed; Comparing the erase information with the disk information of the non-system disk to obtain a data verification result; An erasure report is constructed, and the data verification result is stored in the erasure report.

8. A device for erasing and verifying SSD and HDD hard disk data, characterized in that: The device comprises: The disk information detection module is used to scan and detect the disk information of the non-system disk in the hard disk; The erasing mode selection module is used to judge and display the available erasing modes according to the disk information provided by the disk information detection module, and generate the final erasing strategy; An erasure execution module, used for executing an erasure operation according to the final erasure strategy; A data verification module, used to verify the disk that has been erased; The report generation module is used to collect and integrate the working information of the disk information detection module, the erasure mode selection module, the erasure execution module and the data verification module to generate an erasure report.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

Citation Information

Cited By

  • Multi-terminal parallel mobile terminal data erasing device, method and storage medium

    CN122528229A