Redundant array of independent disks (RAID) function verification method and device and electronic equipment
Through the strip consistency principle of independent disk redundant arrays, data is generated randomly and the verification calculation interface and strip consistency checking interface are called, which solves the problems of poor flexibility and long development cycle in hardware RAID function verification, and achieves efficient functional verification.
Patent Information
- Application Number
- CN202510446312.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the hardware RAID function verification method has poor flexibility, the reference model development cycle is long, and the separation of the verification environment and the algorithm model leads to an increase in development complexity.
Through the strip consistency principle based on the independent disk redundant array, data is generated randomly and the verification calculation interface and the strip consistency check interface are called to realize the independent functional verification of the preset model and the design to be tested. Only the necessary calculation checksum strip consistency checksum checksum checks are needed.
Improves flexibility in the verification process, shortens the development cycle of preset models, and reduces the complexity of the verification environment and storage management pressure.
Smart Images

Figure CN120412692A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, device, and electronic device for verifying the functions of a redundant array of independent disks (RAID). Background Art
[0002] A redundant array of independent disks (RAID) is a technology that combines multiple independent disks into a logical array to achieve a larger storage capacity, higher performance, and data reliability. RAID can be implemented either through software or hardware. Among them, software RAID has a low cost but has a greater impact on system performance. Therefore, hardware RAID is a more mainstream choice. To ensure the correctness of the hardware RAID function, the commonly used verification methods currently include:
[0003] 1) Implement the RAID function algorithm model using a high-level language, save the generated data and results in a file, and the verification environment reads the file to obtain the stimuli and reference results, and compares them with the output of the device under test (DUT). 2) Integrate a reference model with the same function as the DUT in the verification environment, apply test stimuli to both the DUT and the reference model at the same time, and compare the output results of the two.
[0004] However, in method 1), the algorithm model is separated from the verification environment, resulting in poor flexibility. In method 2), the reference model needs to be encapsulated as an interface for the verification environment to call. When the function to be verified is complex, the reference model also needs to implement complex functions, which leads to a long development cycle. Summary of the Invention
[0005] This application provides a method, device, and electronic device for verifying the functions of a redundant array of independent disks, so as to at least solve the problems in the related technologies that in method 1), the algorithm model is separated from the verification environment, resulting in poor flexibility; and in method 2), the reference model needs to be encapsulated as an interface for the verification environment to call, and when the function to be verified is complex, the reference model also needs to implement complex functions, resulting in a long development cycle.
[0006] This application provides a method for verifying the functions of a redundant array of independent disks, including:
[0007] Randomly generate redundant array of independent disks data based on the configuration parameters of the redundant array of independent disks to be verified;
[0008] Call the check calculation interface to update the check data in the redundant array of independent disks data based on the configuration parameters and the redundant array of independent disks data by using a preset model, and obtain the target redundant array of independent disks data;
[0009] Input the configuration parameters and the target redundant array of independent disks (RAID) data into the design under test to obtain an output result, where the design under test is used to implement the to-be-verified function of the to-be-verified RAID;
[0010] Invoke the stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target RAID data, and the output result by using a preset model;
[0011] Determine the verification result of the to-be-verified function based on the stripe consistency check result.
[0012] This application also provides a RAID function verification device, including:
[0013] A generation module, configured to randomly generate RAID data based on the configuration parameters of the to-be-verified RAID;
[0014] A first invocation module, configured to invoke the checksum calculation interface to update the checksum data in the RAID data based on the configuration parameters and the RAID data by using a preset model to obtain the target RAID data;
[0015] An acquisition module, configured to input the configuration parameters and the target RAID data into the design under test to obtain an output result, where the design under test is used to implement the to-be-verified function of the to-be-verified RAID;
[0016] A second invocation module, configured to invoke the stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target RAID data, and the output result by using a preset model;
[0017] A determination module, configured to determine the verification result of the to-be-verified function based on the stripe consistency check result.
[0018] This application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above RAID function verification methods when executing the computer program.
[0019] This application also provides a computer-readable storage medium storing a computer program, where the computer program, when executed by a processor, implements the steps of any of the above RAID function verification methods.
[0020] This application also provides a computer program product including a computer program, where the computer program, when executed by a processor, implements the steps of any of the above RAID function verification methods.
[0021] Through this application, due to the strip consistency principle of the redundant array of independent disks (RAID), the functions implemented by the preset model are separated from the various specific functions implemented by the design under test. By only implementing the necessary calculation verification function and strip consistency check function, the verification of the functions of the design under test can be achieved, greatly reducing the complexity of the preset model. By encapsulating the preset model into a verification calculation interface and a strip consistency check interface, the preset model is integrated into the verification environment. This solves the technical problems of poor flexibility and long development cycle of the reference model (i.e., the preset model) in the related art, and achieves the technical effects of improving flexibility and shortening the development cycle of the preset model. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0023] Figure 1 It is a schematic diagram of disk distribution of a RAID group provided by an embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of a RAID strip provided by an embodiment of the present application;
[0025] Figure 3 It is a schematic flowchart of a method for verifying the functions of a redundant array of independent disks provided by an embodiment of the present application;
[0026] Figure 4 It is a schematic flowchart of another method for verifying the functions of a redundant array of independent disks provided by an embodiment of the present application;
[0027] Figure 5 It is a schematic flowchart of another method for verifying the functions of a redundant array of independent disks provided by an embodiment of the present application;
[0028] Figure 6 It is an execution sequence diagram for verifying the functions of a redundant array of independent disks in a verification environment provided by an embodiment of the present application;
[0029] Figure 7 It is a structural block diagram of a device for verifying the functions of a redundant array of independent disks provided by an embodiment of the present application;
[0030] Figure 8 It is a structural block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0031] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0032] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and not to describe a specific order or sequence.
[0033] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0034] Before introducing the embodiments of the present application, some terms or concepts related to the embodiments of the present application will be explained first. It should be understood that the present application does not make specific limitations on the naming of the following terms. The following terms may have other names. The re-named terms still satisfy the following related term explanations.
[0035] 1) RAID group: In RAID technology, a RAID group usually refers to a disk array composed according to a specific RAID level and is a specific implementation carrier of RAID technology.
[0036] Figure 1 A schematic diagram of the disk distribution of a RAID group provided for the embodiments of the present application. As Figure 1 shown, this RAID group consists of 6 disks, and these 6 disks are D1, D2, D3, D4, D5, and D6. This RAID group can be set to different RAID types according to requirements.
[0037] Exemplarily, if the RAID type of this RAID group is RAID5, then one of the disks is a parity disk, and the remaining five disks are data disks. This parity disk can be denoted as P.
[0038] If the RAID type of this RAID group is RAID6, then two of the disks are parity disks, and the remaining four disks are data disks. The parity disks can be denoted as P and Q respectively.
[0039] If the RAID type of the RAID group is RAID triple parity (TP for short), then three of the disks are parity disks and the remaining three disks are data disks. The parity disks can be denoted as P, Q, and R respectively.
[0040] 2) Strip: Blocks of a certain size (such as 64 KB, 256 KB, etc.) at the same position on all disks in the same RAID group form a strip. Figure 2 This is a schematic diagram of a RAID strip provided by an embodiment of the present application. As Figure 2 shown, D11, D21, D31, D41, D51, D61 form a strip, that is, strip 1; D12, D22, D32, D42, D52, D62 form a strip, that is, strip 2; D13, D23, D33, D43, D53, D63 form a strip, that is, strip 3.
[0041] The size of a strip on each disk is called a strip unit. A strip unit contains multiple blocks of a fixed size (such as 4 KB). The block of this fixed size is the smallest unit for RAID hardware data processing. The strip consistency check in the embodiment of the present application is based on this block of fixed size, which is hereinafter referred to as a unit block.
[0042] 3) Strip consistency: Taking the Reed-Solomon (RS) algorithm using a Vandermonde matrix as an example, assuming that all parity disks are located at the last positions in the RAID group, then for RAID5, RAID6, and RAIDTP, the strip consistency needs to satisfy the following equations respectively:
[0043] RAID5 needs to satisfy this equation:
[0044] RAID6 needs to satisfy the following 2 equations simultaneously:
[0045]
[0046] RAIDTP needs to satisfy the following 3 equations simultaneously:
[0047]
[0048] Among them, d i (i = 1, 2,..., m) represents the data in data disk D i , and p, q, and r respectively represent the parity data in parity disks P, Q, and R. The coefficients in front of d i or p, q, and r are position parameters, which are only related to the position of the disk in the RAID group and have nothing to do with other factors. In practice, the positions of parity disks in different strips will be different, and only need to be adjusted according to the actual positions.
[0049] 4) Calculate parity: That is, calculate the parity data. According to the above stripe consistency principle, it is not difficult to derive the formula for calculating the parity data. Taking RAID6 as an example, the formula for calculating the parity data can be expressed as:
[0050]
[0051] where a i (i = 1, …, m + 2) is a position parameter, which is only related to the position of disk i. Therefore, when the positions of parity disks P and Q are determined, the coefficients of disk data d i can be determined. Then the above formula can be expressed as:
[0052]
[0053] where and can be calculated by the following formula:
[0054]
[0055] RAID is a technology that combines multiple independent disks into a disk array with a larger capacity and better security. By splitting data into multiple segments and storing them on different disks respectively, it uses the scattered read and write technology to improve the overall performance of the disk array. This technology not only expands the system storage capacity, but also enhances the input / output (Input / Output, abbreviated as: IO) concurrent processing ability, and ensures the reliability of data through redundant information.
[0056] RAID technology is widely used in the storage field, mainly through means such as data striping, mirroring, and data parity to achieve performance optimization, reliability improvement, fault tolerance enhancement, and storage scalability. According to different functional characteristics and application scenarios, RAID is divided into multiple levels to meet the storage requirements of different data applications.
[0057] In addition, according to the implementation method, RAID can be divided into software RAID and hardware RAID. Among them, software RAID provides the RAID function by software on the host, which has the advantages of low cost and simple configuration. However, its disadvantage is that it has a greater impact on the overall performance of the system. Especially when the RAID level provides a certain level of redundant information to have a corresponding degree of reliability, a large amount of redundant information needs to be calculated while storing data, which will occupy a large amount of Central Processing Unit (abbreviated as: CPU) resources, thus significantly reducing the system performance. Therefore, in the case of high performance requirements or the use of a higher level of RAID, hardware RAID becomes a better choice. Hardware RAID is to implement the RAID function based on hardware devices.
[0058] With the rapid development of informatization, the demand for data storage is constantly increasing, and hardware RAID has gradually become the mainstream trend. The correctness and stability of the hardware RAID function directly affect data security and system reliability. Therefore, it is particularly important to verify the hardware RAID function. Currently, common methods for verifying the hardware RAID function include:
[0059] 1) Implement an algorithm model of the RAID function with the help of high-level languages such as C language and Matlab language. This model will generate corresponding input data and expected results according to different RAID types and configuration parameters, and save these data and results to specific files. During the verification process, the verification environment will read the input data and configuration parameters from the corresponding files according to the specific verification scenario, apply them as stimuli to the DUT. At the same time, take the expected results stored in the file as a reference. After the DUT outputs the actual results, compare the two to determine whether the output of the DUT is correct, and then determine whether the verification of the hardware RAID function passes. In this embodiment, the DUT is the module that implements the RAID function in the RAID chip.
[0060] 2) Implement a reference model in the verification environment that has the same function as the design under test. During the test, the test stimuli will be applied to both the DUT and the reference model at the same time. When the DUT outputs the results, compare them with the output results of the reference model to check whether the function of the DUT is verified. The function of the DUT is the RAID function.
[0061] However, in the above method 1), due to the separation of the algorithm model and the verification environment, the verification process lacks flexibility. In addition, in order to cover various possible configuration situations, a large number of stimuli and result files need to be generated in advance. When the number of different configurations is large, these files will occupy a large amount of storage space, bringing great pressure to storage management.
[0062] In the above method 2), since the verification environment is generally built using the Universal Verification Methodology (UVM for short) and written in Systemverilog language, while the reference model is generally implemented using C language or Matlab language, etc. If the reference model is transplanted from the C language environment or Matlab language environment to the Systemverilog language environment, not only the implementation process lacks flexibility, but also errors are likely to occur, and the debugging process will consume a lot of time, which is unacceptable for projects with limited verification cycles. Among them, Systemverilog is a hardware design and verification language.
[0063] To solve the problems of the above method 2), in some verification environments, the Direct Programming Interface (DPI)-C technology is adopted to encapsulate the reference model implemented in C language, i.e., the C reference model, and provide an interface for Systemverilog to call. In this way, the C reference model can be directly called in the verification environment to achieve automatic real-time checking of verification. Among them, DPI-C is a programming method for direct interaction between SV and C language, and SV is the abbreviation of Systemverilog.
[0064] However, when the functions implemented by the design under test become complex, the C reference model also needs to implement corresponding complex functions and encapsulate these functions into DPI-C interfaces. In the verification environment, different interfaces need to be called according to different functions, which undoubtedly increases the complexity of the C reference model and the verification environment, and also leads to more debugging time.
[0065] To address the above problems, the embodiments of the present application provide a method, device, and electronic device for verifying the function of a redundant array of independent disks (RAID). The method includes: randomly generating RAID data based on the configuration parameters of the RAID to be verified; calling a check calculation interface to update the check data in the RAID data based on the configuration parameters and the RAID data by using a preset model to obtain target RAID data; inputting the configuration parameters and the target RAID data into the design under test to obtain an output result, where the design under test is used to implement the function to be verified of the RAID to be verified; calling a stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target RAID data, and the output result by using a preset model; and determining the verification result of the function to be verified based on the stripe consistency check result. The method provided by the above solution, based on the stripe consistency principle of the RAID, separates the functions implemented by the preset model from the various specific functions implemented by the design under test, and only needs to implement the necessary calculation and check functions and the stripe consistency check function to verify the function of the design under test, greatly reducing the complexity of the preset model. By encapsulating the preset model into a check calculation interface and a stripe consistency check interface, the preset model is integrated into the verification environment. It solves the technical problems of poor flexibility and long development cycle of the reference model, i.e., the preset model, in the related art, and achieves the technical effects of improving flexibility and shortening the development cycle of the preset model.
[0066] The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0067] The embodiments of the present application provide a method for verifying the function of a redundant array of independent disks, which is applied to a verification environment.Figure 3 This is a flowchart of the method for verifying the redundant array of independent disks (RAID) function provided by the embodiments of the present application. As Figure 3 shown, the process includes the following steps:
[0068] Step S301: Randomly generate RAID data based on the configuration parameters of the RAID to be verified.
[0069] Among them, the design under test can support RAID groups with different RAID types, different numbers of disks, and different strip unit (chunk) sizes. In this embodiment, the function of the design under test is determined according to the RAID to be verified currently.
[0070] The configuration parameters may include RAID type, number of disks, strip unit size, distribution of parity disks, etc.
[0071] Randomly generate RAID data according to the configuration parameters of the RAID to be verified. Exemplarily, the configuration parameters of the RAID to be verified are: the RAID type is RAID6, the chunk size is 64 KB, the number of disks is 16, and the parity disks P and Q are in the last two positions of the RAID group.
[0072] Considering the composition of the RAID group, the distribution of data on the disks in the RAID group, and the format of the hardware RAID to process data, a three-dimensional array is used in the verification environment to store the data of the simulated disks in the RAID group. The three dimensions respectively correspond to the strip unit, the disk, and the number of RAID hardware data included in a unit block in each strip unit.
[0073] That is to say, the RAID data satisfies the three-dimensional array form, and the three dimensions respectively correspond to the strip unit, the disk, and the data volume included in a unit block in each strip unit. After randomly generating the RAID data, the three-dimensional array is all random numbers.
[0074] Considering that the hardware RAID supports RAID groups with different RAID types, different disk data, and different strip unit (chunk) sizes, the sizes of the three-dimensional arrays are also different. Therefore, the space of the three-dimensional array needs to be dynamically allocated in the verification environment. And since the three-dimensional array needs to be shared between the verification environment and the preset model, it needs to be used as a parameter of the DPI-C interface. Since the size is dynamically allocated, the open array svOpenArrayHandle type is used, and at the same time, another structure pointer parameter is used to pass the corresponding RAID information.
[0075] The definitions of the DPI-C interfaces are as follows:
[0076] Parity calculation interface:
[0077] dpi_raid_calc_parity(raid_dpi_cfg_t* cfg, svOpenArrayHandle data)
[0078] Strip consistency check interface:
[0079] dpi_raid_check_consistency(raid_dpi_cfg_t* cfg, svOpenArrayHandle data)
[0080] It should be noted that according to the data structure form of the simulated disk and the data form of the disk strip in the verification environment, the DPI-C interface is defined to transfer data between the verification environment and the preset model. It can be understood that the data structure form of the simulated disk and the data form of the disk strip are determined based on the configuration parameters of the independent disk redundant array to be verified, and are used to simulate the actual disk storage function.
[0081] Step S302, call the check calculation interface to update the check data in the independent disk redundant array data based on the configuration parameters and the independent disk redundant array data by using the preset model, and obtain the target independent disk redundant array data.
[0082] Among them, according to the configuration parameters of the RAID functions supported by the hardware RAID, such as RAID type, number of disks, stripe unit size, check disk distribution, etc., a preset model is developed to implement the functions of calculating checks and stripe consistency checks. The check calculation interface is an interface encapsulated by the check calculation function implemented by the preset model.
[0083] The logic of calculating checks is as described above, and is implemented according to the formula principle. Taking RAID6 as an example, the code logic fragment is as follows:
[0084] / / Point to the starting positions of the parameters corresponding to P and Q in the RAID calculation check parameters respectively
[0085] pParityP = GET_PARITY_P_PTR(pRaidParamTable);
[0086] pParityQ = GET_PARITY_Q_PTR(pRaidParamTable);
[0087] / / Traverse each data in the chunk
[0088] for (data_idx = 0; data_idx < data_size_of_chunk; data_idx++) {
[0089] p_val = 0;
[0090] q_val = 0;
[0091] / / The data at the same position on all data disks is calculated according to the above formula principle
[0092] for (disk_idx = 0; disk_idx < disk_num; disk_idx++) {
[0093] if (disk_idx == ParityPLocation || disk_idx == ParityQLocation) {
[0094] continue;
[0095] }
[0096] p_val ^= GF_MUL(pParityP[disk_idx], pDiskData[disk_idx][data_idx]);
[0097] q_val ^= GF_MUL(pParityQ[disk_idx], pDiskData[disk_idx][data_idx]);
[0098] }
[0099] / / Update the P and Q results to the corresponding positions
[0100] pDiskData[ParityPLocation][data_idx] = p_val
[0101] pDiskData[ParityQLocation][data_idx] = q_val
[0102] }
[0103] It can be understood that the logic of calculating the parity for other RAID types is similar to that of RAID6, and will not be elaborated here.
[0104] Call the parity calculation interface to calculate the parity data based on the preset model, the configuration parameters, and the redundant array of independent disks (RAID) data, and fill the calculated parity data into the positions corresponding to the parity disks in the three-dimensional array, that is, update the parity data in the redundant array of independent disks to obtain the target redundant array of independent disks data.
[0105] This process can be achieved by directly calling the parity calculation interface and passing the corresponding parameters. Among them, the corresponding parameters, that is, the configuration parameters, can be as follows:
[0106] cfg.raid_type = RAID6;
[0107] cfg.disk_num = 16;
[0108] cfg.chunk_size = CHUNK_SIZE_64KB;
[0109] cfg.parity_p_location = 14;
[0110] cfg.parity_q_location = 15;
[0111] for(i = 0; i < cfg.chunk_size; i++){
[0112] dpi_raid_calc_parity(cfg, disk_data[i]);
[0113] }
[0114] It should be noted that after the above operations are completed, the initial data in the disk_data array already satisfies the stripe consistency, that is, the target redundant array of independent disks (RAID) data is data that satisfies the stripe consistency.
[0115] After obtaining the target redundant array of independent disks (RAID) data, it can be written to the corresponding stripe in the simulated disk. This step usually writes the data to the disk by calling the backdoor write function of the simulated disk, which will not be elaborated here. That is to say, after calculating the parity data through the DPI-C interface and writing it to the position of the parity disk in the simulated disk data structure, the verification environment writes all the disk data to the simulated disk.
[0116] Step S303: Input the configuration parameters and the target redundant array of independent disks (RAID) data into the design under test, and obtain the output result. The design under test is used to implement the to-be-verified function of the to-be-verified redundant array of independent disks (RAID).
[0117] Among them, the to-be-verified function can be calculating parity, or calculating missing data or error data, etc.
[0118] Step S304: Call the stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target redundant array of independent disks (RAID) data, and the output result by using the preset model.
[0119] Among them, the stripe consistency check interface is an interface encapsulated by the stripe consistency detection function implemented by the preset model.
[0120] The logic of stripe consistency check is as described above and is implemented according to the formula principle. Taking RAID6 as an example, the code logic fragment is as follows:
[0121] / / Point to the starting positions of the parameters corresponding to P and Q in the RAID stripe consistency check parameters respectively
[0122] pParityP = GET_PARITY_P_PTR(pRaidParamTable);
[0123] pParityQ = GET_PARITY_Q_PTR(pRaidParamTable);
[0124] / / Traverse each data in the chunk
[0125] for (data_idx = 0; data_idx < data_size_of_chunk; data_idx++) {
[0126] p_val = 0;
[0127] q_val = 0;
[0128] / / The data at the same position on all disks is calculated according to the stripe consistency principle
[0129] for (disk_idx = 0; disk_idx < disk_num; disk_idx++) {
[0130] p_val ^= GF_MUL(pParityP[disk_idx], pDiskData[disk_idx][data_idx]);
[0131] q_val ^= GF_MUL(pParityQ[disk_idx], pDiskData[disk_idx][data_idx]);
[0132] }
[0133] / / If the result at any position is not 0, the stripe consistency check fails
[0134] if (p_val!= 0 || q_val!= 0) {
[0135] error_flag = 1;
[0136] }
[0137] }
[0138] It can be understood that the stripe consistency check logic of other RAID types is similar to that of RAID6, and will not be elaborated here.
[0139] It can be understood that, for the functions implemented according to the preset model in this embodiment, two DPI-C interfaces are defined, namely the verification calculation interface and the stripe consistency check interface. Among them, the verification calculation interface is used to calculate verification data, and the stripe consistency check interface is used to implement the stripe consistency check of the redundant array of independent disks (RAID) data.
[0140] Step S305: Based on the stripe consistency check result, determine the verification result of the function to be verified.
[0141] Among them, after the stripe consistency check result is determined, the verification result of the function to be verified can be determined according to the stripe consistency check result, that is, whether the design under test can correctly implement the function to be verified.
[0142] The method for verifying the redundant array of independent disks (RAID) function provided by the embodiment of the present application randomly generates RAID data based on the configuration parameters of the RAID to be verified; calls the verification calculation interface to update the verification data in the RAID data based on the configuration parameters and the RAID data by using the preset model to obtain the target RAID data; inputs the configuration parameters and the target RAID data into the design under test to obtain an output result, and the design under test is used to implement the function to be verified of the RAID to be verified; calls the stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target RAID data and the output result by using the preset model; and based on the stripe consistency check result, determine the verification result of the function to be verified. It realizes the separation of the functions implemented by the preset model from the various specific functions implemented by the design under test. The preset model only implements the necessary calculation verification and stripe consistency check functions, greatly reducing the complexity of the preset model, reducing the number of interfaces, avoiding separate checks according to the RAID function in the verification environment, reducing the complexity of the verification environment, and at the same time retaining the advantages of real-time checking.
[0143] By encapsulating the preset model into the verification calculation interface and the stripe consistency check interface, the preset model is integrated into the verification environment, improving the flexibility of the verification process and reducing the storage management pressure.
[0144] The embodiment of the present application provides a method for verifying the redundant array of independent disks (RAID) function, which is applied to a verification environment. Figure 4 It is a flowchart of the method for verifying the redundant array of independent disks (RAID) function provided by the embodiment of the present application. As Figure 4 shown, the process includes the following steps:
[0145] Step S401: Randomly generate RAID data based on the configuration parameters of the RAID to be verified. For details, please refer to Figure 3 Step S301 of the embodiment shown, which will not be elaborated here.
[0146] Step S402: Invoke the check calculation interface to update the parity data in the RAID data based on the configuration parameters and the RAID data by using a preset model, so as to obtain the target RAID data.
[0147] Specifically, the above Step S402 includes:
[0148] Step S4021: Invoke the check calculation interface to determine the positions of the parity disks and data disks in the RAID to be verified based on the configuration parameters by using a preset model.
[0149] Step S4022: Based on the positions of the data disks, obtain the data at the same positions as all the data disks in the RAID data.
[0150] Step S4023: Determine the parity data at this position of the parity disk based on the data at the same positions as all the data disks in the RAID data.
[0151] Step S4024: Based on the positions of the parity disks, update the parity data at this position of the parity disk to the corresponding positions to obtain the target RAID data.
[0152] For details of the logic for calculating the parity in the foregoing steps, it will not be elaborated here.
[0153] Step S403: Input the configuration parameters and the target RAID data into the design under test, which is used to implement the function to be verified of the RAID to be verified, to obtain an output result. For details, please refer to Figure 3 Step S303 of the embodiment shown, which will not be elaborated here.
[0154] Step S404: Invoke the stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target RAID data and the output result by using a preset model. For details, please refer to Figure 3 Step S304 of the embodiment shown, which will not be elaborated here.
[0155] Step S405: Determine the verification result of the function to be verified based on the stripe consistency check result. For details, please refer to Figure 3 Step S305 of the embodiment shown, which will not be elaborated here.
[0156] The method for verifying the redundant array of independent disks (RAID) function provided by the embodiment of the present application updates the parity data based on the configuration parameters and the RAID data by calling the parity calculation interface and using a preset model. This method can ensure that the target RAID data meets the stripe consistency, thereby improving the accuracy of the RAID function verification.
[0157] In some alternative embodiments, the above step S403 includes:
[0158] Step a1, determining the function to be verified based on the configuration parameters.
[0159] Among them, the design under test can implement all functions of the RAID to be verified. If the configuration parameters include the function to be verified of the RAID to be verified, then the function to be verified is determined based on the configuration parameters.
[0160] Step a2, determining the disk redundant array data to be processed in the target RAID data based on the function to be verified.
[0161] It can be understood that if the function to be verified is to calculate the parity, then the data in the target RAID data except for the data on the parity disk is determined as the disk redundant array data to be processed.
[0162] Step a3, processing the disk redundant array data to be processed based on the design under test to obtain an output result.
[0163] If the function currently implemented by the design under test is the function to be verified, then when the function to be verified is to calculate the parity, the output result obtained after the design under test processes the disk redundant array data to be processed is the parity data on the parity disk.
[0164] The method for verifying the RAID function provided by the embodiment of the present application can accurately locate the function to be verified by determining the function to be verified based on the configuration parameters. This method avoids redundant processing of irrelevant functions, thereby significantly improving the verification efficiency. Based on the function to be verified, the disk redundant array data to be processed in the target RAID data is further determined. This step-by-step screening method ensures the pertinence of data processing and thus ensures the accuracy of the output result.
[0165] In some alternative embodiments, the above step S404 includes:
[0166] Step b1, writing the output result to the target position in the simulated disk to update the data at the target position, where after obtaining the target RAID data, the target RAID data is written to the simulated disk.
[0167] As described above, after obtaining the target RAID data, the verification environment writes the target RAID data to the simulated disk. During the verification process, the design under test outputs the results and writes them to the corresponding positions in the simulated disk to update the data at the corresponding positions, thus implementing the function to be verified.
[0168] Step b2: Whenever the output results of a unit block in a stripe in the simulated disk are all written to the simulated disk, read the data at the corresponding positions of this unit block in this stripe on all disks, and call the stripe consistency check interface to perform a stripe consistency check on the data at the corresponding positions of this unit block in this stripe on all disks by using a preset model, so as to determine the stripe consistency check result of the data at the corresponding positions of this unit block in this stripe on all disks.
[0169] Among them, whenever the output results of a unit block in a stripe in the simulated disk are all written to the simulated disk, the verification environment immediately reads the data at the corresponding positions of this unit block in this stripe on all disks and performs a stripe consistency check by calling the stripe consistency check interface.
[0170] The stripe consistency check performs specific check operations by calling the dpi_raid_check_consistency function. Specifically:
[0171] / / cfg is the relevant configuration parameter for the current task, and this parameter has been set for each task in the verification environment checker
[0172] result = dpi_raid_check_consistency(cfg, current_task.disk_data[i])
[0173] If this function returns 0, it indicates that the check result is correct, and the data at the corresponding positions of the unit block in the stripe being checked conforms to the stripe consistency, indicating that during this verification process, the design under test can correctly process the data, that is, correctly execute the function to be verified, and the verification result of the function to be verified is verification passed.
[0174] If this function does not return 0, it indicates that during this verification process, the design under test cannot correctly process the data, that is, cannot correctly execute the function to be verified, and the verification result of the function to be verified is verification failed. This may be caused by problems in the calculation logic of the hardware RAID, errors occurring when writing data to the disk, or incorrect parity calculation, etc. Once this situation occurs, the verification personnel need to intervene for debugging to find out the problem and solve it.
[0175] The method for verifying the redundant array of independent disks (RAID) function provided by the embodiments of the present application calls the strip consistency check interface immediately after all the output results of a unit block in a strip in the simulated disk are written, and uses a preset model to perform consistency check on the data in the strip. This method can detect in real time whether the corresponding positions of the data on different disks are consistent, thereby ensuring the consistency and integrity of the data.
[0176] In some alternative embodiments, step S405 includes:
[0177] Step c1, when the strip consistency check results of the data at the corresponding positions of all unit blocks in all strips on all disks are all passed in the strip consistency check, determine that the verification result of the function to be verified is passed.
[0178] It can be understood that the target RAID data satisfies strip consistency. If the data obtained after the function to be verified of the design under test is processed still satisfies strip consistency, it is determined that the verification result of the function to be verified is passed.
[0179] The method for verifying the RAID function provided by the embodiments of the present application determines the verification result of the function to be verified based on the strip consistency check result. This method can ensure that the function to be verified is determined to be passed only when the data at the corresponding positions of all disks all pass the strip consistency check. This way significantly improves the accuracy of verification.
[0180] In some alternative embodiments, the above-mentioned method for verifying the RAID function further includes:
[0181] Step d1, if there is any strip consistency check result of any unit block in any strip for the data at the corresponding positions on all disks that fails the strip consistency check, determine that the verification result of the function to be verified is not passed.
[0182] In some alternative embodiments, the above-mentioned method for verifying the RAID function further includes:
[0183] Step e1, record the verification information generated during the RAID function verification process, so that the user can optimize the RAID function verification method based on the verification information.
[0184] Among them, the verification information includes the execution time of each step during the RAID function verification process, various data generated during the RAID function verification process, such as randomly generated RAID data, target RAID data, output results, etc.
[0185] Users can determine which steps are performance bottlenecks based on the execution time of each step in the RAID function verification process in the verification information, and thus optimize the performance of this step specifically.
[0186] When the verification result of the function to be verified fails, users can troubleshoot problems based on various data generated in the RAID function verification process, so as to determine problems in a timely manner and solve them, improving the reliability of the design under test.
[0187] The RAID function verification method provided by the embodiments of this application makes the entire verification process more transparent by recording the execution time of each step and various data generated in the RAID function verification process (such as randomly generated RAID data, target RAID data, output results, etc.). Users can clearly understand the specific execution situation of each step, which is convenient for subsequent analysis and optimization.
[0188] The embodiments of this application provide a RAID function verification method. Figure 5 The following is a flowchart of the RAID function verification method provided by the embodiments of this application. As Figure 5 shown, this process includes the following steps:
[0189] Step 1: Generate stimuli, where the stimuli include disk data.
[0190] Figure 6 The following is an execution sequence diagram for performing RAID function verification in the verification environment provided by the embodiments of this application. As Figure 6 shown, ① Generate stimuli, where the stimuli include configuration parameters and randomly generated RAID data, i.e., disk data. This stimulus is sent as input to the C model, i.e., the preset model.
[0191] Step 2: Call the DPI-C interface to generate check data for the disk data.
[0192] Sending this stimulus as input to the C model is essentially to call the check calculation interface to utilize the preset model to update the check data in the RAID data based on the configuration parameters and RAID data, and obtain the target RAID data.
[0193] Step 3: Write the disk data to the simulated disk.
[0194] As Figure 6 shown, ② Write the target RAID data, i.e., the updated disk data, to the simulated disk.
[0195] Step 4: The DUT executes the RAID function.
[0196] As shown Figure 6 in FIG., ③ and ④ DUT read data from the simulated disk, execute the function to be verified, and write the output result into the simulated disk data.
[0197] Step Five: The checker reads data from the simulated disk.
[0198] As shown Figure 6 in FIG., ⑤ the checker reads data from the simulated disk.
[0199] Step Six: Call the DPI-C interface to check the stripe consistency.
[0200] As shown Figure 6 in FIG., ⑥ call the stripe consistency check interface of the C model to perform stripe consistency check on the data read by the checker from the simulated disk.
[0201] Determine the verification result of the function to be verified in the design under test according to the stripe consistency check result.
[0202] For the detailed description of each step, reference can be made to the corresponding part of the foregoing embodiments, which will not be elaborated here.
[0203] The method for verifying the redundant array of independent disks (RAID) function provided by the embodiment of the present application can verify the RAID function in the RAID chip according to the basic function of RAID without paying attention to the specific implementation of RAID, making the development of the preset model simpler, and at the same time achieving real-time automatic verification.
[0204] The method for verifying the redundant array of independent disks (RAID) function provided by the embodiment of the present application uses corresponding data structures according to the disk data distribution in the RAID group, defines a DPI-C interface with flexible format, and uses it in the corresponding scenarios in the verification environment. The C model calculates the checksum or performs stripe consistency check, and passes the result to the verification environment, thereby realizing the verification of the RAID function, simplifying the development of the C model, using the RAID stripe consistency principle to check the RAID function. The C model only needs to implement the calculation checksum function and the stripe consistency check function of RAID, decoupled from other functions of the hardware RAID. It simplifies the check of the RAID function in the verification environment, only pays attention to whether the data of the corresponding stripe after the data is written to the disk conforms to the stripe consistency, and is decoupled from the specific implementation of the hardware RAID.
[0205] It should be noted that when there is an error in the RAID data scheduling, resulting in incorrect data read from or written to the disk while the RAID calculation process is correct, the method for verifying the redundant array of independent disks (RAID) function provided by the embodiment of the present application can detect the corresponding RAID data stripe consistency error.
[0206] Further, it should be noted that there are usually different levels of verification in chip verification, namely IP level, subsystem level, and system on chip (SOC) level. Among them, the Chinese meaning of IP is intellectual property, and the English full name is Intellectual Property. IP refers to an integrated circuit module that can be reused and has specific functions. By transforming the independent disk redundant array function verification method provided in the embodiments of the present application, it is possible to achieve fast adaptation in verification environments at different levels and achieve better reuse effects.
[0207] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0208] The embodiments of the present application also provide an independent disk redundant array function verification device, as Figure 7 shown, including:
[0209] A generation module 701, configured to randomly generate independent disk redundant array data based on the configuration parameters of the independent disk redundant array to be verified.
[0210] A first call module 702, configured to call a check calculation interface to update the check data in the independent disk redundant array data based on the configuration parameters and the independent disk redundant array data by using a preset model, so as to obtain target independent disk redundant array data.
[0211] An acquisition module 703, configured to input the configuration parameters and the target independent disk redundant array data into the design under test to obtain an output result, where the design under test is used to implement the to-be-verified function of the independent disk redundant array to be verified.
[0212] A second call module 704, configured to call a stripe consistency check interface to determine a stripe consistency check result based on the configuration parameters, the target independent disk redundant array data, and the output result by using a preset model.
[0213] A determination module 705, configured to determine a verification result of the to-be-verified function based on the stripe consistency check result.
[0214] In some optional embodiments, the first call module 702 includes:
[0215] A first determination unit, configured to call a check calculation interface to determine the positions of the check disks and the data disks in the independent disk redundant array to be verified based on the configuration parameters by using a preset model.
[0216] The first acquisition unit is configured to acquire the data located at the same position of all data disks in the redundant array of independent disks (RAID) data based on the location of the data disks.
[0217] The second determination unit is configured to determine the parity data at this position of the parity disk based on the data located at the same position of all data disks in the RAID data.
[0218] The second acquisition unit is configured to update the parity data at this position of the parity disk to the corresponding position based on the location of the parity disk, so as to obtain the target RAID data.
[0219] In some alternative embodiments, the acquisition module 703 includes:
[0220] The third determination unit is configured to determine the function to be verified based on the configuration parameters.
[0221] The fourth determination unit is configured to determine the disk redundant array data to be processed in the target RAID data based on the function to be verified.
[0222] The third acquisition unit is configured to process the disk redundant array data to be processed based on the design under test, so as to obtain an output result.
[0223] In some alternative embodiments, the second invocation module 704 includes:
[0224] The update unit is configured to write the output result to the target position in the simulated disk to update the data at the target position, wherein after obtaining the target RAID data, the target RAID data is written to the simulated disk.
[0225] The fifth determination unit is configured to, whenever the output results of all unit blocks in a stripe in the simulated disk are all written to the simulated disk, read the data at the corresponding positions of all disks for this unit block in this stripe, and invoke the stripe consistency check interface, so as to perform a stripe consistency check on the data at the corresponding positions of all disks for this unit block in this stripe by using a preset model, and determine the stripe consistency check result of the data at the corresponding positions of all disks for this unit block in this stripe.
[0226] In some alternative embodiments, the determination module 705 includes:
[0227] The sixth determination unit is configured to determine that the verification result of the function to be verified is verification passed when the stripe consistency check results of the data at the corresponding positions of all disks for all unit blocks in all stripes are all passed the stripe consistency check.
[0228] In some alternative embodiments, the RAID function verification device further includes:
[0229] A seventh determination unit, configured to determine that the verification result of the function to be verified fails if there is any stripe consistency check result of any unit block of any stripe for the corresponding positions on all disks that fails the stripe consistency check.
[0230] For the description of the features in the corresponding embodiments of the redundant array of independent disks (RAID) function verification device, reference can be made to the relevant descriptions in the corresponding embodiments of the RAID function verification method, which will not be elaborated here one by one.
[0231] An embodiment of the present application further provides an electronic device, as Figure 8 shown, including a processor 801 and a memory 802. A computer program is stored in the memory 802, and the processor 801 is configured to run the computer program to execute the steps in any of the above embodiments of the RAID function verification method.
[0232] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above embodiments of the RAID function verification method when running.
[0233] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.
[0234] An embodiment of the present application further provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the RAID function verification method are implemented.
[0235] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the RAID function verification method are implemented.
[0236] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0237] The above has introduced in detail a method, apparatus, and electronic device for verifying the function of a redundant array of independent disks provided by this application. Specific examples have been used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can still be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for verifying the function of a redundant array of independent disks, characterized in that, Including: Randomly generate redundant array of independent disks (RAID) data based on the configuration parameters of the RAID to be verified; Call the parity calculation interface to update the parity data in the RAID data based on the configuration parameters and the RAID data by using a preset model, and obtain the target RAID data; Input the configuration parameters and the target RAID data into the design under test, which is used to implement the function to be verified of the RAID to be verified, and obtain the output result; Call the stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target RAID data and the output result by using a preset model; Determine the verification result of the function to be verified based on the stripe consistency check result.
2. The method according to claim 1, characterized in that, The step of calling the parity calculation interface to update the parity data in the RAID data based on the configuration parameters and the RAID data by using a preset model, and obtain the target RAID data includes: Call the parity calculation interface to determine the positions of the parity disks and the data disks in the RAID to be verified based on the configuration parameters by using a preset model; Based on the positions of the data disks, obtain the data at the same positions of all the data disks in the RAID data; Based on the data at the same positions of all the data disks in the RAID data, determine the parity data at the corresponding positions of the parity disks; Based on the positions of the parity disks, update the parity data at the corresponding positions of the parity disks to the corresponding positions to obtain the target RAID data.
3. The method according to claim 1, wherein The step of inputting the configuration parameters and the target RAID data into the design under test and obtaining the output result includes: Determine the function to be verified based on the configuration parameters; Determine the RAID data to be processed in the target RAID data based on the function to be verified; Process the RAID data to be processed based on the design under test and obtain the output result.
4. The method according to claim 1, characterized in that, The step of calling the stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target RAID data and the output result by using a preset model includes: Write the output result to the target position in the simulated disk to update the data at the target position, where after obtaining the target RAID data, write the target RAID data to the simulated disk; Whenever all the output results of a unit block in a stripe in the simulated disk are written to the simulated disk, read the data at the corresponding positions of all the disks for this unit block in this stripe, call the stripe consistency check interface, and perform stripe consistency check on the data at the corresponding positions of all the disks for this unit block in this stripe by using a preset model to determine the stripe consistency check result of the data at the corresponding positions of all the disks for this unit block in this stripe.
5. The method according to claim 4, wherein Determining the verification result of the function to be verified based on the stripe consistency check result includes: When the stripe consistency check results of the data of all unit blocks of all stripes at the corresponding positions of all disks all pass the stripe consistency check, determining that the verification result of the function to be verified is verification passed.
6. The method according to claim 5, characterized in that, The method further includes: If there is any unit block of any stripe whose stripe consistency check result of the data at the corresponding positions of all disks fails the stripe consistency check, determining that the verification result of the function to be verified is verification failed.
7. The method according to claim 1, wherein The redundant array of independent disks (RAID) data satisfies a three-dimensional array form, where the three dimensions respectively correspond to stripe units, disks, and the data volume included in one unit block in each stripe unit.
8. An apparatus for verifying the function of a redundant array of independent disks, characterized in that, It includes: A generation module, configured to randomly generate RAID data based on the configuration parameters of the RAID to be verified; A first call module, configured to call a check calculation interface to update the check data in the RAID data based on the configuration parameters and the RAID data by using a preset model, and obtain target RAID data; An acquisition module, configured to input the configuration parameters and the target RAID data into a design under test, and obtain an output result, where the design under test is used to implement the function to be verified of the RAID to be verified; A second call module, configured to call a stripe consistency check interface to determine the stripe consistency check result based on the configuration parameters, the target RAID data, and the output result by using a preset model; A determination module, configured to determine the verification result of the function to be verified based on the stripe consistency check result.
9. An electronic device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the RAID function verification method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program implements the steps of the RAID function verification method according to any one of claims 1 to 7 when executed by a processor.