Data read-write test method and device, computer equipment and storage medium

The data reading and writing test method for chip simulation systems addresses inefficiencies by decomposing operations into two paths, enabling parallel testing and optimizing resource allocation, thereby improving efficiency and reliability.

CN119201730APending Publication Date: 2024-12-27SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411317467.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The inefficiency of chip simulation systems in performing Raid data read and write operations due to slow speeds in simulated disk operations limits the test efficiency and affects the performance of the simulation system.

Method used

A data reading and writing test method that decomposes test operations into two independent paths, utilizing a Raid simulation system test path for the first operation and a second test path for the second operation, allowing parallel testing and optimizing resource allocation.

Benefits of technology

This method improves test efficiency, reduces hardware costs, and enhances the reliability and stability of the simulation system by allowing simultaneous or parallel testing of different environments without relying on actual Raid hardware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201730A_ABST
    Figure CN119201730A_ABST
Patent Text Reader

Abstract

The invention relates to a data read-write test method and device, computer equipment and a storage medium. The method is applied to a data read-write test system, the data read-write test system comprises a Raid simulation system test path and a second test path, and the method comprises the following steps: in response to a received data read-write test instruction, analyzing the data read-write test instruction to obtain a first test operation and a second test operation, target test paths corresponding to the first test operation and the second test operation are determined respectively, the Raid simulation system test path serves as the target test path of the first test operation, and the second test path serves as the target test path of the second test operation; and testing the first test operation through the Raid simulation system test path and testing the second test operation through the second test path. By adopting the method, the test efficiency can be improved and the system performance can be optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to a data reading and writing testing method, device, computer equipment and storage medium. Background Art

[0002] As a combination of computer software or hardware, simulation systems are specifically used to simulate complex systems or processes in the real world. They are widely used to promote in-depth research, testing and optimization of system behavior and performance. In the field of software testing, chip simulation systems are particularly critical. As an advanced software tool, they provide a highly controllable virtual environment. In this environment, the expected behavior of the chip can be simulated and tested, and then debugged and optimized to ensure that the design reaches the optimal state before going into production.

[0003] As chip technology changes with each passing day, the application scope of chip simulation systems is expanding, becoming an indispensable part of the integrated circuit design process. From preliminary design verification to final physical implementation, chip simulation systems play a vital role, providing design teams with a platform for accurate verification and evaluation of design solutions. This tool not only accelerates the product development cycle, but also significantly improves design quality and reliability.

[0004] However, when using chip simulation systems for functional testing, it is necessary to frequently create Raid (Redundant Array of Independent Disks) configurations, accompanied by a large number of data read and write operations. The Raid creation process requires strict data consistency and usually involves a complete clearing of disk data. However, in the simulation environment based on SystemC, due to its simulated nature of disk operations, the read and write speeds are relatively slow, which to some extent limits the efficiency of the test and affects the performance of the simulation system. Summary of the invention

[0005] Based on this, it is necessary to provide a data reading and writing test method, device, computer equipment and storage medium that can improve test efficiency and optimize system performance in response to the above technical problems.

[0006] On the one hand, a data read and write test method is provided, the method is applied to a data read and write test system, the data read and write test system includes a Raid simulation system test path and a second test path, the method includes:

[0007] In response to receiving a data read / write test instruction, parsing the data read / write test instruction to obtain a first test operation and a second test operation,

[0008] Determine the target test paths corresponding to the first test operation and the second test operation respectively, wherein the Raid simulation system test path is used as the target test path of the first test operation, and the second test path is used as the target test path of the second test operation;

[0009] The first test operation is tested through the Raid simulation system test path and the second test operation is tested through the second test path.

[0010] In one embodiment, it also includes:

[0011] In response to receiving a data read / write test instruction, parsing the data read / write test instruction to obtain a first test operation and a second test operation includes:

[0012] The data read and write test instructions include: Raid read test instructions and Raid write test instructions, wherein the Raid read test instructions include: read operation instructions and write disk operation instructions, and the Raid write test instructions include: write operation instructions and read verification operation instructions;

[0013] In response to receiving the Raid read test instruction, the read operation instruction is a first test operation, and the write disk operation instruction is a second test operation;

[0014] In response to receiving the Raid write test instruction, the write operation instruction is a first test operation, and the read verification operation instruction is a second test operation.

[0015] In one embodiment,

[0016] The first test operation is tested through the Raid simulation system test path, including:

[0017] In response to receiving the first test operation, comprising:

[0018] Create several virtual disks and generate virtual disk files of fixed size;

[0019] Configure the Raid array, format the Raid array and mount it to the file system;

[0020] writing the test data of the first test operation into the system file;

[0021] Dividing the test data of the first test operation into a plurality of data blocks, and reading and writing the data through the Raid simulation system test path to obtain a first operation test result;

[0022] Generate a first test report according to the first operation test result and submit it;

[0023] In one embodiment,

[0024] Testing the second test operation through the second test path includes:

[0025] In response to receiving the second test operation, comprising:

[0026] Based on the second test operation, obtaining a number of the second test operations and client information;

[0027] Obtaining a simulation system ID according to the client information;

[0028] Obtain corresponding disk information according to the simulation system ID;

[0029] Obtaining a Raid operation command according to the disk information and the second test operation;

[0030] Perform a corresponding operation on the disk according to the Raid operation command to obtain a second operation test result;

[0031] Generate and submit a second test report based on the second operation test result.

[0032] In one embodiment,

[0033] Performing a corresponding operation on the disk according to the Raid operation command to obtain a second operation test result includes: determining a Raid operation type according to the Raid operation command;

[0034] Wherein, the Raid operation types include: Raid data operation and Raid control operation;

[0035] The Raid data operation includes: a verification operation command and a read-write operation command;

[0036] The Raid control operation includes: creating an operation command, deleting an operation command and clearing an operation command;

[0037] In response to receiving the read / write operation command;

[0038] Reading Raid information, and converting the Raid read-write operation command into a corresponding disk read-write operation according to the Raid information;

[0039] Performing read and write operations on the disk;

[0040] In response to receiving the verification operation command;

[0041] Perform a verification operation according to the Raid information;

[0042] In response to receiving the create operation command;

[0043] According to the creation operation command, create Raid and update Raid information;

[0044] In response to receiving the delete command;

[0045] According to the deletion command, delete the Raid and update the Raid information;

[0046] In response to receiving the clear command;

[0047] According to the clear command, clear the Raid and update the Raid information.

[0048] In one embodiment,

[0049] Write data to the Raid array and divide the data into equal-sized blocks;

[0050] Calculate the check value of the data block to generate a check block;

[0051] According to the distributed storage rule, the data blocks and the check blocks are written into different disks in the Raid array;

[0052] The Raid array data is read, and the integrity of the data is verified based on the data blocks and check blocks read from the disk.

[0053] In one embodiment,

[0054] Read the Raid array data and verify the integrity of the data based on the data blocks and check blocks read from the disk.

[0055] include:

[0056] The data D is divided into n data blocks D1, D2, ..., D n ;

[0057] Calculate the check block P: Calculate the XOR value of all data blocks through the XOR operation as the check block P. The calculation formula is as follows:

[0058] P=D1⊕D2…⊕D n ,where ,⊕ represents the bitwise XOR operation;

[0059] Store data blocks and check blocks on different disks of the Raid array;

[0060] Read all data blocks D1, D2, ..., D n , and recalculate the XOR value Pcheck;

[0061] The calculation formula is as follows:

[0062] Pcheck=D1⊕D2⊕…⊕D n, where Pcheck is the XOR value of the recalculated data block;

[0063] Compare the recalculated XOR value Pcheck with the check block P

[0064] If Pcheck=P, the data is complete, otherwise the data is corrupted.

[0065] On the other hand, a data reading and writing test device for a Raid simulation system is provided, the device comprising:

[0066] An instruction receiving module, used for receiving a data read and write test instruction, parsing the data read and write test instruction to obtain a first test operation and a second test operation;

[0067] A first test module, used for testing a first test operation through a Raid simulation system test path;

[0068] The second test module is used to test the second test operation through a second test path.

[0069] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

[0070] In response to receiving a data read / write test instruction, parsing the data read / write test instruction to obtain a first test operation and a second test operation,

[0071] Determine the target test paths corresponding to the first test operation and the second test operation respectively, wherein the Raid simulation system test path is used as the target test path of the first test operation, and the second test path is used as the target test path of the second test operation;

[0072] The first test operation is tested through the Raid simulation system test path and the second test operation is tested through the second test path.

[0073] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0074] In response to receiving a data read / write test instruction, parsing the data read / write test instruction to obtain a first test operation and a second test operation,

[0075] Determine the target test paths corresponding to the first test operation and the second test operation respectively, wherein the Raid simulation system test path is used as the target test path of the first test operation, and the second test path is used as the target test path of the second test operation;

[0076] The first test operation is tested through the Raid simulation system test path and the second test operation is tested through the second test path.

[0077] The above-mentioned data reading and writing test method, device, computer equipment and storage medium, by decomposing the test operation into two independent parts for the Raid simulation system test path and the second test path, and introducing the test operation into the test path for use. The method allows different test environments or storage architectures to be tested simultaneously or in parallel. This parallel processing method significantly improves the test efficiency, while maintaining the flexibility of the test, and the test path and test operation can be adjusted as needed. In software development and hardware testing, testing directly on real hardware is often costly and risky. Through the Raid simulation system test path, a large number of tests can be performed without relying on the actual Raid hardware, thereby saving hardware costs and reducing the risk of data loss or hardware damage caused by testing. Through clear test paths and test operation divisions, the method enables the conditions and processes of each test to be accurately recorded and reproduced, thereby improving the repeatability and traceability of the test. Testing through two test paths can reduce the test pressure of the Raid simulation system, improve test efficiency, and optimize the stability and reliability of the simulation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 This is an application environment diagram of a data reading and writing test method in an embodiment.

[0079] Figure 2 The figure is a flow chart of a data reading and writing test method in one embodiment.

[0080] Figure 3 It is a structural block diagram of a data reading and writing test device for a Raid simulation system in one embodiment.

[0081] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0082] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0083] The data reading and writing test method provided in this application can be applied to Figure 1In the application environment shown, the terminal 102 communicates with the server 104 through a network. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0084] In one embodiment, Figure 2 As shown, a data reading and writing test method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0085] Step 202: In response to receiving a data read / write test instruction, parse the data read / write test instruction to obtain a first test operation and a second test operation.

[0086] Specifically, the data read and write test instructions are decomposed into a specific first test operation and a second test operation, so that each test operation is more clear and independent. This decomposition makes the test process more modular, and multiple test operations can be executed in parallel or in order of priority, thereby significantly improving the overall efficiency of the test.

[0087] Step 204, respectively determine the target test paths corresponding to the first test operation and the second test operation, wherein the Raid simulation system test path is used as the target test path of the first test operation, and the second test path is used as the target test path of the second test operation.

[0088] Specifically, by separating test operations from test paths, the test system can more flexibly adapt to different test requirements and can reasonably allocate test resources according to the actual situation. Decomposing complex test tasks into multiple independent test operations and assigning specific test paths to each operation can help reduce the complexity and difficulty of the test.

[0089] Step 206: Test the first test operation through the Raid simulation system test path and test the second test operation through the second test path.

[0090] Specifically, using the Raid simulation system test path to perform the first test operation can highly simulate the real Raid storage environment, which helps to ensure the accuracy and reliability of the test results. Each test operation is optimized for its specific test path, making the test more targeted. The first test operation focuses on the data test of the necessary path in the Raid environment, while the second test operation focuses on the test data test of other non-essential paths.

[0091] Different test paths may require different test resources, such as computing resources, storage resources, network resources, etc. By allocating test operations to the test path that best suits their needs, resource allocation and usage can be optimized and test efficiency can be improved.

[0092] In the above-mentioned data reading and writing test method, the test operation is decomposed into two independent parts for the Raid simulation system test path and the second test path, and the test operation is introduced into the test path for use. This method allows different test environments or storage architectures to be tested simultaneously or in parallel. This parallel processing method significantly improves the test efficiency while maintaining the flexibility of the test, and the test path and test operation can be adjusted as needed. In software development and hardware testing, testing directly on real hardware is often costly and risky. Through the Raid simulation system test path, a large number of tests can be performed without relying on actual Raid hardware, thereby saving hardware costs and reducing the risk of data loss or hardware damage caused by testing. Through clear test paths and test operation divisions, the test pressure of the Raid simulation system can be reduced, the test efficiency can be improved, and the stability and reliability of the simulation system can be optimized.

[0093] In one embodiment, in response to receiving a data read / write test instruction, parsing the data read / write test instruction to obtain a first test operation and a second test operation includes:

[0094] The data read and write test instructions include: Raid read test instructions and Raid write test instructions, wherein the Raid read test instructions include: read operation instructions and write disk operation instructions, and the Raid write test instructions include: write operation instructions and read verification operation instructions.

[0095] In response to receiving the Raid read test instruction, the read operation instruction is a first test operation, and the write disk operation instruction is a second test operation.

[0096] In response to receiving the Raid write test instruction, the write operation instruction is a first test operation, and the read verification operation instruction is a second test operation.

[0097] By subdividing the Raid read test instructions and the Raid write test instructions into specific operation instructions to ensure that each test operation performs test read and write operations for its specific target, the read and write performance and reliability of the system can be verified more comprehensively. At the same time, by introducing the read verification operation instructions, the accuracy and consistency of the written data can be further ensured, thereby improving the stability and reliability of the system.

[0098] In one embodiment, testing the first test operation through the Raid simulation system test path includes:

[0099] In response to receiving the first test operation, comprising:

[0100] Step 302: Create several virtual disks and generate virtual disk files of fixed size.

[0101] Specifically, by creating several virtual disks and generating fixed-size disk virtual files, a real physical disk environment can be simulated in an independent and controllable environment, thus avoiding the risks and uncertainties that may be caused by testing on real hardware. At the same time, this virtual environment can be easily reset and copied, making the test process highly repeatable.

[0102] Step 306, configure the Raid array, format the Raid array and mount it into the file system.

[0103] Specifically, a Raid simulation tool is used to configure the required Raid array, and the Raid array is formatted and mounted into the file system.

[0104] Step 308: Write the test data of the first test operation into the system file.

[0105] Specifically, the test data of the first test operation is written into the corresponding file system.

[0106] Step 310: divide the test data of the first test operation into a plurality of data blocks, and read and write the data through the Raid simulation system test path to obtain a first operation test result.

[0107] Specifically, by splitting the test data into multiple data blocks, the concurrent read and write operations in actual use can be simulated, thereby more comprehensively evaluating the processing capabilities of the Raid system. This testing method helps to discover potential performance bottlenecks and data consistency issues.

[0108] Step 312: Generate and submit a first test report based on the first operation test result.

[0109] The entire test process, from creating a virtual environment to generating a test report, is automated, which greatly reduces the need for manual intervention and improves test efficiency. Automated testing can also reduce the impact of human error on test results, ensuring the accuracy and reliability of test results. The first test report generated not only records the various data and indicators during the test, but also analyzes and summarizes the test results. This provides valuable decision-making support information for system administrators and developers, helping developers to optimize and adjust the Raid system based on test results, thereby improving the overall performance and reliability of the system.

[0110] In one embodiment, testing the second test operation through the second test path includes:

[0111] In response to receiving the second test operation, comprising:

[0112] Step 402: Based on the second test operation, obtain a plurality of the second test operations and client information.

[0113] The client information includes: client IP and client MAC address.

[0114] Step 404, obtaining a simulation system ID according to the client information.

[0115] Among them, the client is the terminal that issues the second test operation. According to the IP information carried by the client, the ID information of the simulation system related to the second test operation, that is, the identifier information, can be directly obtained, thereby distinguishing different test operation instructions of the simulation system, that is, distinguishing different Raid access requests.

[0116] Step 406, obtaining corresponding disk information according to the simulation system ID.

[0117] The disk information includes: disk identifier, location, capacity and type.

[0118] Specifically, according to the identifier information of the simulation system, all disk information currently corresponding to the simulation system identifier is indexed. By associating the simulation system ID with the disk information, the system can more accurately control the test environment and ensure the accuracy of the test results.

[0119] Step 408: Obtain a Raid operation command according to the disk information and the second test operation.

[0120] Specifically, the corresponding Raid operation command is generated according to the disk information and the specific requirements of the second test operation (such as read operation or write operation, etc.). By combining the disk information with the test operation, a more accurate and effective test command can be generated, thereby improving the accuracy and efficiency of the test.

[0121] Step 410: Perform a corresponding operation on the disk according to the Raid operation command to obtain a second operation test result.

[0122] Specifically, the Raid operation command is sent to the corresponding disk for execution. During the execution, the time and result of the operation, such as success, failure, error code, etc., and other related information are recorded. Based on this information, the second operation test result is generated.

[0123] Step 412: Generate and submit a second test report based on the second operation test result.

[0124] Specifically, the second operation test result is organized into a test report, including detailed information such as test time, test environment, test steps, test results, etc. The test report may be presented in various forms such as text, charts, or logs. The test report is submitted for further analysis and processing.

[0125] Testing the second test operation through the second test path can reduce the test pressure of the test path of the Raid simulation system. The branch design of the two paths can improve the test efficiency while increasing the comprehensiveness of the side-entry. Each test path can focus on different types of test operations or scenarios, thereby increasing the diversity and comprehensiveness of the test. This division of labor and cooperation helps to ensure that all aspects of the Raid simulation system can be fully verified and reduce omissions and blind spots. Test resources, such as processors, memory, disk space, etc., can be more reasonably allocated and utilized.

[0126] In one embodiment, performing a corresponding operation on the disk according to the Raid operation command to obtain a second operation test result includes:

[0127] Determine the Raid operation type according to the Raid operation command;

[0128] Wherein, the Raid operation types include: Raid data operation and Raid control operation;

[0129] The Raid data operation includes: a verification operation command and a read-write operation command;

[0130] The Raid control operation includes: creating an operation command, deleting an operation command and clearing an operation command;

[0131] In response to receiving the read / write operation command;

[0132] Reading Raid information, and converting the Raid read-write operation command into a corresponding disk read-write operation according to the Raid information;

[0133] Performing read and write operations on the disk;

[0134] In response to receiving the verification operation command;

[0135] Perform a verification operation according to the Raid information;

[0136] In response to receiving the create operation command;

[0137] According to the creation operation command, create Raid and update Raid information;

[0138] In response to receiving the delete command;

[0139] According to the deletion command, delete the Raid and update the Raid information;

[0140] In response to receiving the clear command;

[0141] According to the clear command, clear the Raid and update the Raid information.

[0142] By judging the type of Raid operation command, you can perform corresponding operations on the disk according to different Raid operation types, refine the test type of the disk, make the test results more comprehensive and accurate, and further improve the accuracy and reliability of the test results. The test results are also more valuable for reference.

[0143] In one embodiment, performing a verification operation according to the Raid information includes:

[0144] Write data to the Raid array and divide the data into equal-sized blocks;

[0145] Calculate the check value of the data block to generate a check block;

[0146] According to the distributed storage rule, the data blocks and the check blocks are written into different disks in the Raid array;

[0147] The Raid array data is read, and the integrity of the data is verified based on the data blocks and check blocks read from the disk.

[0148] RAID arrays achieve redundant data storage by dividing data into blocks of equal size and calculating the checksum values ​​of these blocks to generate checksum blocks. This redundant storage improves data reliability. When writing data, the calculation and storage of checksum values ​​can promptly detect and correct potential data errors. When reading data, by comparing data blocks and checksum blocks, the integrity of the data can be verified to prevent data from being damaged due to errors during transmission or storage.

[0149] In one embodiment, the Raid array data is read, and the integrity of the data is verified according to the data blocks and check blocks read from the disk, including:

[0150] The data D is divided into n data blocks D1, D2, ..., D n ;

[0151] Calculate the check block P: Calculate the XOR value of all data blocks through the XOR operation as the check block P. The calculation formula is as follows:

[0152] P=D1⊕D23⊕D n ,where ,⊕ represents the bitwise XOR operation;

[0153] Store data blocks and check blocks on different disks of the Raid array;

[0154] Read all data blocks D1, D2, ..., D n , and recalculate their XOR value Pcheck;

[0155] The calculation formula is as follows:

[0156] Pcheck=D1⊕D2⊕…⊕D n , where Pcheck is the XOR value of the recalculated data block;

[0157] Compare the recalculated XOR value Pcheck with the check block P

[0158] If Pcheck=P, the data is complete, otherwise the data is corrupted.

[0159] Among them, the XOR operation is a logical operation performed at the binary bit level.

[0160] Specifically, by re-reading all data blocks and calculating their XOR values ​​(Pcheck), and then comparing them with the original check block P, it is possible to detect in real time whether the data is damaged during storage or transmission. This verification mechanism helps to detect and correct potential data errors in a timely manner, preventing the further spread and use of erroneous data.

[0161] Performing a verification operation according to the Raid information also includes:

[0162] In response to a failure of the disk, the data on the failed disk is recovered by using data blocks and check blocks on other disks;

[0163] Disk 1: D1, Disk 2: D2, Disk 3: P1;

[0164] Disk 1: D3, Disk 2: P2, Disk 3: D4;

[0165] If a disk data block is lost, the lost data block is rebuilt using other data blocks and the check block.

[0166] The reconstruction formula is as follows: Dmissing=P⊕D1⊕...D n -1

[0167] Wherein, Dmissing is the lost data block, and P is the corresponding check block.

[0168] Assume that data block D2 on disk 2 is lost, and the following data is read:

[0169] D1=01101010

[0170] D3=10101010

[0171] Check block P = 00010101

[0172] The D2 formula is reconstructed as follows:

[0173] D2=P⊕D1,⊕D3=0001010⊕01101010⊕10101010=11010101

[0174] This method can effectively guarantee the ability to recover data in the event of a failure, and ensure the integrity and availability of data.

[0175] In response to receiving the first test report and the second test report;

[0176] According to the comparison between the first test report and the second test report, the above reports are comprehensively analyzed to obtain a comprehensive evaluation result;

[0177] The comprehensive evaluation results are reported.

[0178] By comparing and analyzing the results of the two test reports, comprehensive and objective information support is provided to decision makers. Decision makers can formulate follow-up plans, optimize product design or improve test processes more scientifically based on the evaluation results. If there are significant differences in key indicators between the two test reports, it may mean that there are potential problems or risks in the test object. The comprehensive evaluation results can provide timely warnings and help decision makers take measures in advance to avoid the expansion of problems.

[0179] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0180] In one embodiment, Figure 3 As shown, a data reading and writing test device for a Raid simulation system is provided, comprising: an instruction receiving module 502, a first test module 504 and a second test module 506, wherein:

[0181] An instruction receiving module 502 is used to receive a data read and write test instruction, and parse the data read and write test instruction to obtain a first test operation and a second test operation;

[0182] A first test module 504, used to test the first test operation through a Raid simulation system test path;

[0183] The second test module 506 is used to test the second test operation through the second test path.

[0184] In one embodiment, the instruction receiving module 502 of the device,

[0185] The method is used to parse the data read and write test instruction to obtain a first test operation and a second test operation, including:

[0186] The data read and write test instructions include: Raid read test instructions and Raid write test instructions, wherein the Raid read test instructions include: read operation instructions and write disk operation instructions, and the Raid write test instructions include: write operation instructions and read verification operation instructions;

[0187] In response to receiving the Raid read test instruction, the read operation instruction is a first test operation, and the write disk operation instruction is a second test operation;

[0188] In response to receiving the Raid write test instruction, the write operation instruction is a first test operation, and the read verification operation instruction is a second test operation.

[0189] In one embodiment, the first test module 504 of the device,

[0190] Used to test the first test operation through the Raid simulation system test path, including:

[0191] In response to receiving the first test operation, comprising:

[0192] Create several virtual disks and generate virtual disk files of fixed size;

[0193] Configure the Raid array, format the Raid array and mount it to the file system;

[0194] writing the test data of the first test operation into the system file;

[0195] Dividing the test data of the first test operation into a plurality of data blocks, and reading and writing the data through the Raid simulation system test path to obtain a first operation test result;

[0196] Generate a first test report based on the first operation test result and submit it.

[0197] In one embodiment, the second test module 506 of the device,

[0198] For, in response to receiving the second test operation, comprising:

[0199] Based on the second test operation, obtaining a number of the second test operations and client information;

[0200] Obtaining a simulation system ID according to the client information;

[0201] Obtain corresponding disk information according to the simulation system ID;

[0202] Obtaining a Raid operation command according to the disk information and the second test operation;

[0203] Perform a corresponding operation on the disk according to the Raid operation command to obtain a second operation test result;

[0204] Generate and submit a second test report based on the second operation test result.

[0205] In one embodiment, the second test module 506 of the device is also used to

[0206] Determine the Raid operation type according to the Raid operation command;

[0207] Wherein, the Raid operation types include: Raid data operation and Raid control operation;

[0208] The Raid data operation includes: a verification operation command and a read-write operation command;

[0209] The Raid control operation includes: creating an operation command, deleting an operation command and clearing an operation command;

[0210] In response to receiving the read / write operation command;

[0211] Reading Raid information, and converting the Raid read-write operation command into a corresponding disk read-write operation according to the Raid information;

[0212] Performing read and write operations on the disk;

[0213] In response to receiving the verification operation command;

[0214] Perform a verification operation according to the Raid information;

[0215] In response to receiving the create operation command;

[0216] According to the creation operation command, create Raid and update Raid information;

[0217] In response to receiving the delete command;

[0218] According to the deletion command, delete the Raid and update the Raid information;

[0219] In response to receiving the clear command;

[0220] According to the clear command, clear the Raid and update the Raid information.

[0221] The specific definition of the data reading and writing test device for the Raid simulation system can be found in the definition of the data reading and writing test method in the above text, which will not be repeated here. Each module in the above-mentioned data reading and writing test device for the Raid simulation system can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0222] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store test operation instructions, client information and disk data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data reading and writing test method is implemented.

[0223] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0224] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0225] The data read and write test instructions include: Raid read test instructions and Raid write test instructions, wherein the Raid read test instructions include: read operation instructions and write disk operation instructions, and the Raid write test instructions include: write operation instructions and read verification operation instructions;

[0226] In response to receiving the Raid read test instruction, the read operation instruction is a first test operation, and the write disk operation instruction is a second test operation;

[0227] In response to receiving the Raid write test instruction, the write operation instruction is a first test operation, and the read verification operation instruction is a second test operation.

[0228] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0229] In response to receiving the first test operation, comprising:

[0230] Create several virtual disks and generate virtual disk files of fixed size;

[0231] Configure the Raid array, format the Raid array and mount it to the file system;

[0232] writing the test data of the first test operation into the system file;

[0233] Dividing the test data of the first test operation into a plurality of data blocks, and reading and writing the data through the Raid simulation system test path to obtain a first operation test result;

[0234] Generate a first test report based on the first operation test result and submit it.

[0235] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0236] Determine the Raid operation type according to the Raid operation command;

[0237] Wherein, the Raid operation types include: Raid data operation and Raid control operation;

[0238] The Raid data operation includes: a verification operation command and a read-write operation command;

[0239] The Raid control operation includes: creating an operation command, deleting an operation command and clearing an operation command;

[0240] In response to receiving the read / write operation command;

[0241] Reading Raid information, and converting the Raid read-write operation command into a corresponding disk read-write operation according to the Raid information;

[0242] Performing read and write operations on the disk;

[0243] In response to receiving the verification operation command;

[0244] Perform a verification operation according to the Raid information;

[0245] In response to receiving the create operation command;

[0246] According to the creation operation command, create Raid and update Raid information;

[0247] In response to receiving the delete command;

[0248] According to the deletion command, delete the Raid and update the Raid information;

[0249] In response to receiving the clear command;

[0250] According to the clear command, clear the Raid and update the Raid information.

[0251] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0252] The data D is divided into n data blocks D1, D2, ..., D n ;

[0253] Calculate the check block P: Calculate the XOR value of all data blocks through the XOR operation as the check block P. The calculation formula is as follows:

[0255] P=D1⊕D2...⊕D n , where ,⊕ represents the bitwise XOR operation;

[0256] Store data blocks and check blocks on different disks of the Raid array;

[0257] Read all data blocks D1, D2, ..., D n , and recalculate their XOR value Pcheck;

[0258] The calculation formula is as follows:

[0259] Pcheck=D1⊕D2⊕…⊕D n , where Pcheck is the XOR value of the recalculated data block;

[0260] Compare the recalculated XOR value Pcheck with the check block P

[0261] If Pcheck=P, the data is complete, otherwise the data is corrupted.

[0262] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0263] In response to receiving a data read / write test instruction, parsing the data read / write test instruction to obtain a first test operation and a second test operation,

[0264] Determine the target test paths corresponding to the first test operation and the second test operation respectively, wherein the Raid simulation system test path is used as the target test path of the first test operation, and the second test path is used as the target test path of the second test operation;

[0265] The first test operation is tested through the Raid simulation system test path and the second test operation is tested through the second test path.

[0266] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0267] In response to receiving the second test operation, comprising:

[0268] Based on the second test operation, obtaining a number of the second test operations and client information;

[0269] Obtaining a simulation system ID according to the client information;

[0270] Obtain corresponding disk information according to the simulation system ID;

[0271] Obtaining a Raid operation command according to the disk information and the second test operation;

[0272] Perform a corresponding operation on the disk according to the Raid operation command to obtain a second operation test result;

[0273] Generate and submit a second test report based on the second operation test result.

[0274] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0275] The data D is divided into n data blocks D1, D2, ..., D n ;

[0276] Calculate the check block P: Calculate the XOR value of all data blocks through the XOR operation as the check block P. The calculation formula is as follows:

[0278] P=D1⊕D2...⊕D n , where ,⊕ represents the bitwise XOR operation;

[0279] Store data blocks and check blocks on different disks of the Raid array;

[0280] Read all data blocks D1, D2, ..., D n , and recalculate their XOR value Pcheck;

[0281] The calculation formula is as follows:

[0282] Pcheck=D1⊕D2⊕…⊕D n , where Pcheck is the XOR value of the recalculated data block;

[0283] Compare the recalculated XOR value Pcheck with the check block P

[0284] If Pcheck=P, the data is complete, otherwise the data is corrupted.

[0285] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0286] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0287] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A data reading and writing test method, characterized in that: The method is applied to a data reading and writing test system, the data reading and writing test system includes a Raid simulation system test path and a second test path, and the method includes: In response to receiving a data read / write test instruction, parsing the data read / write test instruction to obtain a first test operation and a second test operation, Determine the target test paths corresponding to the first test operation and the second test operation respectively, wherein the Raid simulation system test path is used as the target test path of the first test operation, and the second test path is used as the target test path of the second test operation; The first test operation is tested through the Raid simulation system test path and the second test operation is tested through the second test path.

2. A data reading and writing test method according to claim 1, characterized in that: In response to receiving a data read / write test instruction, parsing the data read / write test instruction to obtain a first test operation and a second test operation includes: The data read and write test instructions include: Raid read test instructions and Raid write test instructions, wherein the Raid read test instructions include: read operation instructions and write disk operation instructions, and the Raid write test instructions include: write operation instructions and read verification operation instructions; In response to receiving the Raid read test instruction, the read operation instruction is a first test operation, and the write disk operation instruction is a second test operation; In response to receiving the Raid write test instruction, the write operation instruction is a first test operation, and the read verification operation instruction is a second test operation.

3. A data reading and writing test method according to claim 1, characterized in that: The first test operation is tested through the Raid simulation system test path, including: In response to receiving the first test operation, comprising: Create several virtual disks and generate virtual disk files of fixed size; Configure the Raid array, format the Raid array and mount it to the file system; writing the test data of the first test operation into the system file; Dividing the test data of the first test operation into a plurality of data blocks, and reading and writing the data through the Raid simulation system test path to obtain a first operation test result; Generate a first test report based on the first operation test result and submit it.

4. A data reading and writing test method according to claim 1, characterized in that: Testing the second test operation through the second test path includes: In response to receiving the second test operation, comprising: Based on the second test operation, obtaining a number of the second test operations and client information; Obtaining a simulation system ID according to the client information; Obtain corresponding disk information according to the simulation system ID; Obtaining a Raid operation command according to the disk information and the second test operation; Perform a corresponding operation on the disk according to the Raid operation command to obtain a second operation test result; Generate and submit a second test report based on the second operation test result.

5. A data reading and writing test method according to claim 4, characterized in that: Performing a corresponding operation on the disk according to the Raid operation command to obtain a second operation test result includes: Determine the Raid operation type according to the Raid operation command; Wherein, the Raid operation types include: Raid data operation and Raid control operation; The Raid data operation includes: a verification operation command and a read-write operation command; The Raid control operation includes: creating an operation command, deleting an operation command and clearing an operation command; In response to receiving the read / write operation command; Reading Raid information, and converting the Raid read-write operation command into a corresponding disk read-write operation according to the Raid information; Performing read and write operations on the disk; In response to receiving the verification operation command; Perform a verification operation according to the Raid information; In response to receiving the create operation command; According to the creation operation command, create Raid and update Raid information; In response to receiving the delete command; According to the deletion command, delete the Raid and update the Raid information; In response to receiving the clear command; According to the clear command, clear the Raid and update the Raid information.

6. A data reading and writing test method according to claim 5, characterized in that: Performing a verification operation according to the Raid information includes: Write data to the Raid array and divide the data into equal-sized blocks; Calculate the check value of the data block to generate a check block; According to the distributed storage rule, the data blocks and the check blocks are written into different disks in the Raid array; The Raid array data is read, and the integrity of the data is verified based on the data blocks and check blocks read from the disk.

7. A data reading and writing test method according to claim 6, characterized in that: Read the Raid array data and verify the integrity of the data based on the data blocks and check blocks read from the disk, including: The data D is divided into n data blocks D1, D2, ..., D n ; Calculate the check block P: Calculate the XOR value of all data blocks through the XOR operation as the check block P. The calculation formula is as follows: P=D1⊕D2…⊕D n ,where ,⊕ represents the bitwise XOR operation; Store data blocks and check blocks on different disks of the Raid array; Read all data blocks D1, D2, ..., D n , and recalculate their XOR value Pcheck; The calculation formula is as follows: Pcheck=D1⊕D2⊕…⊕D n , where Pcheck is the XOR value of the recalculated data block; Compare the recalculated XOR value Pcheck with the check block P If Pcheck=P, the data is complete, otherwise the data is corrupted.

8. A data reading and writing test device applied to a Raid simulation system, characterized in that: The device comprises: An instruction receiving module, used for receiving a data read and write test instruction, parsing the data read and write test instruction to obtain a first test operation and a second test operation; A first test module, used for testing a first test operation through a Raid simulation system test path; The second test module is used to test the second test operation through a second test path.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.