CN112363901B - Hard disk performance detection method, device, system, storage medium and electronic device - Google Patents

Hard disk performance detection method, device, system, storage medium and electronic device Download PDF

Info

Publication number
CN112363901B
CN112363901B CN202011290877.0A CN202011290877A CN112363901B CN 112363901 B CN112363901 B CN 112363901B CN 202011290877 A CN202011290877 A CN 202011290877A CN 112363901 B CN112363901 B CN 112363901B
Authority
CN
China
Prior art keywords
hard disk
instruction
target
information
acquiring
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.)
Active
Application number
CN202011290877.0A
Other languages
Chinese (zh)
Other versions
CN112363901A (en
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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202011290877.0A priority Critical patent/CN112363901B/en
Publication of CN112363901A publication Critical patent/CN112363901A/en
Application granted granted Critical
Publication of CN112363901B publication Critical patent/CN112363901B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • 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)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a method, a device, a system, a storage medium and an electronic device for detecting the performance of a hard disk, wherein the method comprises the following steps: acquiring a first instruction, wherein the first instruction is used for requesting a target hard disk to execute target processing; acquiring first information of a first instruction; transmitting a first instruction to a target hard disk based on the hard disk information; acquiring a first instruction response returned by the target hard disk after the target hard disk executes target processing based on the first instruction; acquiring second information responded by the first instruction; and determining the performance of the target hard disk based on the time difference between the first sending time and the second sending time and the processing capacity. The application solves the problem of inaccurate detection of the hard disk performance in the related technology, and further achieves the effect of improving the accuracy of the hard disk performance detection.

Description

Hard disk performance detection method, device, system, storage medium and electronic device
Technical Field
The embodiment of the application relates to the field of communication, in particular to a method, a device, a system, a storage medium and an electronic device for detecting the performance of a hard disk.
Background
The existing hard disk performance test is mainly performed through user state open source test tools such as dd (data description), fio (flexible IO tester, adaptive IO test tools) and the like, different test parameters are configured, the test parameters comprise sequential reading and writing, random reading and writing, large-block reading and writing, small-block reading and writing, mixed reading and writing and the like, and corresponding test results are analyzed according to corresponding data output by the test tools. Many automatic hard disk performance tests basically adopt a script mode to run a plurality of test instructions by one key and output corresponding results.
The data acquired during the existing hard disk performance test is generally obtained through block layer (block equipment layer) statistics or through user state calculation, and the data is affected by the difference of different file systems in the acquisition process, so that the strategy processing results of different block layers are different, and the obtained hard disk performance data is inaccurate.
Disclosure of Invention
The embodiment of the application provides a method, a device, a system, a storage medium and an electronic device for detecting hard disk performance, which are used for at least solving the problem of inaccurate detection of hard disk performance data in the related technology.
According to an embodiment of the present application, there is provided a hard disk performance detection method including:
acquiring a first instruction, wherein the first instruction is used for requesting a target hard disk to execute target processing;
acquiring first information of the first instruction, wherein the first information comprises a first sending time for sending the first instruction, hard disk information of the target hard disk and processing capacity corresponding to the target processing;
transmitting the first instruction to the target hard disk based on the hard disk information;
acquiring a first instruction response returned by the target hard disk after the target processing is executed based on the first instruction;
acquiring second information of the first instruction response, wherein the second information comprises second sending time of the target hard disk for sending the first instruction response;
and determining the performance of the target hard disk based on the time difference between the first sending time and the second sending time and the processing amount.
In an exemplary embodiment, before the fetching of the first instruction, the method further comprises one of:
counting the total processing amount corresponding to the target hard disk execution history processing, and triggering and executing the operation of acquiring the first instruction under the condition that the total processing amount reaches a target threshold value;
and triggering and executing the operation of acquiring the first instruction under the condition of receiving the hard disk performance detection instruction.
In an exemplary embodiment, the triggering execution of the operation of obtaining the first instruction when the hard disk performance detection instruction is received includes:
and triggering and executing the operation of acquiring the first instruction under the condition that the hard disk performance detection instruction sent according to a preset sending period is received.
In an exemplary embodiment, the triggering execution of the operation of obtaining the first instruction when the hard disk performance detection instruction is received further includes:
and triggering and executing the operation of acquiring the first instruction under the condition that the hard disk performance detection instruction sent under the preset triggering condition is received, wherein the preset triggering condition comprises the first starting of the target hard disk.
In an exemplary embodiment, the predetermined triggering condition further includes:
the target hard disk is inserted into target equipment, wherein the target equipment has a function of hot plug of the hard disk.
In one exemplary embodiment, after the determining the performance of the target hard disk based on the time difference between the first transmission time and the second transmission time and the throughput, the method further comprises:
obtaining standard performance corresponding to the first instruction;
and executing alarm operation under the condition that the performance of the target hard disk is determined to be lower than the standard performance.
According to another embodiment of the present application, there is provided a hard disk performance detecting apparatus including:
the system comprises an instruction acquisition module, a target hard disk and a target processing module, wherein the instruction acquisition module is used for acquiring a first instruction, and the first instruction is used for requesting the target hard disk to execute target processing;
the first information acquisition module is used for acquiring first information of the first instruction, wherein the first information comprises first sending time for sending the first instruction, hard disk information of the target hard disk and processing amount corresponding to the target processing;
the instruction sending module is used for sending the first instruction to the target hard disk based on the hard disk information;
the instruction feedback module is used for acquiring a first instruction response returned by the target hard disk after the target processing is executed based on the first instruction;
the second information acquisition module is used for acquiring second information of the first instruction response, wherein the second information comprises second sending time of the target hard disk for sending the first instruction response;
and the performance calculation module is used for determining the performance of the target hard disk based on the time difference between the first sending time and the second sending time and the processing amount.
In an exemplary embodiment, the apparatus further comprises one of:
the statistics triggering module is used for counting the total processing amount corresponding to the target hard disk execution history processing, and triggering and executing the operation of acquiring the first instruction under the condition that the total processing amount reaches a target threshold value;
and the instruction triggering module is used for triggering and executing the operation of acquiring the first instruction under the condition of receiving the hard disk performance detection instruction.
According to still another embodiment of the present application, there is also provided a hard disk performance detection system including:
the kernel device is used for receiving a first instruction for requesting a target hard disk to execute target processing and sending the first instruction to the target hard disk through the hard disk performance detection equipment;
the hard disk performance detection device is connected with the kernel device and the target hard disk, wherein the hard disk performance detection device comprises the hard disk performance detection device;
the target hard disk is connected to the hard disk performance detection device, and is used for receiving the first instruction and returning the first instruction response after the target processing is executed based on the first instruction.
According to a further embodiment of the application, there is also provided a storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the application, the target hard disk is indicated to execute target instruction operation through tracking, so that the interference of other services is avoided, the problem of inaccurate detection of the hard disk performance data in the related technology can be solved, and the effect of improving the hard disk performance detection precision is achieved.
Drawings
Fig. 1 is a block diagram of a hardware structure of a mobile terminal of a hard disk performance detection method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for detecting hard disk performance according to an embodiment of the present application;
FIG. 3 is a block diagram of a hard disk performance detection apparatus according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an embodiment of the present application;
fig. 5 is a flow chart of an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be performed in a mobile terminal, a computer terminal or similar computing device. Taking the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal according to an embodiment of the present application. As shown in fig. 1, a mobile terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a method for detecting performance of a hard disk in an embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for detecting performance of a hard disk is provided, and fig. 2 is a flowchart of a method for detecting performance of a hard disk according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
step S202, a first instruction is obtained, wherein the first instruction is used for requesting a target hard disk to execute target processing;
in this embodiment, the first instruction includes an instruction instructing the target hard disk to perform a read operation, a write operation, or other operations, where the read operation is to read data or information stored in the target hard disk, and the write operation is to store external data or information in a target area of the target hard disk, where, to facilitate target storage, the first instruction further includes an identifier indicating the target process, such as a read identifier or a write identifier, etc., that identifies the target process indicated by the first instruction.
The manner of acquiring the first instruction may be, but is not limited to, storing in advance identification information corresponding to the first instruction, then, in the case of reading the first instruction, comparing an identification indicating target processing included in the first instruction with the prestored identification information, and taking a prestored instruction with the identification information being identical as the first instruction; or intercepting the first instruction, recording the identification indicating the target processing included in the first instruction, and forwarding the identification to the target hard disk; and continuously acquiring the information flow in the kernel mode in the forwarding process of the first instruction, and continuously analyzing the acquired information flow to acquire the first instruction contained in the information flow.
Taking an automatic hard disk performance test under linux as an example, a read-write IO instruction in a user mode is sent from the user mode to a kernel mode, then enters a hard disk performance detection module with a hard disk performance detection function through a file system layer, a BLOCK layer, a SCSI layer and a SCSI controller driving layer in the kernel mode, then the read-write IO instruction is sent to a target hard disk by the hard disk performance detection module, then the target hard disk acquires the read-write IO instruction, and executes the read-write IO instruction.
Step S204, obtaining first information of a first instruction, wherein the first information comprises first sending time for sending the first instruction, hard disk information of a target hard disk and processing capacity corresponding to target processing;
in the present embodiment, the first information further includes position information and the like of a target process corresponding to the first instruction in the target hard disk, for example, a target hard disk area in which a read operation is performed, a target hard disk area in which a write operation is performed, and the like; the first sending time may be (but is not limited to) a system time when the first instruction is sent for the user mode, or may be a system time when the hard disk performance detection module sends the first instruction; the hard disk information of the target hard disk includes (but is not limited to) model, identity ID, storage space, identification information and position information of the storage area, etc. of the target hard disk; the processing amount corresponding to the target processing includes the byte length of the first instruction, the data length of the target processing, the data amount thereof, and the like.
The manner of acquiring the first information of the first instruction may be (but is not limited to) that the first instruction is acquired by analyzing the first instruction after the first instruction is acquired, or may be that the identifier corresponding to the first information is identified and the first information corresponding to the identifier is recorded, or may be that the first information is searched after the first instruction is acquired, and then the searched first information is stored and recorded, which is not described herein again.
Step S206, a first instruction is sent to a target hard disk based on the hard disk information;
in this embodiment, after the hard disk performance detection module obtains the hard disk information, the first instruction is sent to the target storage area according to the identification information of the storage area in the hard disk information and the information such as the storage space size of the storage area, so that the target hard disk performs a corresponding operation in the target storage area, so that the target hard disk can have enough space to perform a corresponding target process, where the mode of sending the first instruction to the target hard disk may be data transmission in a serial mode or data transmission in a parallel mode.
It should be noted that, when the target hard disk has a plurality of input/output ports, the target hard disk may receive the first instruction together by the plurality of ports, the first instruction may be received in one-to-one manner by one port, or may be received in other manners, which will not be described herein.
Step S208, a first instruction response returned by the target hard disk after the target hard disk executes the target processing based on the first instruction is obtained;
in this embodiment, after receiving the first instruction, the target hard disk executes target processing such as a read operation or a write operation in the target storage area, and feeds back a first instruction response to the kernel state after completing the target processing, where the first instruction response includes (but is not limited to) information such as hard disk information of the target hard disk that completes the target processing, link negotiation rate of the target hard disk that completes the target processing, system time of the target hard disk that completes the target processing, and data length of the completed target processing, where the link negotiation rate refers to a rate at which data interaction is performed by a link connected between the target hard disk and the hard disk performance detection module.
The method for returning the first instruction response by the target hard disk may (but is not limited to) return by parallel transmission, may return by serial transmission, or may return by other methods.
For example, after the target hard disk finishes the target processing, a first instruction response is returned to the hard disk performance detection module in the kernel state, the hard disk performance detection module sends the first instruction response to the SCSI controller driving layer after obtaining the first instruction response, and the first instruction response returns to the user state through the SCSI layer, the BLOCK layer and the file system layer in sequence.
Step S210, obtaining second information of the first instruction response, wherein the second information comprises second sending time of the target hard disk for sending the first instruction response;
in this embodiment, after receiving the first instruction response returned by the target hard disk, the hard disk performance detection module analyzes the first instruction response to obtain second information included in the first instruction response, where the second information includes, in addition to the second sending time of the target hard disk to send the first instruction response, information such as a data length of the completed target processing.
Step S212, determining the performance of the target hard disk based on the time difference between the first transmission time and the second transmission time and the throughput.
In this embodiment, after the hard disk performance detection module obtains the second sending time, determining the time consumed by the target hard disk to execute the target processing by calculating the time difference between the first sending time and the second sending time, converting the rate of the target hard disk when executing the target processing according to the processing amount and the time consumed by the target hard disk to execute the target processing, and then determining the performance of the target hard disk according to the rate of the target hard disk when executing the target processing; the processing amount includes, but is not limited to, the data amount of the target processing, the data length of the first instruction, and the like.
Through the steps, the hard disk performance detection module directly detects the hard disk performance according to the information fed back by the hard disk, so that data deviation caused by the business of other layers is avoided, the problem of inaccurate hard disk performance detection is solved, and the hard disk performance detection precision is improved.
In an alternative embodiment, prior to fetching the first instruction, the method further comprises one of:
step S2002, counting the total processing amount corresponding to the target hard disk execution history processing, and triggering and executing the operation of acquiring the first instruction under the condition that the total processing amount reaches a target threshold value;
in step S2004, in the case of receiving the hard disk performance detection instruction, the operation of acquiring the first instruction is triggered to be executed.
In this embodiment, the operation of executing the first instruction may be triggered by the kernel state actively by counting the total processing amount, or may be triggered by acquiring the hard disk performance detection instruction from another device, or may be triggered by other means.
The total processing amount corresponding to the target hard disk execution history processing includes (but is not limited to) the read data length, the write data length, the time consumed by the read IO instruction, the time consumed by the write IO instruction and the like of the target hard disk execution history processing. When the accumulated read data length and write data length reach a preset threshold, for example, the preset threshold is 1GB, the operation of acquiring the first instruction is triggered and executed.
The statistical process may be to record and store data length information and the like included in the first information and the second information when the first information of the first instruction and the second information of the first instruction response are acquired, and accumulate successively.
The process of triggering and executing the first instruction may be that a trigger instruction is sent to a port receiving the first instruction to enable the port receiving the first instruction to be in a receiving state, or that a receiving instruction is sent to the port receiving the first instruction to enable the corresponding port to start receiving the first instruction; it should be noted that, the operation of triggering execution of the first instruction is independent of whether the first instruction reaches the corresponding port, and only the corresponding port is in a state of receiving the first instruction.
The hard disk performance detection instruction can be from other external equipment or from the kernel mode, the sending mode of the hard disk performance detection instruction can be that the external equipment sends through a wired transmission mode or that the external equipment sends through a wireless transmission mode, the port for receiving the hard disk performance detection instruction can be one or a plurality of ports, and the mode for receiving the hard disk performance detection instruction can be serial port receiving or parallel port receiving.
It should be noted that the hard disk performance detection instruction includes (but is not limited to) an instruction identifier for identifying the hard disk performance detection instruction, a time for indicating execution of the operation for triggering acquisition of the first instruction, a target object for indicating execution of the operation for triggering acquisition of the first instruction, and the like.
In an alternative embodiment, in a case where the hard disk performance detection instruction is received, triggering the operation of acquiring the first instruction includes:
in step S2006, when a hard disk performance detection instruction transmitted in a predetermined transmission cycle is received, an operation of acquiring the first instruction is triggered to be executed.
In this embodiment, when a predetermined transmission period is reached, the external device or the kernel mode itself transmits a hard disk performance instruction; the predetermined sending period may be preset according to actual requirements, or may be set according to a specific formula in an actual working process, for example, the predetermined sending period may be adjusted in real time according to the throughput of the first instruction.
In an alternative embodiment, in a case that the hard disk performance detection instruction is received, triggering the operation of acquiring the first instruction further includes:
in step S2008, the operation of obtaining the first instruction is triggered to be executed when the hard disk performance detection instruction sent under the predetermined triggering condition is received, where the predetermined triggering condition includes the first start of the target hard disk.
In this embodiment, the first start-up of the target hard disk bit may be determined by searching the pre-stored hard disk information according to the hard disk information of the target hard disk before the target hard disk is started up, and determining that the target hard disk is started up for the first time if the hard disk information corresponding to the target hard disk is not retrieved; or after the target hard disk is started, acquiring starting information sent by the target hard disk, searching pre-stored starting information corresponding to the target hard disk according to the starting information, and judging that the target hard disk is started for the first time under the condition that the pre-stored starting information is not searched.
It should be noted that, by judging whether the target hard disk is started for the first time, the data amount accumulated during the history processing of the target hard disk can be conveniently counted.
In an alternative embodiment, the predetermined triggering condition further comprises:
in step S2010, the target hard disk is inserted into the target device, where the target device has a function of hot-plugging the hard disk.
In this embodiment, the hot plug is a state in which the target hard disk and the target device are connected or disconnected under the condition that the kernel state keeps working normally; when the target hard disk is connected or disconnected with the target device, the target hard disk sends a connection signal or a disconnection signal, so that the operation of acquiring the first instruction is triggered to be executed.
In an alternative embodiment, after determining the performance of the target hard disk based on the time difference between the first transmission time and the second transmission time and the throughput, the method further comprises:
step S214, obtaining standard performance corresponding to the first instruction;
in step S216, in the case where it is determined that the performance of the target hard disk is lower than the standard performance, an alarm operation is performed.
In this embodiment, the standard performance includes a rate threshold table for comparing the performance of the hard disk, which is stored in the hard disk performance detection module or the target hard disk in advance, and the rate threshold table may include rate thresholds corresponding to SATA (Serial Advanced Technology Attachment, serial hard disk) 1.0, SATA2.0, SATA3.0, and the like; the standard performance corresponding to the first instruction may be obtained by reading the rate threshold table after determining the performance of the target hard disk, or may be obtained by reading the rate threshold table before determining the performance of the target hard disk.
The performance of the target hard disk being below the standard performance may be, but is not limited to, the data processing speed of the target hard disk being below the data processing speed of the corresponding target hard disk stored in the rate threshold table.
The alarm operation can be performed by sending alarm voice or sending an alarm signal for indicating the alarm lamp to flash or illuminate, or by combining the alarm voice with the alarm signal, wherein the alarm voice or the alarm signal can be sent in a wired transmission mode or in a wireless transmission mode.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
In this embodiment, a device for detecting performance of a hard disk is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 3 is a block diagram of a hard disk performance detecting apparatus according to an embodiment of the present application, as shown in fig. 3, the apparatus includes:
the instruction acquisition module 32 is configured to acquire a first instruction, where the first instruction is used to request the target hard disk to execute target processing;
the first information acquisition module 34 is configured to acquire first information of a first instruction, where the first information includes a first sending time for sending the first instruction, hard disk information of a target hard disk, and a throughput corresponding to target processing;
an instruction sending module 36, configured to send a first instruction to the target hard disk based on the hard disk information;
the instruction feedback module 38 is configured to obtain a first instruction response returned by the target hard disk after the target hard disk performs the target processing based on the first instruction;
a second information acquisition module 40, configured to acquire second information of the first instruction response, where the second information includes a second sending time of the target hard disk to send the first instruction response;
the performance calculation module 42 is configured to determine the performance of the target hard disk based on the time difference between the first transmission time and the second transmission time and the throughput.
In an alternative embodiment, the apparatus further comprises one of:
the statistics triggering module 44 is configured to count a total throughput corresponding to the execution history of the target hard disk, and trigger execution of the operation of obtaining the first instruction when the total throughput reaches a target threshold;
the instruction triggering module 46 is configured to trigger, when receiving the hard disk performance detection instruction, to perform an operation of acquiring the first instruction.
In an alternative embodiment, the instruction triggering module 46 includes:
the cycle inspection unit 462, upon receiving the hard disk performance detection instruction transmitted in accordance with the predetermined transmission cycle, triggers execution of the operation of acquiring the first instruction.
In an alternative embodiment, instruction triggering module 46 further includes:
and a first start triggering unit 464, configured to trigger to perform an operation of acquiring the first instruction when receiving the hard disk performance detection instruction sent under a predetermined triggering condition, where the predetermined triggering condition includes first start of the target hard disk.
In an alternative embodiment, instruction triggering module 46 further includes:
and the hot plug triggering unit 468 is configured to trigger, when the target hard disk is inserted into the target device, to execute an operation of acquiring the first instruction, where the target device has a function of hot plug of the hard disk.
In an alternative embodiment, the apparatus further comprises:
a standard performance acquisition module 48, configured to acquire a standard performance corresponding to the first instruction;
and the prompting module 50 is used for executing the alarming operation under the condition that the performance of the target hard disk is determined to be lower than the standard performance.
In this embodiment, there is also provided a hard disk performance detection system, including:
the kernel device 52 is configured to receive a first instruction requesting the target hard disk 56 to execute target processing, and send the first instruction to the target hard disk 56 through the hard disk performance detection apparatus 54;
a hard disk performance detection apparatus 54 connected to the kernel device 52 and the target hard disk 56, wherein the hard disk performance detection apparatus 54 includes the hard disk performance detection device as described above;
a target hard disk 56 connected to the hard disk performance detecting device 54 for receiving the first instruction and executing target processing according to the first instruction; the target hard disk 56 returns a first instruction response after the target process is executed based on the first instruction.
In this embodiment, the kernel device 52 includes a file system layer connected to the external user mode and used for receiving the first instruction, a BLOCK layer connected to the file system layer and forwarding the first instruction, a SCSI layer connected to the BLOCK layer and a SCSI layer controller driver layer connected to the SCSI layer and the hard disk performance detecting device, the SCSI layer being used for forwarding the first instruction to the SCSI layer controller driver layer and receiving the performance of the target hard disk 56 fed back by the SCSI layer controller driver layer.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
The application will now be described with reference to specific examples.
Referring to fig. 4, when the hard disk performance test is started, the user state is in normal storage service operation, then the read-write IO instruction is transmitted from the user state to the kernel state and gradually transmitted to the SCSI controller driving layer, and then enters the hard disk performance detection module to start the detection and tracking of the read-write IO instruction.
When the detection tracking of the read-write IO instruction is started, recording the system time for sending the read-write IO instruction, receiving the hard disk information of the target hard disk of the read-write IO instruction, the read-write data length of the read-write IO instruction, the type of the read-write IO instruction, the read-write position and other information, and sending the read-write IO instruction to the target hard disk.
After the target hard disk executes the read-write IO instruction, returning the instruction response to the SCSI controller, capturing the instruction response by the hard disk performance detection module, recording the system time of the target hard disk for completing the read-write IO instruction according to the instruction response fed back by the target hard disk, completing the hard disk information of the hard disk for reading-write IO instruction, completing the link negotiation rate of the target hard disk for reading-write IO instruction, and the data length information of the read-write IO instruction, and calculating the read or write rate of the IO according to the time difference consumed by completing the read-write IO instruction and the data length information of the read-write IO instruction.
Referring to fig. 5, before starting the detection and tracking of the read/write IO instruction, a determination is made as to whether the triggering condition of the user mode for obtaining the hard disk performance detection result is satisfied (corresponding to step S502 in fig. 5), and if the triggering condition is not satisfied, the operation for obtaining the hard disk performance detection result is not performed (corresponding to step S506 in fig. 5), otherwise, the operation for obtaining the hard disk performance detection result is performed (corresponding to step S504 in fig. 5).
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic apparatus may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.

Claims (9)

1. A method for detecting performance of a hard disk, comprising:
acquiring a first instruction, wherein the first instruction is used for requesting a target hard disk to execute target processing;
acquiring first information of the first instruction, wherein the first information comprises a first sending time for sending the first instruction, hard disk information of the target hard disk and processing capacity corresponding to the target processing;
the first instruction is sent to the target hard disk based on the hard disk information, wherein the first instruction sequentially enters the target hard disk from a user state through a file system layer, a BLOCK layer, a SCSI layer and a SCSI controller driving layer in a kernel state;
acquiring a first instruction response returned by the target hard disk after the target processing is executed based on the first instruction, wherein the first instruction response is captured from a SCSI controller, and the first instruction response sequentially passes through a SCSI controller driving layer, the SCSI layer, the BLOCK layer and the file system layer and returns to the user state;
acquiring second information of the first instruction response, wherein the second information comprises second sending time of the target hard disk for sending the first instruction response;
determining performance of the target hard disk based on a time difference between the first transmission time and the second transmission time and the throughput;
before the fetching of the first instruction, the method further comprises one of:
counting the total processing amount corresponding to the target hard disk execution history processing, and triggering and executing the operation of acquiring the first instruction under the condition that the total processing amount reaches a target threshold value;
triggering and executing the operation of acquiring the first instruction under the condition of receiving a hard disk performance detection instruction;
the method further comprises the steps of:
during the hard disk performance test, the user mode is in normal storage business operation.
2. The method of claim 1, wherein the triggering execution of the operation to obtain the first instruction in the event that a hard disk performance detection instruction is received comprises:
and triggering and executing the operation of acquiring the first instruction under the condition that the hard disk performance detection instruction sent according to a preset sending period is received.
3. The method of claim 1, wherein the triggering execution of the operation to obtain the first instruction upon receiving a hard disk performance detection instruction further comprises:
and triggering and executing the operation of acquiring the first instruction under the condition that the hard disk performance detection instruction sent under the preset triggering condition is received, wherein the preset triggering condition comprises the first starting of the target hard disk.
4. A method according to claim 3, wherein the predetermined triggering condition further comprises:
the target hard disk is inserted into target equipment, wherein the target equipment has a function of hot plug of the hard disk.
5. The method of claim 1, wherein after the determining the performance of the target hard disk based on the time difference of the first transmit time and the second transmit time and the throughput, the method further comprises:
obtaining standard performance corresponding to the first instruction;
and executing alarm operation under the condition that the performance of the target hard disk is determined to be lower than the standard performance.
6. A hard disk performance detection apparatus, comprising:
the system comprises an instruction acquisition module, a target hard disk and a target processing module, wherein the instruction acquisition module is used for acquiring a first instruction, and the first instruction is used for requesting the target hard disk to execute target processing;
the first information acquisition module is used for acquiring first information of the first instruction, wherein the first information comprises first sending time for sending the first instruction, hard disk information of the target hard disk and processing amount corresponding to the target processing;
the instruction sending module is used for sending the first instruction to the target hard disk based on the hard disk information, wherein the first instruction sequentially enters the target hard disk from a user state through a file system layer, a BLOCK layer, a SCSI layer and a SCSI controller driving layer in a kernel state;
the instruction feedback module is used for acquiring a first instruction response returned by the target hard disk after the target processing is executed based on the first instruction, wherein the first instruction response sequentially passes through the SCSI controller driving layer, the SCSI layer, the BLOCK layer and the file system layer and returns to the user state;
the second information acquisition module is used for acquiring second information of the first instruction response, wherein the second information comprises second sending time of the target hard disk for sending the first instruction response;
a performance calculation module, configured to determine performance of the target hard disk based on a time difference between the first transmission time and the second transmission time and the throughput;
the apparatus further comprises one of:
the statistics triggering module is used for counting the total processing amount corresponding to the target hard disk execution history processing, and triggering and executing the operation of acquiring the first instruction under the condition that the total processing amount reaches a target threshold value;
the instruction triggering module is used for triggering and executing the operation of acquiring the first instruction under the condition of receiving the hard disk performance detection instruction;
the device is also used for enabling the user mode to be in normal storage service operation during the hard disk performance test.
7. A hard disk performance detection system, comprising:
the system comprises a kernel device, a hard disk performance detection device and a storage device, wherein the kernel device is used for receiving a first instruction for requesting a target hard disk to execute target processing and sending the first instruction to the target hard disk through the hard disk performance detection device, wherein the first instruction sequentially enters the target hard disk from a user state through a file system layer, a BLOCK layer, a SCSI layer and a SCSI controller driving layer of the kernel state;
the hard disk performance detection apparatus connecting the kernel device and the target hard disk, wherein the hard disk performance detection apparatus includes the hard disk performance detection device as set forth in claim 6;
the target hard disk is connected to the hard disk performance detection device and is used for receiving the first instruction, returning the first instruction response after the target processing is executed based on the first instruction, wherein the first instruction response sequentially passes through the SCSI controller driving layer, the SCSI layer, the BLOCK layer and the file system layer and returns to the user state.
8. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 5 when run.
9. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 5.
CN202011290877.0A 2020-11-17 2020-11-17 Hard disk performance detection method, device, system, storage medium and electronic device Active CN112363901B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011290877.0A CN112363901B (en) 2020-11-17 2020-11-17 Hard disk performance detection method, device, system, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011290877.0A CN112363901B (en) 2020-11-17 2020-11-17 Hard disk performance detection method, device, system, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112363901A CN112363901A (en) 2021-02-12
CN112363901B true CN112363901B (en) 2023-08-29

Family

ID=74532599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011290877.0A Active CN112363901B (en) 2020-11-17 2020-11-17 Hard disk performance detection method, device, system, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112363901B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893230A (en) * 2016-04-05 2016-08-24 浪潮电子信息产业股份有限公司 Method and device for detecting IOPS performance of hard disks
CN106407083A (en) * 2016-10-26 2017-02-15 华为技术有限公司 Fault detection method and device
CN107832202A (en) * 2017-11-06 2018-03-23 郑州云海信息技术有限公司 A kind of method, apparatus and computer-readable recording medium for detecting hard disk
CN108763000A (en) * 2018-05-23 2018-11-06 郑州云海信息技术有限公司 A kind of hard disk I/O Request delay simulation judgment method and system based on Linux platform
CN109346122A (en) * 2018-10-15 2019-02-15 郑州云海信息技术有限公司 The test method and device of solid state hard disk performance
CN109448778A (en) * 2018-11-06 2019-03-08 郑州云海信息技术有限公司 A kind of solid state hard disk performance test methods, system, device and readable storage medium storing program for executing
CN111756575A (en) * 2020-06-19 2020-10-09 星辰天合(北京)数据科技有限公司 Performance analysis method and device of storage server and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9176883B2 (en) * 2009-04-30 2015-11-03 HGST Netherlands B.V. Storage of data reference blocks and deltas in different storage devices
US10346293B2 (en) * 2017-10-04 2019-07-09 International Business Machines Corporation Testing pre and post system call exits

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893230A (en) * 2016-04-05 2016-08-24 浪潮电子信息产业股份有限公司 Method and device for detecting IOPS performance of hard disks
CN106407083A (en) * 2016-10-26 2017-02-15 华为技术有限公司 Fault detection method and device
CN107832202A (en) * 2017-11-06 2018-03-23 郑州云海信息技术有限公司 A kind of method, apparatus and computer-readable recording medium for detecting hard disk
CN108763000A (en) * 2018-05-23 2018-11-06 郑州云海信息技术有限公司 A kind of hard disk I/O Request delay simulation judgment method and system based on Linux platform
CN109346122A (en) * 2018-10-15 2019-02-15 郑州云海信息技术有限公司 The test method and device of solid state hard disk performance
CN109448778A (en) * 2018-11-06 2019-03-08 郑州云海信息技术有限公司 A kind of solid state hard disk performance test methods, system, device and readable storage medium storing program for executing
CN111756575A (en) * 2020-06-19 2020-10-09 星辰天合(北京)数据科技有限公司 Performance analysis method and device of storage server and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
测试海量存储系统可用性的故障注入法;潘清;庄泽南;王霄军;张晓清;;计算机工程与应用(第36期);全文 *

Also Published As

Publication number Publication date
CN112363901A (en) 2021-02-12

Similar Documents

Publication Publication Date Title
CN110958161B (en) Block chain link point monitoring method and device and storage medium
CN110475124B (en) Video jamming detection method and device
US10021634B2 (en) Method and device for switching SIM cards of communication terminal and computer storage medium
CN113038084B (en) State identification method, device and system
CN107770805B (en) Method and device for judging identification information of terminal
CN112561721A (en) Live pig information processing method and device and block chain node point equipment
CN115811484A (en) Network detection method, device and storage medium
CN105323748B (en) Test error uploading method and device
CN102388640B (en) Method for identifying mobile telephone
US20090325600A1 (en) System and method for collecting communication signals
CN106686575A (en) Goods fleeing recognition method and goods fleeing recognition device
CN112363901B (en) Hard disk performance detection method, device, system, storage medium and electronic device
CN112422369B (en) Method and device for determining offline time, storage medium and electronic device
CN109426826B (en) User behavior analysis method and device
CN111124891B (en) Method and device for detecting access state, storage medium and electronic device
CN110825609B (en) Service testing method, device and system
CN107491332B (en) Method and device for identifying false installation of application program and server
JP6574310B2 (en) Evaluation information matching method, apparatus and server
CN108965053A (en) Upper computer software method for testing pressure, apparatus and system
CN114531340A (en) Log acquisition method and device, electronic equipment, chip and storage medium
CN110493818B (en) Detection method and device of wireless fidelity module, storage medium and electronic device
CN113868137A (en) Method, device and system for processing buried point data and server
CN112783942A (en) Block chain-based data acquisition quality verification method, system, device and medium
CN111584092A (en) Information determination method, device, system and server
CN110801630A (en) Cheating program determining method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant