Abnormal positioning method of storage device, related device and storage medium
By replacing reserved or invalid fields with timestamps in the hardware cache of storage devices and storing recorded events, the problems of long time, high cost and poor compatibility in locating storage device anomalies in existing technologies are solved, and fast and accurate anomaly location is achieved.
Patent Information
- Application Number
- CN202411111968.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies suffer from problems such as long processing time, high cost, poor compatibility, and incomplete information when locating storage device anomalies, making it difficult to accurately reproduce the interaction content and timing of the anomaly.
By detecting the presence of General Flash Memory Protocol (GLP) information units in the hardware cache of the storage device, replacing their reserved or invalid fields with timestamps, and storing the recorded events in the data buffer, the interaction content and timing between the storage device and the host are determined based on these recorded events.
It enables rapid and accurate location of storage device anomalies, improving location efficiency and accuracy, reducing costs, and enhancing platform compatibility.
Smart Images

Figure CN121523601A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure belongs to the technical field of storage, and particularly relates to an abnormality positioning method of a storage device, a related device and a storage medium. BACKGROUND
[0002] A storage system usually includes a computer device (also referred to as a host) and a storage device (also referred to as a storage chip), which can be a Universal Flash Storage (UFS). The storage device can include a controller and a memory (for example, a Flash). During the development of the storage device, it needs to be verified and debugged for a long time, and maintained after mass production. During this process, technicians may encounter various difficult-to-solve abnormal problems. These abnormal problems usually need to be solved within a tight time limit, so timely positioning of the causes of the abnormality and solving are essential in the debugging work of the storage device. At present, the following methods are usually used to locate the abnormality: one is to reproduce the abnormal scene by accessing a protocol analyzer to capture trace information, and then analyze and locate. This abnormality positioning method has the following problems: first, it needs to reproduce the abnormal scene, which (especially in the case of a customer site or difficult and long reproduction) requires a lot of time and labor cost. Second, the protocol analyzer has high equipment cost, large size and is not easy to carry, has specific requirements for the placement platform of the storage device, has poor compatibility, may reduce the signal quality, introduce other problems, and increase the difficulty of reproducing the abnormal scene. The other is to print out Debug (debug) information at different stages of firmware (FW) execution, and analyze and locate by viewing the Debug information of the firmware. Although this abnormality positioning method can directly export debug logs from the abnormal scene for analysis, it still has the following problems: first, the Debug information usually only includes important state information, and in order to ensure the performance of the chip, these information is usually simplified and cannot fully and clearly reflect the interaction content between the host and the storage device in the abnormal scene, so it cannot well help the technicians to locate the abnormality. Second, the Debug information is controlled by the FW to print, and the printing state and sequence of the Debug information are affected by various factors such as the reporting strategy of the hardware (HW), the implementation of the FW, and thus the Debug information cannot reflect the actual command issuing time and sequence of the host. SUMMARY
[0003] In view of the above problems, this disclosure provides a method, related apparatus and storage medium for anomaly localization of storage devices, which aims to determine the UFS command interaction content and timing between the storage device and the host based on the recorded events stored in the data buffer of the storage device, thereby locating the cause of the anomaly in the storage device and improving the efficiency and accuracy of anomaly localization of storage devices.
[0004] According to a first aspect of this disclosure, a method for anomaly localization of a storage device is provided, comprising:
[0005] Detect the presence of General Flash Memory Protocol (GPLP) information units in the hardware cache of the storage device;
[0006] When the General Flash Storage Protocol (GPLP) information unit is detected, the first field in the GPLP information unit is deleted so that a timestamp is stored at that location, so as to obtain the record event of the GPLP storage command corresponding to the GPLP information unit. The first field includes one or more of a reserved field and an invalid information field.
[0007] The recorded event is stored in the data buffer of the storage device;
[0008] Based on the recorded events, the content and timing of the general flash storage command interactions between the storage device and the host under abnormal conditions are obtained, thereby locating the cause of the abnormality in the storage device.
[0009] Optionally, the data structure of the General Flash Memory Protocol (GPLP) information unit includes a transaction type field, and after detecting whether the GPLP information unit exists in the hardware cache of the storage device, the anomaly localization method further includes:
[0010] Upon detecting the General Flash Storage Protocol (GSP) information unit, the transaction type field is compared with the target transaction type field;
[0011] Based on the comparison results, it is determined that the first general flash memory storage protocol information unit needs to be stored in the data buffer, wherein the transaction type field in the first general flash memory storage protocol information unit matches the target transaction type field.
[0012] Optionally, the data structure of the general flash storage protocol information unit includes a transaction type field, and after storing the recorded event in the data buffer of the storage device, the anomaly location method further includes:
[0013] The transaction type field corresponding to the recorded event stored in the data buffer is compared with the target transaction type field. Based on the comparison result, a first recorded event is determined, wherein the transaction type field corresponding to the first recorded event matches the target transaction type field.
[0014] Optionally, after detecting whether a General Flash Memory Protocol (GPLP) information unit exists in the hardware cache of the storage device, the anomaly localization method further includes:
[0015] Upon detecting the General Flash Memory Protocol (GPLP) information unit, a truncation operation is performed on the GPLP information unit to extract a predetermined number of bytes from the beginning of the GPLP information unit.
[0016] Optionally, before storing the recorded event in the data buffer of the storage device, the anomaly localization method further includes:
[0017] The first field corresponding to the recorded event is deleted so that the state-related information of the storage device can be stored at that location.
[0018] Optionally, storing the recorded event in the data buffer of the storage device includes:
[0019] Determine whether there is free space in the data buffer; if so, store the recorded event in the free space.
[0020] If not, the earliest stored record event in the data buffer is deleted in a first-in-first-out order in order to store the current record event.
[0021] Optionally, after storing the recorded event in the data buffer of the storage device, the anomaly localization method further includes:
[0022] The recorded event is read from the data buffer and organized into a predetermined format. The predetermined format includes a second field, which includes the timestamp corresponding to the recorded event, the time interval between the timestamp corresponding to the recorded event and the next recorded event, and the name and fields of the general flash memory storage protocol information unit corresponding to the recorded event.
[0023] According to a second aspect of this disclosure, an anomaly location device for a storage device is provided, comprising:
[0024] The packet detection unit is used to detect whether there are General Flash Memory Protocol information units in the hardware cache of the storage device;
[0025] The field replacement unit is used to delete the first field in the general flash storage protocol information unit when the general flash storage protocol information unit is detected so as to store a timestamp at the location, so as to obtain the record event of the general flash storage command corresponding to the general flash storage protocol information unit. The first field includes one or more of a reserved field and an invalid information field.
[0026] An event recording storage unit is used to store the recorded events in the data buffer of the storage device;
[0027] An anomaly localization unit is used to obtain the general flash memory storage command interaction content and timing of the storage device and the host under the abnormal situation based on the recorded events, and then locate the cause of the anomaly in the storage device.
[0028] According to a third aspect of this disclosure, a storage system is provided, comprising:
[0029] Host;
[0030] The storage device includes the anomaly location device described above, which is used to obtain the general flash storage command interaction content and timing between the storage device and the host based on the recorded events stored in the data buffer of the storage device, and then locate the cause of the anomaly in the storage device.
[0031] According to a fourth aspect of this disclosure, a storage medium is provided that stores a computer program or instructions, which, when executed by a processor, implement the steps of the method described above.
[0032] This disclosure brings the following beneficial effects:
[0033] The anomaly localization method for storage devices disclosed herein detects the presence of a General Flash Memory Protocol (GPLP) information unit in the hardware cache of the storage device. Upon detection of a GPLP information unit, the first field of that GPLP information unit is replaced with a timestamp to obtain a record event of the GPLP command corresponding to that GPLP information unit. The first field includes one or more of a reserved field and an invalid information field. The record event is stored in the data buffer of the storage device. Based on the record event, the interaction content and timing of the GPLP commands between the storage device and the host at the anomaly site are determined, thereby locating the cause of the anomaly in the storage device. Thus, the record event includes fields related to the GPLP command and a timestamp, accurately reproducing the interaction content and timing of the GPLP commands between the storage device and the host at the anomaly site. This allows for rapid and accurate localization of the cause of the storage device anomaly based on complete and clear interaction content and timing, improving the accuracy and efficiency of anomaly localization.
[0034] It does not require additional equipment or specific platforms and can be directly compatible with any abnormal situation, improving the platform compatibility of storage device anomaly location and reducing time and cost.
[0035] Since the recorded events stored in the data buffer of the storage device include fields related to general flash memory storage commands and timestamps, the anomaly localization method of this disclosure can be applied to the performance debugging of chips. The execution time of general flash memory storage commands can be obtained based on the timestamps and fields related to general flash memory storage commands, making the chip debugging of storage devices more efficient.
[0036] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objects and other advantages of this disclosure are realized and obtained through the structures particularly pointed out in the description and the drawings.
[0037] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0038] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0039] Figure 1 This is a schematic diagram of the structure of a storage system provided according to an embodiment of the present disclosure;
[0040] Figure 2 This is a flowchart illustrating a method for locating an anomaly in a storage device according to an embodiment of the present disclosure.
[0041] Figure 3 A schematic diagram showing a general UPIU data structure provided according to an embodiment of the present disclosure is shown;
[0042] Figure 4 A schematic diagram illustrating the correspondence between the name of a UPIU and the transaction type field according to an embodiment of this disclosure is shown.
[0043] Figure 5A A schematic diagram illustrating the data structure of recorded events of UPIUs other than Command UPIUs received by a storage device according to an embodiment of the present disclosure;
[0044] Figure 5B A schematic diagram illustrating the data structure of a recording event of a Command UPIU received by a storage device according to an embodiment of the present disclosure;
[0045] Figure 5C A schematic diagram illustrating the data structure of a UPIU recording event sent by a storage device according to an embodiment of the present disclosure;
[0046] Figure 6 This diagram illustrates the structure of a data buffer according to an embodiment of the present disclosure;
[0047] Figure 7 A schematic diagram illustrating the structure of a predetermined format for recording events according to an embodiment of the present disclosure is shown.
[0048] Figure 8 This is a flowchart illustrating a method for locating an anomaly in a storage device according to an embodiment of the present disclosure.
[0049] Figure 9 This is a flowchart illustrating a method for locating an anomaly in a storage device according to an embodiment of the present disclosure.
[0050] Figure 10 This is a schematic diagram of the structure of an anomaly location device for a storage device according to an embodiment of the present disclosure;
[0051] Figure 11 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present disclosure. Detailed Implementation
[0052] Various embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. In the various drawings, the same elements are indicated by the same or similar reference numerals. For clarity, the various portions in the drawings are not drawn to scale.
[0053] The following terms are used in this document:
[0054] Universal Flash Storage (UFS) is a universal flash storage interface protocol used in mobile devices and other terminal devices. It can also represent the name of a storage device that uses this protocol. UFS commands are instructions used for data exchange between UFS devices and UFS hosts.
[0055] The Universal Flash Storage Protocol Information Unit (UPIU) is a data packet used in the UFS protocol to transmit commands, data, and status information. It is the basic unit for data exchange in the UFS protocol. UFS commands are encapsulated into UPIUs for transmission between UFS devices and UFS hosts.
[0056] An abnormal scenario refers to the state of a system when an anomaly or error occurs. This includes the state of the CPU (such as the value of the program counter and registers), the state of memory (such as the data in memory), and the state of devices (such as the device's operating status and input / output status). This state information is crucial for locating and handling anomalies.
[0057] Figure 1 A schematic diagram of the structure of a storage system provided according to an embodiment of the present disclosure is shown. For example... Figure 1 As shown, the storage system 100 provided in this embodiment includes a computer device 110 and a storage device 120, wherein the storage device 120 can be understood as an external storage device of the computer device 110. In some embodiments, the storage device 120 may be a universal flash storage (UFS) memory. In some embodiments, the computer device 110 may be a device with a storage device 120, such as a mobile phone, tablet computer, PC, wearable device, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. This embodiment does not limit the specific type of the computer device 110.
[0058] In some embodiments, storage device 120 may include a controller 121 and a memory (e.g., Flash) 122. The controller 121 includes a data buffer 123, firmware (FW) 124, and an anomaly detection device 125. In some embodiments, an operating system may run on the computer device 110, which can be understood as the host 111 of the storage device 120. The host 111 can send instructions (including read / write commands, Trim commands, and FW-related task commands) to the firmware 124 according to protocol specifications (e.g., SCSI protocol, Small Computer System Interface) through the physical layer interface between the computer device 110 and the storage device 120 (e.g., an interface defined according to the MPHY physical layer interface standard). When the host 111 sends a write command to the firmware 124, the firmware 124 can write data to the memory 122 according to the write command. When the host 111 sends a read command to the firmware 124, the firmware 124 can read data from the memory 122 according to the read command and return the read data to the host 111. It should be noted that, for ease of description, Figure 1Taking the computer device 110 as an example, which does not include the storage device 120, the storage device 120 can also be included as part of the computer device 110.
[0059] In some embodiments, the anomaly location device 125 detects whether a UPIU exists in the hardware of the storage device 120. If a UPIU is detected, the first field in the UPIU is replaced with a timestamp to obtain a record event of the UFS command corresponding to that UPIU. The first field includes one or more of a reserved field and an invalid information field. The record event is stored in the data buffer 123 of the storage device 120. Based on the record event, the content and timing of the UFS command interaction between the storage device 120 and the host 111 are determined, thereby locating the cause of the anomaly in the storage device 120. It should be noted that, for ease of description, Figure 1 Taking the absence of the abnormal location device 125 as an example, the components of firmware 124 can be alternatively made to include the abnormal location device 125 as part of firmware 124.
[0060] Since the process of locating the cause of the anomaly in the storage device 120 using the anomaly location method in this embodiment will be described in detail below, it will not be repeated here.
[0061] Figure 2 This is a schematic flowchart illustrating a method for locating anomalies in a storage device according to an embodiment of the present disclosure. The anomaly location method of this embodiment can be executed by an anomaly location device 125. (See also...) Figure 2 The anomaly localization method includes steps S210 to S240.
[0062] In step S210, it is detected whether a General Flash Memory Protocol (GPLP) information unit exists in the hardware cache of the storage device.
[0063] In some embodiments, the hardware of storage device 120 refers to the physical structure and components of the chip, which determine the chip's basic functions and performance. Data exchange between host 111 and storage device 120 is achieved by encapsulating UFS commands (including UFS commands sent from host 111 to storage device 120 and UFS commands sent from storage device 120 to host 111) into UPIUs and transmitting the UPIUs. All UPIUs transmitted between host 111 and storage device 120 are processed by the hardware of storage device 120. Therefore, in this embodiment, it is possible to detect whether a UPIU exists in the hardware cache of storage device 120, that is, to detect whether a UPIU is being executed or has already been executed in the hardware cache of storage device 120.
[0064] In some embodiments, the UPIUs being executed or already executed in the hardware of storage device 120 may include two types: one type is UPIUs received by storage device 120, including: COMMAND UPIU, DATAOUT UPIU, TASKMANAGEMENT REQUEST UPIU, QUERY REQUEST UPIU, and NOP OUT UPIU; the other type is UPIUs sent by storage device 120, including: REPONSE UPIU, READY TO TRANSFER UPIU, DATA IN UPIU, TASKMANAGEMENT RESPONSE UPIU, QUERY RESPONSE UPIU, and NOP IN UPIU. In some embodiments, the data structure of the UPIU in this disclosure includes a Transaction Type field. Figure 3 A schematic diagram illustrating a general UPIU data structure provided according to an embodiment of the present disclosure is shown. Figure 3 As shown, a typical UPIU data structure may include a Transaction Type field, Flags field, Logical Unit Number (LUN) field, Task Tag field, Initiator ID field, Command Set Type field, Query Function and Task Management Function fields, Response field, Status field, Total EHS Length field, Device Information field, Data Segment Length field, Transaction Specific Fields field, Extra Header Segment field, Header E2ECRC field, Data Segment field, and Data E2ECRC field. The header length can be 12 bytes, but is not limited to this. The minimum length of a UPIU is 32 bytes and the maximum is 65,600 bytes, but is not limited to these. The transaction type field indicates the type of request or response contained in the data structure. For example, the transaction type field can include a transaction code, which can define the content, function, or use of the UPIU. Each transaction code corresponds one-to-one with a UPIU name. Figure 4This diagram illustrates the correspondence between the name of a UPIU and the transaction type field according to an embodiment of this disclosure. Figure 4 As shown, the transaction codes for the transaction type field differ for different UPIU names. For example, the transaction code for the transaction type field in Command UPIU is '00 0001b', while the transaction code for the transaction type field in Response UPIU is '10 0001b'.
[0065] In some embodiments, when a UPIU is detected in the hardware cache of storage device 120 (i.e., a UPIU being executed or already executed exists in the hardware cache of storage device 120), the transaction type field in the UPIU is compared with the target transaction type field. Based on the comparison result, it is determined that the first UPIU needs to be stored in data buffer 123. It is understood that the transaction type field in the first UPIU matches the target transaction type field. It should be noted that the target transaction type field may be related to the business project executed by storage device 120 and can be set by technical personnel. By selectively storing the first UPIU in data buffer 123 based on the target transaction type field, it is possible to record only UPIUs of the transaction types of interest in the cache space, without storing UPIUs of other uninterested transaction types, thus improving UPIU storage efficiency and consequently improving the anomaly detection efficiency of storage device 120.
[0066] In some embodiments, when a UPIU is detected in the hardware cache of storage device 120 (i.e., a UPIU being executed or already executed exists in the hardware cache of storage device 120), a truncation operation is performed on the UPIU to truncate the first predetermined number (e.g., 32) bytes of the UPIU. Return to Reference Figure 3For a typical UPIU, the first 32 bytes, consisting of the Transaction Type field, Flags field, Logical Unit Number (LUN) field, TaskTag field, Initiator ID field, Command Set Type field, Query Function and Task Management Function fields, Response field, Status field, Total EHS Length field, Device Information field, Data Segment Length field, and TransactionSpecific Fields field, can be extracted. It is understood that step S220 can be executed on the UPIU after the extraction operation.
[0067] In step S220, when the General Flash Storage Protocol (GPLP) information unit is detected, the first field in the GPLP information unit is deleted so that a timestamp is stored at that location, so as to obtain the record event of the GPLP storage command corresponding to the GPLP information unit. The first field includes one or more of a reserved field and an invalid information field.
[0068] In some embodiments, the UPIU data structure includes a first field, which includes one or more of a reserved field and an invalid information field. It is understood that the invalid information field is a field with a fixed value across all UPIUs, such as the Total EHS Length field, whose value is fixed at '0' across all UPIUs. For example, the Data SegmentLength field, whose value is the same across all Command UPIUs. The reserved field is a pre-defined blank field in the UPIU data structure. In some embodiments, the first field also includes fields unrelated to abnormal location of the storage device.
[0069] In some embodiments, when a UPIU is detected in the hardware cache of storage device 120 (i.e., a UPIU being executed or already executed exists in the hardware cache of storage device 120), the first field in the UPIU is deleted so that a timestamp is stored at that location to obtain the record event of the UFS command corresponding to the UPIU. It should be noted that the timestamp can be the system time when the UPIU is detected in the hardware cache of storage device 120, the system time when the hardware of storage device 120 executes the UPIU, or the system time when the hardware of storage device 120 finishes executing the UPIU. The timestamp only needs to represent the timing of the hardware execution of the UPIU by storage device 120; this disclosure is not limited in this regard. Figure 5A This diagram illustrates a data structure for recording events of UPIUs other than the Command UPIU received by a storage device according to an embodiment of the present disclosure. Figure 5A As shown, the Reserved field and the Total EHS Length field are replaced with a timestamp. In some embodiments, after deleting the first field in the UPIU to store the timestamp at that location, the first field corresponding to the record event of the UFS command corresponding to the UPIU can also be deleted to store the status information of the storage device 120 at that location. Figure 5B A schematic diagram illustrating the data structure of a Command UPIU recording event received by a storage device according to an embodiment of the present disclosure is shown. Figure 5B As shown, the Reserved and Total EHSLength fields are replaced with timestamps. In some embodiments, anomalies in the storage device may be related to the current UTP layer of the HW and certain custom states. Therefore, the Data Segment Length field is replaced with the CMD_STS field, which is important for anomaly localization, and the Reserved field is replaced with the UTP_STS field, which is also important for anomaly localization. Figure 5C This diagram illustrates the data structure of a UPIU recording event sent by a storage device according to an embodiment of the present disclosure. Figure 5C As shown, the Reserved field is replaced with a timestamp. It is understood that replacing the first field in the UPIU with a timestamp and status-related information of the storage device 120 allows for flexible configuration of the UPIU's recorded event data structure according to the business project requirements executed by the storage device, enabling the anomaly localization method of this embodiment to adapt to different project debugging processes.
[0070] In step S230, the recorded event is stored in the data buffer of the storage device.
[0071] Figure 6 A schematic diagram of the structure of a data buffer provided according to an embodiment of the present disclosure is shown. Figure 6 As shown, after replacing the fields in the UPIU with timestamps and status-related information of the storage device 120, the recorded events of the UPIU are stored in the data buffer 123 in a first-in-first-out (FIFO) order. In some embodiments, it can be determined whether there is free space in the data buffer 123. If so, the recorded event is stored in the free space; if not, the earliest recorded event currently stored in the data buffer 123 is deleted in a FIFO order to store the current recorded event.
[0072] In some embodiments, after storing the recorded event in the data buffer 123 of the storage device 120, the transaction type field corresponding to the recorded event stored in the data buffer 123 can be compared with a target transaction type field, and the first recorded event can be determined based on the comparison result. It is understood that the transaction type field corresponding to the first recorded event matches the target transaction type field. It should be noted that the target transaction type field may be related to the business project executed by the storage device 120 and can be set by technical personnel. Based on the target transaction type field, the first recorded event of interest to technical personnel stored in the data buffer 123 can be selected for subsequent anomaly localization.
[0073] In some embodiments, when performing anomaly location or debugging, the recorded events stored in the data buffer 123 can be read directly and organized into a predetermined format. Figure 7 This diagram illustrates the structure of a predetermined format for recording events according to an embodiment of the present disclosure. Figure 7 As shown, the predefined format includes a second field, which includes the timestamp corresponding to the recorded event (represented as Time, an absolute time), the time interval between the recorded event and the timestamp corresponding to the next recorded event (represented as Time Delta), and the name of the UPIU corresponding to the recorded event and fields within the UPIU corresponding to the recorded event, such as the Flags field, the Logical Unit Number (LUN) field, and the TaskTag field. It can be understood that by organizing the recorded events into a predefined format, the content and timing of the common flash storage command interactions between the storage device and the host under abnormal conditions can be accurately reproduced. This allows for the rapid and accurate identification of the cause of the storage device's abnormality based on the complete and clear interaction content and timing, improving the accuracy and efficiency of abnormality localization.
[0074] In step S240, the content and timing of the general flash memory storage command interaction between the storage device and the host under the abnormal situation are obtained based on the recorded events, thereby locating the cause of the abnormality in the storage device.
[0075] Figure 8 This is a schematic flowchart illustrating a method for locating anomalies in a storage device according to an embodiment of the present disclosure. The anomaly location method of this embodiment can be executed by an anomaly location device 125. (See also...) Figure 8 The anomaly localization method includes steps S810 to S870.
[0076] In step S810, it is detected whether a General Flash Memory Protocol (GPLP) information unit exists in the hardware cache of the storage device.
[0077] In step S820, when the generic flash storage protocol information unit is detected, the transaction type field is compared with the target transaction type field. Based on the comparison result, it is determined that the first generic flash storage protocol information unit needs to be stored in the data buffer, wherein the transaction type field in the first generic flash storage protocol information unit matches the target transaction type field.
[0078] In step S830, when the General Flash Memory Protocol (GPLP) information unit is detected, a truncation operation is performed on the GPLP information unit to truncate the first predetermined number of bytes of the GPLP information unit.
[0079] In step S840, when the General Flash Storage Protocol (GPLP) information unit is detected, the first field in the GPLP information unit is deleted so that a timestamp is stored at that location, so as to obtain the record event of the GPLP storage command corresponding to the GPLP information unit. The first field includes one or more of a reserved field and an invalid information field.
[0080] In step S850, the first field corresponding to the recorded event is deleted so that the state-related information of the storage device can be stored at that location.
[0081] In step S860, the recorded event is stored in the data buffer of the storage device;
[0082] In step S870, the content and timing of the general flash memory storage command interaction between the storage device and the host under the abnormal situation are obtained based on the recorded event, thereby locating the cause of the abnormality in the storage device.
[0083] Since the process of locating the cause of the anomaly in the storage device 120 using the anomaly location method in this embodiment has been described in detail above, it will not be repeated here.
[0084] Figure 9This is a schematic flowchart illustrating a method for locating anomalies in a storage device according to an embodiment of the present disclosure. The anomaly location method of this embodiment can be executed by an anomaly location device 125. (See also...) Figure 9 The anomaly localization method includes steps S910 to S970.
[0085] In step S910, it is detected whether a General Flash Memory Protocol (GPLP) information unit exists in the hardware cache of the storage device.
[0086] In step S920, when the General Flash Memory Protocol (GPLP) information unit is detected, a truncation operation is performed on the GPLP information unit to truncate the first predetermined number of bytes of the GPLP information unit.
[0087] In step S930, when the general flash storage protocol information unit is detected, the first field in the general flash storage protocol information unit is deleted so that a timestamp is stored at that location, so as to obtain the record event of the general flash storage command corresponding to the general flash storage protocol information unit. The first field includes one or more of a reserved field and an invalid information field.
[0088] In step S940, the first field corresponding to the recorded event is deleted so that the state-related information of the storage device can be stored at that location.
[0089] In step S950, the recorded event is stored in the data buffer of the storage device.
[0090] In step S960, the transaction type field corresponding to the record event stored in the data buffer is compared with the target transaction type field. Based on the comparison result, a first record event is determined, wherein the transaction type field corresponding to the first record event matches the target transaction type field.
[0091] In step S970, the content and timing of the general flash memory storage command interaction between the storage device and the host under the abnormal situation are obtained based on the recorded event, thereby locating the cause of the abnormality in the storage device.
[0092] Since the process of locating the cause of the anomaly in the storage device 120 using the anomaly location method in this embodiment has been described in detail above, it will not be repeated here.
[0093] Figure 10 This is a schematic diagram of the structure of an anomaly location device for a storage device according to an embodiment of the present disclosure. Figure 10As shown, the anomaly location device 1000 includes a data packet detection unit 1010, a field replacement unit 1020, a record event storage unit 1030, and an anomaly location unit 1040.
[0094] The packet detection unit 1010 is used to detect whether there is a General Flash Memory Protocol information unit in the hardware cache of the storage device.
[0095] The field replacement unit 1020 is used to delete the first field in the general flash storage protocol information unit when the general flash storage protocol information unit is detected so as to store a timestamp at the location, so as to obtain the record event of the general flash storage command corresponding to the general flash storage protocol information unit. The first field includes one or more of a reserved field and an invalid information field.
[0096] The event recording storage unit 1030 is used to store the recorded events in the data buffer of the storage device.
[0097] The anomaly localization unit 1040 is used to obtain the general flash memory storage command interaction content and timing of the storage device and the host under the abnormal situation based on the recorded event, and then locate the cause of the anomaly in the storage device.
[0098] Since the process of locating the cause of the anomaly in the storage device 120 using the anomaly location method in this embodiment has been described in detail above, it will not be repeated here.
[0099] This disclosure also provides an electronic device, such as... Figure 11 As shown, it includes a memory 1120, a processor 1110, and a program stored in the memory 1120 and executable on the processor 1110. When the program is executed by the processor 1110, it can implement the various processes of the above-described abnormal location methods and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0100] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. Therefore, this disclosure also provides a storage medium storing a computer program or instructions, which, when executed by a processor, can implement the various processes of the embodiments of the above-described anomaly localization methods.
[0101] Since the instructions stored in the storage medium can execute the steps in the anomaly localization method provided in the embodiments of this disclosure, the beneficial effects achievable by the anomaly localization method provided in the embodiments of this disclosure can be realized, as detailed in the preceding embodiments, and will not be repeated here. The specific implementation of each of the above operations can be found in the preceding embodiments, and will not be repeated here.
[0102] In summary, the anomaly localization method for storage devices provided in this disclosure detects the presence of a General Flash Memory Protocol (GPLP) information unit in the hardware cache of the storage device. Upon detection of a GPLP information unit, the first field in the GPLP information unit is replaced with a timestamp to obtain a record event of the GPLP command corresponding to that GPLP information unit. The first field includes one or more of a reserved field and an invalid information field. The record event is stored in the data buffer of the storage device. Based on the record event, the interaction content and timing of the GPLP commands between the storage device and the host under the abnormal situation are obtained, thereby locating the cause of the anomaly in the storage device. Thus, the record event includes fields related to the GPLP command and a timestamp, accurately reproducing the interaction content and timing of the GPLP commands between the storage device and the host under the abnormal situation, rather than just a simplified portion of information with uncertain timing, thereby quickly and accurately locating the cause of the anomaly.
[0103] Finally, it should be noted that the above embodiments are merely examples for clearly illustrating this disclosure and are not intended to limit the implementation. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of this disclosure.
Claims
1. A method for locating anomalies in a storage device, comprising: Detect the presence of General Flash Memory Protocol (GPLP) information units in the hardware cache of the storage device; When the General Flash Storage Protocol (GPLP) information unit is detected, the first field in the GPLP information unit is deleted so that a timestamp is stored at that location, so as to obtain the record event of the GPLP storage command corresponding to the GPLP information unit. The first field includes one or more of a reserved field and an invalid information field. The recorded event is stored in the data buffer of the storage device; Based on the recorded events, the content and timing of the general flash storage command interactions between the storage device and the host under abnormal conditions are obtained, thereby locating the cause of the abnormality in the storage device.
2. The anomaly localization method according to claim 1, wherein, The data structure of the General Flash Memory Protocol (GPLP) information unit includes a transaction type field. After detecting whether the GPLP information unit exists in the hardware cache of the storage device, the anomaly localization method further includes: Upon detecting the General Flash Storage Protocol (GSP) information unit, the transaction type field is compared with the target transaction type field; Based on the comparison results, it is determined that the first general flash memory storage protocol information unit needs to be stored in the data buffer, wherein the transaction type field in the first general flash memory storage protocol information unit matches the target transaction type field.
3. The anomaly localization method according to claim 1, wherein, The data structure of the general flash memory storage protocol information unit includes a transaction type field. After storing the recorded event in the data buffer of the storage device, the anomaly location method further includes: The transaction type field corresponding to the recorded event stored in the data buffer is compared with the target transaction type field. Based on the comparison result, a first recorded event is determined, wherein the transaction type field corresponding to the first recorded event matches the target transaction type field.
4. The anomaly localization method according to claim 1, wherein, After detecting whether a General Flash Memory Protocol (GPLP) information unit exists in the hardware cache of the storage device, the anomaly localization method further includes: Upon detecting the General Flash Memory Protocol (GPLP) information unit, a truncation operation is performed on the GPLP information unit to extract a predetermined number of bytes from the beginning of the GPLP information unit.
5. The anomaly localization method according to claim 1, wherein, Before storing the recorded event in the data buffer of the storage device, the anomaly localization method further includes: The first field corresponding to the recorded event is deleted so that the state-related information of the storage device can be stored at that location.
6. The anomaly localization method according to any one of claims 1 to 5, wherein, The step of storing the recorded event in the data buffer of the storage device includes: Determine whether there is free space in the data buffer; if so, store the recorded event in the free space. If not, the earliest stored record event in the data buffer is deleted in a first-in-first-out order in order to store the current record event.
7. The anomaly localization method according to any one of claims 1 to 5, wherein, After storing the recorded event in the data buffer of the storage device, the anomaly localization method further includes: The recorded event is read from the data buffer and organized into a predetermined format. The predetermined format includes a second field, which includes the timestamp corresponding to the recorded event, the time interval between the timestamp corresponding to the recorded event and the next recorded event, and the name and fields of the general flash memory storage protocol information unit corresponding to the recorded event.
8. An anomaly location device for a storage device, comprising: The packet detection unit is used to detect whether there are General Flash Memory Protocol information units in the hardware cache of the storage device; The field replacement unit is used to delete the first field in the general flash storage protocol information unit when the general flash storage protocol information unit is detected so as to store a timestamp at the location, so as to obtain the record event of the general flash storage command corresponding to the general flash storage protocol information unit. The first field includes one or more of a reserved field and an invalid information field. An event recording storage unit is used to store the recorded events in the data buffer of the storage device; An anomaly localization unit is used to obtain the general flash memory storage command interaction content and timing of the storage device and the host under the abnormal situation based on the recorded events, and then locate the cause of the anomaly in the storage device.
9. A storage system, comprising: Host; A storage device, including the anomaly location device as described in claim 8, is used to obtain the general flash storage command interaction content and timing of the storage device and the host based on the recorded events stored in the data buffer of the storage device, thereby locating the cause of the anomaly in the storage device.
10. A storage medium storing a computer program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Autonomous event logging for drive failure analysis
US20130198574A1
Method of processing exception events and storage device for processing exception events
US20240248780A1