CN116483641B - Method, system and medium for abnormal power failure detection of hard disk - Google Patents

Method, system and medium for abnormal power failure detection of hard disk Download PDF

Info

Publication number
CN116483641B
CN116483641B CN202310702044.8A CN202310702044A CN116483641B CN 116483641 B CN116483641 B CN 116483641B CN 202310702044 A CN202310702044 A CN 202310702044A CN 116483641 B CN116483641 B CN 116483641B
Authority
CN
China
Prior art keywords
hard disk
tested
test
area
power failure
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.)
Active
Application number
CN202310702044.8A
Other languages
Chinese (zh)
Other versions
CN116483641A (en
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.)
Shenzhen Jingcun Technology Co ltd
Original Assignee
Shenzhen Jingcun Technology 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 Shenzhen Jingcun Technology Co ltd filed Critical Shenzhen Jingcun Technology Co ltd
Priority to CN202310702044.8A priority Critical patent/CN116483641B/en
Publication of CN116483641A publication Critical patent/CN116483641A/en
Application granted granted Critical
Publication of CN116483641B publication Critical patent/CN116483641B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application discloses a method, a system and a medium for abnormal power failure detection of a hard disk, wherein the method comprises the following steps: selecting at least one part of addresses in the hard disk to be tested to carry out shielding so as to form a first shielding area, and taking the rest addresses of the hard disk to be tested as a first test area; sending a test instruction to the hard disk to be tested, and carrying out power-down test on the hard disk to be tested; after the hard disk to be tested passes the power failure test, the addresses of the first shielding area and the first test area are adjusted; and sending a test instruction to the adjusted hard disk to be tested, and carrying out power failure test on the hard disk to be tested again. According to the technical scheme, a part of addresses can be designated for testing in the power failure test process, so that the test efficiency is improved.

Description

Method, system and medium for abnormal power failure detection of hard disk
Technical Field
The application relates to the technical field of data processing, in particular to a method, a system and a medium for abnormal power failure detection of a hard disk.
Background
There are many different anomalies in the working environment of SSD (Solid State Disk). Among these, the most common one is sudden power outage. To ensure that its internal data is correct and reliable, SSDs typically have power-down data protection capabilities. Since the power failure condition in the SSD actual working environment may occur in the states of reading, writing, standing, etc., FW (firmware) and HW (Hard Ware) need to consider the power failure condition under different conditions. A large amount of test work is required to ensure the power-down reliability of the data.
At present, in the power failure test process of a hard disk, a main control randomly performs address allocation, data is written into a generated random address, abnormal power failure is executed in the process, and then whether the data has a problem is determined. Because of the random address mechanism, a specific range cannot be designated for testing in the abnormal power failure test process, and the test needs to be repeated later to verify the wrong address, so that the test time is prolonged and the test efficiency is reduced.
Disclosure of Invention
The embodiment of the application provides a method, a system and a medium for testing abnormal power failure of a hard disk, which can be used for designating a part of addresses for testing in the power failure testing process and quickening the testing efficiency.
In a first aspect, an embodiment of the present application provides a method for detecting abnormal power failure of a hard disk, where the method includes:
selecting at least one part of addresses in a hard disk to be tested to carry out shielding so as to form a first shielding area, and taking the rest addresses of the hard disk to be tested as a first test area;
sending a test instruction to the hard disk to be tested, and carrying out a power failure test on the hard disk to be tested;
after the hard disk to be tested passes a power-down test, the addresses of the first shielding area and the first test area are adjusted;
and sending the test instruction to the adjusted hard disk to be tested, and carrying out power failure test on the hard disk to be tested again.
In some embodiments, the adjusting the addresses of the first shielding region and the first test region includes:
shielding the first test area according to the address of the first test area to form a second shielding area, and unblocking the address of the first shielding area to form a second test area;
or,
the method comprises the steps of removing shielding of addresses of a first shielding area based on preset removing parameters, taking the address after removing shielding and the first testing area as a second testing area, and taking the rest addresses of the first shielding area as a second shielding area.
In some embodiments, the test instructions include at least one test process; the step of sending a test instruction to the hard disk to be tested and carrying out power failure test on the hard disk to be tested comprises the following steps:
sending the test instruction to the hard disk to be tested so as to test a first test area of the hard disk to be tested according to the test process;
performing abnormal power-down operation on the hard disk to be tested;
after the abnormal power-down operation is carried out on the hard disk to be tested, carrying out power-up operation on the hard disk to be tested;
and carrying out data verification on the hard disk to be tested after the power-on operation.
In some embodiments, before the sending the test instruction to the adjusted hard disk to be tested and restarting the power failure of the hard disk to be tested, the method further includes:
performing capacity calculation on the second test area to obtain test capacity;
and performing data filling operation on the second test area based on preset filling parameters.
In some embodiments, after the sending the test instruction to the adjusted hard disk to be tested and restarting the power failure of the hard disk to be tested, the method further includes:
and under the condition that the hard disk to be tested passes the power-down test, continuing to perform data filling operation on the second test area, and sending the test instruction to the hard disk to be tested again until all the test capacity is filled.
In some embodiments, the selecting at least a portion of the addresses in the hard disk to be tested to mask the addresses, determining a first mask area, and taking the remaining addresses of the hard disk to be tested as a first test area includes:
performing capacity test on the hard disk to be tested to determine the actual capacity of the hard disk to be tested;
and selecting at least one part of addresses in the actual capacity for shielding, determining a first shielding area, and taking the rest addresses in the actual capacity as a first test area.
In some embodiments, further comprising:
determining an error address under the condition that the hard disk to be tested fails a power-down test;
determining error data in the hard disk to be tested according to the error address;
and labeling the error data to generate an error report.
In some embodiments, after the re-performing the power down test on the hard disk under test, the method further includes:
formatting the hard disk to be tested;
shielding the address of the hard disk to be tested based on a preset shielding parameter to form a third shielding region and a third testing region;
and sending the test instruction to the hard disk to be tested, and performing power-down test on the hard disk to be tested until the parameters of the hard disk to be tested meet preset hard disk parameters.
In a second aspect, an embodiment of the present application further provides a system for abnormal power failure detection of a hard disk, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the hard disk abnormal power failure test method according to the first aspect when executing the computer program.
In a third aspect, embodiments of the present application further provide a computer-readable storage medium storing computer-executable instructions for performing the method for detecting abnormal power failure of a hard disk according to the first aspect.
The embodiment of the application has at least the following beneficial effects: firstly, selecting at least one part of addresses in a hard disk to be tested to form a first shielding area, taking the rest addresses of the hard disk to be tested as a first test area, realizing the selection of a specific range, avoiding the subsequent repeated verification, then sending a test instruction to the hard disk to be tested, carrying out a power-down test on the hard disk to be tested, testing the data protection capability of the hard disk, improving the reliability and stability of the hard disk, after the hard disk to be tested passes the power-down test, adjusting the addresses of the first shielding area and the first test area, thereby realizing the conversion of the range of the shielding area, testing the area in the specific range, avoiding the influence of a random address mechanism, finally sending a test instruction to the adjusted hard disk to be tested, and carrying out the power-down test on the hard disk to be tested again, and designating one part of addresses in the power-down test process, so as to accelerate the test efficiency.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and drawings.
Drawings
FIG. 1 is a flow chart of a method for detecting abnormal power failure of a hard disk according to one embodiment of the present invention;
FIG. 2 is a flowchart of a specific method of step S102 in FIG. 1;
FIG. 3 is a flowchart of a method for detecting abnormal power failure of a hard disk according to another embodiment of the present invention;
FIG. 4 is a flowchart of a method for detecting abnormal power failure of a hard disk according to another embodiment of the present invention;
FIG. 5 is another flowchart of a specific method of step S101 in FIG. 1;
FIG. 6 is a flowchart of a method for detecting abnormal power failure of a hard disk according to another embodiment of the present invention;
FIG. 7 is a flowchart of a method for detecting abnormal power failure of a hard disk according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of a hard disk abnormal power failure detection system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It should be noted that although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different from that in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
It should be noted that in the description of embodiments of the present invention, the terms "first," "second," and the like in the description and claims and in the foregoing drawings are used for distinguishing between similar objects and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated. "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relation of association objects, and indicates that there may be three kinds of relations, for example, a and/or B, and may indicate that a alone exists, a and B together, and B alone exists. Wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. Although functional block diagrams are depicted in the device diagrams, logical orders are depicted in the flowchart, in some cases, the steps shown or described may be performed in a different order than the block diagrams in the device, or in the flowchart.
In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
The hard disk is one of the main storage media of the computer, and comprises a solid state hard disk, a mechanical hard disk and a hybrid hard disk, and the hard disk is designed by considering the influences of the performance, erasure loss and the like of the hard disk, so that the hard disk is required to be subjected to testing processes such as speed testing, quality testing and the like before products are sent to a client, and the quality problem of the hard disk is avoided.
There are many different anomalies in the working environment of SSD (Solid State Disk). Among these, the most common one is sudden power outage. To ensure that its internal data is correct and reliable, SSDs typically have power-down data protection capabilities. Since the power failure condition in the SSD actual working environment may occur in the states of reading, writing, standing, etc., FW (firmware) and HW (Hard Ware) need to consider the power failure condition under different conditions. A large amount of test work is required to ensure the power-down reliability of the data.
At present, in the power failure test process of a hard disk, a main control randomly performs address allocation, data is written into a generated random address, abnormal power failure is executed in the process, and then whether the data has a problem is determined. Because of the random address mechanism, a specific range cannot be designated for testing in the abnormal power failure test process, and the test needs to be repeated later to verify the wrong address, so that the test time is prolonged and the test efficiency is reduced.
In order to solve the problems, the invention provides a method, a system and a medium for testing abnormal power failure of a hard disk, which comprises the steps of firstly selecting at least one part of addresses in the hard disk to be tested to form a first shielding area, taking the rest addresses of the hard disk to be tested as a first testing area, realizing the selection of a specific range, avoiding the subsequent repeated verification, then sending a testing instruction to the hard disk to be tested, performing a power failure test on the hard disk to be tested, testing the data protection capability of the hard disk, improving the reliability and the stability of the hard disk, adjusting the addresses of the first shielding area and the first testing area after the hard disk to be tested passes the power failure test, thereby realizing the conversion of the range of the shielding area, testing the area in the specific range, avoiding the influence of a random address mechanism, finally sending the testing instruction to the adjusted hard disk to be tested, and re-testing the hard disk to be tested, and designating one part of addresses for the test in the power failure test process, thereby improving the test efficiency.
Embodiments of the present application are further described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of a method for detecting abnormal power failure of a hard disk according to an embodiment of the present invention, where the method includes, but is not limited to, steps S101 to S104.
Step S101: selecting at least one part of addresses in the hard disk to be tested to carry out shielding so as to form a first shielding area, and taking the rest addresses of the hard disk to be tested as a first test area;
in some embodiments, at least a part of addresses in the hard disk to be tested are selected for shielding to form a first shielding area, and the remaining addresses of the hard disk to be tested are used as a first test area, so that a part of addresses can be designated for testing, and the whole test of the hard disk to be tested is not required.
It can be understood that in this embodiment, a half of the addresses of the hard disk to be tested may be selected to form the first shielding area, one third of the addresses of the hard disk to be tested may be selected to form the first shielding area, two thirds of the addresses of the hard disk to be tested may be selected to form the first shielding area, and so on; selecting one half of addresses of the hard disk to be tested to form a first shielding area, and forming the rest half of addresses into a first test area; selecting one third of addresses of the hard disk to be tested to form a first shielding area, and forming a first test area by the rest two thirds of addresses; when two thirds of addresses of the hard disk to be tested are selected to form a first shielding area, the rest one third of addresses form a first test area, and the like.
Step S102: sending a test instruction to the hard disk to be tested, and carrying out power-down test on the hard disk to be tested;
in some embodiments, a test instruction is sent to the hard disk to be tested, and a power failure test is performed on the hard disk to be tested, so that the stability and reliability of the hard disk to be tested can be tested, and the performance and efficiency of the hard disk to be tested are improved.
It should be noted that, performing the power failure test on the hard disk to be tested includes, but is not limited to, performing the test on the performance such as data persistence, data consistency, fault tolerance, writing performance, reading performance, stability performance, etc. of the hard disk to be tested, and the embodiment is not limited specifically.
Step S103: after the hard disk to be tested passes the power failure test, the addresses of the first shielding area and the first test area are adjusted;
in some embodiments, after the hard disk to be tested passes the power failure test, the data in the first test area is complete, and the hard disk is stable and reliable, and the addresses of the first shielding area and the first test area need to be adjusted, so that the range of the shielding area is changed, and the addresses in the shielding area are conveniently tested subsequently, so that the comprehensive test of the hard disk to be tested is realized.
Step S104: and sending a test instruction to the adjusted hard disk to be tested, and carrying out power failure test on the hard disk to be tested again.
In some embodiments, a test instruction is sent to the adjusted hard disk to be tested, and the power-down test is performed on the hard disk to be tested again, so that the test on the adjusted test area is realized, the repeated test on the hard disk to be tested is avoided, and the test efficiency of the hard disk to be tested is improved.
In some embodiments, step S103 includes the following two cases:
in the first case, shielding the first test area according to the address of the first test area to form a second shielding area, and unblocking the address of the first shielding area to form a second test area;
in some embodiments, the addresses in the first test area are shielded, so that the first test area becomes a second shielding area, and the addresses in the first shielding area are unshielded, so that the first shielding area becomes a second test area, thereby realizing the test of all the addresses in the first shielding area, realizing the comprehensive test of the hard disk to be tested, and improving the test precision of the hard disk to be tested.
In the second case, the address of the first mask area is unmasked based on a preset unmasking parameter, so that the unmasked address and the first test area are used as a second test area, and the rest address of the first mask area is used as the second mask area.
In some embodiments, the address of the first mask area is unmasked according to the preset unmasked parameter, the unmasked address and the address in the first test area are used as the second test area, and the remaining unmasked address of the first mask area is used as the second mask area, so that the gradual test of the address in the first mask area is realized, and the test precision is improved.
It should be noted that, the release parameter may be set by the user according to the needs, for example, to release half of the addresses in the first mask area, to release one third of the addresses in the first mask area, to release all of the addresses in the first mask area, and so on, where when the half of the addresses in the first mask area are released, then the half of the addresses released from the mask and the addresses in the first test area are used as the second test area, and the remaining half of the addresses not released from the mask form the second mask area; when the one third of the addresses in the first shielding area are shielded, taking the one third of the addresses which are shielded and the addresses in the first test area as a second test area, and forming a second shielding area by the rest two thirds of the addresses which are not shielded; when the masking of all the addresses in the first mask area is released, all the addresses released from the masking and the addresses in the first test area are used as the second test area, and at this time, no address exists in the second mask area, and the setting of the release parameter is not particularly limited in this embodiment.
It can be understood that, in this embodiment, besides performing the unmasking of the addresses in the first mask area according to the preset unmasking parameters each time, the unmasking range of the addresses can be sequentially enlarged or reduced, for example, the first time of unmasking the addresses in one third of the first mask area, and the second time of unmasking the addresses in two thirds of the first mask area; or first unmasking three-quarters of the addresses in the first mask area, second unmasking one-quarter of the addresses in the first mask area, and so on, the embodiment is not particularly limited.
Referring to fig. 2, fig. 2 is a flowchart of a specific method of step S102 in fig. 1, and further describes step S102, where step S102 includes, but is not limited to, steps S201 to S204.
It should be noted that the test instruction includes at least one test process, where the test process includes, but is not limited to, a read instruction, a write instruction, a cache instruction, a refresh instruction, and the like.
Step S201: sending a test instruction to the hard disk to be tested so as to test a first test area of the hard disk to be tested according to a test process;
it will be appreciated that in the process of testing the hard disk under test according to the test procedure, one or more test procedures may be selected to test the first test area.
Step S202: performing abnormal power-down operation on the hard disk to be tested;
step S203: after the abnormal power-down operation is carried out on the hard disk to be tested, carrying out the power-up operation on the hard disk to be tested;
step S204: and carrying out data verification on the hard disk to be tested after the power-on operation.
In some embodiments, a test instruction is sent to a hard disk to be tested, so that a first test area of the hard disk to be tested is tested according to a test process, and then abnormal power-down operation is performed on the hard disk to be tested, so that the working performance of the hard disk to be tested under the unexpected power-down condition is verified, after the abnormal power-down operation is performed on the hard disk to be tested, power-up operation is performed on the hard disk to be tested, and finally, data verification is performed on the hard disk to be tested after the power-up operation, so that the data protection capability of the hard disk under the power-down condition can be obtained, and the data security is enhanced.
It should be noted that, the process of performing data verification on the hard disk to be tested after the power-on operation includes, but is not limited to, verifying data consistency of the hard disk to be tested, for example, verifying whether data is missing, whether data is changed, and the like; checking the functions of power failure protection, power restarting and the like of the hard disk to be tested; checking the read-write speed of the hard disk to be tested, and the like, and the embodiment is not particularly limited.
Referring to fig. 3, fig. 3 is a flowchart of a method for detecting abnormal power failure of a hard disk according to another embodiment of the present invention, where the method includes, but is not limited to, steps S301 to S302.
It should be noted that, steps S301 to S302 occur before sending a test instruction to the adjusted hard disk to be tested and restarting the power failure of the hard disk to be tested.
Step S301: performing capacity calculation on the second test area to obtain test capacity;
step S302: and performing data filling operation on the second test area based on the preset filling parameters.
In some embodiments, the capacity calculation is performed on the second test area, the test capacity of the second test area is determined, and then, the data filling operation is performed on the second test area, so that the daily use scene of a user is simulated, and the application scene of the hard disk to be tested is widened.
It should be noted that the filling parameter may be set according to the needs of the user, and the filling parameter is smaller than the test capacity.
Referring to fig. 4, fig. 4 is a flowchart of a method for detecting abnormal power failure of a hard disk according to another embodiment of the present invention, where the method includes, but is not limited to, step S401.
It should be noted that step S401 occurs after the test hard disk is subjected to the power down test again.
Step S401: and under the condition that the hard disk to be tested passes the power-down test, continuing to perform data filling operation on the second test area, and sending a test instruction to the hard disk to be tested again until all the test capacity is filled.
In some embodiments, under the condition that the hard disk to be tested passes the power failure test, continuing to perform data filling operation on the second test area, sending a test instruction to the hard disk to be tested again, and performing the power failure test, that is, repeating the steps S102-S103 until all the test capacity is filled, so that the range of the shielding area can be changed under the condition of filling data, and the method is more suitable for the daily use scene of a user, thereby realizing the comprehensive test of the hard disk to be tested.
Referring to fig. 5, fig. 5 is a flowchart of a specific method of step S101 in fig. 1, and further describes step S101, where step S101 includes, but is not limited to, steps S501 to S502.
Step S501: performing capacity test on the hard disk to be tested to determine the actual capacity of the hard disk to be tested;
step S502: and selecting at least one part of addresses in the actual capacity for shielding, determining a first shielding area, and taking the rest addresses in the actual capacity as a first test area.
In some embodiments, capacity testing is performed on a hard disk to be tested based on a preset testing tool, the actual capacity of the hard disk to be tested is determined, then at least a part of addresses in the actual capacity are selected for shielding, a first shielding area is determined, and the rest addresses in the actual capacity are used as a first testing area, so that the addresses in a specific area can be selected for testing, and the influence caused by random addresses is avoided.
It should be noted that the test tool includes, but is not limited to, disk Genius, partition Guru, etc., and the embodiment is not limited in particular.
Referring to fig. 6, fig. 6 is a flowchart of a method for detecting abnormal power failure of a hard disk according to another embodiment of the present invention, where the method includes, but is not limited to, steps S601 to S603.
Step S601: under the condition that the hard disk to be tested does not pass the power-down test, determining an error address;
step S602: determining error data in the hard disk to be tested according to the error address;
step S603: and marking the error data to generate an error report.
In some embodiments, under the condition that it is determined that the hard disk to be tested fails the power failure test, determining an error address where an error occurs in the first test area, then determining error data where the error occurs in the hard disk to be tested according to the error address, and finally marking the error data to generate an error report, thereby effectively screening out an abnormal hard disk, facilitating a tester to check in which test link the current hard disk fails, and realizing quick test result tracing.
Referring to fig. 7, fig. 7 is a flowchart of a method for detecting abnormal power failure of a hard disk according to another embodiment of the present invention, where the method includes, but is not limited to, steps S701 to S703.
Step S701: formatting the hard disk to be tested;
step S702: shielding the address of the hard disk to be tested based on a preset shielding parameter to form a third shielding area and a third testing area;
step S703: and sending a test instruction to the hard disk to be tested, and carrying out power-down test on the hard disk to be tested until the parameters of the hard disk to be tested meet preset hard disk parameters.
In some embodiments, after the test is performed on the hard disk to be tested again, formatting operation is performed on the hard disk to be tested, data filled in the hard disk to be tested is removed, the second shielding area or the second test area is divided, and the like, the hard disk to be tested is shielded again based on the shielding parameters to form a third shielding area and a third test area, repeated test on the hard disk to be tested is achieved, the situation that data are omitted in the test process is avoided, the test precision of the hard disk to be tested is further improved, finally, a test instruction is sent to the hard disk to be tested, and the power-down test is performed on the hard disk to be tested until the parameters of the hard disk to be tested meet preset hard disk parameters, so that the test process can be verified, and the test precision is improved.
It should be noted that the hard disk parameters include, but are not limited to, a power management parameter, a data protection parameter, and the like, where the power management parameter is a power management policy of the hard disk in a power failure situation, and the parameters include a power mode, a power management level, a power management time, and the like of the hard disk. In the power failure test, attention is paid to the setting of these parameters to ensure that the hard disk can correctly store data in the case of power failure; the data protection parameter is a data protection strategy of the hard disk under the condition of power failure. These parameters include caching policies of the hard disk, write policies, verification policies, etc. In a power down test, the validity of these parameters needs to be tested to ensure that the hard disk is able to properly protect the data in the event of a power down.
Referring to fig. 8, fig. 8 illustrates a hardware structure of a hard disk abnormal power down test system according to another embodiment, where the hard disk abnormal power down test system includes:
the processor 1001 may be implemented by using a general-purpose CPU (Central Processing Unit ), a microprocessor, an application-specific integrated circuit (Application SpecificIntegrated Circuit, ASIC), or one or more integrated circuits, etc. to execute related programs to implement the technical solutions provided by the embodiments of the present application;
the Memory 1002 may be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access Memory (Random Access Memory, RAM). The memory 1002 may store an operating system and other application programs, and when the technical solutions provided in the embodiments of the present disclosure are implemented by software or firmware, relevant program codes are stored in the memory 1002, and the processor 1001 invokes a method for performing abnormal power failure detection of a hard disk according to the embodiments of the present disclosure;
an input/output interface 1003 for implementing information input and output;
the communication interface 1004 is configured to implement communication interaction between the present device and other devices, and may implement communication in a wired manner (e.g. USB, network cable, etc.), or may implement communication in a wireless manner (e.g. mobile network, WIFI, bluetooth, etc.);
a bus 1005 for transferring information between the various components of the device (e.g., the processor 1001, memory 1002, input/output interface 1003, and communication interface 1004);
wherein the processor 1001, the memory 1002, the input/output interface 1003, and the communication interface 1004 realize communication connection between each other inside the device through the bus 1005.
In addition, an embodiment of the present invention further provides a computer readable storage medium storing computer executable instructions that are executed by a processor or a controller, for example, by one of the processors in the above system embodiment, and cause the processor to perform the abnormal power failure measurement method of the hard disk in the above embodiment.
The embodiments described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and as those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
It will be appreciated by those skilled in the art that the solutions shown in fig. 1-7 are not limiting to embodiments of the present application and may include more or fewer steps than shown, or certain steps may be combined, or different steps.
The above described apparatus embodiments are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the present application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this application, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is merely a logical function division, and there may be another division manner in actual implementation, for example, a plurality of units or components may be combined or may be 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 form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this 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 of the technical solution or in part in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the various 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 (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing a program.
Preferred embodiments of the present application are described above with reference to the accompanying drawings, and thus do not limit the scope of the claims of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the embodiments of the present application shall fall within the scope of the claims of the embodiments of the present application.

Claims (7)

1. An abnormal power failure detection method for a hard disk, which is characterized by comprising the following steps:
selecting at least one part of addresses in a hard disk to be tested to carry out shielding so as to form a first shielding area, and taking the rest addresses of the hard disk to be tested as a first test area;
sending a test instruction to the hard disk to be tested, and carrying out a power failure test on the hard disk to be tested;
after the hard disk to be tested passes a power-down test, the addresses of the first shielding area and the first test area are adjusted;
sending the test instruction to the adjusted hard disk to be tested, and carrying out power-down test on the hard disk to be tested again;
after the power-down test is carried out on the hard disk to be tested again, formatting the hard disk to be tested;
shielding the address of the hard disk to be tested based on a preset shielding parameter to form a third shielding region and a third testing region;
transmitting the test instruction to the hard disk to be tested, and performing a power-down test on the hard disk to be tested until the parameters of the hard disk to be tested meet preset hard disk parameters, wherein the hard disk parameters comprise power management parameters and data protection parameters, the power management parameters are used for representing a power management strategy of the hard disk to be tested under the condition of power failure, and the data protection parameters are used for representing a data protection strategy of the hard disk to be tested under the condition of power failure;
determining an error address under the condition that the hard disk to be tested fails a power-down test;
determining error data in the hard disk to be tested according to the error address;
labeling the error data to generate an error report;
wherein said adjusting the addresses of the first shielding region and the first test region comprises:
shielding the first test area according to the address of the first test area to form a second shielding area, and unblocking the address of the first shielding area to form a second test area;
or,
the method comprises the steps of removing shielding of addresses of a first shielding area based on preset removing parameters, taking the address after removing shielding and the first testing area as a second testing area, and taking the rest addresses of the first shielding area as a second shielding area.
2. The method of claim 1, wherein the test instructions comprise at least one test process; the step of sending a test instruction to the hard disk to be tested and carrying out power failure test on the hard disk to be tested comprises the following steps:
sending the test instruction to the hard disk to be tested so as to test a first test area of the hard disk to be tested according to the test process;
performing abnormal power-down operation on the hard disk to be tested;
after the abnormal power-down operation is carried out on the hard disk to be tested, carrying out power-up operation on the hard disk to be tested;
and carrying out data verification on the hard disk to be tested after the power-on operation.
3. The method for testing abnormal power failure of a hard disk according to claim 1, further comprising, before said sending the test command to the adjusted hard disk to be tested and re-testing the hard disk to be tested for power failure:
performing capacity calculation on the second test area to obtain test capacity;
and performing data filling operation on the second test area based on preset filling parameters.
4. The method for testing abnormal power failure of a hard disk according to claim 3, further comprising, after said sending the test command to the adjusted hard disk to be tested and re-performing the power failure test on the hard disk to be tested:
and under the condition that the hard disk to be tested passes the power-down test, continuing to perform data filling operation on the second test area, and sending the test instruction to the hard disk to be tested again until all the test capacity is filled.
5. The method for testing abnormal power failure of a hard disk according to claim 1, wherein selecting at least a part of addresses in the hard disk to be tested to mask to form a first mask area, and taking the remaining addresses of the hard disk to be tested as a first test area comprises:
performing capacity test on the hard disk to be tested to determine the actual capacity of the hard disk to be tested;
and selecting at least one part of addresses in the actual capacity for shielding, determining a first shielding area, and taking the rest addresses in the actual capacity as a first test area.
6. An abnormal power failure detection system for a hard disk, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method for detecting abnormal power failure of a hard disk according to any one of claims 1 to 5 when the computer program is executed.
7. A computer-readable storage medium storing computer-executable instructions for performing the hard disk abnormal power failure detection method according to any one of claims 1 to 5.
CN202310702044.8A 2023-06-14 2023-06-14 Method, system and medium for abnormal power failure detection of hard disk Active CN116483641B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310702044.8A CN116483641B (en) 2023-06-14 2023-06-14 Method, system and medium for abnormal power failure detection of hard disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310702044.8A CN116483641B (en) 2023-06-14 2023-06-14 Method, system and medium for abnormal power failure detection of hard disk

Publications (2)

Publication Number Publication Date
CN116483641A CN116483641A (en) 2023-07-25
CN116483641B true CN116483641B (en) 2024-04-02

Family

ID=87219854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310702044.8A Active CN116483641B (en) 2023-06-14 2023-06-14 Method, system and medium for abnormal power failure detection of hard disk

Country Status (1)

Country Link
CN (1) CN116483641B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279109A (en) * 2014-11-25 2016-01-27 天津市英贝特航天科技有限公司 Solid state disk power down protection circuit and power down protection method
CN113960391A (en) * 2021-09-13 2022-01-21 珠海亿智电子科技有限公司 Abnormal power failure testing device and method for storage medium
CN114265733A (en) * 2021-12-27 2022-04-01 至誉科技(武汉)有限公司 Automatic testing method and device for abnormal power failure of solid state disk
CN115437865A (en) * 2022-09-21 2022-12-06 曙光信息产业股份有限公司 Method, device, equipment and medium for testing abnormal power failure of hard disk
CN115954042A (en) * 2022-12-20 2023-04-11 珠海妙存科技有限公司 nand flash power-down test device, nand flash power-down test method and storage medium
WO2023098192A1 (en) * 2021-11-30 2023-06-08 苏州浪潮智能科技有限公司 Method and apparatus for processing abnormal power failure of solid state disk, and electronic device and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279109A (en) * 2014-11-25 2016-01-27 天津市英贝特航天科技有限公司 Solid state disk power down protection circuit and power down protection method
CN113960391A (en) * 2021-09-13 2022-01-21 珠海亿智电子科技有限公司 Abnormal power failure testing device and method for storage medium
WO2023098192A1 (en) * 2021-11-30 2023-06-08 苏州浪潮智能科技有限公司 Method and apparatus for processing abnormal power failure of solid state disk, and electronic device and medium
CN114265733A (en) * 2021-12-27 2022-04-01 至誉科技(武汉)有限公司 Automatic testing method and device for abnormal power failure of solid state disk
CN115437865A (en) * 2022-09-21 2022-12-06 曙光信息产业股份有限公司 Method, device, equipment and medium for testing abnormal power failure of hard disk
CN115954042A (en) * 2022-12-20 2023-04-11 珠海妙存科技有限公司 nand flash power-down test device, nand flash power-down test method and storage medium

Also Published As

Publication number Publication date
CN116483641A (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN106201338B (en) Date storage method and device
CN109831487B (en) Fragmented file verification method and terminal equipment
CN103164523A (en) Inspection method, device and system of data consistency inspection
CN116340076B (en) Hard disk performance test method, device and medium
CN108875061A (en) A kind of conformance test method and relevant apparatus of distributed file system
CN110059068B (en) Data verification method and data verification system in distributed storage system
CN104914815A (en) Processor monitoring method, device and system
CN110442298A (en) Store unit exception detection method and device, distributed memory system
CN112133357B (en) eMMC test method and device
CN103902419A (en) Method and device for testing caches
CN111694684A (en) Abnormal construction method and device of storage equipment, electronic equipment and storage medium
CN116483641B (en) Method, system and medium for abnormal power failure detection of hard disk
CN110990207B (en) BPS memory test method, system, terminal and storage medium based on Whitley platform
CN117149550A (en) Solid state disk performance detection method and device and electronic equipment
CN115359834B (en) Disk arbitration region detection method, device, equipment and readable storage medium
CN109359093A (en) A kind of rule file update method and system
CN107273283B (en) Automatic software detection method and device
CN114385418A (en) Protection method, device, equipment and storage medium for communication equipment
CN113470725A (en) Method and device for testing dynamic random access memory
CN111782141A (en) Data inspection method and device
CN116665758B (en) Hard disk data testing method, device, system and medium
CN116913361B (en) Automatic hard disk testing method, system and medium
CN112466383B (en) Test method, test device and test equipment for arbitration reliability of storage system
CN115756517A (en) Method, device and medium for burning SSD (solid State disk)
CN116136813B (en) Method, device and storage medium for simulating adaptive multi-model avionics signals

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
GR01 Patent grant
GR01 Patent grant