Raid chip verification method and device, electronic equipment and readable storage medium

By generating target read and write instructions that conform to normal distribution and random start addresses and capacity, the Raid chip is verified, which solves the problem of difficulty in detecting occasional problems in the prior art, and improves the detection function coverage and data transmission stability .

CN119003232APending Publication Date: 2024-11-22SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411026026.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

Due to the sequence and predictability of existing Raid chip verification methods, it is difficult to detect occasional problems, and it is impossible to conduct comprehensive inspection of Raid chips.

Method used

By generating target read and write instructions that conform to normal distribution and random start address and random capacity, the Raid chip is verified to detect occasional problems on the Raid chip and improve the coverage of detection function.

Benefits of technology

It realizes more disordered and randomized reading and writing of Raid chips, improves the chip's detection function coverage, can detect occasional problems more effectively, and ensures the stability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003232A_ABST
    Figure CN119003232A_ABST
Patent Text Reader

Abstract

The invention provides a Raid chip verification method and device, electronic equipment and a readable storage medium, and the method comprises the steps: determining a random initial address for executing a target read-write instruction according to the capacity of a storage space operated by a Raid chip; the random initial address obeys a normal distribution principle in a storage space range of the Raid chip; determining the random capacity for executing the target read-write instruction based on the capacity of the storage space with the highest operation frequency of the historical read-write instruction; the random capacity obeys a normal distribution principle in a storage space range of the Raid chip; generating a target read-write instruction based on the random initial address and the random capacity; and performing verification operation on the Raid chip by executing the target read-write instruction. According to the method and the device, the random initial address and the random capacity conforming to normal distribution can be generated, more disordered and randomized read-write of the Raid chip can be realized based on the generated randomized target read-write instruction, detection of accidental problems of the Raid chip is realized, and the detection function coverage rate of the chip is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a Raid chip verification method, device, electronic equipment and readable storage medium. Background Art

[0002] Raid chip (Redundant Array of Independent Disks) is a data storage technology used to improve the performance, capacity and reliability of data storage systems. Common Raid levels include Raid 0, Raid 1, Raid 5, Raid 10, etc., that is, by combining multiple hard disks together, decentralized data storage and redundant backup are achieved to provide faster data access speed and higher data security, and data management will be performed on each hard disk at different Raid levels.

[0003] The stability of the Raid chip when processing large amounts of data is the key to chip verification. Therefore, it is necessary to verify the execution of a large number of IO commands and the accuracy of data reading and writing to each hard disk when the Raid chip is at different Raid levels. For this verification scenario, the currently commonly used sequential, predictable, and directional stimulus generation method sends IO commands to the Raid chip to achieve coverage of the chip functions.

[0004] However, this stimulus generation method is not conducive to the detection of occasional problems of the Raid chip due to its sequential and predictable verification method. Summary of the invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a Raid chip verification method, device, electronic device and readable storage medium that overcome the above problems or at least partially solve the above problems.

[0006] In a first aspect, an embodiment of the present application discloses a Raid chip verification method, the method comprising:

[0007] According to the capacity of the storage space operated by the Raid chip, a random starting address for executing a target read / write instruction is determined; the random starting address obeys a normal distribution principle within the storage space of the Raid chip;

[0008] Based on the capacity of the storage space with the highest frequency of historical read and write instruction operations, determine the random capacity for executing the target read and write instructions; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip;

[0009] Based on the random starting address and the random capacity, generating a target read / write instruction;

[0010] The Raid chip is verified by executing the target read and write instructions.

[0011] In a second aspect, an embodiment of the present application discloses a Raid chip verification device, characterized in that the device comprises:

[0012] A first determination module is used to determine a random starting address for executing a target read / write instruction according to the capacity of the storage space operated by the Raid chip; the random starting address obeys a normal distribution principle within the storage space of the Raid chip;

[0013] The second determination module is used to determine the random capacity of executing the target read-write instruction based on the capacity of the storage space with the highest frequency of historical read-write instruction operations; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip;

[0014] A generating module, used for generating a target read-write instruction based on the random starting address and the random capacity;

[0015] An execution module is used to perform a verification operation on the Raid chip by executing the target read and write instructions.

[0016] In a third aspect, an embodiment of the present application further discloses an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0017] In a fourth aspect, an embodiment of the present application further discloses a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0018] In a fifth aspect, an embodiment of the present application further discloses a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0019] In an embodiment of the present application, a random starting address for executing a target read / write instruction is determined according to the capacity of the storage space operated by the Raid chip; the random starting address obeys the normal distribution principle within the storage space range of the Raid chip; the random capacity for executing a target read / write instruction is determined based on the capacity of the storage space with the highest frequency of historical read / write instruction operations; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip; a target read / write instruction is generated based on the random starting address and the random capacity; and the Raid chip is verified by executing the target read / write instruction. The method of the present application can generate a random starting address and a random capacity that conform to the normal distribution, so that when verifying the Raid chip based on the target read / write instruction, it can realize a more disordered and random read / write of the Raid chip based on the generated randomized target read / write instruction, realize the detection of occasional problems of the Raid chip, and improve the coverage of the chip's detection function. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a flow chart of the steps of a Raid chip verification method provided by an embodiment of the present invention;

[0021] Figure 2 It is a flowchart of the steps of another Raid chip verification method provided by an embodiment of the present invention;

[0022] Figure 3 A method for generating Slba and nblock provided by an embodiment of the present invention;

[0023] Figure 4 This is a data storage schematic diagram provided by an embodiment of the present invention;

[0024] Figure 5 This is a flow chart of a data comparison method provided by an embodiment of the present invention;

[0025] Figure 6 This is a third Raid chip verification method provided by an embodiment of the present invention;

[0026] Figure 7 It is a SLBA random number normal distribution histogram provided by an embodiment of the present invention;

[0027] Figure 8 is a normal distribution histogram of nblock random numbers provided by an embodiment of the present invention;

[0028] Fig. 9 A Raid chip verification device 30 provided in an embodiment of the present invention;

[0029] Fig.10 An electronic device provided by an embodiment of the present invention;

[0030] Fig.11 This is another electronic device provided by the present invention. DETAILED DESCRIPTION

[0031] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0032] The concepts involved in this application and the solutions provided are explained below.

[0033] IO (Input / Output) commands: The IO commands in the NVMe (Non-Volatile Memory Express) protocol include operations such as read, write, read and update, write zero data, secure erase, and flush cache. These commands are used to read and write storage devices and ensure data consistency, security, and persistence.

[0034] The NVME protocol (Non Volatile Memory Host Controller Interface Specification) is a bus transmission protocol specification based on a device logic interface similar to AHCI. It is used to access non-volatile memory media attached through the PCI Express (PCIe) bus and has the characteristics of high bandwidth and low latency.

[0035] Block: IO commands use block as the minimum granularity when reading and writing hard disk data. Usually the size of a block is 4KB or 512B.

[0036] slba: The index of the first block operated by the IO read and write command in the hard disk.

[0037] nblock: The size of the storage area operated by IO read and write commands, in blocks.

[0038] nsid: The hard disk will divide the physical space into multiple logical storage spaces (namespaces), where nsid indicates the ID number of the namespace. Since the host regards the Raid chip as a large hard disk, the nsid sent by the host to the Raid chip actually indicates different Raid levels.

[0039] Stripe: During the RAID formation process, the physical disk will be divided into units (blocks). This unit is the RAID stripe, which is the basic unit of RAID data processing.

[0040] Chunk size: The storage unit corresponding to each disk in the same stripe is a Chunk, and its size is Chunksize in blocks.

[0041] Normal distribution: Normal distribution is a probability distribution with a bell-shaped symmetrical curve, determined by the mean and standard deviation. About 68% of the data fall within the range of ± one standard deviation from the mean, 95% of the data fall within the range of ± two standard deviations, and 99.7% of the data fall within the range of ± three standard deviations. Since most random events in nature maintain a normal distribution, this probability distribution is widely used in natural sciences, social sciences, and statistics.

[0042] In the related art, the verification method for the Raid chip is to use a sequential, predictable, and directional stimulus generation method to send IO commands to the Raid chip. For example, according to the address order of the storage space, the fixed storage area size is read and written each time. In practice, the storage area operated by the IO command is random, and the storage area is not necessarily consistent with the fixed storage area size during verification. Therefore, the current verification method is difficult to fully detect the Raid chip, which is not conducive to the detection of occasional problems of the Raid chip. Based on this, a verification method for the raid chip of this application is proposed to realize random stimulus verification for the Raid chip. The core method is to generate a large number of slba, nblock, nsid and data random IO read and write commands as the stimulus of the Raid chip, and realize the read and write operations of random hard disks and stripes under different Raid levels, and slba and nblock follow the normal distribution principle and are in a reasonable range. At the same time, the data obtained or issued by the read and write commands are compared in bytes to determine the accuracy of the data. The specific scheme is as follows.

[0043] refer to Figure 1 , which shows a flowchart of a Raid chip verification method provided by an embodiment of the present application, the method comprising:

[0044] Step 101, determining a random starting address for executing a target read / write instruction according to the capacity of the storage space operated by the Raid chip; the random starting address obeys a normal distribution principle within the storage space of the Raid chip.

[0045] In the embodiment of the present invention, the random start address generates a random slba field, which is the index of the first block of the IO read and write command operation in the hard disk. The generated random start address makes the IO command no longer perform sequential and predictable read and write operations, but starts reading blocks with a random start address within the storage space of the Raid chip to correspond to the actual read and write scenarios.

[0046] Specifically, from the analysis of the user's operating habits on the hard disk, it can be known that the user generally only performs read and write operations on the same file within a certain period of time, which is reflected in the operation of IO read and write commands, which is concentrated on a section of storage space, and the frequency of user operations will be greatly reduced for some files that are not modified or used very often. Therefore, in actual usage scenarios, the read and write operations on the hard disk mounted under the Raid chip usually show a trend of centralization and uniform distribution. This trend is consistent with the changing trend of the normal distribution, and from the perspective of probability, the normal distribution is consistent with the distribution mode of most random events. Therefore, the normal distribution method can be used to generate the slba field in the IO command, so as to cause the IO command to show a normal distribution trend for the operation position of the storage area.

[0047] Since the storage space of the hard disk attached to the Raid chip mostly reaches the PB level (1PB equals 1024TB), the slba data range that can be set by the IO command is generally very large. The basic principle of the central limit theorem is to use a large number of uniformly distributed normal variables to make the final random number approximately obey the normal distribution. Therefore, the central limit theorem can be used to generate slba random numbers, that is, random starting addresses.

[0048] According to the capacity of the storage space operated by the Raid chip and the normal distribution principle, a random starting address that conforms to the normal distribution principle can be generated. The generated random starting address can be saved as a list. All random starting addresses in the list satisfy the normal distribution to ensure that the actual read and write scenarios can be simulated based on the random starting address.

[0049] Step 102, based on the capacity of the storage space with the highest frequency of historical read and write instruction operations, determine the random capacity for executing the target read and write instructions; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip.

[0050] In an embodiment of the present invention, the capacity of the storage space operated by the read / write instruction may correspond to the block field, that is, the random capacity may correspond to the nblock random number, where nblock is the size of the storage area operated by the IO read / write command, in blocks. Based on the analysis of actual usage scenarios, it can be seen that, in general, when copying files or data, their sizes will be concentrated in a stable range, and the frequency of extremely small or extremely large data transmissions is very low. This trend also conforms to the changing trend of the normal distribution. Similarly, the normal distribution method can be used to generate the nblock field in the IO command, thereby causing the size of the storage space operated by the IO command to also present a normal distribution trend.

[0051] In the related art, a fixed-size nblock is used to execute read and write commands. In the present application, a random-size storage area can be obtained by generating a random capacity (nblock) combined with a random start address to simulate an actual read and write scenario.

[0052] Specifically, the random capacity for executing the target read and write instructions can be determined based on the capacity of the storage space with the highest frequency of historical read and write instruction operations. That is, the capacity of the storage space with the highest frequency of historical read and write instruction operations is the capacity size that users actually need most frequently. This capacity size can be used as the average value, and the standard deviation can be further determined based on the calculation principle of normal distribution. Therefore, the random capacity is generated based on the determined average value and standard deviation. The generated random capacity can be saved as a list, where the random capacity in the list conforms to the normal distribution principle.

[0053] Step 103: Generate a target read / write instruction based on the random start address and the random capacity.

[0054] In the embodiment of the present invention, a target read / write instruction may be generated based on the random start address and the random capacity. When generating the target read / write instruction, it may be performed based on the list storing the random start address and the list storing the random storage capacity.

[0055] Specifically, the starting address and the storage capacity can determine a storage area starting with the starting address and having a size of the storage capacity, and the storage area can be used as an area for read and write instruction operations.

[0056] For example, the list of random starting addresses includes random starting address 1, random starting address 2, random starting address 3, random starting address 4, random starting address 5, random starting address 6, etc., and the list of random storage capacity includes: random storage capacity 1, random storage capacity 2, random storage capacity 3, random storage capacity 4, etc., then the storage area corresponding to the generated target read / write instruction 1 is random starting address 1 + storage capacity 1, the storage area corresponding to the target read / write instruction 1 is random starting address 1 + storage capacity 2, the storage area corresponding to the target read / write instruction 3 is random starting address 1 + storage capacity 3, the storage area corresponding to the target read / write instruction 4 is random starting address 1 + storage capacity 4, and so on. The random storage address 2 is combined with each storage capacity in the random capacity list in turn to determine the target read / write instruction.

[0057] That is, by determining a random starting address and random capacity that conforms to the normal distribution principle, the present application can combine and generate a large number of target read and write instructions that operate different storage areas, and the storage areas operated by the target read and write instructions are also random, so that random stimulation of the Raid chip can be achieved through the target read and write instructions.

[0058] Step 104, performing a verification operation on the Raid chip by executing the target read and write instructions.

[0059] In the embodiment of the present invention, based on the method of step 103, target read and write instructions can be generated in sequence, and the target read and write instructions can be executed in sequence to implement the random verification operation of the Raid chip.

[0060] In addition, in addition to using the central limit theorem and the 3 sigma method, the method of generating normally distributed random starting addresses and random capacity addresses can also be generated using the Ziggurat algorithm, rejection sampling method, Box-Muller transformation method, etc., which are not limited in the embodiments of the present application.

[0061] In summary, in the embodiment of the present application, the random starting address for executing the target read-write instruction is determined according to the capacity of the storage space operated by the Raid chip; the random starting address obeys the normal distribution principle within the storage space range of the Raid chip; the random capacity for executing the target read-write instruction is determined based on the capacity of the storage space with the highest frequency of historical read-write instruction operations; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip; the target read-write instruction is generated based on the random starting address and the random capacity; the Raid chip is verified by executing the target read-write instruction. The method of the present application can generate a random starting address and a random capacity that conform to the normal distribution, so that when verifying the Raid chip based on the target read-write instruction, it can realize more disordered and randomized reading and writing of the Raid chip based on the generated randomized target read-write instruction, realize the detection of occasional problems of the Raid chip, and improve the coverage of the chip's detection function.

[0062] refer to Figure 2 , Figure 2 Another Raid chip verification method disclosed in the present application is shown, comprising:

[0063] Step 201, determining a random starting address for executing a target read / write instruction according to the capacity of the storage space operated by the Raid chip; the random starting address obeys a normal distribution principle within the storage space of the Raid chip.

[0064] Optionally, step 201 includes:

[0065] Sub-step 2011, determining the stripe size of the disk mounted by the Raid chip according to the number of hard disks operated by the Raid chip and the storage block capacity;

[0066] Sub-step 2012, determining the capacity of the storage space operated by the Raid chip according to the number of stripes set by the Raid chip and the stripe size;

[0067] Sub-step 2013, determining half of the capacity of the storage space as a first average value;

[0068] Sub-step 2014, determining a first standard deviation according to the capacity of the storage space, the first average value, and the 3 sigma principle;

[0069] Sub-step 2015: determining a random starting address for executing a target read / write instruction according to the first average value and the first standard deviation.

[0070] In the embodiment of the present invention, for sub-steps 2011 to 2015, the normal distribution random number generating the random starting address (slba random number) needs to determine the average value μ and the standard deviation σ. First, the first average value μ is determined based on formula 1, and the standard deviation σ is determined according to the number of hard disks p. n The product of the storage block capacity (chunk size) s1 is used to obtain the stripe size of the disk currently hung by the Raid chip. Then, the capacity of the storage space operated by the Raid chip is calculated based on the number of stripes num set inside the Raid chip. Finally, half of it can be taken as the first average value μ, thereby ensuring that the random start address (slba random number) is concentrated in the middle part of the entire storage area. In addition, to ensure that the random start address finally generated is distributed within the range of the entire storage space, according to the 3 sigma principle, 95.4% of the normally distributed random numbers are distributed within the range of [μ-3σ,μ+3σ]. Therefore, the size of the storage space is kept consistent with μ+3σ, and the first standard deviation σ of the random number can be calculated based on formula 2.

[0071] μ=(p n *s1*num) / 2 (Formula 1)

[0072] σ=(p n *s1*num)-μ) / 3 (Formula 2)

[0073] A specified number of random starting addresses can be generated based on the first average value and the first standard deviation determined above, and the random starting addresses are saved as a list for subsequent determination of random storage areas for read and write instruction operations.

[0074] Step 202, based on the capacity of the storage space with the highest frequency of historical read and write instruction operations, determine the random capacity for executing the target read and write instructions; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip.

[0075] Optionally, step 202 includes:

[0076] Sub-step 2021, taking the capacity of the storage space with the highest frequency of historical read and write instruction operations as the second average value;

[0077] Sub-step 2022, determining a second standard deviation based on the capacity of other storage spaces operated in the historical read / write instructions, the second mean value, and the 3 sigma principle; the capacity of the other storage space is the capacity of the storage space operated by the historical read / write instructions except the capacity of the storage space with the highest operation frequency;

[0078] Sub-step 2023, determining the random capacity for executing the target read / write instruction according to the second average value and the second standard deviation.

[0079] In the embodiment of the present invention, for sub-steps 2021 to 2023, the key point of the Raid chip to implement the read and write operations on the random size storage space is to provide unpredictable random capacity (nblock) to the IO command, which is similar to the way of generating the random number of the normal distribution of the random starting address (slba), and the central limit theorem can also be used to generate the random number of nblock. First of all, considering that the storage space size commonly operated by users for different purposes of the Raid chip is inconsistent, the commonly used nblock value can be determined as the second average value μ according to the actual user group of the Raid chip, and the second standard deviation σ is also calculated based on the 3 sigma principle.

[0080] Specifically, based on the 3 Sigma principle, the nblock value actually used by the user (the capacity of the storage space operated by the historical read and write instructions in addition to the capacity of the storage space with the highest operation frequency) can be collected as sample data, and the square of the difference between each data in the sample data and the second average value is added, and then divided by the number of data to obtain the variance of the data. The square root of the variance is the second standard deviation. Based on the second average value and the second standard deviation determined above, a specified number of random capacities can be generated. After the random capacity is saved as a list, it can be combined with the random starting address to determine the target read and write instructions for different storage area operations, thereby realizing the verification of the Raid chip.

[0081] Step 203, generating a random Raid level according to the number of hard disks operated by the Raid chip.

[0082] Step 204, generating a target read / write instruction according to the random Raid level, the random start address and the random capacity.

[0083] In the embodiment of the present invention, for step 203 and step 204, in order to realize the read and write operations of random hard disks and strips at different Raid levels, the present application also generates a random Raid level based on the number of hard disks operated by the Raid chip, and generates a target read and write instruction in combination according to the generated random Raid level, random starting address and the random capacity. The read and write operations of random hard disks and strips at different Raid levels are realized based on the target read and write instructions, thereby improving the functional coverage of the high chip.

[0084] Step 205: Verify the Raid chip by executing the target read and write instructions.

[0085] This step may refer to step 104 and will not be described in detail here.

[0086] Optionally, step 205 includes:

[0087] Sub-step 2051, determining a target storage area of ​​a target read / write instruction currently being executed according to the random start address and the random capacity;

[0088] Sub-step 2052, determining whether the target storage area includes an area where a read / write instruction has been executed;

[0089] Sub-step 2053, if not, executing the target read and write instruction to perform a verification operation on the target storage area of ​​the Raid chip;

[0090] Sub-step 2054: If yes, the current target read / write instruction is abandoned, and a new target read / write instruction is generated based on the new random start address and random capacity.

[0091] In the embodiment of the present invention, reference Figure 3 , Figure 3 A method for generating Slba and nblock is shown. For sub-steps 2051 to 2054, a normal distribution random number library of nsid random numbers, random starting addresses (slba) and random capacities (nblock) within a range is generated according to relevant input parameters (storage space size, i.e., the number of hard disks, chunk size, number of stripes, and commonly used nblock size). However, the storage area operated by the IIO command composed of slba and nblock may be partially repeated, and the repetition may cause read or write errors, resulting in subsequent data comparison failure. Therefore, before executing the target read / write instruction, the storage space from slba to slba+nblock can be calculated according to the nblock value of the current target read / write instruction (IO command) as the storage granularity required for this IO operation. At this time, it is determined whether the current IO is the first IO command. If so, the slba and nblock values ​​are used as the final output. If not, all previous slba and slba+nblock record values ​​are traversed, and at the same time, it is determined whether the storage area range of the current IO command operation has been used. If the storage area operated is repeated, the current target read / write instruction is abandoned, and a new random starting address and random capacity are taken from the slba and nblock normal distribution random number library and the same judgment is performed as above. Otherwise, the slba and nblock values ​​are output as the final output to generate an executable target read / write instruction.

[0092] Optionally, the method further comprises:

[0093] Step 206, each time the target read / write instruction is executed, the operation parameters corresponding to the target read / write instruction are recorded, and a read instruction maintenance table and a write instruction maintenance table are generated; the operation parameters include: random Raid level, random start address and the random capacity;

[0094] Among them, the read instruction maintenance table and the write instruction maintenance table have the same index for the same operation parameters, and the read instruction maintenance table and the write instruction maintenance table also include data storage addresses corresponding to the operation parameters, and the data storage addresses are used to store the data content corresponding to the read instruction or the data content corresponding to the write instruction.

[0095] In the related art, a direct data comparison method is often used when performing IO read and write command alternating operations, that is, the source data is compared with the acquired data after each read and write operation, and the data space is released after the comparison is completed. However, this method is not very suitable for large-scale data read and write comparison. Therefore, the present invention proposes a large-scale IIO read and write data comparison mechanism based on a read and write information maintenance table, by maintaining a read instruction maintenance table corresponding to the read data and a write instruction maintenance table corresponding to the write data, two information maintenance tables are used to store slba and other related parameter information and read and write data storage addresses involved in each IO read and write operation, and a specified index is added for each IO operation, so that the corresponding data storage space address can be queried based on the index during subsequent data comparison, thereby performing data comparison byte by byte and outputting the comparison result.

[0096] Specifically, refer to Figure 4 , Figure 4 A data storage schematic diagram provided by an embodiment of the present application is shown. As the increase in the number of IO commands makes the comparison of read and write data more and more complicated, the comparison mechanism of the present application is disclosed for large-scale IO read and write data comparison scenarios. Each time the target read and write instruction (IO command) is sent, the nsid, nblock, and slba set by the command are stored in the read / write instruction maintenance table, and an independent index is assigned to the IO command set for each parameter, and the indexes of the IO read and write commands under the same parameters in the two tables are guaranteed to be the same, so that the read and write commands that operate the same hard disk area can be identified during the subsequent data comparison. At the same time, space is allocated for random data obtained or issued by the IO read and write command, and the space address is stored in the data storage address field in the read / write instruction maintenance table to ensure that the data will not be lost due to reasons such as memory release, thereby affecting the accuracy of the subsequent data comparison.

[0097] Optionally, after step 205, the method further includes:

[0098] Step 207, obtaining the data storage address under the same index in the read instruction maintenance table and the write instruction maintenance table;

[0099] Step 208, obtaining data content corresponding to the read instruction and data content corresponding to the write instruction from the data storage address;

[0100] Step 209, splitting the data content corresponding to the read instruction and the data content corresponding to the write instruction respectively according to the size of the random capacity to generate a read data block to be compared and a write data block to be compared;

[0101] Step 210, comparing the read data block to be compared with the write data block to be compared in bytes;

[0102] Step 211, if the read data block to be compared is consistent with the write data block to be compared, the comparison is successful, and the read instruction maintenance table and the write instruction maintenance table are continuously traversed to perform comparison of the remaining data;

[0103] Step 212: If the read data block to be compared is inconsistent with the write data block to be compared, the comparison fails, the failed read instruction related information and the failed write instruction related information are output, and the data comparison process is exited.

[0104] In the embodiment of the present invention, reference Figure 5 , Figure 5 A data comparison method provided by an embodiment of the present application is shown. For steps 207 to 212, the data comparison mainly relies on the target read / write instruction (IO command) related information recorded in the information maintenance table corresponding to the read / write instruction. First, the data storage address of the read instruction maintenance table and the write instruction maintenance table under the same index needs to be obtained, and the data content corresponding to the read instruction and the data content corresponding to the write instruction are obtained from the data storage address; and based on the size of nblock, the read and write data are split into a read data block to be compared and a write data block to be compared, for example, at a granularity of 4KB. Then, the 4KB read data block to be compared and the write data block to be compared are compared in bytes. If the data comparison fails at this time, the relevant IO command information is printed through the terminal and the data comparison mechanism is exited. If the data comparison is normal, all the comparison operations of the IO read and write command related data that have been completed are traversed, and finally the comparison is completed and the data comparison is completed. Exit.

[0105] refer to Figure 6 , Figure 6 The third Raid chip verification method provided in the embodiment of the present application is shown, including:

[0106] Step S1, determining relevant input parameters;

[0107] Step S2, randomly generate nsid within a range;

[0108] Step S3, generating slba and nblock that follow normal distribution;

[0109] In an embodiment of the present invention, for steps S1 to S3, the relevant input parameters include the storage space size of the hard disk mounted on the current Raid chip, that is, the number of hard disks, chunk size, number of stripes and the commonly used nblock size. Based on the above parameters, the value range of nblock, nsid and slba can be determined, and data can be provided for the subsequent generation of slba and nblock random numbers.

[0110] The slba and nblock normal random number generation includes: extracting the relevant parameters obtained above, and based on the slba and nblock normal distribution random number calculation method described above, the slba and nblock values ​​that conform to the normal distribution trend can be calculated, which are used as the slba and nblock random number library for subsequent operations.

[0111] Based on the above SLBA and Nblock random number generation methods, such as Figure 7 The following is a distribution histogram of slba random data when there are 4 Raid chip hanging disks, chunk_size is 256KB (64 blocks), and the number of stripes is 2048; Figure 8 The following is a histogram of random data distribution of nblock when the commonly used nblock value is 4MB (1024 blocks). From the two figures, we can see that the slba random number shows a normal distribution trend in the entire storage space, and the nblock random number changes evenly from 1024 to both sides, covering most of the commonly used nblock values, which is in line with the change trend in real scenarios.

[0112] Step S4, sending IO read / write commands and saving relevant information;

[0113] Step S5, comparing read and write data;

[0114] Step S6, output the comparison result.

[0115] In the embodiment of the present invention, for step S4 to step S5, reference may be made to the description of step 207 to step 212, which will not be repeated here.

[0116] The above method of the present application can improve the functional coverage of the Raid chip, and can input random and disordered IO command stimulation to the Raid chip to increase the probability of occasional failures being verified, thereby improving the functional coverage of the Raid chip. At the same time, the stability of large-scale data transmission of the Raid chip can be tested. The read and write data of large-scale IO read and write command operations can be compared through the data comparison mechanism, thereby judging the stability of the Raid chip during large-scale data transmission.

[0117] In summary, in the embodiment of the present application, the random starting address for executing the target read-write instruction is determined according to the capacity of the storage space operated by the Raid chip; the random starting address obeys the normal distribution principle within the storage space range of the Raid chip; the random capacity for executing the target read-write instruction is determined based on the capacity of the storage space with the highest frequency of historical read-write instruction operations; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip; the target read-write instruction is generated based on the random starting address and the random capacity; the Raid chip is verified by executing the target read-write instruction. The method of the present application can generate a random starting address and a random capacity that conform to the normal distribution, so that when verifying the Raid chip based on the target read-write instruction, it can realize more disordered and randomized reading and writing of the Raid chip based on the generated randomized target read-write instruction, realize the detection of occasional problems of the Raid chip, and improve the coverage of the chip's detection function.

[0118] refer to Fig. 9 , which shows a Raid chip verification device 30 provided in an embodiment of the present application, the device comprising:

[0119] The first determination module 301 is used to determine the random starting address for executing the target read / write instruction according to the capacity of the storage space operated by the Raid chip; the random starting address obeys the normal distribution principle within the storage space of the Raid chip;

[0120] The second determination module 302 is used to determine the random capacity of executing the target read / write instruction based on the capacity of the storage space with the highest frequency of historical read / write instruction operations; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip;

[0121] A generating module 303, configured to generate a target read / write instruction based on the random start address and the random capacity;

[0122] The execution module 304 is used to perform a verification operation on the Raid chip by executing the target read and write instructions.

[0123] Optionally, the first determining module includes:

[0124] The first submodule is used to determine the stripe size of the disk hung by the Raid chip according to the number of hard disks operated by the Raid chip and the storage block capacity;

[0125] The second submodule is used to determine the capacity of the storage space operated by the Raid chip according to the number of stripes and the stripe size set by the Raid chip;

[0126] A third submodule, configured to determine half of the capacity of the storage space as a first average value;

[0127] A fourth submodule, configured to determine a first standard deviation according to the capacity of the storage space, the first average value, and the 3 sigma principle;

[0128] A fifth submodule is used to determine a random starting address for executing a target read / write instruction according to the first average value and the first standard deviation.

[0129] Optionally, the second determining module includes:

[0130] A sixth submodule, configured to take the capacity of the storage space with the highest frequency of historical read and write instruction operations as a second average value;

[0131] A seventh submodule, for determining a second standard deviation based on the capacity of other storage spaces operated in the historical read-write instructions, the second average value, and the 3 sigma principle; the capacity of the other storage space is the capacity of the storage space operated by the historical read-write instructions except the capacity of the storage space with the highest operation frequency;

[0132] An eighth submodule is used to determine a random capacity for executing a target read or write instruction according to the second average value and the second standard deviation.

[0133] Optionally, the generating module includes:

[0134] The level generation submodule is used to generate a random Raid level according to the number of hard disks operated by the Raid chip;

[0135] The instruction generation submodule is used to generate target read and write instructions according to the random Raid level, the random starting address and the random capacity.

[0136] Optionally, the execution module includes:

[0137] A region determination submodule, used for determining a target storage region of a target read / write instruction currently being executed according to the random start address and the random capacity;

[0138] A determination submodule, used for determining whether the target storage area includes an area where a read / write instruction has been executed;

[0139] A first execution submodule, for executing the target read-write instruction to perform a verification operation on the target storage area of ​​the Raid chip if no;

[0140] The second execution submodule is used to abandon the current target read / write instruction if yes, and generate a new target read / write instruction based on the new random starting address and random capacity.

[0141] Optionally, the device further comprises:

[0142] A table generation module is used to record the operation parameters corresponding to the target read and write instructions each time the target read and write instructions are executed, and generate a read instruction maintenance table and a write instruction maintenance table; the operation parameters include: random Raid level, random starting address and the random capacity;

[0143] Among them, the read instruction maintenance table and the write instruction maintenance table have the same index for the same operation parameters, and the read instruction maintenance table and the write instruction maintenance table also include data storage addresses corresponding to the operation parameters, and the data storage addresses are used to store the data content corresponding to the read instruction or the data content corresponding to the write instruction.

[0144] Optionally, after performing a verification operation on the Raid chip by executing the target read / write instruction, the device further comprises:

[0145] An acquisition module, used to acquire the data storage address under the same index in the read instruction maintenance table and the write instruction maintenance table;

[0146] A reading module, used for acquiring data content corresponding to a read instruction and data content corresponding to a write instruction from the data storage address;

[0147] A splitting module, used for splitting the data content corresponding to the read instruction and the data content corresponding to the write instruction respectively according to the size of the random capacity, to generate a read data block to be compared and a write data block to be compared;

[0148] A comparison module, used for comparing the read data block to be compared with the write data block to be compared in units of bytes;

[0149] A circular comparison module, for, if the read data block to be compared is consistent with the write data block to be compared, the comparison is successful, and the read instruction maintenance table and the write instruction maintenance table are continuously traversed to perform the comparison of the remaining data;

[0150] The comparison exit module is used to output the failed read instruction related information and the failed write instruction related information if the read data block to be compared is inconsistent with the write data block to be compared, and exit the data comparison process.

[0151] In summary, in the embodiment of the present application, the random starting address for executing the target read-write instruction is determined according to the capacity of the storage space operated by the Raid chip; the random starting address obeys the normal distribution principle within the storage space range of the Raid chip; the random capacity for executing the target read-write instruction is determined based on the capacity of the storage space with the highest frequency of historical read-write instruction operations; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip; the target read-write instruction is generated based on the random starting address and the random capacity; the Raid chip is verified by executing the target read-write instruction. The method of the present application can generate a random starting address and a random capacity that conform to the normal distribution, so that when verifying the Raid chip based on the target read-write instruction, it can realize more disordered and randomized reading and writing of the Raid chip based on the generated randomized target read-write instruction, realize the detection of occasional problems of the Raid chip, and improve the coverage of the chip's detection function.

[0152] Fig.10 A block diagram of an electronic device 600 is shown according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0153] Reference Fig.10 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0154] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0155] The memory 604 is used to store various types of data to support the operation of the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, multimedia, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0156] The power supply component 606 provides power to the various components of the electronic device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.

[0157] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0158] The audio component 610 is used to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0159] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0160] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0161] The communication component 616 is used to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0162] In an exemplary embodiment, the electronic device 600 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to implement a Raid chip verification method provided in an embodiment of the present application.

[0163] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0164] Fig.11A block diagram of an electronic device 700 is shown according to an exemplary embodiment. For example, the electronic device 700 can be provided as a server. Fig.11 The electronic device 700 includes a processing component 722, which further includes one or more processors, and a memory resource represented by a memory 732 for storing instructions that can be executed by the processing component 722, such as an application. The application stored in the memory 732 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 722 is configured to execute instructions to perform a Raid chip verification method provided in an embodiment of the present application.

[0165] The electronic device 700 may also include a power supply component 726 configured to perform power management of the electronic device 700, a wired or wireless network interface 750 configured to connect the electronic device 700 to a network, and an input / output (I / O) interface 758. The electronic device 700 may operate based on an operating system stored in the memory 732, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0166] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0167] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A Raid chip verification method, It is characterized in that The method comprises: According to the capacity of the storage space operated by the Raid chip, a random starting address for executing a target read / write instruction is determined; the random starting address obeys a normal distribution principle within the storage space of the Raid chip; Based on the capacity of the storage space with the highest frequency of historical read and write instruction operations, determine the random capacity for executing the target read and write instructions; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip; Based on the random starting address and the random capacity, generating a target read / write instruction; The Raid chip is verified by executing the target read and write instructions.

2. The method according to claim 1, It is characterized in that Determining the random starting address for executing the target read / write instruction according to the capacity of the storage space operated by the Raid chip includes: Determine the stripe size of the disk mounted by the Raid chip according to the number of hard disks operated by the Raid chip and the storage block capacity; Determine the capacity of the storage space operated by the Raid chip according to the number of stripes set by the Raid chip and the stripe size; determining half of the capacity of the storage space as a first average value; determining a first standard deviation according to the capacity of the storage space, the first average value, and the 3 sigma principle; A random starting address for executing a target read / write instruction is determined according to the first average value and the first standard deviation.

3. The method according to claim 1, It is characterized in that The determining of the random capacity for executing the target read / write instruction based on the capacity of the storage space with the highest frequency of historical read / write instruction operations includes: The capacity of the storage space with the highest frequency of historical read and write instruction operations is taken as a second average value; Determining a second standard deviation based on the capacity of other storage spaces operated in the historical read / write instructions, the second average value, and the 3 sigma principle; the capacity of the other storage space is the capacity of the storage space operated by the historical read / write instructions except the capacity of the storage space with the highest operation frequency; The random capacity for executing the target read / write instruction is determined according to the second average value and the second standard deviation.

4. The method according to claim 1, It is characterized in that The generating a target read / write instruction based on the random start address and the random capacity includes: Generates a random Raid level based on the number of hard disks operated by the Raid chip; Generate target read and write instructions according to the random Raid level, random starting address and random capacity.

5. The method according to claim 1, It is characterized in that The verification operation on the Raid chip by executing the target read-write instruction includes: Determine a target storage area for a target read / write instruction currently being executed according to the random start address and the random capacity; Determining whether the target storage area includes an area where a read / write instruction has been executed; If not, executing the target read and write instruction to perform a verification operation on the target storage area of ​​the Raid chip; If so, the current target read / write instruction is abandoned, and a new target read / write instruction is generated based on the new random start address and random capacity.

6. The method according to claim 4, It is characterized in that The method further comprises: Each time the target read / write instruction is executed, the operation parameters corresponding to the target read / write instruction are recorded to generate a read instruction maintenance table and a write instruction maintenance table; the operation parameters include: random Raid level, random starting address and the random capacity; Among them, the read instruction maintenance table and the write instruction maintenance table have the same index for the same operation parameters, and the read instruction maintenance table and the write instruction maintenance table also include data storage addresses corresponding to the operation parameters, and the data storage addresses are used to store the data content corresponding to the read instruction or the data content corresponding to the write instruction.

7. The method according to claim 6, It is characterized in that After the verification operation is performed on the Raid chip by executing the target read-write instruction, the method further includes: Obtain the data storage address under the same index in the read instruction maintenance table and the write instruction maintenance table; Acquire data content corresponding to the read instruction and data content corresponding to the write instruction from the data storage address; According to the size of the random capacity, the data content corresponding to the read instruction and the data content corresponding to the write instruction are respectively split to generate a read data block to be compared and a write data block to be compared; Comparing the read data block to be compared with the write data block to be compared in bytes; If the read data block to be compared is consistent with the write data block to be compared, the comparison is successful, and the read instruction maintenance table and the write instruction maintenance table are continuously traversed to perform the comparison of the remaining data; If the read data block to be compared is inconsistent with the write data block to be compared, the comparison fails, the failed read instruction related information and the write instruction related information are output, and the data comparison process is exited.

8. A verification device for a Raid chip, It is characterized in that The device comprises: A first determination module is used to determine a random starting address for executing a target read / write instruction according to the capacity of the storage space operated by the Raid chip; the random starting address obeys a normal distribution principle within the storage space of the Raid chip; The second determination module is used to determine the random capacity of executing the target read-write instruction based on the capacity of the storage space with the highest frequency of historical read-write instruction operations; the random capacity obeys the normal distribution principle within the storage space range of the Raid chip; A generating module, used for generating a target read-write instruction based on the random starting address and the random capacity; An execution module is used to perform a verification operation on the Raid chip by executing the target read and write instructions.

9. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium, It is characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.