CN112799593A - Processing method and device and electronic equipment - Google Patents
Processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN112799593A CN112799593A CN202110134876.5A CN202110134876A CN112799593A CN 112799593 A CN112799593 A CN 112799593A CN 202110134876 A CN202110134876 A CN 202110134876A CN 112799593 A CN112799593 A CN 112799593A
- Authority
- CN
- China
- Prior art keywords
- storage component
- target storage
- target
- command
- log data
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0619—Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0659—Command handling arrangements, e.g. command buffers, queues, command scheduling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application provides a processing method, which comprises the following steps: obtaining log data of a target storage component; determining a state of the target storage component based at least on a value of a target field in a data structure of the log data; outputting data information characterizing the state. In this embodiment, the state of the target storage component can be determined based on the value of the target field in the log data of the target storage component, and the data information is output, so that the state of the target storage component is determined based on the data information.
Description
Technical Field
The present application relates to the field of electronic devices, and in particular, to a processing method and apparatus, and an electronic device.
Background
The SSD (Solid State drive, Solid State disk) uses NAND Flash (computer Flash memory device) as a medium for data storage, and following continuous loss of NAND Program/Erase cycle (write/Erase cycle count) in use, after the P/E cycle is exhausted, the service life of the SSD will end, and at this time, the SSD will become in a failure State and cannot be used continuously. Failure of the SSD can be easily detected and identified by common SMART (Self-Monitoring Analysis and Reporting Technology) based detection software. The SAMRT is a test to determine if the SMART attribute parameter of each standard exceeds a threshold setting to determine if a fault has occurred.
In practical application, the Nand P/E cycle is not seriously worn during the use process of the SSD by a user, and the service life threshold is far not reached. But because some abnormal conditions, such as the SSD responding to the read instruction, are already very slow, the detection of the SMART attribute parameters of the respective standards by the detection software of the SMART does not report abnormal values or error codes, i.e. the detection result indicates that the health of the SSD is a normal state. However, the failure phenomenon seen in the use of the end user is the performance degradation of the PC (personal computer) system, and at this time, the user cannot directly find out what is caused by the failure phenomenon, which results in poor customer experience.
Disclosure of Invention
The application provides the following technical scheme:
a method of processing, comprising:
obtaining log data of a target storage component;
determining a state of the target storage component based at least on a value of a target field in a data structure of the log data;
outputting data information characterizing the state.
Optionally, the method, where obtaining log data of the target storage component includes:
directly sending a first command to the target storage component to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to the target storage component through a Universal Serial Bus (USB) to Serial Advanced Technology Attachment (SATA) chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to the target storage component through a Serial Peripheral Interface (SPI) to Serial Advanced Technology Attachment (SATA) chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to a target storage component of target equipment through an Internet of things chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to a target storage component of target equipment through an Internet of things chip and gateway equipment so as to read log data recorded by the target storage component.
Optionally, the method for determining the state of the target storage unit at least based on the value of the target field in the data structure of the log data includes:
acquiring attribute information and identification information of log data in the first command;
reading a numerical value of a target field corresponding to the identification information in a data structure of target log data corresponding to the attribute information;
determining a performance state and/or an operational state of the target storage component based on the value of the target field and the data structure.
Optionally, the method for determining the state of the target storage unit at least based on the value of the target field in the data structure of the log data includes:
obtaining attribute information of log data in the first command;
reading the numerical value of each field in the data structure of the target log data corresponding to the attribute information;
determining a performance state and/or an operational state of the target storage component based on the values of the fields and the data structure.
Optionally, the method further includes:
a second command is obtained to control the target storage component to perform a performance optimization operation based at least on the second command.
Optionally, the method, wherein controlling the target storage device to perform the performance optimization operation based on at least the second command includes:
if a target instruction set reported by the target storage component is obtained, generating a second command based on the target instruction set, and sending the second command to the target storage component to control the target storage component to execute garbage collection and/or cache cleaning operation;
and if the input optimized according to the current state of the target storage component is obtained, generating the second command based on the input, and sending the second command to the target storage component to control the target storage component to execute garbage collection and/or cache cleaning operation.
Optionally, the method, where obtaining log data of the target storage component, further includes:
acquiring execution information which is reported by a target storage component and recorded according to a preset data structure and relates to garbage collection and/or cache cleaning operation; or the like, or, alternatively,
and reading the execution information about the garbage collection and/or cache cleaning operation recorded in the data structure of the log data based on a first command sent to the target storage component.
Optionally, the method further includes:
and sending a first command to the target storage component at preset intervals so as to monitor the execution progress of the target storage component through the execution information about garbage collection and/or cache cleaning operation recorded in the log data.
Alternatively, the method of the above, wherein,
and if the first command is sent before the second command is sent to the target storage component, obtaining the latest updated progress information of the target storage component for performing garbage collection and/or cache cleaning.
A processing apparatus, comprising:
the acquisition module is used for acquiring the log data of the target storage component;
an analysis module to determine a state of the target storage component based at least on a value of a target field in a data structure of the log data;
and the output module is used for outputting the data information representing the state.
An electronic device, comprising: a memory, a processor;
wherein, the memory stores a processing program;
the processor is used for loading and executing the processing program stored in the memory so as to realize the steps of the processing method according to any one of the above items.
A readable storage medium having stored thereon a computer program for being invoked and executed by a processor for carrying out the steps of the processing method according to any one of the preceding claims.
As can be seen from the above technical solutions, the present application provides a processing method, including: obtaining log data of a target storage component; determining a state of the target storage component based at least on a value of a target field in a data structure of the log data; outputting data information characterizing the state. According to the scheme, the state of the target storage component can be determined based on the numerical value of the target field in the log data of the target storage component, and the data information is output, so that the state of the target storage component is determined based on the data information.
Drawings
In order to more clearly illustrate the embodiments of the present application or technical solutions in the prior art, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only the embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of example 1 of a processing method provided herein;
FIG. 2 is a flow chart of an embodiment 2 of a processing method provided by the present application;
FIG. 3 is a flow chart of embodiment 3 of a processing method provided by the present application;
FIG. 4 is a graphical interface diagram of embodiment 3 of a processing method provided herein;
FIG. 5 is a flow chart of an embodiment 4 of a processing method provided by the present application;
FIG. 6 is a flow chart of an embodiment 5 of a processing method provided by the present application;
FIG. 7 is a flow chart of an embodiment 6 of a processing method provided by the present application;
FIG. 8 is a schematic structural diagram of an embodiment of a processing apparatus provided herein;
fig. 9 is a flowchart of an embodiment of a processing method applied to a target storage component according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As shown in fig. 1, a flowchart of embodiment 1 of a processing method provided by the present application is applied to an electronic device, and the method includes the following steps:
step S101: obtaining log data of a target storage component;
the target storage component is a component having an information storage function in the electronic device, such as an SSD (solid state Drive), an HDD (Hard Disk Drive), and the like.
In the operation configuration, the respective parameters, states, and the like of the target storage unit are recorded in the log.
Specifically, the log data of the target storage component is obtained, that is, the information related to the operation of the target storage component is obtained.
Step S102: determining a state of the target storage component based at least on a value of a target field in a data structure of the log data;
the data structure in the log data has a plurality of fields, different fields can correspond to different attributes of the target storage component, and the data of each field changes according to the operating condition of the corresponding storage component.
Specifically, the log data is analyzed to determine the value of a particular target field in the data structure.
Accordingly, the state of the target storage unit can be determined based on the value of the target field in the obtained log data.
The following embodiments will explain the specific process of determining the state of the target storage unit in detail, and details are not described in this embodiment.
Step S103: outputting data information characterizing the state.
Wherein the data information is output so that the user can know the state of the target storage unit.
In a specific implementation, the data information may be output in a graph/graphical interface or a command line, etc., to report the performance status of the SSD, so that the user knows the performance status of the SSD.
In summary, the processing method provided in this embodiment includes: obtaining log data of a target storage component; determining a state of the target storage component based at least on a value of a target field in a data structure of the log data; outputting data information characterizing the state. In this embodiment, the state of the target storage component can be determined based on the value of the target field in the log data of the target storage component, and the data information is output, so that the state of the target storage component is determined based on the data information.
As shown in fig. 2, a flowchart of embodiment 2 of a processing method provided by the present application includes the following steps:
step S201: obtaining log data of a target storage component;
the target storage unit may be a storage unit provided in the electronic device, or may be a storage unit for another device.
In particular, the log of the smart device or the storage means when the device does not have a display unit
The specific implementation manner in this step may be one of the following:
firstly, directly sending a first command to the target storage component to read log data recorded by the target storage component;
the target storage component is a storage component of the electronic device, such as an SSD (solid state Disk), an HDD (Hard Disk Drive), and accordingly, the log data of the target storage component is read, which can be read in various ways. The specific reading mode is a one-to-three mode.
Specifically, when the target storage device is read by a BIOS (Basic Input Output System), the first command may be directly sent to the target storage device, so as to read the log data recorded by the target storage device.
Secondly, a first command is sent to the target storage component through a Universal Serial Bus (USB) to Serial Advanced Technology Attachment (SATA) chip so as to read log data recorded by the target storage component;
specifically, when the Embedded Controller/ESIO is read, the first command may be sent to the target storage component through a usb (universal Serial bus) to sata (Serial Advanced Technology attachment) chip, so as to indirectly read the log data recorded by the target storage component.
Thirdly, a first command is sent to the target storage component through a Serial Peripheral Interface (SPI) to Serial Advanced Technology Attachment (SATA) chip so as to read log data recorded by the target storage component;
specifically, when the application software reads the data, the first command may be sent to the target storage component through an spi (serial Peripheral interface) to SATA chip, so as to indirectly read the log data recorded by the target storage component.
Fourthly, sending a first command to a target storage component of the target equipment through the chip of the Internet of things so as to read log data recorded by the target storage component;
the target storage component is a storage component of target equipment connected with the electronic equipment, the target equipment can be intelligent equipment without a display unit such as a server or a sweeper or other storage components, correspondingly, log data of the target storage component can be read, and the log data can be read in multiple modes. The specific reading mode is a four-to-five mode.
The target equipment is connected with the electronic equipment through the Internet of things.
Correspondingly, the log data recorded in the target storage component can be read by the first command sent to the target storage component of the target device by the internet of things chip.
And fifthly, sending a first command to a target storage component of the target equipment through the Internet of things chip and the gateway equipment so as to read the log data recorded by the target storage component.
The target device is connected with the electronic device through the Internet of things and the gateway device.
Correspondingly, the log data recorded in the target storage component can be read by the first command sent to the target storage component of the target device by the internet of things chip and the gateway device.
In specific implementation, a corresponding specific implementation manner may be selected according to a practical connection situation between the target device and the electronic device.
Specifically, the first command may be a standard NVMe command, specifically a Get Log Page command.
Step S202: acquiring attribute information and identification information of log data in a first command;
and analyzing the first command to acquire the attribute information and the identification information of the log data carried by the first command.
Wherein the attribute information characterizes a target Log Page (Log Page) that can be determined based on the attribute information, the identification information characterizes a target Log identifier that can be determined in the target Log Page based on the identification information.
Accordingly, a target log page and a target log identifier stored in the target storage section can be determined based on the attribute information and the identification information of the log data.
Step S203: reading a numerical value of a target field corresponding to the identification information in a data structure of target log data corresponding to the attribute information;
the log page corresponding to the log attribute information contains a data structure, and the data structure can be data in a performance monitoring page.
Specifically, the log data of the target storage unit may be a Drive Performance Monitor Page (Drive Performance Monitor Page).
For example, the log data corresponding to the SSD Performance in the driver Performance Monitor Page specifically refers to a driver Performance Monitor Page data structure table dbh (drive Performance Monitor Page dbh) as follows.
Specifically, bits Byte0-511 are in the data structure table.
Wherein, Bytes 0-288 are reserved; bytes 289 write Performance level; bytes 290 read performance level; bytes 291-292: a write performance index; bytes 293-294: reading a performance index; bytes 295-.
Bytes 289 write Performance level. The expected performance level of subsequent write commands is reported in percentage. This value will be calculated and reported when the log is read DFh. Valid values are 0 to 100. The value 100 represents the maximum performance and 0 represents the minimum performance level.
Among them, the following tables 1-2 are tables of write performance values:
TABLE 1
TABLE 2
Bytes 290 read performance level. The expected performance level of subsequent read commands is reported as a percentage. This value will be calculated and reported when the log is read DFh. Valid values are 0 to 100. The value 100 represents the maximum performance and 0 represents the minimum performance level.
Among them, the following tables 3-4 are tables of read performance values:
TABLE 3
TABLE 4
The definition information of each bit in the bitmap of Bytes 291-.
TABLE 5
Bytes 291-292: a write performance index. This field contains a bitmap indicating that these entries are used as performance indices to quantify write performance. Each bit corresponds to a performance index type; multiple bits may be set to "1". If a bit is cleared to "0," the performance index is not applicable. Note that the bits in this field indicate the state of the last 10 seconds of association and are not persistent.
The definition information of each bit in the bitmap of Bytes 293-294 as shown in the following table 6.
TABLE 6
Bytes 293-294: a read performance index. This field contains a bitmap indicating that these entries are used as performance indices to quantify read performance. Each bit corresponds to a performance index type; multiple bits may be set to "1". If a bit is cleared to "0," the performance index is not applicable. Note that the bits in this field indicate the state of the last 10 seconds of association and are not persistent.
It should be noted that, the SSD FW (firmware) periodically polls and detects the working state of the current SSD according to the read/write performance index defined by the target fields (Bytes 291-.
Specifically, a data structure in the log page is determined based on the attribute information, and a value of the target field is determined based on the identification information.
Referring to the table, the values of the target fields corresponding to the attribute information and the identification information can be read.
Step S204: determining a performance state and/or an operational state of the target storage component based on the value of the target field and the data structure;
wherein different values of the target field characterize different states.
For example, a bit 06 value of byte291-292 of 1 indicates that severe over-temperature protection is occurring.
In particular, the performance and/or operational state of the target storage component is determined based on the value of the target field and the data structure.
Accordingly, the data information that can be output in the subsequent step S205 may be the target field and the value, or may be the performance status and/or the operation status corresponding to the target field and the value thereof.
In a specific implementation, the host may be provided with a read/write performance value table, and different performance value tables are adopted for the TCL or SLC modes for the flash memory blocks, and the performance values on the performance value tables are generated and filled based on the performance structure and/or the motion state on the target storage unit.
Accordingly, the performance value and/or its corresponding condition may be output when the performance condition is output.
Step S205: outputting data information characterizing the state.
Step S205 is the same as step S103 in embodiment 1, and details are not described in this embodiment.
In summary, in a processing method provided in this embodiment, determining a state of the target storage unit at least based on a value of a target field in a data structure of the log data includes: acquiring attribute information and identification information of log data in a first command; reading a numerical value of a target field corresponding to the identification information in a data structure of target log data corresponding to the attribute information; determining a performance state and/or an operational state of the target storage component based on the value of the target field and the data structure. In this embodiment, log data of a target storage component is obtained based on a first command, attribute information and identification information of the log data in the first command are obtained, a corresponding data structure and a numerical value of a target field are read, and then a performance state and/or an operating state of the target storage component can be determined based on the numerical value of the target field and the data structure.
As shown in fig. 3, a flowchart of embodiment 3 of a processing method provided by the present application includes the following steps:
step S301: obtaining log data of a target storage component;
the step S301 refers to a specific implementation manner of the step S201 in the embodiment 2, and details are not described in this embodiment.
Step S302: obtaining attribute information of log data in the first command;
and analyzing the first command to acquire the attribute information of the log data carried by the first command.
Wherein the attribute information characterizes a target Log Page (Log Page) that can be determined based on the attribute information.
Accordingly, a target log page stored in the target storage section can be determined based on the attribute information of the log data.
Step S303: reading the numerical value of each field in the data structure of the target log data corresponding to the attribute information;
the log page corresponding to the log attribute information contains a data structure, and the data structure can be data in a performance monitoring page.
Specifically, the log data of the target storage unit may be a drive performance monitoring page.
The meaning of each field in the data structure of the log data refers to the data structure table of the performance monitoring page driven in step S203 in embodiment 2, which is not described in detail in this embodiment.
Specifically, a data structure in the log page is determined based on the attribute information, and the numerical value of each field in the data structure characterizes the performance state and/or the motion state of the corresponding target storage unit.
And referring to the data structure table of the performance monitoring page of the driver, the value of the target field corresponding to the attribute information can be read.
Step S304: determining a performance state and/or an operational state of the target storage component based on the values of the fields and the data structure;
wherein, based on the values of the fields and the data structure, the performance status and/or the operation status of the target storage unit corresponding to the values of the fields are determined,
wherein different values of the target field characterize different states.
For example, a bit 06 value of byte291-292 of 1 indicates that severe over-temperature protection is occurring.
In particular, the performance and/or operational state of the target storage component is determined based on the value of the target field and the data structure.
Accordingly, the data information that can be output in the subsequent step S205 may be the target field and the value, or may be the performance status and/or the operation status corresponding to the target field and the value thereof.
Fig. 4 is a schematic diagram of a graphical interface for outputting a certain performance state of a target storage device, in which the horizontal axis represents time, the vertical axis represents performance, and the broken line represents the change of performance over a period of time.
Step S305: outputting data information characterizing the state.
Step S305 is the same as step S103 in embodiment 1, and is not described in detail in this embodiment.
In summary, the processing method provided in this embodiment, the determining the state of the target storage unit based on at least the value of the target field in the data structure of the log data includes: obtaining attribute information of log data in the first command; reading the numerical value of each field in the data structure of the target log data corresponding to the attribute information; determining a performance state and/or an operational state of the target storage component based on the values of the fields and the data structure. In this embodiment, by using the method, each performance state and operation state of the solid state disk can be accurately determined based on the first command.
As shown in fig. 5, a flowchart of embodiment 4 of a processing method provided by the present application includes the following steps:
step S501: obtaining log data of a target storage component;
step S502: determining a state of the target storage component based at least on a value of a target field in a data structure of the log data;
step S503: outputting data information representing the state;
steps S501 to 503 are the same as steps S101 to 103 in embodiment 1, and are not described in detail in this embodiment.
Step S504: a second command is obtained to control the target storage component to perform a performance optimization operation based at least on the second command.
When the cache space in the target storage component is full, data cannot be written continuously, and at this time, performance optimization operation needs to be performed on the target storage component.
In particular, the second command may be an NVMe instruction generated by the host software to the SSD.
Wherein the controlling the target storage component to perform the performance optimization operation based on at least the second command comprises:
if a target instruction set reported by the target storage component is obtained, generating a second command based on the target instruction set, and sending the second command to the target storage component to control the target storage component to execute garbage collection and/or cache cleaning operation;
and if the input optimized according to the current state of the target storage component is obtained, generating the second command based on the input, and sending the second command to the target storage component to control the target storage component to execute garbage collection and/or cache cleaning operation.
Wherein the second command is generated according to a condition of the target storage unit or an optimization instruction performed for the target storage unit.
Specifically, the target storage component reports a target instruction set according to a set period or rule, and when the target instruction set meets a set condition, the target storage component is characterized to be required to be cleaned, and then a second command is generated based on the target instruction value.
As a specific example, in the performance state and/or the running state of the target storage component as shown in embodiment 2, the 02 bit of the byte291-292 is set to "1" or the 02 bit of the byte293-294 is set to "1", both indicating that SLC to TLC data migration may be required during host I/O operation, or the 00 bit of the byte291-292 is set to "1", indicating that the dynamic SLC cache is disabled (when the SSD FW defined condition is met), in the above case, the second command is generated.
Specifically, the optimization instruction for the target storage component may be an instruction input by the user, or may be generated and input by the host software based on a set condition (e.g., a set period), and when receiving an input for optimizing the current state of the target storage component, the second command may be generated based on the input.
And after the second command is generated, sending the second command to the target storage component, and executing garbage collection and/or cache cleaning operation by the target storage component based on the second command so as to realize performance optimization of the target storage component.
The target storage unit is specifically an SSD, and the SSD stores in a TCL (ternary-Level Cell) mode and caches in an SLC (Single-Level Cell) mode. Since the SLC mode region cannot be cleared automatically in the prior art, in a specific implementation, the second command may indicate an operation to clear the SLC mode region.
After the region of the SLC mode is cleared, the region can continue to be cached, and the overall high storage performance of the NAND is ensured in cooperation with the storage of the TCL region.
Wherein, when the second command is an instruction indicating SLC cache inside the SSD case, the format of the second command is as shown in table 7 below.
TABLE 7
Wherein the FNV is an abbreviation of FLUSH NON-VOLATILE, which is used to instruct the SSD device to trigger a FLUSH action to its internal SLC cache.
In summary, the processing method provided in this embodiment further includes: a second command is obtained to control the target storage component to perform a performance optimization operation based at least on the second command. In this embodiment, the target storage component can be controlled to perform performance optimization operation based on the second command, so that the performance of the target storage component is improved.
As shown in fig. 6, a flowchart of embodiment 5 of a processing method provided by the present application includes the following steps:
step S601: obtaining log data of a target storage component;
the specific implementation process of step S601 is based on step S501 shown in embodiment 4, and includes other processes.
Specifically, the obtaining of the log data of the target storage component further includes any one of:
acquiring execution information which is reported by a target storage component and recorded according to a preset data structure and relates to garbage collection and/or cache cleaning operation;
after executing garbage collection and/or cache cleaning operation, the target storage component reports information of the operation, specifically, reports the information in a mode of recording a preset data structure.
Specifically, the execution information includes operation time and operation event, and the execution information is recorded according to a data structure of a log page.
In a specific implementation, the page for recording the execution information may specifically be an DEh log page.
The format of the log page is shown in table 8 below.
TABLE 8
And secondly, reading the execution information about the garbage collection and/or cache cleaning operation recorded in the data structure of the log data based on a first command sent to the target storage component.
The first command sent to the target storage component is targeted to read a data structure of log data, the data structure is recorded with execution information related to garbage collection and/or cache cleaning operation, the data structure of the log data is read based on the first command, and correspondingly, the execution information related to the garbage collection and/or cache cleaning operation recorded in the data structure is read.
After executing garbage collection and/or cache cleaning operation, the target storage component automatically stores the execution information thereof in the data structure of the log data.
The stored structure refers to the contents of the data structure described above.
Step S602: determining a state of the target storage component based at least on a value of a target field in a data structure of the log data;
step S603: outputting data information representing the state;
step S604: a second command is obtained to control the target storage component to perform a performance optimization operation based at least on the second command.
Steps S602 to 604 are the same as steps S502 to 504 in embodiment 4, and are not described in detail in this embodiment.
In summary, in a processing method provided in this embodiment, the obtaining log data of a target storage component further includes: acquiring execution information which is reported by a target storage component and recorded according to a preset data structure and relates to garbage collection and/or cache cleaning operation; or reading the execution information about the garbage collection and/or cache cleaning operation recorded in the data structure of the log data based on a first command sent to the target storage component. In this embodiment, two specific implementation manners for obtaining execution information about garbage collection and/or cache cleaning operations are provided, and the implementation flexibility is high.
As shown in fig. 7, a flowchart of embodiment 6 of a processing method provided by the present application includes the following steps:
step S701: obtaining log data of a target storage component;
step S702: determining a state of the target storage component based at least on a value of a target field in a data structure of the log data;
step S703: outputting data information representing the state;
steps S701 to 703 are the same as steps S101 to 103 in embodiment 1, and are not described in detail in this embodiment.
Step S704: and sending a first command to the target storage component at preset intervals so as to monitor the execution progress of the target storage component through the execution information about garbage collection and/or cache cleaning operation recorded in the log data.
Wherein execution information of garbage collection and/or cache scrubbing operations executed in the target storage component is automatically recorded in log data.
Correspondingly, the host sends a first command to the target storage component at preset intervals (cycles) to monitor the execution progress of the target storage component through the content recorded in the log data.
It should be noted that the host sends the first command to the target storage component at a preset interval, for example, 10 seconds, to monitor the execution progress of the target storage component, and when the progress status of the target storage component is monitored to be 100 and the remaining time is 0 second, the first command may be sent at another interval (for example, 1 second) to obtain the content recorded in the log data.
And if the first command is sent before the second command is sent to the target storage component, obtaining the progress information of the target storage component which is updated recently and executes garbage collection and/or cache cleaning.
It should be noted that the second command is a command for controlling the target storage device to perform garbage collection and/or cache scrubbing operation, and if the first command is sent before the second command is sent to the target storage device, progress information of performing garbage collection and/or cache scrubbing by the target storage device, which is the latest updated progress information, can be obtained based on the first command.
In summary, the processing method provided in this embodiment further includes: and sending a first command to the target storage component at preset intervals so as to monitor the execution progress of the target storage component through the execution information about garbage collection and/or cache cleaning operation recorded in the log data. In this embodiment, the first command may be sent to the target storage component at a preset time interval, and the execution progress of the garbage collection and/or cache cleaning operation performed by the target storage component is monitored through the content recorded in the log data, so as to achieve the purpose of monitoring.
Corresponding to the embodiment of the processing method provided by the application, the application also provides an embodiment of a processing device corresponding to the processing method.
Fig. 8 is a schematic structural diagram of an embodiment of a processing apparatus provided in the present application, where the processing apparatus is applied to an electronic device, and the apparatus includes the following structures: an acquisition module 801, an analysis module 802 and an output module 803;
the obtaining module 801 is configured to obtain log data of a target storage component;
wherein the analysis module 802 is configured to determine a status of the target storage unit based on at least a value of a target field in a data structure of the log data;
wherein, the output module 803 is configured to output data information representing the state.
Optionally, the obtaining log data of the target storage component includes:
directly sending a first command to the target storage component to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to the target storage component through a Universal Serial Bus (USB) to Serial Advanced Technology Attachment (SATA) chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to the target storage component through a Serial Peripheral Interface (SPI) to Serial Advanced Technology Attachment (SATA) chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to a target storage component of target equipment through an Internet of things chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to a target storage component of target equipment through an Internet of things chip and gateway equipment so as to read log data recorded by the target storage component.
Optionally, determining the state of the target storage unit at least based on the value of the target field in the data structure of the log data includes:
acquiring attribute information and identification information of log data in the first command;
reading a numerical value of a target field corresponding to the identification information in a data structure of target log data corresponding to the attribute information;
determining a performance state and/or an operational state of the target storage component based on the value of the target field and the data structure.
Optionally, determining the state of the target storage unit at least based on the value of the target field in the data structure of the log data includes:
obtaining attribute information of log data in the first command;
reading the numerical value of each field in the data structure of the target log data corresponding to the attribute information;
determining a performance state and/or an operational state of the target storage component based on the values of the fields and the data structure.
Optionally, the method further includes:
a second command is obtained to control the target storage component to perform a performance optimization operation based at least on the second command.
Optionally, wherein controlling the target storage unit to perform a performance optimization operation based on at least the second command includes:
if a target instruction set reported by the target storage component is obtained, generating a second command based on the target instruction set, and sending the second command to the target storage component to control the target storage component to execute garbage collection and/or cache cleaning operation;
and if the input optimized according to the current state of the target storage component is obtained, generating the second command based on the input, and sending the second command to the target storage component to control the target storage component to execute garbage collection and/or cache cleaning operation.
Optionally, obtaining the log data of the target storage component further includes:
acquiring execution information which is reported by a target storage component and recorded according to a preset data structure and relates to garbage collection and/or cache cleaning operation; or the like, or, alternatively,
and reading the execution information about the garbage collection and/or cache cleaning operation recorded in the data structure of the log data based on a first command sent to the target storage component.
Optionally, the method further includes:
and sending a first command to the target storage component at preset intervals so as to monitor the execution progress of the target storage component through the execution information about garbage collection and/or cache cleaning operation recorded in the log data.
Optionally, if the first command is sent before the second command is sent to the target storage component, obtaining the progress information of performing garbage collection and/or cache cleaning on the target storage component which is updated recently.
In summary, the processing apparatus provided in this embodiment includes: the acquisition module is used for acquiring the log data of the target storage component; an analysis module to determine a state of the target storage component based at least on a value of a target field in a data structure of the log data; and the output module is used for outputting the data information representing the state. According to the scheme, the state of the target storage component can be determined based on the numerical value of the target field in the log data of the target storage component, and the data information is output, so that the state of the target storage component is determined based on the data information.
Corresponding to the embodiment of the processing method applied to the host side provided by the present application, the present application also provides an embodiment of a method applied to the storage component side.
As shown in fig. 9, a flowchart of embodiment 1 of a processing method applied to a storage component end is provided, where the method includes the following steps:
step S901: periodically polling and detecting the current working state of the target storage component;
step S902: determining a value of a corresponding target field in a performance monitoring page data structure based on the current working state;
it should be noted that the method in the present embodiment is applied to the SSD FW.
Specifically, the SSD FW periodically polls and detects the working state of the current SSD according to the read/write performance indexes defined by the target fields (e.g., Bytes 291-.
The principle of setting the bit value of the read/write performance index to 1 or 0 refers to tables 5 to 6.
Specifically, the SSD FW fills the values of the bit positions of the performance read/write index into the corresponding fields in the data structure according to the values of the current bit positions defined by the target fields (such as Bytes 291-.
And determining the defined performance condition of the current bit value corresponding to the target field in the performance monitoring page data structure, and determining the corresponding performance value based on the calculation method defined in the table 1-2, such as a mode of overlapping and combining the performance conditions.
Step S903: and filling the value of the target field into a corresponding field in a data structure of a performance monitoring data table.
Specifically, the determined corresponding performance value is filled into a corresponding field in the data structure of the performance monitoring data table, so as to be used for reading and calling by the host software.
Wherein the corresponding fields are Bytes 289 and 290 in the data structure.
In specific implementation, the host software sends a standard NVMe Get Log Page instruction to acquire values of fields in a performance monitoring Page data structure, and the host software outputs the acquired performance state of the SSD to a user in a suitable form, such as a graphical interface or a command line, and reports the performance state of the SSD.
Corresponding to the embodiment of the processing method provided by the application, the application also provides the electronic equipment and the readable storage medium corresponding to the processing method.
Wherein, this electronic equipment includes: a memory, a processor;
wherein, the memory stores a processing program;
the processor is used for loading and executing the processing program stored in the memory so as to realize the steps of the processing method according to any one of the above items.
Specifically, the implementation processing method of the electronic device may refer to the foregoing processing method embodiment.
Wherein the readable storage medium has stored thereon a computer program which is called and executed by a processor to implement the steps of the processing method according to any one of the preceding claims.
Specifically, the computer program stored in the readable storage medium executes the implementation processing method, and reference may be made to the foregoing processing method embodiments.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the device provided by the embodiment, the description is relatively simple because the device corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
The previous description of the provided embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features provided herein.
Claims (10)
1. A method of processing, comprising:
obtaining log data of a target storage component;
determining a state of the target storage component based at least on a value of a target field in a data structure of the log data;
outputting data information characterizing the state.
2. The method of claim 1, wherein obtaining log data for a target storage component comprises:
directly sending a first command to the target storage component to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to the target storage component through a Universal Serial Bus (USB) to Serial Advanced Technology Attachment (SATA) chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to the target storage component through a Serial Peripheral Interface (SPI) to Serial Advanced Technology Attachment (SATA) chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to a target storage component of target equipment through an Internet of things chip so as to read log data recorded by the target storage component; or the like, or, alternatively,
sending a first command to a target storage component of target equipment through an Internet of things chip and gateway equipment so as to read log data recorded by the target storage component.
3. The method of claim 2, determining the state of the target storage component based at least on a value of a target field in a data structure of the log data, comprising:
acquiring attribute information and identification information of log data in the first command;
reading a numerical value of a target field corresponding to the identification information in a data structure of target log data corresponding to the attribute information;
determining a performance state and/or an operational state of the target storage component based on the value of the target field and the data structure.
4. The method of claim 2, determining the state of the target storage component based at least on a value of a target field in a data structure of the log data, comprising:
obtaining attribute information of log data in the first command;
reading the numerical value of each field in the data structure of the target log data corresponding to the attribute information;
determining a performance state and/or an operational state of the target storage component based on the values of the fields and the data structure.
5. The method of claim 1, further comprising:
a second command is obtained to control the target storage component to perform a performance optimization operation based at least on the second command.
6. The method of claim 5, wherein controlling the target storage component to perform a performance optimization operation based at least on the second command comprises:
if a target instruction set reported by the target storage component is obtained, generating a second command based on the target instruction set, and sending the second command to the target storage component to control the target storage component to execute garbage collection and/or cache cleaning operation;
and if the input optimized according to the current state of the target storage component is obtained, generating the second command based on the input, and sending the second command to the target storage component to control the target storage component to execute garbage collection and/or cache cleaning operation.
7. The method of claim 6, wherein obtaining log data for a target storage component further comprises:
acquiring execution information which is reported by a target storage component and recorded according to a preset data structure and relates to garbage collection and/or cache cleaning operation; or the like, or, alternatively,
and reading the execution information about the garbage collection and/or cache cleaning operation recorded in the data structure of the log data based on a first command sent to the target storage component.
8. The method of any of claims 1 to 7, further comprising:
and sending a first command to the target storage component at preset intervals so as to monitor the execution progress of the target storage component through the execution information about garbage collection and/or cache cleaning operation recorded in the log data.
9. The method of claim 8, wherein,
and if the first command is sent before the second command is sent to the target storage component, obtaining the latest updated progress information of the target storage component for performing garbage collection and/or cache cleaning.
10. A processing apparatus, comprising:
the acquisition module is used for acquiring the log data of the target storage component;
an analysis module to determine a state of the target storage component based at least on a value of a target field in a data structure of the log data;
and the output module is used for outputting the data information representing the state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110134876.5A CN112799593A (en) | 2021-02-01 | 2021-02-01 | Processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110134876.5A CN112799593A (en) | 2021-02-01 | 2021-02-01 | Processing method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112799593A true CN112799593A (en) | 2021-05-14 |
Family
ID=75813318
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110134876.5A Pending CN112799593A (en) | 2021-02-01 | 2021-02-01 | Processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112799593A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114265549A (en) * | 2021-11-21 | 2022-04-01 | 山东云海国创云计算装备产业创新中心有限公司 | NVMe command processing method and device and readable storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1641607A (en) * | 2004-01-14 | 2005-07-20 | 国际商业机器公司 | Method and apparatus for maintaining performance monitoring structures in a page table for use in monitoring performance of a computer program |
CN102239472A (en) * | 2008-09-05 | 2011-11-09 | Arc景象有限责任公司 | Storing log data efficiently while supporting querying |
CN105159602A (en) * | 2015-08-03 | 2015-12-16 | 联想(北京)有限公司 | Data processing method and storage device |
CN106095329A (en) * | 2016-05-27 | 2016-11-09 | 浪潮电子信息产业股份有限公司 | A kind of management method of Intel SSD hard disk based on NVME interface |
CN107451003A (en) * | 2017-06-30 | 2017-12-08 | 郑州云海信息技术有限公司 | The method of testing and device of a kind of storage system |
CN109407990A (en) * | 2018-10-19 | 2019-03-01 | 郑州云海信息技术有限公司 | A kind of solid state hard disk |
CN109901794A (en) * | 2017-12-11 | 2019-06-18 | 爱思开海力士有限公司 | The device and method of garbage collection are operated using Host Idle |
CN110069371A (en) * | 2019-04-11 | 2019-07-30 | 深圳大普微电子科技有限公司 | A kind of method and solid state hard disk identifying solid state hard disk performance |
US20200125553A1 (en) * | 2017-06-21 | 2020-04-23 | Huawei Technologies Co., Ltd. | Systems and methods for management of a log-structure |
-
2021
- 2021-02-01 CN CN202110134876.5A patent/CN112799593A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1641607A (en) * | 2004-01-14 | 2005-07-20 | 国际商业机器公司 | Method and apparatus for maintaining performance monitoring structures in a page table for use in monitoring performance of a computer program |
CN102239472A (en) * | 2008-09-05 | 2011-11-09 | Arc景象有限责任公司 | Storing log data efficiently while supporting querying |
CN105159602A (en) * | 2015-08-03 | 2015-12-16 | 联想(北京)有限公司 | Data processing method and storage device |
CN106095329A (en) * | 2016-05-27 | 2016-11-09 | 浪潮电子信息产业股份有限公司 | A kind of management method of Intel SSD hard disk based on NVME interface |
US20200125553A1 (en) * | 2017-06-21 | 2020-04-23 | Huawei Technologies Co., Ltd. | Systems and methods for management of a log-structure |
CN107451003A (en) * | 2017-06-30 | 2017-12-08 | 郑州云海信息技术有限公司 | The method of testing and device of a kind of storage system |
CN109901794A (en) * | 2017-12-11 | 2019-06-18 | 爱思开海力士有限公司 | The device and method of garbage collection are operated using Host Idle |
CN109407990A (en) * | 2018-10-19 | 2019-03-01 | 郑州云海信息技术有限公司 | A kind of solid state hard disk |
CN110069371A (en) * | 2019-04-11 | 2019-07-30 | 深圳大普微电子科技有限公司 | A kind of method and solid state hard disk identifying solid state hard disk performance |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114265549A (en) * | 2021-11-21 | 2022-04-01 | 山东云海国创云计算装备产业创新中心有限公司 | NVMe command processing method and device and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7326379B2 (en) | Hard disk failure countermeasures, array controllers, and hard disks | |
US10147048B2 (en) | Storage device lifetime monitoring system and storage device lifetime monitoring method thereof | |
US7444483B2 (en) | Management apparatus, management method and storage management system | |
CN103218173B (en) | Storage controlling method and device | |
US7992061B2 (en) | Method for testing reliability of solid-state storage medium | |
EP2942715A1 (en) | Data migration method, data migration apparatus and storage device | |
CN105468484A (en) | Method and apparatus for determining fault location in storage system | |
CN108733579B (en) | Method for providing window of opportunity hints for background operations in solid state disk and solid state disk | |
CN107515731B (en) | Evolution storage system based on solid-state disk and working method thereof | |
KR102302649B1 (en) | Dynamic bandwidth reporting for solid-state drives | |
US11507502B2 (en) | Data storage device performance prediction based on valid fragment count | |
EP4078380A1 (en) | Behavior-driven die management on solid-state drives | |
CN111949488A (en) | Hard disk fault prediction method and system, electronic equipment and storage medium | |
CN112799593A (en) | Processing method and device and electronic equipment | |
CN116662214A (en) | Hard disk garbage recycling method, device, system and medium based on fio | |
KR20200100185A (en) | Hard disk drive life prediction | |
WO2020048442A1 (en) | Hard disk fault processing method, array controller and hard disk | |
CN112650446A (en) | Intelligent storage method, device and equipment of NVMe full flash memory system | |
US10776240B2 (en) | Non-intrusive performance monitor and service engine | |
WO2014155228A1 (en) | A primary memory module with a record of usage history and applications of the primary memory module to a computer system | |
CN114116357A (en) | Automatic test method, device and tool for hard disk | |
CN115237641A (en) | Fault detection method and device, electronic equipment and readable medium | |
CN112732179A (en) | Data management method of SSD (solid State disk) and related device | |
KR101966394B1 (en) | Apparatus and method for lifetime prediction of storage device | |
US20210081130A1 (en) | Method, device, and product for managing scrubbing operation in storage system |
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 |