Vulnerability repair test method, device and equipment and readable storage medium
By obtaining the old verification data from the hard disk to construct a new strip and simulating the write vulnerability, the write vulnerability is repaired and verified, which solves the problems of long vulnerability repair testing and low accuracy in the existing technology, and improves the response capability of the storage system. and overall reliability.
Patent Information
- Application Number
- CN202411162952.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-10-29
AI Technical Summary
In the existing technology, vulnerability repair testing is time-consuming, labor-intensive, and inefficient, and accuracy is difficult to guarantee, resulting in hidden dangers to the reliability and stability of the storage system.
By obtaining the old verification data of the target strip from the hard disk, constructing a new strip, and writing it to the hard disk to simulate the occurrence of a write vulnerability, repair the write vulnerability, and perform repair verification when the repair is completed, using independent disk redundancy The XOR algorithm of the residual array module calculates the check data to verify whether the repair is successful or not.
It simplifies the test process, increases the probability of recurrence of write vulnerability problems, reduces the complexity of manual operations and system restarts, reduces resource consumption, accelerates the test cycle, significantly improves test efficiency, and ensures that the storage system is safe in the face of write Fast and reliable recovery of data security in case of breach.
Smart Images

Figure CN118862097A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of security verification, and in particular to a vulnerability repair test method, device, equipment and readable storage medium. Background Art
[0002] RAID (Redundant Array of Independent Disks) is a virtualization technology that combines multiple independent physical disks into a virtual disk group in different ways, thereby solving the shortcomings of small capacity, low performance and poor reliability of a single disk. In a RAID storage system with a checksum function (such as RAID 5 and RAID 6), the Write Hole problem occurs because the valid data and the checksum data are written asynchronously.
[0003] To address the write vulnerability problem in RAID storage systems, the existing method is usually to power off or restart the RAID system to test, and perform multiple test collisions to increase the probability of write vulnerability problems when the system is powered off / restarted, and then repair the write vulnerability and perform repair tests. This test method is time-consuming, labor-intensive, inefficient, and difficult to guarantee accuracy, which is a hidden danger to the reliability and stability of the RAID storage system. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a vulnerability repair test method, device, equipment and readable storage medium, which solves the problems in the prior art that vulnerability repair testing is time-consuming, labor-intensive, inefficient, and difficult to ensure accuracy, and also poses certain risks to the reliability and stability of the storage system.
[0005] In order to solve the above technical problems, the present invention provides a vulnerability repair test method, comprising:
[0006] Obtain old check data corresponding to the target stripe from the hard disk, and construct a new stripe based on the old check data and valid data in the target stripe;
[0007] Writing the data in the new stripe into the hard disk to simulate the occurrence of a write leak;
[0008] Write vulnerability fixes and verify the fixes when they are complete.
[0009] On the one hand, the obtaining of old check data corresponding to the target stripe from the hard disk and the construction of a new stripe based on the old check data and valid data in the target stripe includes:
[0010] Get the stripe number and stripe width to be tested;
[0011] Obtaining a stripe address of the target stripe based on the stripe number and the stripe width, and converting the stripe address into a physical address of the hard disk;
[0012] Obtaining old check data corresponding to the target stripe from the physical address of the hard disk;
[0013] The old check data is written to the original check position in the target stripe, thereby constructing the new stripe.
[0014] On the one hand, writing the old check data to the original check position in the target stripe to construct the new stripe includes:
[0015] When the host writes data to the storage system in a sequential writing mode, the time for the host to write to the target stripe is calculated according to the stripe number and the stripe width, and it is determined whether the target stripe has completed data writing;
[0016] If yes, writing the old check data to the original check position in the target stripe;
[0017] If not, wait until the target stripe completes data writing.
[0018] On the one hand, the writing vulnerability repair and performing repair verification when the repair is completed include:
[0019] Enable write vulnerability protection for the storage system and perform system repairs;
[0020] When the repair is completed, the repaired check data is obtained, and new check data is calculated based on the valid data in the new stripe;
[0021] When the repaired verification data is consistent with the new verification data, the repair is successful; otherwise, the repair fails.
[0022] On the one hand, the write vulnerability repair is performed, and when the repair is completed, the repair verification is performed, including:
[0023] Enable write vulnerability protection of the storage system and perform system repair; the storage system includes the hard disk and independent disk redundant array module;
[0024] When the repair is completed, the repaired verification data is obtained from the repaired new stripe;
[0025] When the repaired verification data is consistent with the old verification data, the repair fails and an error reminder is given;
[0026] When the repaired check data is inconsistent with the old check data, the XOR algorithm of the independent redundant array of disks module is used to recalculate according to the valid data in the new stripe to obtain new check data;
[0027] If the repaired verification data is consistent with the new verification data, the repair is successful, the environment configuration is cleaned up and the terminal is notified;
[0028] If the repaired verification data is inconsistent with the new verification data, the repair fails and an error reminder is given.
[0029] On the one hand, enabling the write vulnerability protection of the storage system and performing system repair includes:
[0030] According to the command mode of the current storage system, a corresponding system repair solution for write vulnerability protection is started.
[0031] On the one hand, the obtaining of old check data corresponding to the target stripe from the hard disk and the construction of a new stripe based on the old check data and valid data in the target stripe includes:
[0032] Performing a data writing operation on the storage system through the host, and determining in real time whether the data writing operation is completed on the target stripe;
[0033] When the target stripe completes the data writing operation, the steps of obtaining the old check data corresponding to the target stripe from the hard disk and constructing a new stripe based on the old check data and the valid data in the target stripe are performed.
[0034] The present invention also provides a vulnerability repair testing device, comprising:
[0035] A new stripe construction module, used for obtaining old check data corresponding to a target stripe from a hard disk, and constructing a new stripe based on the old check data and valid data in the target stripe;
[0036] A write vulnerability simulation module, used for writing the data in the new stripe into the hard disk to simulate the occurrence of a write vulnerability;
[0037] The repair verification module is used to write vulnerability repairs and perform repair verification when the repair is completed.
[0038] The present invention also provides a vulnerability repair test device, comprising:
[0039] Memory for storing computer programs;
[0040] A processor is used to implement the steps of the above-mentioned vulnerability repair testing method when executing the computer program.
[0041] The present invention also provides a storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the steps of the above-mentioned vulnerability repair test method are implemented.
[0042] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned vulnerability repair test method when executed by a processor.
[0043] It can be seen from the above technical scheme that the present invention obtains the old verification data corresponding to the target stripe from the hard disk, and constructs a new stripe based on the old verification data and the valid data in the target stripe; writes the data in the new stripe into the hard disk to simulate the occurrence of a write vulnerability; performs write vulnerability repair, and performs repair verification when the repair is completed. The beneficial effect of the present invention is that it can construct a write vulnerability of a specific stripe in a directional manner. Compared with the traditional method of simulating write vulnerabilities by restarting a large number of systems to collide, this method simplifies the test process, greatly improves the probability of recurrence of the write vulnerability problem, and reduces the complexity and difficulty brought by manual operation and a large number of system restarts in traditional tests, reduces resource consumption in the test process, accelerates the test cycle, and significantly improves the test efficiency. The present invention can also verify the repair of the write vulnerability in a directional manner, can quickly and accurately determine whether the repair measures are effective, greatly shortens the verification time, improves the efficiency of the repair effect verification, and ensures that the storage system can quickly and reliably restore data security when facing the write vulnerability problem. Therefore, the present invention not only improves the coping ability of the storage system when facing the write vulnerability problem, but also fundamentally enhances the overall reliability and stability of the storage system. This has far-reaching significance for ensuring user data security and improving system performance, and is an important step in promoting the development of data storage technology.
[0044] In addition, the present invention also provides a vulnerability repair test device, equipment and readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0046] Figure 1 A schematic diagram of an architecture consisting of a storage system and a host system;
[0047] Figure 2 A flowchart of a vulnerability repair testing method provided by an embodiment of the present invention;
[0048] Figure 3 A flowchart of a vulnerability repair test method provided by an embodiment of the present invention;
[0049] Figure 4 A flowchart of another vulnerability repair test method provided by an embodiment of the present invention;
[0050] Figure 5 A schematic diagram of the structure of a vulnerability repair test device provided by an embodiment of the present invention;
[0051] Figure 6 A schematic diagram of the structure of a vulnerability repair test device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0053] Please refer to Figure 1 , the host performs business IO interaction with the storage device, that is, the host and the storage system perform business-level read / write data interaction. Among them, the storage system includes the upper module, the RAID array management module (abbreviated as RAID) and the storage system lower module and other modules such as drivers (abbreviated as hard disks). In the storage system, RAID performs IO interaction with the upper module and the hard disk respectively. RAID uses striping technology to divide the host's request data into multiple sub-IOs (read and write requests) according to a certain topology, and divides them into different disks. When accessing data, the related disks in the array act together, which greatly reduces the data access time and has better space utilization. Write vulnerability problems usually occur in storage devices using RAID, especially in RAID with verification function (such as RAID 5, RAID 6). This type of storage system protects data through verification data inside the stripe to improve data reliability and fault tolerance.
[0054] In a RAID with a verification function, data writing is usually divided into two steps: updating the valid data in the stripe in the RAID, and then updating the verification data in the stripe. Data protection is performed through the verification data inside the stripe. In the process of writing data to the storage device, it may happen that the data block D (i.e., valid data) has been written to the disk but the verification block P (i.e., verification data) has not been written to the disk. Here, writing to the disk refers to the process of writing data to the target address, which will cause the verification data and the valid data in the stripe to be unable to match, resulting in inconsistent data in the stripe. This situation is called a write vulnerability problem. Taking the spatial distribution of RAID5 as an example, the stripe of RAID5 is composed of multiple data blocks D and a verification block P. The following Table 1 shows the spatial distribution of a stripe width of 4. The asynchronous writing of data blocks D and verification blocks P is the root cause of the write vulnerability, that is, the host IO successfully writes to the disk and returns the result, but the verification data calculated by the host fails to be written to the disk.
[0055] Table 1 Spatial distribution of stripe width 4 in RAID5
[0056]
[0057] Write vulnerability issues pose a huge risk to the security of user data storage, reduce the reliability and stability of the storage system, and increase the risk of data loss. Therefore, it is necessary to study write vulnerabilities. At present, specific test methods and tools are usually required for write vulnerability testing in RAID. Usually, the storage system is powered off or restarted for testing. By performing test collisions multiple times, the probability of write vulnerability problems occurring during system power off / restart is increased. The specific process is as follows:
[0058] Step 1: Configure the RAID system;
[0059] Step 2: Issue IO to the RAID system to ensure that the system runs normally;
[0060] Step 3: Simulate power outage (unplug the cable / turn off the power) or restart the system;
[0061] Step 4: Introduce a log mechanism, use non-volatile memory, perform a full system scan, and use advanced RAID write vulnerability repair methods, wait for the system to recover, and check data consistency by inspecting all RAID stripe spaces;
[0062] Step 5: Repeat steps 3 and 4.
[0063] The above vulnerability testing method will have the following problems:
[0064] 1) High labor costs: Manual operations are required on-site in the computer room, and the equipment must be repeatedly powered off and restarted;
[0065] 2) Time-consuming: The inspection of RAID system takes a long time, and the data is basically checked on a weekly basis;
[0066] 3) There are no valid results to show, and the accuracy of the test cannot be confirmed: there is no guarantee that the write vulnerability problem has been actually tested, and thus the reliability and stability of the solution cannot be verified.
[0067] In summary, the current testing methods for vulnerability issues are time-consuming, labor-intensive, inefficient, and difficult to ensure the accuracy of verification, which poses a hidden danger to the reliability and stability of storage systems.
[0068] In view of the above problems, the present invention proposes a vulnerability repair test method. For details, please refer to Figure 2 , Figure 2 A flowchart of a vulnerability repair test method provided by an embodiment of the present invention. The method may include:
[0069] S101: Obtain old check data corresponding to a target stripe from a hard disk, and construct a new stripe based on the old check data and valid data in the target stripe.
[0070] The executor of this embodiment is a terminal. This embodiment does not limit the type of terminal, as long as the operation of the vulnerability repair test method can be completed. The target stripe in this embodiment is the stripe selected by the user to be tested, and targeted testing can be performed. It can be understood that the target stripe in this embodiment can be 1 stripe or multiple stripes; of course, it can also be multiple non-adjacent stripes or multiple adjacent stripes. According to the above introduction to RAID5, each stripe is composed of multiple data blocks D and a check block P. This embodiment obtains the old check data corresponding to the target stripe from the hard disk, that is, reads the old check data stored in the check block from the hard disk position corresponding to the target stripe, and the old check data and the valid data in the stripe together constitute a new stripe, where the valid data is the data written by the host to the target stripe in the RAID.
[0071] Furthermore, in order to ensure the accuracy of searching for old check data, the above-mentioned obtaining old check data corresponding to the target stripe from the hard disk and constructing a new stripe based on the old check data and valid data in the target stripe may include the following steps:
[0072] Step 21: Get the stripe number and stripe width to be tested;
[0073] Step 22: Obtain the stripe address of the target stripe based on the stripe number and the stripe width, and convert the stripe address into a physical address of the hard disk;
[0074] Step 23: Obtain old check data corresponding to the target stripe from the physical address of the hard disk;
[0075] Step 24: Write the old check data to the original check position in the target stripe to construct a new stripe.
[0076] Specifically, this embodiment obtains information such as the stripe number and stripe width of the target stripe of the RAID; according to the RAID address distribution rule of the storage system, the target stripe is randomly searched, and the stripe address is calculated according to the stripe number and the stripe width, the stripe number and the corresponding stripe address are recorded, and the obtained stripe address is converted to the physical address of the hard disk; according to the physical address of the hard disk, the address of the check block corresponding to this stripe is searched, and the old check data stored in the check block is read (that is, the check data that has not been written to IO and has not been generated by new calculations), thereby writing the obtained old check data into the check block in the target stripe, that is, the original check position, to construct a new stripe.
[0077] Further, in order to improve efficiency, the above-mentioned writing of the old check data to the original check position in the target stripe to construct a new stripe may include the following steps:
[0078] Step 241: When the host writes data to the storage system in a sequential writing mode, the time for the host to write to the target stripe is calculated according to the stripe number and the stripe width, and it is determined whether the target stripe has completed data writing; if so, step 242 is executed; if not, step 243 is executed;
[0079] Step 242: writing the old check data to the original check position in the target stripe;
[0080] Step 242: Wait until data writing to the target stripe is completed.
[0081] In this embodiment, the host sends IO pressure to the storage system, and the IO model is sequential write, so that the time for the host to write data to the target stripe can be accurately calculated. When the writing of the target stripe is completed, it means that the valid data in the data block in the target stripe has been updated. At this time, there is no need to calculate the verification data. The old verification data obtained from the hard disk is directly written to the verification block of the target stripe to form a new stripe.
[0082] Furthermore, in order to ensure the accuracy of the timing of constructing the new stripe, the above-mentioned obtaining the old check data corresponding to the target stripe from the hard disk and constructing the new stripe based on the old check data and the valid data in the target stripe may include the following steps:
[0083] Step 31: Write data to the storage system through the host, and determine in real time whether the target stripe has completed the data writing operation;
[0084] Step 32: When the data writing operation of the target stripe is completed, the steps of obtaining the old verification data corresponding to the target stripe from the hard disk and constructing a new stripe based on the old verification data and the valid data in the target stripe are executed.
[0085] In this embodiment, step 31 does not limit the host's writing method to the storage system. It can be sequential writing or random writing. At this time, real-time judgment is required. When the target stripe completes the data writing operation, that is, after the valid data is written, the old verification data acquisition action is executed.
[0086] S102: Writing the data in the new stripe into the hard disk to simulate the occurrence of a write leak.
[0087] This step writes all the data in the new stripe constructed in the above step to the hard disk, simulating the write vulnerability problem.
[0088] S103: Perform write vulnerability repair and perform repair verification when the repair is completed.
[0089] This step targets the write vulnerability problem simulated in the above step, which needs to be repaired at this time, and the repair verification is performed when the repair is completed, so as to verify whether the repair is successful. This embodiment does not limit the write vulnerability repair method. For example, it can be the introduction of a log mechanism; or it can be non-volatile memory; or it can be performing a full system scan and then using an advanced solution; or other repair methods. This embodiment can verify various repair methods to check whether various repair methods are effective.
[0090] Furthermore, in order to improve the verification efficiency, the above-mentioned writing vulnerability repair and performing repair verification when the repair is completed may include the following steps:
[0091] Step 31: Enable the storage system write vulnerability protection and perform system repair;
[0092] Step 32: When the repair is completed, the repaired check data is obtained, and new check data is calculated based on the valid data in the new stripe;
[0093] Step 33: When the repaired verification data is consistent with the new verification data, the repair is successful; otherwise, the repair fails.
[0094] After repairing the new stripe in this embodiment, a repaired stripe can be obtained. New verification data corresponding to the stripe is calculated based on the valid data in the repaired stripe, and the new verification data is compared with the verification data in the repaired stripe. If they are consistent, it means that the repair is successful; if they are inconsistent, it means that the repair has failed.
[0095] Furthermore, in order to improve the accuracy and efficiency of the verification, and to display the repair results and promptly inform the user of the repair status, the above-mentioned writing vulnerability repair and performing repair verification when the repair is completed may include the following steps:
[0096] Step 41: Enable write vulnerability protection of the storage system and perform system repair; the storage system includes a hard disk and an independent disk redundant array module;
[0097] Step 42: When the repair is completed, the repaired verification data is obtained from the repaired new stripe;
[0098] Step 43: When the repaired verification data is consistent with the old verification data, the repair fails and an error reminder is given;
[0099] Step 44: When the repaired check data is inconsistent with the old check data, the XOR algorithm of the independent disk redundant array module is used to recalculate according to the valid data in the new stripe to obtain new check data;
[0100] Step 45: If the repaired verification data is consistent with the new verification data, the repair is successful, the environment configuration is cleaned up and the terminal is notified;
[0101] Step 46: If the repaired verification data is inconsistent with the new verification data, the repair fails and an error reminder is given.
[0102] When the repair is completed, first compare the old check data in the new stripe with the repaired check data in the repaired new stripe. If they are consistent, it means that the repair has failed and the repair method has no effect; if they are inconsistent, it means that the repair may be successful and further verification is required. According to the valid data in the new stripe, the check data is recalculated using the RAID XOR algorithm to obtain new check data. If the new check data is consistent with the repaired check data, the repair is successful, otherwise, the repair fails. When the repair fails, an error reminder is required; when the repair is successful, the environment configuration needs to be cleared and the terminal is informed, and the next vulnerability test can be performed at this time. This embodiment determines the repair status by comparing the check data twice. In the first comparison, no calculation is required. Therefore, if the first comparison is consistent, no subsequent steps are required, which directly indicates that the repair method may not be effectively executed. The user can be informed in time to check whether the repair method is effectively started; if the first comparison is inconsistent, the second comparison process is entered. This comparison method can further explain the cause of the repair failure and improve the comparison efficiency.
[0103] Furthermore, in order to test the effectiveness of the repair method, the above-mentioned enabling of the storage system write vulnerability protection and performing system repair may include the following steps:
[0104] According to the command mode of the current storage system, start the corresponding system repair plan for write vulnerability protection.
[0105] This embodiment first obtains the command mode of the current storage system, and selects a corresponding system repair solution for write vulnerability protection according to the command mode, so as to avoid invalid testing of other repair solutions and improve the effectiveness and efficiency of the repair method test.
[0106] Furthermore, for the accuracy of the test, after the above repair fails, the following steps may also be performed:
[0107] When the repair fails, the same repair method is used again for repair and verification; if the number of failures of the repair method exceeds the preset threshold continuously, an alarm is issued, and other repair methods are used for repair and verification.
[0108] In this embodiment, the repair work for the write vulnerability problem can be continuously tested using the same repair method. If the repair method fails to repair N times in a row, it means that there is a problem with the repair method, and an alarm needs to be issued to inform the user. The repair plan can be modified in time, and the accuracy of the test can be improved by testing a repair method multiple times. At this time, the next repair method can be tested, so that multiple repair methods can be tested at the same time for the same write vulnerability problem, thereby improving the test efficiency.
[0109] Further, according to a vulnerability repair test method proposed in this embodiment, another vulnerability repair test method can also be obtained, which may specifically include:
[0110] Step 51: Acquire a target stripe, where the target stripe includes valid data and check data calculated based on the valid data;
[0111] Step 52: Obtain old verification data corresponding to the target stripe from the hard disk;
[0112] Step 53: Write all data in the target stripe to the hard disk, and use the old check data to replace the check data calculated in the hard disk, simulating the occurrence of a write vulnerability;
[0113] Step 54: Write the vulnerability repair and perform repair verification when the repair is completed.
[0114] In this embodiment, write holes are generated at the hard disk level, that is, when the valid data and verification data in the target stripe are written to the hard disk, the old verification data pre-taken from the hard disk replaces the verification data therein, thereby simulating the occurrence of a write hole.
[0115] The vulnerability repair test method provided by the embodiment of the present invention is applied, by obtaining the old verification data corresponding to the target stripe from the hard disk, and constructing a new stripe based on the old verification data and the valid data in the target stripe; writing the data in the new stripe into the hard disk to simulate the occurrence of a write vulnerability; repairing the write vulnerability, and performing repair verification when the repair is completed. The beneficial effect of this method is that it can construct a write vulnerability of a specific stripe in a directional manner. Compared with the traditional method of simulating write vulnerabilities by restarting a large number of systems to collide, this method simplifies the test process and greatly improves the probability of recurrence of the write vulnerability problem, that is, the write vulnerability problem will also occur when the system is not powered off. At the same time, it reduces the complexity and difficulty brought by manual operation and a large number of system restarts in traditional tests, reduces resource consumption during the test process, accelerates the test cycle, and significantly improves the test efficiency. This method can also verify the repair of the write vulnerability in a directional manner, can quickly and accurately determine whether the repair measures are effective, greatly shortens the verification time, improves the efficiency of the repair effect verification, and ensures that the storage system can quickly and reliably restore data security when facing the write vulnerability problem. Therefore, this method not only improves the storage system's ability to cope with write vulnerability problems, but also fundamentally enhances the overall reliability and stability of the storage system. This has far-reaching significance for protecting user data security and improving system performance, and is an important step in promoting the development of data storage technology.
[0116] In order to make the present invention easier to understand, please refer to Figure 3 , Figure 3 This is a flowchart of a vulnerability repair test method provided by an embodiment of the present invention. Specifically, it may include:
[0117] 1. Create RAID and determine the stripe width and number of parity blocks for each stripe in RAID (taking RAID5 single parity as an example). The host writes data to the storage system normally to ensure that RAID can perform IO read and write operations normally.
[0118] 2. After configuring the host, use the host to issue IO pressure to the storage system, and the IO model is sequential write.
[0119] 3. Start the test script and conduct vulnerability testing. If the test succeeds, clean up the environment configuration; if the test fails, collect logs and other information and submit a bug. The calculation of new verification data and the time required to fill the target stripe with data in the test script need to be combined with the specific storage system operation mode and hard disk space distribution.
[0120] The execution process of the test script can be referred to Figure 4 , Figure 4 This is a flowchart of another vulnerability repair test method provided by an embodiment of the present invention. Specifically, it may include:
[0121] 1. Enable script control, execute printing and testing.
[0122] 2. Get information such as RAID type and stripe width.
[0123] 3. According to the RAID address distribution pattern of the storage system, randomly search for multiple target stripes. Here we take two target stripes as an example, Stripe 1 and Stripe 2. Calculate the stripe address according to the stripe number and stripe width of the target stripe, and record the stripe number and the corresponding stripe address. You can use the addressing tool to search and confirm the RAID stripe number and stripe address LBA (Logical Block Addressing, a common representation method for data locations on auxiliary storage devices such as hard disks), and find the stripe number and address that can be read and written normally for a concurrent amount or more. LBA is an addressing method used to identify the location of data blocks on a storage device. It uses a continuous numbering method to sort the blocks on the storage device and assigns a unique address to each block starting from 0.
[0124] 4. Convert the obtained stripe address to the physical address of the hard disk and record it.
[0125] 5. Read the old check data stored in the check block according to the physical address of the hard disk, recorded as P1 and P2.
[0126] 6. According to the IOPS (number of IOs sent per second, i.e., concurrency) sent by the host and the obtained stripe number, calculate whether the current IO has completed writing the obtained stripe. If not, calculate the writing completion time according to the IO volume (depending on the IOPS of the current storage environment) and wait for the writing to be completed;
[0127] 7. After the data of the target stripe is written, P1 and P2 are written to the location of the original check block, simulating the effect that the check data is not actually written to the disk, that is, the write vulnerability problem;
[0128] 8. According to the command mode of the current storage system, start the solution of write vulnerability protection and wait for the repair to be completed;
[0129] 9. Read the repaired check data of stripe 1 and stripe 2 again and record them as P`1 and P`2. Compare the repaired check data P`1 and P`2 with the old check data P1 and P2 to see if they are consistent. If they are inconsistent, an error is reported.
[0130] 10. Read the valid data in stripe 1 and stripe 2, and recalculate the check data according to the RAID XOR algorithm, denoted as P``1 and P``2. Compare the new check data P``1 and P``2 with the repaired check data P``1 and P`2 to see if they are consistent. It is expected that they are consistent, otherwise an error is reported.
[0131] The following is an introduction to a vulnerability repair test device provided in an embodiment of the present invention. The vulnerability repair test device described below and the vulnerability repair test method described above can be referenced to each other.
[0132] Please refer to Figure 5 , Figure 5 A schematic diagram of a vulnerability repair test device provided by an embodiment of the present invention may include:
[0133] A new stripe construction module 100 is used to obtain old check data corresponding to a target stripe from a hard disk, and to construct a new stripe based on the old check data and valid data in the target stripe;
[0134] A write vulnerability simulation module 200, used to write the data in the new stripe into the hard disk to simulate the occurrence of a write vulnerability;
[0135] The repair verification module 300 is used to repair the write vulnerability and perform repair verification when the repair is completed.
[0136] Based on the above embodiment, the new strip construction module 100 may include:
[0137] A stripe number and stripe width obtaining unit, used to obtain the stripe number and stripe width to be tested;
[0138] A stripe address obtaining unit, configured to obtain a stripe address of the target stripe based on the stripe number and the stripe width, and convert the stripe address into a physical address of the hard disk;
[0139] An old check data acquisition unit, used for acquiring old check data corresponding to the target stripe from the physical address of the hard disk;
[0140] The first new stripe construction unit is used to write the old check data into the original check position in the target stripe, so as to construct the new stripe.
[0141] Based on the above embodiment, the first new stripe construction unit may include:
[0142] a judgment unit, configured to calculate the time for the host to write to the target stripe according to the stripe number and the stripe width, and to judge whether the target stripe has completed data writing when the host writes data to the storage system in a sequential writing mode;
[0143] A first result unit, configured to write the old check data to the original check position in the target stripe if yes;
[0144] The second result unit is used to wait, if not, until the data writing to the target stripe is completed.
[0145] Based on the above embodiment, the repair verification module 300 may include:
[0146] A repair unit, used to enable write vulnerability protection of the storage system and perform system repair;
[0147] A new check data calculation unit, used for obtaining the repaired valid data after the repair is completed, and calculating the new check data according to the valid data in the new stripe;
[0148] The first repair verification unit is used to determine that the repair is successful when the repaired verification data is consistent with the new verification data; otherwise, the repair fails.
[0149] Based on the above embodiment, the repair verification module 300 may include:
[0150] A repair unit, used to enable write vulnerability protection of the storage system and perform system repair; the storage system includes the hard disk and an independent disk redundant array module;
[0151] A repaired valid data acquisition unit, used to acquire the repaired verification data from the repaired new stripe after the repair is completed;
[0152] A second repair verification unit, configured to indicate that the repair fails and issue an error reminder when the repaired verification data is consistent with the old verification data;
[0153] A third repair verification unit, configured to, when the repaired verification data is inconsistent with the old verification data, recalculate the data according to the valid data in the new stripe using the XOR algorithm of the independent redundant array of disks module to obtain new verification data;
[0154] A fourth repair verification unit, configured to: if the repaired verification data is consistent with the new verification data, the repair is successful, clean up the environment configuration and notify the terminal;
[0155] The fifth repair verification unit is used to indicate that the repair has failed and to issue an error reminder if the repaired verification data is inconsistent with the new verification data.
[0156] Based on the above embodiment, the repair unit may include:
[0157] The repair subunit is used to start a corresponding system repair solution for write vulnerability protection according to the command mode of the current storage system.
[0158] Based on the above embodiment, the new strip construction module 100 may include:
[0159] A data writing judgment unit, used to perform a data writing operation on the storage system through the host, and to judge in real time whether the data writing operation is completed on the target stripe;
[0160] The second new stripe construction unit is used to execute the steps of obtaining old verification data corresponding to the target stripe from the hard disk and constructing a new stripe based on the old verification data and valid data in the target stripe when the data writing operation of the target stripe is completed.
[0161] It should be noted that the order of the modules and units in the above vulnerability repair test device can be changed without affecting the logic.
[0162] The vulnerability repair test device provided by the embodiment of the present invention is applied, through the new stripe construction module 100, used to obtain the old verification data corresponding to the target stripe from the hard disk, and construct a new stripe based on the old verification data and the valid data in the target stripe; the write vulnerability simulation module 200 is used to write the data in the new stripe into the hard disk to simulate the occurrence of the write vulnerability; the repair verification module 300 is used to repair the write vulnerability and perform repair verification when the repair is completed. The beneficial effect of this device is that it can construct the write vulnerability of a specific stripe in a directional manner. Compared with the traditional method of simulating the write vulnerability by restarting a large number of systems to collide, this device simplifies the test process, greatly improves the probability of recurrence of the write vulnerability problem, and reduces the complexity and difficulty brought by manual operation and a large number of system restarts in traditional tests, reduces resource consumption in the test process, accelerates the test cycle, and significantly improves the test efficiency. The device can also verify the repair of the write vulnerability in a directional manner, can quickly and accurately determine whether the repair measures are effective, greatly shortens the verification time, improves the efficiency of the repair effect verification, and ensures that the storage system can quickly and reliably restore data security when facing the write vulnerability problem. Therefore, this device not only improves the storage system's ability to cope with write vulnerability problems, but also fundamentally enhances the overall reliability and stability of the storage system. This has far-reaching significance for protecting user data security and improving system performance, and is an important step in promoting the development of data storage technology.
[0163] Figure 6 A schematic diagram of a vulnerability repair test device provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the vulnerability repair test equipment includes:
[0164] A memory 60, for storing computer programs;
[0165] The processor 61 is used to implement the steps of the vulnerability repair testing method in the above embodiment when executing a computer program.
[0166] The vulnerability repair test device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0167] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0168] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, it can implement the relevant steps of the vulnerability repair test method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be short-term storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. Data 603 may include, but is not limited to, data of the vulnerability repair test method, etc.
[0169] In some embodiments, the vulnerability repair testing device may further include a display screen 62 , an input and output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0170] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the vulnerability repair test device, and may include more or fewer components than shown in the figure.
[0171] It is understandable that if the vulnerability repair test method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the contribution to the current technology or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and executes all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program code.
[0172] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the vulnerability repair test method described above are implemented.
[0173] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0174] Professionals may further 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 the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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 the present invention.
[0175] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0176] The vulnerability repair test method, device, equipment and readable storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A vulnerability repair testing method, characterized in that: include: Obtain old check data corresponding to the target stripe from the hard disk, and construct a new stripe based on the old check data and valid data in the target stripe; Writing the data in the new stripe into the hard disk to simulate the occurrence of a write leak; Write vulnerability fixes and verify the fixes when they are complete.
2. The vulnerability repair testing method according to claim 1, characterized in that: Obtaining old check data corresponding to the target stripe from the hard disk, and constructing a new stripe based on the old check data and valid data in the target stripe, including: Get the stripe number and stripe width to be tested; Obtaining a stripe address of the target stripe based on the stripe number and the stripe width, and converting the stripe address into a physical address of the hard disk; Obtaining old check data corresponding to the target stripe from the physical address of the hard disk; The old check data is written to the original check position in the target stripe, thereby constructing the new stripe.
3. The vulnerability repair testing method according to claim 2, characterized in that: Writing the old check data to the original check position in the target stripe to construct the new stripe includes: When the host writes data to the storage system in a sequential writing mode, the time for the host to write to the target stripe is calculated according to the stripe number and the stripe width, and it is determined whether the target stripe has completed data writing; If yes, writing the old check data to the original check position in the target stripe; If not, wait until the target stripe completes data writing.
4. The vulnerability repair testing method according to claim 1, characterized in that: Write vulnerability fixes and verify the fixes when they are complete, including: Enable write vulnerability protection for the storage system and perform system repairs; When the repair is completed, the repaired check data is obtained, and new check data is calculated based on the valid data in the new stripe; When the repaired verification data is consistent with the new verification data, the repair is successful; otherwise, the repair fails.
5. The vulnerability repair testing method according to claim 1, characterized in that: Write vulnerability repairs. When the repair is completed, perform repair verification, including: Enable write vulnerability protection of the storage system and perform system repair; the storage system includes the hard disk and independent disk redundant array module; When the repair is completed, the repaired verification data is obtained from the repaired new stripe; When the repaired verification data is consistent with the old verification data, the repair fails and an error reminder is given; When the repaired check data is inconsistent with the old check data, the XOR algorithm of the independent redundant array of disks module is used to recalculate according to the valid data in the new stripe to obtain new check data; If the repaired verification data is consistent with the new verification data, the repair is successful, the environment configuration is cleaned up and the terminal is notified; If the repaired verification data is inconsistent with the new verification data, the repair fails and an error reminder is given.
6. The vulnerability repair testing method according to any one of claims 4 or 5, characterized in that: Enable the storage system's write vulnerability protection and perform system repairs, including: According to the command mode of the current storage system, a corresponding system repair solution for write vulnerability protection is started.
7. The vulnerability repair testing method according to claim 1, characterized in that: Obtaining old check data corresponding to the target stripe from the hard disk, and constructing a new stripe based on the old check data and valid data in the target stripe, including: Performing a data writing operation on the storage system through the host, and determining in real time whether the data writing operation is completed on the target stripe; When the data writing operation is completed for the target stripe, the steps of obtaining the old verification data corresponding to the target stripe from the hard disk and constructing a new stripe based on the old verification data and the valid data in the target stripe are performed.
8. A vulnerability repair testing device, characterized in that: include: A new stripe construction module, used for obtaining old check data corresponding to a target stripe from a hard disk, and constructing a new stripe based on the old check data and valid data in the target stripe; A write vulnerability simulation module, used for writing the data in the new stripe into the hard disk to simulate the occurrence of a write vulnerability; The repair verification module is used to write vulnerability repairs and perform repair verification when the repair is completed.
9. A vulnerability repair test device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the vulnerability repair testing method according to any one of claims 1 to 7 when executing the computer program.
10. A storage medium, characterized in that: The storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by the processor, the steps of the vulnerability repair testing method according to any one of claims 1 to 7 are implemented.
