CN116382991A - Storage device testing method and device, computer device and storage medium - Google Patents

Storage device testing method and device, computer device and storage medium Download PDF

Info

Publication number
CN116382991A
CN116382991A CN202310486862.9A CN202310486862A CN116382991A CN 116382991 A CN116382991 A CN 116382991A CN 202310486862 A CN202310486862 A CN 202310486862A CN 116382991 A CN116382991 A CN 116382991A
Authority
CN
China
Prior art keywords
test
storage device
value
target
storage devices
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310486862.9A
Other languages
Chinese (zh)
Inventor
许建
邹芳清
苏航
曾维
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Phytium Technology Co Ltd
Original Assignee
Phytium Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Phytium Technology Co Ltd filed Critical Phytium Technology Co Ltd
Priority to CN202310486862.9A priority Critical patent/CN116382991A/en
Publication of CN116382991A publication Critical patent/CN116382991A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The application discloses a storage device testing method, a storage device testing device, computer equipment and a storage medium, wherein the method comprises the following steps: detecting the category of storage devices included in the current system; storing the mounting addresses of the storage devices into corresponding sets according to the categories of the storage devices; according to the corresponding relation between the category of the preconfigured storage device and the plurality of test categories, respectively determining target test categories to be executed by the storage devices in each set; and calling a target test function corresponding to the target test category, and respectively performing performance test on the storage devices corresponding to the mounting addresses in each set by utilizing the target test parameters associated with the target test category. According to the scheme, the corresponding relation between the types of the various storage devices and the test types is preconfigured, and the test function and the test parameter corresponding to each test type are preconfigured, so that the automatic large-scale repeated test of the storage devices is realized, the test efficiency is improved, and the accuracy of the test result is ensured.

Description

Storage device testing method and device, computer device and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for testing a storage device, a computer device, and a storage medium.
Background
When performance testing is performed on multiple storage devices with different interfaces and different protocols, the related testing means can only perform single manual testing on specific interfaces and specific protocols. During the test, a tester needs to configure the test function and the test parameter corresponding to the current storage device in real time, and meanwhile, the test device and the test environment are prevented from being in error.
The test means is manually and serially executed by a tester, and has low test efficiency and easily-made test results for a scene requiring to execute repeated tests.
Disclosure of Invention
The embodiment of the application provides a storage device testing method, a storage device testing device, computer equipment and a storage medium, which can realize automatic and large-scale repeated testing of the storage device, greatly reduce testing time, improve testing efficiency and ensure accuracy of testing results.
To achieve the above object, a first aspect of an embodiment of the present application provides a storage device testing method, including:
detecting the category of storage devices included in the current system;
Storing the mounting address of the storage device into a corresponding set according to the category of the storage device;
according to the corresponding relation between the category of the preset storage device and a plurality of test categories, respectively determining the target test category to be executed of the storage device in each set; the target test class is one of the plurality of test classes, the plurality of test classes including a performance test class of the storage device;
and calling a target test function corresponding to the target test category, and respectively performing performance test on the storage devices corresponding to the mounting addresses in each set by utilizing the target test parameters associated with the target test category.
In the embodiment of the application, the corresponding relation between the types of various storage devices and the test types is preconfigured, and the test function and the test parameter corresponding to each test type are preconfigured, so that when the storage devices of various types are tested, the target test type corresponding to the current storage device type can be determined, and the target test function and the target test parameter corresponding to the target test type are automatically called, thereby realizing the automatic and large-scale repeated test of the storage devices, greatly reducing the test time, improving the test efficiency and ensuring the accuracy of the test result.
In one possible implementation manner, the class of the storage device includes a removable storage device, a mechanical hard disk, and a solid state hard disk, where a return value of a removable storage device field of the removable storage device under a device file directory in a current system is a first value, a return value of the mechanical hard disk in a rotating storage device field is a second value, a return value of the solid state hard disk in the rotating storage device field is a third value, and the detecting the class of the storage device included in the current system includes:
acquiring a first return value of a removable storage device field under a device file directory in the current system;
if the first return value is a preset first value, determining that the system comprises a removable storage device;
acquiring a second return value of a rotating storage device field under a device file directory in the system;
and if the second return value is a preset second value, determining that the system comprises a mechanical hard disk, and if the second return value is a preset third value, determining that the system comprises a solid state hard disk.
According to the method and the device for determining the type of the storage device included in the system, whether the removable storage device is included in the system is determined according to the first return value of the removable storage device field in the device file directory, whether the mechanical hard disk and the solid state hard disk are included in the system is determined according to the second return value of the rotating storage device field, and therefore the type of the storage device included in the system can be obtained quickly and accurately.
In one possible implementation manner, before performing performance testing on the storage devices corresponding to the mount addresses in each set by using the target test parameters associated with the target test class, the method further includes:
configuring corresponding test parameters for each test category; the test categories include: fio test, dd test, and copy test;
wherein, the test parameters of the configuration required by the fio test comprise: the address and name of the tested file, the use buffer condition, the read-write mode, the block size of single operation, the test time and the output address of the test report;
the test parameters of the dd test required configuration include: operation type, block size of single operation, number of blocks of operation, use buffer status, output address of test report;
the test parameters of the configuration required by copy test comprise: the source file address and name to be copied, the destination file address, the output address of the test report.
According to the embodiment of the application, the corresponding test parameters are configured for each test category, so that the configured test parameters can be directly used when the test is executed, and the test efficiency is improved.
In a possible implementation manner, the storing the mounting address of the storage device into the corresponding set according to the class of the storage device includes:
Determining a target storage device where a current operating system is located; the target storage device is one of the storage devices included in the current system;
acquiring mounting addresses of other storage devices except the target storage device in the current system;
and storing the mounting addresses of the other storage devices into corresponding sets according to the categories of the storage devices.
According to the method and the device for testing the storage device, the mounting addresses of other storage devices except the target storage device in the current system are obtained, the mounting addresses of the other storage devices are stored into the corresponding set according to the category of the storage device, and therefore the storage device where the operating system is located can be skipped in the testing process, damage to the operating system in the testing process is avoided, and normal operation of the operating system is guaranteed.
In one possible implementation manner, after performing performance test on the storage devices corresponding to the mount addresses in each set, the method further includes:
acquiring a test report of the performance test, and acquiring the read-write rate of the storage device from the test report;
if the read-write rate is lower than a preset rate, acquiring a system kernel starting parameter of the current system;
And if the starting parameter is a preset first value, generating a first message, wherein the first message is used for suggesting a user to adjust the starting parameter from the first value to a target value smaller than the first value.
According to the embodiment of the application, the performance of the storage device is judged according to the read-write speed of the storage device, the tuning advice for adjusting the starting parameters of the system kernel is provided, a user can conveniently perform tuning setting on the storage device according to the tuning advice, and a large amount of tuning work is avoided.
In one possible implementation manner, after performing performance test on the storage devices corresponding to the mount addresses in each set, the method further includes:
acquiring a test report of the performance test, and acquiring the CPU core utilization rate of the current system from the test report;
if the CPU core utilization rate is lower than the preset utilization rate, generating a second message, wherein the second message is used for suggesting the user to use the tool to perform the binding core tuning.
According to the embodiment of the application, the performance of the storage device is judged according to the CPU core utilization rate of the storage device, the suggestion of core binding tuning is given, a user can conveniently set tuning of the storage device according to the tuning suggestion, and a large amount of tuning work is avoided manually.
A second aspect of the embodiments of the present application provides a storage device testing apparatus, including:
the device type detection module is used for detecting the type of the storage device included in the current system;
the storage module is used for storing the mounting address of the storage device into a corresponding set according to the category of the storage device;
the test category determining module is used for determining target test categories to be executed by the storage devices in each set according to the corresponding relation between the category of the pre-configured storage device and the plurality of test categories; the target test class is one of the plurality of test classes, the plurality of test classes including a performance test class of the storage device;
and the test module is used for calling a target test function corresponding to the target test category and respectively performing performance test on the storage devices corresponding to the mounting addresses in each set by utilizing the target test parameters associated with the target test category.
In one possible implementation manner, the categories of the storage devices include a removable storage device, a mechanical hard disk, and a solid state hard disk, where a return value of a removable storage device field of the removable storage device under a device file directory in a current system is a first value, a return value of the mechanical hard disk in a rotating storage device field is a second value, and a return value of the solid state hard disk in the rotating storage device field is a third value, and the device category detection module is specifically configured to:
Acquiring a first return value of a removable storage device field under a device file directory in the current system;
if the first return value is a preset first value, determining that the system comprises a removable storage device;
acquiring a second return value of a rotating storage device field under a device file directory in the system;
and if the second return value is a preset second value, determining that the system comprises a mechanical hard disk, and if the second return value is a preset third value, determining that the system comprises a solid state hard disk.
In one possible embodiment, the apparatus further comprises:
the test parameter configuration module is used for configuring corresponding test parameters aiming at each test category; the test categories include: fio test, dd test, and copy test;
wherein, the test parameters of the configuration required by the fio test comprise: the address and name of the tested file, the use buffer condition, the read-write mode, the block size of single operation, the test time and the output address of the test report;
the test parameters of the dd test required configuration include: operation type, block size of single operation, number of blocks of operation, use buffer status, output address of test report;
The test parameters of the configuration required by copy test comprise: the source file address and name to be copied, the destination file address, the output address of the test report.
In one possible implementation, the storage module is specifically configured to:
determining a target storage device where a current operating system is located; the target storage device is one of the storage devices included in the current system;
acquiring mounting addresses of other storage devices except the target storage device in the current system;
and storing the mounting addresses of the other storage devices into corresponding sets according to the categories of the storage devices.
In one possible embodiment, the apparatus further comprises:
the read-write rate acquisition module is used for acquiring a test report of the performance test and acquiring the read-write rate of the storage device from the test report;
the starting parameter acquisition module is used for acquiring the system kernel starting parameter of the current system if the read-write rate is lower than a preset rate;
and the first message generation module is used for generating a first message if the starting parameter is a preset first value, and the first message is used for suggesting a user to adjust the starting parameter from the first value to a target value smaller than the first value.
In one possible embodiment, the apparatus further comprises:
the core utilization rate acquisition module is used for acquiring a test report of the performance test and acquiring the CPU core utilization rate of the current system from the test report;
and the second message generation module is used for generating a second message if the CPU core utilization rate is lower than a preset utilization rate, wherein the second message is used for suggesting the user to use the tool to carry out core binding tuning.
A third aspect of the present application provides a computer device comprising a processor and a memory having stored therein at least one instruction or at least one program loaded and executed by the processor to implement a storage device testing method as described in the first aspect.
A fourth aspect of the present application provides a computer readable storage medium having stored therein at least one instruction or at least one program loaded and executed by a processor to implement a storage device testing method as described in the first aspect.
The embodiment of the application has the following beneficial effects:
In the embodiment of the application, the category of the storage equipment included in the current system is detected; storing the mounting address of the storage device into a corresponding set according to the category of the storage device; according to the corresponding relation between the category of the preset storage device and a plurality of test categories, respectively determining the target test category to be executed of the storage device in each set; the target test class is one of the plurality of test classes, the plurality of test classes including a performance test class of the storage device; and calling a target test function corresponding to the target test category, and respectively performing performance test on the storage devices corresponding to the mounting addresses in each set by utilizing the target test parameters associated with the target test category. According to the scheme, the corresponding relation between the types of various storage devices and the test types is preconfigured, and the test function and the test parameter corresponding to each test type are preconfigured, so that when the storage devices of various types are tested, the target test type corresponding to the current storage device type can be determined, and the target test function and the target test parameter corresponding to the target test type are automatically called, so that the automatic and large-scale repeated test of the storage devices is realized, the test time is greatly shortened, the test efficiency is improved, and the accuracy of the test result is ensured.
Secondly, according to the embodiment of the application, whether the system contains the removable storage device is determined according to the first return value of the removable storage device field in the device file directory, and whether the system contains the mechanical hard disk and the solid state hard disk is determined according to the second return value of the rotating storage device field, so that the category of the storage device contained in the system can be obtained quickly and accurately.
And finally, acquiring the mounting addresses of other storage devices except the target storage device in the current system, and storing the mounting addresses of the other storage devices into the corresponding set according to the category of the storage devices, so that the storage device where the operating system is located can be skipped in the testing process, damage to the operating system in the testing process is avoided, and normal operation of the operating system is ensured.
Finally, the embodiment of the application judges the performance of the storage device according to the read-write rate and the CPU core utilization rate of the storage device, gives the tuning advice, facilitates tuning setting of the storage device according to the tuning advice, and avoids a great amount of tuning work by manpower.
Drawings
FIG. 1 is a flowchart of a method for testing a storage device according to an embodiment of the present disclosure;
FIG. 2 is a second flowchart of a method for testing a memory device according to an embodiment of the present disclosure;
FIG. 3 is a third flowchart of a method for testing a memory device according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a storage device testing apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of a computer device for storage device testing according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the embodiments of the present disclosure, unless otherwise indicated, the meaning of "a plurality" is two or more. In addition, the use of "based on" or "according to" is intended to be open and inclusive in that a process, step, calculation, or other action "based on" or "according to" one or more of the stated conditions or values may in practice be based on additional conditions or beyond the stated values.
In the related art, different types of storage devices have different interfaces connected with a computer, and different data transmission protocols are followed, so that different types of storage devices have different testing types for performance testing, and required testing environments and testing parameters are different. The related test means can only perform single manual test on the storage devices with different interfaces and different protocols according to the specific protocol of the specific interface, and testers need to track and check the test environment in real time during the test to prevent errors of the test devices and the environment, so that the test efficiency of the test means is lower.
In order to solve the problems that related testing means are manually and serially executed by testers, and for the scene that repeated testing needs to be executed for many times, the testing efficiency is low and the testing result is easy to make mistakes, the embodiment of the invention provides a storage device testing method.
The execution subject of the storage device testing method provided by the embodiment of the application is a storage device testing device. The storage device testing apparatus may be a host or a chip in the host.
In some embodiments, the host may be a terminal device, a server, a cloud computing platform, or the like, including a device including a storage device testing apparatus. The terminal equipment can be a notebook computer, a palm computer, a computer and the like.
Fig. 1 is a flowchart of a method for testing a storage device according to an embodiment of the present application, where the method may include the following steps:
step 101, detecting the category of the storage device included in the current system.
Storage devices refer to machines for storing and maintaining digital files.
The storage device included in the computer system may specifically include: OS (Operating System) System Disk, HDD (Hard Disk Drive) mechanical Hard Disk, SSD (Solid State Drive solid state Drive) solid state Disk, removable storage medium, and the like.
Shell is a command interpreter on the Linux system, which is a program that interacts with the user in the terminal emulation window, and is an instruction that instructs the system to perform certain operations. It receives the user command and then invokes the corresponding application.
In particular, shell commands may be used to detect the class of storage devices that are currently included in the system. Illustratively, when using shell commands, a classfy_test function is called in the main function to detect the class of storage devices inserted into the system, and after detecting the class of storage devices, the storage devices are classified and marked and returned to the main function.
Step 102, storing the mounting address of the storage device into a corresponding set according to the category of the storage device.
In order to improve the test efficiency, the storage devices are classified into different sets according to the categories, so that different test categories can be conveniently executed on the storage devices in the different sets.
The set may be a plurality of groups or a linked list.
For example, if the types of the storage devices are removable storage devices, mechanical hard disks, and solid state disks, the mounting addresses of the storage devices are respectively stored in the sets corresponding to the removable storage devices, the mechanical hard disks, and the solid state disks in the main function.
Mounting is the process of connecting the file system in the storage device to the file system of the computer. After the storage device is mounted, we can access the files in the storage device through the mounting address.
According to the embodiment of the application, the mounting addresses of the storage devices are stored into the corresponding sets according to the categories of the storage devices, so that when the test is executed, the storage devices corresponding to the mounting addresses are directly accessed for the test.
Step 103, according to the pre-configured corresponding relation between the class of the storage device and a plurality of test classes, respectively determining the target test class to be executed by the storage device in each set; the target test class is one of the plurality of test classes, including a performance test class of the storage device.
The performance test of the storage device refers to the test of the disk reading and writing capability of the storage device.
The performance test class of the storage device includes various kinds of fio (flexible I/O test), dd (write) test, copy (copy) test, and the like. The types of tests that need to be performed by different types of storage devices are different, and therefore, the correspondence between the types of storage devices and the types of tests is configured before the tests are performed.
Specifically, the correspondence between the class of the storage device and the plurality of test classes may be determined according to the test requirement, and the correspondence between the class of the storage device and the test class is not specifically limited in the embodiment of the present application.
For example, the test class corresponding to the removable storage device may be a fio test, the test class corresponding to the mechanical hard disk may be a dd test, and the test class corresponding to the solid state hard disk may be a fio test and a copy test.
And 104, calling a target test function corresponding to the target test category, and respectively performing performance test on the storage devices corresponding to the mounting addresses in each set by utilizing the target test parameters associated with the target test category.
Before the test is executed, the method further comprises the steps of configuring test functions and test parameters corresponding to each test category, and setting association relations between the test categories and the test functions and between the test parameters.
In this way, before executing the test, the storage devices corresponding to the mounting addresses in each set are acquired, the target test class is determined according to the class of the storage devices in the set, the target test function corresponding to the target test class is called, and meanwhile, the performance test is executed on each storage device in the set by using the target test parameters.
Illustratively, the test actions of the fio test, the dd test, and the copy test are encapsulated in three functions in advance. The fio_test function mainly comprises fio command execution, logic processing, cleaning and caching, report classification mobile phone storage and the like; the dd_test function mainly comprises dd command execution, logic processing, cleaning cache, dd required data block size, dd required data block number use and the like; the copy_test function mainly comprises copy command execution, logic processing, cleaning up cache, running time stamp, file size verification before and after copying, cleaning up test files, and the like.
For example, if the storage device class of the first set is a removable storage device, when performing performance test on the storage device in the first set, invoking the fio_test function and the test parameters corresponding to the fio_test function in the mix function; if the class of the storage devices in the second set is a mechanical hard disk, calling a dd_test function and test parameters corresponding to the dd_test function in the mean function when performing performance test on the storage devices in the second set; and if the storage device type in the third set is the solid state disk, when the performance test is performed on the storage devices in the third set, invoking the fio_test function, the copy_test function, and test parameters corresponding to the fio_test function and the copy_test function in the mean function.
According to the scheme, the storage devices in the system are screened and classified by using codes, so that the storage devices with different interfaces and protocols are classified into different sets. Therefore, when the repeated test is executed for a plurality of times, the test class is directly determined according to the class of the storage device, the corresponding target test function and the target test parameter are called according to the test class, excessive intervention is not needed by manpower, and the efficiency is obviously improved.
In summary, in the embodiment of the present application, the class of the storage device included in the current system is detected; storing the mounting address of the storage device into a corresponding set according to the category of the storage device; according to the corresponding relation between the category of the preset storage device and a plurality of test categories, respectively determining the target test category to be executed of the storage device in each set; the target test class is one of the plurality of test classes, the plurality of test classes including a performance test class of the storage device; and calling a target test function corresponding to the target test category, and respectively performing performance test on the storage devices corresponding to the mounting addresses in each set by utilizing the target test parameters associated with the target test category. According to the scheme, the corresponding relation between the types of various storage devices and the test types is preconfigured, and the test function and the test parameter corresponding to each test type are preconfigured, so that when the storage devices of various types are tested, the target test type, the target test function and the target test parameter corresponding to the current storage device type can be directly determined, automatic and large-scale repeated tests are realized, the test time is greatly shortened, the test efficiency is improved, and the accuracy of the test result is ensured.
In a possible implementation manner, as shown in fig. 2, the class of the storage device includes a removable storage device, a mechanical hard disk, and a solid state hard disk, where a return value of a removable storage device field of the removable storage device under a device file directory in a current system is a first value, a return value of the mechanical hard disk in a rotating storage device field is a second value, and a return value of the solid state hard disk in the rotating storage device field is a third value, and the step 101 includes:
step 1011, obtaining a first return value of a removable storage device field under a device file directory in the current system.
And determining whether the removable storage device exists in the current system according to the first return value of the removable storage device field under the device file directory.
Removable storage means a storage device that can be moved between different terminals.
Step 1012, if the first return value is a preset first value, determining that the system includes a removable storage device.
Since the return value of the removable storage device may be preset to be the first value, if the first return value is the first value, it is known that the removable storage device is included in the system.
Taking the linux system as an example, the first value is preset to be 1. The removable device field under the search device file directory is specifically a search/sys/block/x (storage device)/removable field, and if the first return value is 1, it is determined that the system directory includes a removable storage device. Devices under the directory may be marked as removable storage devices and stored into an array or linked list.
Step 1013, obtaining a second return value of a rotating storage device field under a device file directory in the system.
And determining whether the rotating storage device exists in the current system according to the first return value of the rotating storage device field under the device file directory.
A rotating storage device refers to a storage device that reads data using mechanical rotation, and includes a mechanical Hard Disk (HDD).
Step 1014, if the second return value is a preset second value, determining that the system includes a mechanical hard disk, and if the second return value is a preset third value, determining that the system includes a solid state hard disk.
Since the return value of the mechanical hard disk in the rotating storage device field can be preset to be the second value, if the second return value is the second value, the mechanical hard disk is included in the system.
Because the return value of the Solid State Disk in the rotating storage device field is the third value, if the second return value is the third value, it can be known that the system includes the Solid State Disk (SSD).
Taking the linux system as an example, the second value is preset to be 1, and the third value is other values except 1. The rotating storage device field under the search device file directory is specifically a search/sys/block/x (storage device)/queue/rotation field. If the second return value is 1, the system comprises a mechanical hard disk, and if the second return value is not 1, the system comprises a solid state hard disk. The two devices under the target may be marked and stored in an array or linked list.
In steps 1011-1014, it is determined whether the system includes a removable storage device according to the first return value of the removable storage device field in the device file directory, and whether the system includes a mechanical hard disk and a solid state hard disk according to the second return value of the rotating storage device field, so that the class of the storage device included in the system can be detected. According to the scheme, the category of the storage device can be obtained quickly and accurately according to the return value of the storage device field.
In one possible implementation manner, before performing performance testing on the storage devices corresponding to the mount addresses in each set by using the target test parameters associated with the target test class, the method further includes:
Configuring corresponding test parameters for each test category; the test categories include: fio test, dd test, and copy test;
wherein, the test parameters of the configuration required by the fio test comprise: the address and name of the tested file, the use buffer condition, the read-write mode, the block size of single operation, the test time and the output address of the test report;
the test parameters of the dd test required configuration include: operation type, block size of single operation, number of blocks of operation, use buffer status, output address of test report;
the test parameters of the configuration required by copy test comprise: the source file address and name to be copied, the destination file address, the output address of the test report.
In the embodiment of the application, the fio test is a complex disk I/O (Input/Output) pressure test tool, and can simulate various I/O scenes, including random read-write, sequential read-write, hybrid read-write, and the like. The fio test may specify parameters such as multiple threads, queue depth, block size, etc. to simulate I/O operations in a real application scenario.
dd tests are typically used to copy data from one place to another, e.g., from file to device, from device to file, etc. The dd test can perform sequential read-write operation on a device or a file, and can specify parameters such as the size of a data block, the number of read-write times and the like so as to test the I/O performance of the device or the file.
Copy test is similar to dd test, but Copy test is done on files and dd test is done on blocks.
In the test parameters of the fio test, the "use buffer status" refers to whether to use buffer to perform I/O operation, the "read-write mode" refers to selecting sequential read-write or random read-write, and the "test time" refers to the duration of the present test.
In the test parameters of the dd test, "operation type" refers to whether to read from or write to a file, "block size of a single operation" refers to the number of bytes read/written at a time, "block number of operations" refers to the number of times bytes read/written.
In the test parameters of copy test, the "destination file address" refers to the address to which the source file is to be copied.
According to the embodiment of the application, the corresponding test parameters are configured for each test category, so that the configured test parameters can be directly used when the test is executed, and the test efficiency is improved.
In one possible implementation, as shown in fig. 3, step 102 includes:
step 1021, determining a target storage device where the current operating system is located; the target storage device is one of the storage devices included in the current system;
Step 1022, obtaining the mounting addresses of other storage devices except the target storage device in the current system;
step 1023, storing the mounting addresses of the other storage devices into corresponding sets according to the categories of the storage devices.
In steps 1021-1023, the target storage device where the current operating system is located is determined, and the mount address of the target storage device is not placed in the collection. Thus, when the performance test is performed on the storage devices corresponding to the mounting addresses in each set, the performance test is not performed on the target storage device because the target storage device is not in the set.
Therefore, the storage equipment where the operating system is located can be skipped in the testing process, so that the operating system is prevented from being damaged in the testing process, and the normal operation of the operating system is ensured.
In one possible implementation, after step 104, further includes:
step 201, obtaining a test report of the performance test, and obtaining a read-write rate of the storage device from the test report;
step 202, if the read-write rate is lower than a preset rate, acquiring a system kernel starting parameter of the current system;
Step 203, if the starting parameter is a preset first value, generating a first message, where the first message is used to suggest the user to adjust the starting parameter from the first value to a target value smaller than the first value.
In steps 201-203, after performance testing is performed on the storage device, a test report of the performance testing is obtained, and tuning advice is given according to the test report.
Tuning suggestions based on three levels of operating system, test tool parameters, and file system can be generally given.
Specifically, a numerical range of a normal read-write rate is obtained in advance, and the minimum value in the numerical range of the normal read-write rate is selected as a preset rate.
And then, after the fio test or the dd test is finished, acquiring the read-write rate of the storage device from the test report, and if the read-write rate is lower than the preset rate, indicating that the read-write rate of the storage device is lower than the normal range, and performing tuning operation.
When the read-write speed is lower than the normal range, the system kernel starting parameter relax_domain_level can be detected. And if the value of the parameter is a preset first value, sending a first message, wherein the first message is used for suggesting the user to adjust the system kernel starting parameter level to be a target value smaller than the first value.
The higher value of the system kernel start-up parameter may be selected as the preset first value, and the preset first value may be 3, and the target value may be 0, 1 or 2, for example.
According to the embodiment of the application, the performance of the storage device is judged according to the read-write speed of the storage device, the tuning advice is given, a user can conveniently perform tuning setting on the storage device according to the tuning advice, and a large amount of tuning work is avoided.
In one possible implementation, after step 104, the method further includes:
step 301, obtaining a test report of the performance test, and obtaining the CPU core utilization rate of the current system from the test report;
step 302, if the CPU core utilization rate is lower than a preset utilization rate, generating a second message, where the second message is used to suggest the user to use the tool to perform the binding core tuning.
In steps 301-302, after performance testing of the storage device, a test report of the performance test is obtained, and tuning advice is given according to the test report.
Specifically, a normal numerical range of the CPU core utilization rate is obtained in advance, and a minimum value in the normal numerical range is selected as a preset utilization rate.
And then, after the test is finished, acquiring the utilization rate of the CPU core from the test report, and if the utilization rate is lower than the preset utilization rate, indicating that the utilization rate of the CPU core is lower than the normal range in the storage test process, and needing to perform tuning operation.
Specifically, when the CPU core utilization rate is detected to be lower than the preset utilization rate, a second message is generated, the second message is used for suggesting that the user uses a tool to perform core binding tuning, and furthermore, the user can also be suggested to use a numactl tool to perform core binding tuning in the second message.
Fig. 4 is a schematic structural diagram of a storage device testing apparatus according to an embodiment of the present application. As shown in fig. 4, the apparatus 400 includes:
a device class detection module 401, configured to detect a class of a storage device included in the current system;
a storage module 402, configured to store a mount address of the storage device into a corresponding set according to a class of the storage device;
a test class determining module 403, configured to determine target test classes to be executed by the storage devices in each set according to a preset correspondence between a class of the storage device and a plurality of test classes; the target test class is one of the plurality of test classes, the plurality of test classes including a performance test class of the storage device;
and the test module 404 is configured to call a target test function corresponding to the target test class, and perform performance test on the storage devices corresponding to the mount addresses in each set by using the target test parameters associated with the target test class.
Optionally, the types of storage devices include a removable storage device, a mechanical hard disk, and a solid state hard disk, where a return value of a removable storage device field of the removable storage device in a device file directory in a current system is a first value, a return value of the mechanical hard disk in a rotating storage device field is a second value, and a return value of the solid state hard disk in the rotating storage device field is a third value, and the device type detection module 401 is specifically configured to:
acquiring a first return value of a removable storage device field under a device file directory in the current system;
if the first return value is a preset first value, determining that the system comprises a removable storage device;
acquiring a second return value of a rotating storage device field under a device file directory in the system;
and if the second return value is a preset second value, determining that the system comprises a mechanical hard disk, and if the second return value is a preset third value, determining that the system comprises a solid state hard disk.
Optionally, the apparatus 400 further includes:
the test parameter configuration module is used for configuring corresponding test parameters aiming at each test category; the test categories include: fio test, dd test, and copy test;
Wherein, the test parameters of the configuration required by the fio test comprise: the address and name of the tested file, the use buffer condition, the read-write mode, the block size of single operation, the test time and the output address of the test report;
the test parameters of the dd test required configuration include: operation type, block size of single operation, number of blocks of operation, use buffer status, output address of test report;
the test parameters of the configuration required by copy test comprise: the source file address and name to be copied, the destination file address, the output address of the test report.
Optionally, the storage module 402 is specifically configured to:
determining a target storage device where a current operating system is located; the target storage device is one of the storage devices included in the current system;
acquiring mounting addresses of other storage devices except the target storage device in the current system;
and storing the mounting addresses of the other storage devices into corresponding sets according to the categories of the storage devices.
Optionally, the apparatus 400 further includes:
the read-write rate acquisition module is used for acquiring a test report of the performance test and acquiring the read-write rate of the storage device from the test report;
The starting parameter acquisition module is used for acquiring the system kernel starting parameter of the current system if the read-write rate is lower than a preset rate;
and the first message generation module is used for generating a first message if the starting parameter is a preset first value, and the first message is used for suggesting a user to adjust the starting parameter from the first value to a target value smaller than the first value.
Optionally, the apparatus 400 further includes:
the core utilization rate acquisition module is used for acquiring a test report of the performance test and acquiring the CPU core utilization rate of the current system from the test report;
and the second message generation module is used for generating a second message if the CPU core utilization rate is lower than a preset utilization rate, wherein the second message is used for suggesting the user to use the tool to carry out core binding tuning.
It will be clear to those skilled in the art that, for convenience and brevity of description, reference may be made to the corresponding process in the foregoing method embodiment for the specific working process of the apparatus described above, which is not described herein again.
In yet another embodiment provided herein, a computer device is provided, where the computer device includes a processor and a memory, where at least one instruction or at least one program is stored in the memory, where the at least one instruction or at least one program is loaded and executed by the processor to implement a storage device testing method described in an embodiment of the present application. Fig. 5 is a block diagram of a computer device for storage device testing according to an embodiment of the present application. The internal structure thereof can be shown in fig. 5. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured 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 and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a storage device testing method.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of a portion of the architecture associated with the disclosed aspects and is not limiting of the computer device to which the disclosed aspects apply, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In yet another embodiment provided herein, a computer readable storage medium is provided, where at least one instruction or at least one program is stored, where the at least one instruction or at least one program is loaded and executed by a processor to implement a storage device testing method described in an embodiment of the present application.
The foregoing description of the solution provided in the embodiments of the present application has been mainly from the perspective of the device. It will be appreciated that the apparatus, in order to achieve the above-described functions, comprises hardware structures and/or software modules corresponding to the execution of the respective functions. Those of skill in the art will readily appreciate that the algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for testing a memory device, comprising:
detecting the category of storage devices included in the current system;
storing the mounting address of the storage device into a corresponding set according to the category of the storage device;
according to the corresponding relation between the category of the preset storage device and a plurality of test categories, respectively determining the target test category to be executed of the storage device in each set; the target test class is one of the plurality of test classes, the plurality of test classes including a performance test class of the storage device;
and calling a target test function corresponding to the target test category, and respectively performing performance test on the storage devices corresponding to the mounting addresses in each set by utilizing the target test parameters associated with the target test category.
2. The method of claim 1, wherein the class of storage devices includes a removable storage device, a mechanical hard disk, and a solid state disk, wherein the removable storage device has a first value for a return value of a removable storage device field under a device file directory in a current system, wherein the mechanical hard disk has a second value for a return value of a rotating storage device field, wherein the solid state disk has a third value for a return value of the rotating storage device field, and wherein the detecting the class of storage devices included in the current system comprises:
acquiring a first return value of a removable storage device field under a device file directory in the current system;
if the first return value is a preset first value, determining that the system comprises a removable storage device;
acquiring a second return value of a rotating storage device field under a device file directory in the system;
and if the second return value is a preset second value, determining that the system comprises a mechanical hard disk, and if the second return value is a preset third value, determining that the system comprises a solid state hard disk.
3. The method of claim 1, further comprising, prior to performing performance testing on the storage devices corresponding to the mount addresses in each of the sets, respectively, using the target test parameters associated with the target test categories:
Configuring corresponding test parameters for each test category; the test categories include: fio test, dd test, and copy test;
wherein, the test parameters of the configuration required by the fio test comprise: the address and name of the tested file, the use buffer condition, the read-write mode, the block size of single operation, the test time and the output address of the test report;
the test parameters of the dd test required configuration include: operation type, block size of single operation, number of blocks of operation, use buffer status, output address of test report;
the test parameters of the configuration required by copy test comprise: the source file address and name to be copied, the destination file address, the output address of the test report.
4. The method of claim 1, wherein storing the mount address of the storage device into the corresponding set according to the class of the storage device comprises:
determining a target storage device where a current operating system is located; the target storage device is one of the storage devices included in the current system;
acquiring mounting addresses of other storage devices except the target storage device in the current system;
And storing the mounting addresses of the other storage devices into corresponding sets according to the categories of the storage devices.
5. The method according to any one of claims 1-4, further comprising, after performing performance tests on the storage devices corresponding to the mount addresses in each set, respectively:
acquiring a test report of the performance test, and acquiring the read-write rate of the storage device from the test report;
if the read-write rate is lower than a preset rate, acquiring a system kernel starting parameter of the current system;
and if the starting parameter is a preset first value, generating a first message, wherein the first message is used for suggesting a user to adjust the starting parameter from the first value to a target value smaller than the first value.
6. The method according to any one of claims 1-4, further comprising, after performing performance tests on the storage devices corresponding to the mount addresses in each set, respectively:
acquiring a test report of the performance test, and acquiring the CPU core utilization rate of the current system from the test report;
if the CPU core utilization rate is lower than the preset utilization rate, generating a second message, wherein the second message is used for suggesting the user to use the tool to perform the binding core tuning.
7. A storage device testing apparatus, comprising:
the device type detection module is used for detecting the type of the storage device included in the current system;
the storage module is used for storing the mounting address of the storage device into a corresponding set according to the category of the storage device;
the test category determining module is used for determining target test categories to be executed by the storage devices in each set according to the corresponding relation between the category of the pre-configured storage device and the plurality of test categories; the target test class is one of the plurality of test classes, the plurality of test classes including a performance test class of the storage device;
and the test module is used for calling a target test function corresponding to the target test category and respectively performing performance test on the storage devices corresponding to the mounting addresses in each set by utilizing the target test parameters associated with the target test category.
8. The apparatus of claim 7, wherein the class of storage devices includes a removable storage device, a mechanical hard disk, and a solid state disk, the removable storage device has a first value for a return value of a removable storage device field under a device file directory in a current system, the mechanical hard disk has a second value for a return value of a rotating storage device field, the solid state disk has a third value for a return value of the rotating storage device field, and the device class detection module is specifically configured to:
Acquiring a first return value of a removable storage device field under a device file directory in the current system;
if the first return value is a preset first value, determining that the system comprises a removable storage device;
acquiring a second return value of a rotating storage device field under a device file directory in the system;
and if the second return value is a preset second value, determining that the system comprises a mechanical hard disk, and if the second return value is a preset third value, determining that the system comprises a solid state hard disk.
9. A computer device comprising a processor and a memory, wherein the memory has stored therein at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the storage device testing method of any of claims 1-6.
10. A computer readable storage medium having stored therein at least one instruction or at least one program loaded and executed by a processor to implement the storage device testing method of any of claims 1-6.
CN202310486862.9A 2023-04-28 2023-04-28 Storage device testing method and device, computer device and storage medium Pending CN116382991A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310486862.9A CN116382991A (en) 2023-04-28 2023-04-28 Storage device testing method and device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310486862.9A CN116382991A (en) 2023-04-28 2023-04-28 Storage device testing method and device, computer device and storage medium

Publications (1)

Publication Number Publication Date
CN116382991A true CN116382991A (en) 2023-07-04

Family

ID=86977002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310486862.9A Pending CN116382991A (en) 2023-04-28 2023-04-28 Storage device testing method and device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN116382991A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932275A (en) * 2023-09-13 2023-10-24 飞腾信息技术有限公司 Data scrubbing control method, DDR controller and system on chip

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932275A (en) * 2023-09-13 2023-10-24 飞腾信息技术有限公司 Data scrubbing control method, DDR controller and system on chip
CN116932275B (en) * 2023-09-13 2023-12-29 飞腾信息技术有限公司 Data scrubbing control method, DDR controller and system on chip

Similar Documents

Publication Publication Date Title
CN108133732B (en) Performance test method, device and equipment of flash memory chip and storage medium
US8073673B2 (en) Emulated memory management
CN107659455B (en) Method, storage medium, device and system for Mock data of iOS (internet operating system) end
CN1332409A (en) Central processing unit capable of testing and debugging program easily
US10643736B2 (en) Method, apparatus and electronic device for read/write speed testing
CN107193699A (en) One kind tests the wide time-delay method of HCA cassette tapes automatically by RDMA modes
CN116382991A (en) Storage device testing method and device, computer device and storage medium
CN110556155A (en) Method and device for testing diskless started SSD product and computer equipment
CN110928720A (en) Core dump file generation method and device based on Linux system
CN114924923A (en) Method, system, equipment and medium for verifying correctness of hard disk write-in point
CN114116355A (en) Memory test method and device and electronic equipment
CN110795304B (en) Method and device for testing performance of distributed storage system
CN110990207B (en) BPS memory test method, system, terminal and storage medium based on Whitley platform
CN111026656A (en) Automatic testing system, method, equipment and storage medium for distributed storage
CN115509924A (en) Fault simulation method, device and related equipment
CN115576766A (en) Flash memory management algorithm debugging method, system, device and readable storage medium
CN115292147A (en) Convenient and efficient memory pressure testing method and system and readable storage medium
CN115617479A (en) BIOS log storage method and computing equipment
US7539839B1 (en) Method to test error recovery with selective memory allocation error injection
US7546589B2 (en) Semi-automated desk checking system and method
CN111813673A (en) Hard disk filling test method and system
US20090228241A1 (en) System testing method through subsystem performance-based generator
CN113835631B (en) Residual platform configuration data deleting method, system, terminal and storage medium
CN111063387A (en) Method, device and equipment for testing performance of solid state disk and storage medium
CN118152300A (en) Batch test system and method for carrying out NVMe SSD abnormal power-off read-write on Linux PC

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination