CN115904787A - Method, device and medium for determining reason of lost disk - Google Patents

Method, device and medium for determining reason of lost disk Download PDF

Info

Publication number
CN115904787A
CN115904787A CN202211521534.XA CN202211521534A CN115904787A CN 115904787 A CN115904787 A CN 115904787A CN 202211521534 A CN202211521534 A CN 202211521534A CN 115904787 A CN115904787 A CN 115904787A
Authority
CN
China
Prior art keywords
disk
core
solid state
reason
storage space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211521534.XA
Other languages
Chinese (zh)
Inventor
赵昌磊
尹作刚
钟戟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN202211521534.XA priority Critical patent/CN115904787A/en
Publication of CN115904787A publication Critical patent/CN115904787A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method, a device and a medium for determining a reason for lost disks, and relates to the technical field of computer storage. According to the scheme, under the condition that the SSD loses the disk, the reason of the disk loss is determined through the flag bit information stored when the NOR FLASH is powered off abnormally, and the defect that the reason of the disk loss cannot be positioned through running logs is overcome; the method can enable technicians to distinguish whether the lost disk is caused by software problems or hardware problems, and realizes accurate positioning of the reason for the lost disk when the SSD is powered off abnormally. On the basis, specific problems are positioned by technical personnel, so that the problems that hardware is positioned by software personnel and software is positioned by hardware personnel are avoided, and the product research and development efficiency is improved.

Description

Method, device and medium for determining reason of lost disk
Technical Field
The present application relates to the field of computer storage technologies, and in particular, to a method, an apparatus, and a medium for determining a reason for lost disk.
Background
With the rapid development of information technology, the generation and storage of data is a problem facing current computer technology. Solid State Disks (SSD) have characteristics of high bandwidth and low latency, and thus are widely used in various industries. The existing positioning scheme for positioning the abnormal power-off fault of the SSD is to position through the running log of the SSD. The running log of the SSD is generally stored on the NAND FLASH and the NOR FLASH; when the SSD is abnormally powered off, an interrupt pin of the SSD controller is triggered, and at the moment, the power supply of the SSD is switched to the power supply of a capacitor in the SSD from the power supply of the host. The capacitor can support the power supply time of 40-80ms, and the lower current path of the SSD must be completed in the time, otherwise the SSD can hang up.
However, since the controller of the SSD is multi-core (multicore), different software modules may run on different physical cores. When the core (core) in charge of the log module is deadlocked due to software problems or the capacitor power supply lasts for 10ms or less, the SSD fails to power down and the SSD cannot be normally used under the two conditions; and at the moment, the specific reason that the SSD fails to be powered down and the disk is lost cannot be accurately positioned according to the running log of the SSD.
In view of the above problems, how to accurately locate the reason for losing a disk when the SSD is powered off abnormally is an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a method, a device and a medium for determining a reason for losing a disk, so as to accurately locate the reason for losing the disk when an SSD is abnormally powered off.
In order to solve the above technical problem, the present application provides a method for determining a reason for lost disks, including:
when the solid state disk is electrified again after being abnormally powered off, if the solid state disk is determined to be in a lost disk state in the electrified state, whether the reason for the lost disk can be determined according to the running log of the solid state disk is judged;
if not, acquiring the zone bit information stored by NORFLASH when the solid state disk is abnormally powered off; the flag bit information comprises flag information of each core in the solid state hard disk controller during abnormal power-off and capacitance working time information of a capacitor;
and determining the reason for losing the disk according to the zone bit information.
Preferably, before the solid state disk is abnormally powered down, the method further includes:
setting a preset space in the NOR FLASH and setting abnormal power-off cut-off time;
respectively allocating a storage space to each core of the solid state hard disk controller in the preset space, so that each core stores the flag information when power down is abnormally interrupted and the flag information when power down is abnormally turned off in the corresponding storage space;
and setting a capacitor working time storage space in the preset space, so as to store the capacitor working time information of the capacitor when the solid state disk is abnormally powered off in the capacitor working time storage space.
Preferably, the storage space includes a first storage space and a second storage space, and when the solid state disk is powered off abnormally, the storing, by the NOR FLASH, the flag bit information includes:
storing the mark information during abnormal power-off interruption through the first storage space corresponding to each core respectively;
based on the abnormal power-off cut-off time, the mark information at the time of abnormal power-off cut-off is stored in the second storage space corresponding to each core;
storing the capacitance operating time information of the capacitance in the capacitance operating time storage space.
Preferably, the storing the flag information during abnormal power-off interruption by the first storage spaces corresponding to the cores respectively includes:
respectively starting a timer corresponding to each core, and respectively applying for the lock by each core; wherein the lock characterization is that only one of the cores is capable of operating the NOR FLASH at a time;
respectively judging whether each core applies for the lock;
if yes, writing the mark information during abnormal power-off interruption into the first storage space corresponding to the core, and releasing the lock;
and if not, adding the cores to a waiting queue, and returning to the step of respectively applying for the lock by each core.
Preferably, the storing the flag information when power down abnormally ends in the second storage spaces corresponding to the cores respectively includes:
when the abnormal power-off cut-off time is determined to be reached according to the corresponding timers, the application of each core to the lock is carried out respectively;
respectively judging whether each core applies for the lock;
if so, writing the mark information when the abnormal power-off is cut off into the second storage space corresponding to the core, and releasing the lock;
and if not, adding the cores to the waiting queue, and returning to the step of respectively applying for the lock by each core.
Preferably, the storing the capacitance on-time information of the capacitance in the capacitance on-time storage space includes:
selecting a preset core from the cores of the solid state hard disk controller;
starting a capacitance and electric quantity timer of the preset core;
and writing the capacitor working time information into the capacitor working time storage space in a preset period through the capacitor electric quantity timer.
Preferably, the determining the reason for the disc loss according to the flag bit information includes:
judging whether each core triggers abnormal power-off interruption or not according to the mark information in each first storage space when the power-off interruption is abnormal;
if the core is determined not to trigger abnormal power-off interruption, determining that the reason for the lost disk is the fault of the solid state hard disk controller;
if it is determined that each core triggers abnormal power-off interruption, respectively judging whether each core writes the flag information when abnormal power-off is cut off in the corresponding second storage space;
if at least one core writes the mark information when abnormal power-off cut-off exists in the corresponding second storage space, determining that the reason for the lost disk is software failure in the core;
if the mark information when abnormal power-off is cut off is not written into the corresponding second storage space by each core, acquiring the capacitance working time information stored in the capacitance working time storage space;
and if the working time information of the capacitor does not correspond to the abnormal power-off cut-off time, determining that the reason for losing the disk is the capacitor and hardware faults.
Preferably, when the solid state disk is powered on again after being powered off abnormally, if it is determined that the power-on state of the solid state disk is a normal state, the method further includes:
and erasing the flag bit information stored in the NOR FLASH.
Preferably, after determining that the power-on state of the solid state disk is the lost disk state, the method further includes:
and if the solid state disk is powered off abnormally again, the NOR FLASH reserves the flag bit information stored when the solid state disk is powered off abnormally for the first time.
In order to solve the above technical problem, the present application further provides a lost disc reason determining device, including:
the judging module is used for judging whether a reason for losing the disk can be determined according to the running log of the solid state disk if the solid state disk is determined to be in the disk losing state after being powered off abnormally and then powered on again; if not, triggering the acquisition module;
the acquisition module is used for acquiring the flag bit information stored by the NOR FLASH when the solid state disk is powered off abnormally; the flag bit information comprises flag information of each core in the solid state hard disk controller during abnormal power-off and capacitance working time information of a capacitor;
and the determining module is used for determining the reason of the lost disc according to the zone bit information.
In order to solve the above technical problem, the present application further provides another lost disc reason determining apparatus, including:
a memory for storing a computer program;
a processor for implementing the steps of the above-mentioned method for determining a reason for lost disc when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for determining a reason for missing a disk.
According to the method for determining the reason for losing the disk, when the solid state disk is powered on again after being powered off abnormally, if the power-on state of the solid state disk is determined to be the state of losing the disk, whether the reason for losing the disk can be determined according to the operation log of the solid state disk is judged; if not, acquiring the flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off; the flag bit information comprises flag information of each core in the solid state hard disk controller during abnormal power-off and capacitance working time information of a capacitor; and determining the reason of the lost disc according to the flag bit information. Therefore, in the scheme, under the condition that the SSD loses the disk, the reason of the disk loss is determined through the flag bit information stored when the NOR FLASH is powered off abnormally, and the defect that the reason of the disk loss cannot be positioned through running logs is overcome; the method can enable technicians to distinguish whether the lost disk is caused by software problems or hardware problems, and realizes accurate positioning of the reason for the lost disk when the SSD is powered off abnormally. On the basis, the specific problem is positioned by technical personnel, the hardware problem is avoided, software personnel are positioned, the software problem is unfavorable for positioning the hardware personnel, and the product research and development efficiency is improved.
In addition, the embodiment of the application also provides a device and a medium for determining the reason of lost disks, and the effect is the same as the above.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for determining a reason for lost disk according to an embodiment of the present application;
fig. 2 is a schematic diagram of a device for determining a reason for lost disks according to an embodiment of the present application;
fig. 3 is a schematic diagram of another lost-disc cause determining apparatus according to an embodiment of 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 the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a method, a device and a medium for determining a reason of disc loss.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
In order to provide a supplement for the problem of the reason that the disk loss cannot be located through the running log under the condition that the disk loss of the solid state disk occurs, and enable a technician to distinguish whether the disk loss is caused by a software problem or a hardware problem, the embodiment of the application provides a method for determining the reason of the disk loss. Fig. 1 is a flowchart of a method for determining a reason for lost disk according to an embodiment of the present application. As shown in fig. 1, the method comprises:
s10: when the solid state disk is electrified again after being powered off abnormally, if the solid state disk is determined to be in a lost disk state, whether the reason of the lost disk can be determined according to the running log of the solid state disk is judged. If not, the process proceeds to step S11.
It can be understood that, when the solid state disk is powered on again after being powered off abnormally, the power-on state of the solid state disk at this time needs to be determined first. The power-on state includes a normal state and a lost disk state. If the power-on state of the solid state disk is a normal state, the solid state disk can be directly used; if the power-on state of the solid state disk is a lost disk state, the reason for the lost disk needs to be determined so as to repair the solid state disk.
The operation log of the solid state disk records various information in the working process of the solid state disk, and is generally stored in a NAND FLASH (a nonvolatile FLASH memory medium which can be rewritten and is easy to lose data for a long time) of the solid state disk. When the solid state disk is in a disk losing state, if the information recorded by the derived running log is comprehensive, the reason of disk losing can be analyzed through the running log; and when the derived running log does not record relevant information of power-on and power-off, the situation that the disk is lost due to a log module or other reasons is indicated, and the reason for the disk loss cannot be determined through the running log.
S11: and acquiring the flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off.
The flag bit information includes flag information of each core in the solid state disk controller when the core is powered off abnormally and capacitance working time information of the capacitor.
S12: and determining the reason of the lost disc according to the zone bit information.
Therefore, when the reason for the lost disk of the solid state disk cannot be determined according to the operation log, the reason for the lost disk needs to be determined in other ways. Specifically, the flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off is obtained, and the reason for losing the disk is determined according to the flag bit information.
NOR FLASH is a non-volatile FLASH medium that cannot be rewritten, must be erased before writing, and is very stable. In this embodiment, the flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off includes flag information of each core in the solid state disk controller when the solid state disk controller is abnormally powered off and capacitance operating time information of the capacitor. Because the solid state hard disk controller is multi-core, different software modules can be operated on different cores, the problem of whether the solid state hard disk controller or the software module is available can be checked according to the flag information of each core when the cores are powered off abnormally; meanwhile, the capacitor in the solid state disk is used for supporting the solid state disk to complete the whole abnormal power-off process after the solid state disk is interrupted due to abnormal power-off, so that whether the problem of the capacitor and a hardware circuit exists can be checked according to the capacitor working time information of the capacitor.
It should be noted that, in this embodiment, there is no limitation on the specific way of storing the flag bit information in the NOR FLASH, and there is no limitation on the specific process of determining the reason for the lost disk according to the flag bit, which is determined according to the specific implementation situation.
In the embodiment, when the solid state disk is powered on again after being powered off abnormally, if the solid state disk is determined to be in a lost disk state, whether the reason for the lost disk can be determined according to the running log of the solid state disk is judged; if not, acquiring the flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off; the flag bit information comprises flag information of each core in the solid state hard disk controller during abnormal power-off and capacitance working time information of a capacitor; and determining the reason of the lost disc according to the zone bit information. Therefore, in the scheme, under the condition that the SSD loses the disk, the reason for the disk loss is determined through the flag bit information stored when the NOR FLASH is powered off abnormally, and the defect that the reason for the disk loss cannot be located through running the log is overcome; the method can enable technicians to distinguish whether the lost disk is caused by software problems or hardware problems, and achieves accurate positioning of the reason for the lost disk when the SSD is powered off abnormally. On the basis, the specific problem is positioned by technical personnel, the hardware problem is avoided, software personnel are positioned, the software problem is unfavorable for positioning the hardware personnel, and the product research and development efficiency is improved.
In order to realize the storage of the flag bit information by the NOR FLASH, as a preferred embodiment, before the solid state disk is abnormally powered down, the method further includes:
setting a preset space in the NOR FLASH and setting abnormal power-off cut-off time;
respectively allocating storage spaces to cores of the solid state hard disk controller in a preset space, wherein the storage spaces are used for storing the mark information when abnormal power-off interruption occurs and the mark information when abnormal power-off is cut off in the corresponding storage spaces of the cores;
and setting a capacitor working time storage space in the preset space to store capacitor working time information of the capacitor when the solid state disk is powered off abnormally in the capacitor working time storage space.
Specifically, a preset space is set in the NOR FLASH of the solid state disk, and the preset space is used for storing the flag information of each core when the solid state disk is abnormally powered off and the capacitance working time information of the capacitor when the solid state disk is abnormally powered off. The size of the preset space is not limited in this embodiment, and is determined according to specific implementation situations. Preferably, the preset space may be set to 4K.
Meanwhile, abnormal power-off cut-off time needs to be set. It can be understood that, when the solid state disk is powered off abnormally, an interrupt pin of the solid state disk controller is triggered, at this time, a power supply of the solid state disk is switched from a high-speed serial computer expansion bus (PCIE) interface (host power supply) to a capacitor inside the solid state disk, the capacitor can support 40-80ms generally, a lower current path of the solid state disk must be completed in this period of time, otherwise, the solid state disk may hang on the disk. The abnormal power-off cutoff time in this embodiment is the last time of the power-off process, that is, the abnormal power-off of the solid state disk must be completed within the abnormal power-off cutoff time, otherwise, the power-off is considered to be failed. In this embodiment, the cut-off time of the abnormal power interruption is not limited, and is determined according to specific implementation conditions. Preferably, the abnormal power-off time may be set to 40ms.
Further, memory spaces are respectively allocated to the cores of the solid state hard disk controller in the preset space, so that the cores store the flag information when the power supply is abnormally interrupted and the flag information when the power supply is abnormally cut off in the corresponding memory spaces. It can be understood that, for each core of the solid state hard disk controller, the storage spaces allocated respectively are used for storing the flag information when the abnormal power down is interrupted and the flag information when the abnormal power down is turned off, and the two kinds of flag information respectively represent the beginning and the end of the abnormal power down. In addition, a capacitor working time storage space is arranged in the preset space and used for storing capacitor working time information of the capacitor when the solid state disk is abnormally powered off.
It should be noted that, in this embodiment, there is no limitation on the specific forms of the flag information and the capacitor operating time information, and there is no limitation on the specific allocation condition of the preset space, which is determined according to the specific implementation condition.
In this embodiment, the storage of the flag bit information is realized by setting a preset space in the NOR FLASH.
In the foregoing embodiment, a specific manner of storing the flag bit information by the NOR FLASH is not limited, and as a preferred embodiment, in this embodiment, the storage space includes a first storage space and a second storage space, and when the solid state disk is powered off abnormally, the storing the flag bit information by the NOR FLASH includes:
respectively storing the mark information during abnormal power-off interruption through the first storage space corresponding to each core;
based on the abnormal power-off cut-off time, storing the mark information when the abnormal power-off cut-off is carried out through the second storage space corresponding to each core;
and storing capacitance operating time information of the capacitor in the capacitance operating time storage space.
It can be understood that, since the storage space is respectively allocated to each core of the solid state hard disk controller in the preset space of the NOR FLASH for each core to store the flag information when the abnormal power-down interruption occurs and the flag information when the abnormal power-down is turned off in the corresponding storage space, two sub-storage spaces may be specifically allocated to each core: the first storage space and the second storage space are used for respectively storing the mark information when the abnormal power-off is interrupted and the mark information when the abnormal power-off is cut off. Therefore, the storage of the flag bit information by the NOR FLASH may specifically be to store the flag information during abnormal power-off interruption through the first storage spaces corresponding to the cores, respectively; based on the abnormal power-off cut-off time, storing the mark information when the abnormal power-off cut-off is carried out through the second storage space corresponding to each core; and storing capacitance operating time information of the capacitor in the capacitance operating time storage space.
In this embodiment, a solid state disk controller is taken as 4 cores for example, which are respectively a core0, a core1, a core2, and a core3, and respectively correspond to four software modules: a Control Module (CM), a management module (AM), a Data Module (DM) and a write-in module (WM); assuming that the preset space of the NOR FLASH is 4K, in a specific implementation, 0-3byte of the 4K space can be used as a first storage space of core0, for storing flag information of the core0 when the power is interrupted due to abnormal power down; 4-7 bytes are used as a second storage space of the core0 and used for storing the mark information when the core0 is cut off under abnormal power-off; preferably, the two kinds of flag information may be embodied as flag numbers 0xa and 0xa, respectively.
Further taking 8-11 bytes as a first storage space of the core1, and storing mark information when the core1 is in power failure under abnormal conditions; 12-15 bytes are used as a second storage space of the core1 and used for storing the mark information when the core1 is cut off under abnormal power-off; preferably, the two kinds of flag information may be embodied as flag numbers 0xb and 0xbb, respectively.
Taking 16-19 bytes as a first storage space of the core2, and storing mark information of the core2 when the power is interrupted due to abnormal power supply; 20-23 bytes are used as a second storage space of the core2 and used for storing mark information when the core2 is cut off under abnormal power-off; preferably, the two kinds of flag information may be embodied as flag numbers 0xc and 0xcc, respectively.
Taking 24-27 bytes as a first storage space of the core3, and storing mark information when the core3 is interrupted in abnormal power-off; 28-31 bytes are used as a second storage space of the core3 and used for storing the mark information when the core3 is cut off under abnormal power-off; preferably, the two kinds of flag information may be embodied as flag numbers 0xd and 0xdd, respectively.
Finally, after 32 bytes, every 4 bytes is a time scale supported by the capacitance electric quantity to serve as a capacitance working time storage space for storing capacitance working time information of the capacitor.
It should be noted that, in the present embodiment, there is no limitation on the specific process of storing flag bit information in the NOR FLASH, which depends on the specific implementation.
In the embodiment, the flag information during abnormal power-off interruption is stored through the first storage space corresponding to each core; based on the abnormal power-off cut-off time, storing the mark information when the abnormal power-off cut-off is carried out through the second storage space corresponding to each core; and the capacitor working time information of the capacitor is stored in the capacitor working time storage space, so that the storage of the zone bit information is realized, and the subsequent reason for losing the disk is convenient to determine.
In order to realize specific storage of flag bit information in NOR FLASH, as a preferred embodiment based on the above embodiments, the storing of flag information during abnormal power-down interruption in the first storage spaces corresponding to the cores respectively includes:
respectively starting a timer corresponding to each core, and respectively applying for the lock by each core; wherein the lock characterizes that only one core can operate NOR FLASH at the same time;
respectively judging whether each core applies for the lock;
if so, writing the mark information during abnormal power-off interruption into a first storage space corresponding to the core, and releasing the lock;
if not, adding the cores to the waiting queue, and returning to the step of respectively applying for the lock by each core.
Specifically, when the solid state disk is abnormally powered off, each core of the solid state disk controller detects abnormal power-off interruption, respectively starts a corresponding timer, and respectively applies for a lock. Note that the lock functions to ensure that only one core is operating NOR FLASH at a time.
Therefore, it is necessary to further determine whether each core applies for a lock. For the core applying for the lock, writing the corresponding mark information during abnormal power-off interruption into the corresponding first storage space, and releasing the lock after the completion; and for cores which do not apply for the lock, adding the cores to a waiting queue (pending list), continuing applying for the lock after the lock is released until all cores write the corresponding flag information in the abnormal power-off interruption into the corresponding first storage space.
Similarly, in the process of storing the flag information at the time of abnormal power-off in the second storage space corresponding to each core, each core also applies for a lock:
when the abnormal power-off cut-off time is determined to be reached according to the corresponding timers, the application of each core to the lock is carried out respectively;
respectively judging whether each core applies for the lock;
if so, writing the mark information when the abnormal power-off is cut off into a second storage space corresponding to the core, and releasing the lock;
if not, adding the cores to the waiting queue, and returning to the step of respectively applying for the lock by each core.
In specific implementation, after all cores write the corresponding flag information during abnormal power-off interruption into the corresponding first storage space, the flag information is incremented along with time, and when the time reaches the abnormal power-off cutoff time determined by the corresponding timer, each core applies for the lock. For the core applying for the lock, writing the mark information when the abnormal power-off is cut off into a second storage space corresponding to the core, and releasing the lock; and for cores which do not apply for the lock, adding the cores to a waiting queue, continuing applying for the lock after the lock is released until all the cores write the mark information when the abnormal power-off is cut off in the corresponding second storage space.
It is understood that the storage of the capacitor operating time information also starts when the solid state disk is abnormally powered down. Accordingly, the storing of the capacitance operating time information of the capacitance in the capacitance operating time storage space includes:
selecting a preset core from each core of the solid state hard disk controller;
starting a capacitor electric quantity timer with a preset core;
and writing the capacitor working time information into the capacitor working time storage space in a preset period through the capacitor electric quantity timer.
Specifically, a predetermined core is selected in the solid state disk controller. For example, core0, i.e. the core of the operation control module CM, is selected; and recording the electric quantity of the capacitor after abnormal power-off through the core. When the solid state disk is abnormally powered off, the core0 detects that the abnormal power-off interruption occurs, then a capacitor electric quantity timer is started, and the timer is used for writing capacitor working time information into a capacitor working time storage space of the NOR FLASH in a preset period.
Assuming that the abnormal power-off time is 40ms, the capacitor should theoretically supply power for at least 40ms after the abnormal power-off occurs. Taking the preset period as 5ms and the capacitor working time information as time count as an example, after abnormal power-off, the capacitor electric quantity timer writes a number into the capacitor working time storage space of the NOR FLASH every 5ms, for example, 5ms writes 1, 10ms writes 2, \ 8230;, 40ms writes 8. Therefore, the actual working time of the capacitor can be confirmed only by counting the time in the working time storage space of the capacitor subsequently.
In this embodiment, flag bit information is stored in the NOR FLASH, so that the reason for the subsequent lost disk can be determined.
In order to realize the final determination of the reason for missing the disc, on the basis of the above embodiment, as a preferred embodiment, the determining the reason for missing the disc according to the flag bit information includes:
judging whether each core triggers abnormal power-off interruption or not according to the mark information in each first storage space during the abnormal power-off interruption;
if the core is determined to have not triggered abnormal power-off interruption, determining that the reason for losing the disk is the fault of the solid state hard disk controller;
if the fact that each core triggers abnormal power-off interruption is determined, whether each core writes mark information when abnormal power-off is cut off in the corresponding second storage space or not is judged;
if at least one core writes the flag information when the power failure is abnormal in the corresponding second storage space, determining that the reason of the lost disk is the software fault in the core;
if the flag information of abnormal power-off cut-off is not written in the corresponding second storage space by each core, acquiring the capacitance working time information stored in the capacitance working time storage space;
and if the working time information of the capacitor does not meet the abnormal power-off cut-off time, determining that the reason for losing the disk is the capacitor and hardware faults.
In specific implementation, after flag bit information stored in the NOR FLASH is obtained, whether each core of the solid state hard disk controller receives abnormal power-off interruption is observed firstly; specifically, whether each core triggers abnormal power-off interruption or not is judged according to the flag information when the abnormal power-off interruption occurs in each first storage space. If the core does not trigger abnormal power-off interruption, determining that the reason for losing the solid state hard disk controller is fault and needing specific inspection; and if the cores are determined to trigger the abnormal power-off interruption, respectively judging whether the cores write the flag information when the abnormal power-off is cut off into the corresponding second storage space. If at least one core writes the flag information of the abnormal power-off cut-off in the corresponding second storage space, determining that the reason for the lost disk is software failure in the core; and if the flag information of abnormal power-off cut-off is not written in the corresponding second storage space by each core, acquiring the capacitance working time information stored in the capacitance working time storage space to judge whether the hardware problems such as capacitance and the like exist. If the capacitor working time information does not correspond to the abnormal power-off cut-off time, for example, the time count is used for calculating that the capacitor is triggered from the abnormal power-off interruption to the power exhaustion, and the duration is not enough to the abnormal power-off cut-off time, the reason that the lost disk is the capacitor and hardware faults is determined.
In the embodiment, the reason for losing the disk is confirmed through the zone bit information, and a supplement is provided for the problem that the reason for losing the disk cannot be positioned through the log; the technical personnel can be made to distinguish whether the problem is caused by a software problem or a hardware problem, and the maintenance of the technical personnel is convenient.
In addition, in the specific implementation, to ensure that the process of determining the reason for the lost disk is performed normally, when the solid state disk is powered on again after being powered off abnormally, if it is determined that the power-on state of the solid state disk is a normal state, the method further includes:
and erasing the flag bit information stored in the NOR FLASH.
It can be understood that, when the solid state disk is powered on again after being powered off abnormally, if the solid state disk is in a normal state at the time, the reason for the disk loss does not need to be determined. However, the flag bit information stored in the previous abnormal power-off state is still retained in the solid state disk. Therefore, in order to ensure that the flag bit information is successfully written in the solid state disk when the solid state disk is powered off next time in an abnormal mode, the flag bit information stored in the NOR FLASH is erased at the moment, and therefore the normal operation of determining the reason for losing the disk when the solid state disk is powered off next time in an abnormal mode is ensured.
Further, after determining that the power-on state of the solid state disk is the lost disk state, the method further includes:
and if the solid state disk is powered off abnormally again, the NOR FLASH reserves the flag bit information stored when the solid state disk is powered off abnormally for the first time.
It can be understood that, after the power-on state of the solid state disk is determined to be the lost disk state, if the solid state disk is powered off abnormally again, in order to determine the reason for the power-off loss caused by the abnormal power-off for the first time, the NOR FLASH needs to retain the flag bit information stored when the solid state disk is powered off abnormally for the first time, and the flag bit information when the power-off abnormality is powered off abnormally this time is not recorded, so that the normal operation of the determination process of the reason for the lost disk can be ensured.
In the above embodiments, the method for determining a reason for missing a disk is described in detail, and the present application also provides an embodiment corresponding to the device for determining a reason for missing a disk. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one is from the perspective of the functional module, and the other is from the perspective of the hardware structure.
Fig. 2 is a schematic diagram of a device for determining a reason for lost disks according to an embodiment of the present application. As shown in fig. 2, the disc loss cause determining apparatus includes:
the judging module 10 is configured to, when the solid state disk is powered off abnormally and then powered on again, judge whether a reason for a disk loss can be determined according to an operation log of the solid state disk if it is determined that the power-on state of the solid state disk is a disk loss state; if not, the obtaining module 11 is triggered.
And the obtaining module 11 is configured to obtain flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off. The flag bit information includes flag information of each core in the solid state disk controller when the core is powered off abnormally and capacitance working time information of the capacitor.
And the determining module 12 is configured to determine a reason for disc loss according to the flag bit information.
In this embodiment, the device for determining the reason for missing a disk includes a determining module, an obtaining module, and a determining module. The method which can be realized by the device for determining the reason of the lost disk is the same as the method for determining the reason of the lost disk. When the solid state disk is electrified again after being abnormally powered off, if the solid state disk is determined to be in a lost disk state in the electrified state, whether the reason for the lost disk can be determined according to the running log of the solid state disk is judged; if not, acquiring the flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off; the flag bit information comprises flag information of each core in the solid state disk controller during abnormal power-off and capacitance working time information of a capacitor; and determining the reason of the lost disc according to the zone bit information. Therefore, in the scheme, under the condition that the SSD loses the disk, the reason for the disk loss is determined through the flag bit information stored when the NOR FLASH is powered off abnormally, and the defect that the reason for the disk loss cannot be located through running the log is overcome; the method can enable technicians to distinguish whether the lost disk is caused by software problems or hardware problems, and realizes accurate positioning of the reason for the lost disk when the SSD is powered off abnormally. On the basis, the specific problem is positioned by technical personnel, the hardware problem is avoided, software personnel are positioned, the software problem is unfavorable for positioning the hardware personnel, and the product research and development efficiency is improved.
Fig. 3 is a schematic diagram of another lost-disc cause determining apparatus according to an embodiment of the present application. As shown in fig. 3, the disc loss cause determining apparatus includes:
a memory 20 for storing a computer program.
A processor 21, configured to implement the steps of the method for determining a reason for lost disks as mentioned in the above embodiments when executing the computer program.
The method for determining the reason for lost disk provided by the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The Processor 21 may be implemented in hardware using at least one of a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an Artificial Intelligence (AI) processor for processing computational operations related to machine learning.
The memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement the relevant steps of the method for determining a reason for missing a disk disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among others, windows, unix, linux, and the like. Data 203 may include, but is not limited to, data related to a lost disc cause determination method.
In some embodiments, the device for determining the reason for lost disks may further include a display 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
It will be appreciated by those skilled in the art that the configuration shown in figure 3 does not constitute a limitation of the lost disc cause determination means and may include more or fewer components than those shown.
In this embodiment, the device for determining a reason for lost disk includes a memory and a processor. The memory is for storing a computer program. The processor is adapted to carry out the steps of the method for determining a reason for lost discs as mentioned in the above embodiments when executing the computer program. When the solid state disk is electrified again after being abnormally powered off, if the solid state disk is determined to be in a lost disk state in the electrified state, whether the reason for the lost disk can be determined according to the running log of the solid state disk is judged; if not, acquiring the flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off; the flag bit information comprises flag information of each core in the solid state hard disk controller during abnormal power-off and capacitance working time information of a capacitor; and determining the reason of the lost disc according to the flag bit information. Therefore, in the scheme, under the condition that the SSD loses the disk, the reason of the disk loss is determined through the flag bit information stored when the NOR FLASH is powered off abnormally, and the defect that the reason of the disk loss cannot be positioned through running logs is overcome; the method can enable technicians to distinguish whether the lost disk is caused by software problems or hardware problems, and realizes accurate positioning of the reason for the lost disk when the SSD is powered off abnormally. On the basis, the specific problem is positioned by technical personnel, the hardware problem is avoided, software personnel are positioned, the software problem is unfavorable for positioning the hardware personnel, and the product research and development efficiency is improved.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is understood that, if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, which are essential or part of the prior art, or all or part of the technical solutions may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In this embodiment, a computer program is stored on a computer-readable storage medium, and when executed by a processor, the computer program implements the steps described in the above method embodiments. When the solid state disk is electrified again after being abnormally powered off, if the solid state disk is determined to be in a lost disk state in the electrified state, whether the reason for the lost disk can be determined according to the running log of the solid state disk is judged; if not, acquiring the flag bit information stored by the NOR FLASH when the solid state disk is abnormally powered off; the flag bit information comprises flag information of each core in the solid state hard disk controller during abnormal power-off and capacitance working time information of a capacitor; and determining the reason of the lost disc according to the zone bit information. Therefore, in the scheme, under the condition that the SSD loses the disk, the reason for the disk loss is determined through the flag bit information stored when the NOR FLASH is powered off abnormally, and the defect that the reason for the disk loss cannot be located through running the log is overcome; the method can enable technicians to distinguish whether the lost disk is caused by software problems or hardware problems, and achieves accurate positioning of the reason for the lost disk when the SSD is powered off abnormally. On the basis, the specific problem is positioned by technical personnel, the hardware problem is avoided, software personnel are positioned, the software problem is unfavorable for positioning the hardware personnel, and the product research and development efficiency is improved.
The method, the apparatus, and the medium for determining the reason for lost disks provided in the present application are described in detail above. The embodiments are described in a progressive mode in the specification, the emphasis of each embodiment is on the difference from the other embodiments, and the same and similar parts among the embodiments can be referred to each other. The device disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part. It should be noted that, for those skilled in the art, without departing from the principle of the present application, the present application can also make several improvements and modifications, and those improvements and modifications also fall into the protection scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.

Claims (12)

1. A method for determining a reason for lost disk, comprising:
when the solid state disk is electrified again after being abnormally powered off, if the solid state disk is determined to be in a lost disk state in the electrified state, whether the reason for the lost disk can be determined according to the running log of the solid state disk is judged;
if not, acquiring the zone bit information stored by NORFLASH when the solid state disk is abnormally powered off; the flag bit information comprises flag information of each core in the solid state hard disk controller during abnormal power-off and capacitance working time information of a capacitor;
and determining the reason for the lost disc according to the zone bit information.
2. The method for determining the reason for the lost disk according to claim 1, further comprising, before the solid state disk is abnormally powered down:
setting a preset space in the NOR FLASH and setting abnormal power-off cut-off time;
respectively allocating a storage space to each core of the solid state hard disk controller in the preset space, so that each core stores the flag information when power down is abnormally interrupted and the flag information when power down is abnormally turned off in the corresponding storage space;
and setting a capacitor working time storage space in the preset space, so as to store the capacitor working time information of the capacitor when the solid state disk is abnormally powered off in the capacitor working time storage space.
3. The method according to claim 2, wherein the storage space includes a first storage space and a second storage space, and when the solid state disk is powered off abnormally, the NOR FLASH storing the flag bit information includes:
storing the mark information during abnormal power-off interruption through the first storage space corresponding to each core respectively;
based on the abnormal power-off cut-off time, the mark information at the time of abnormal power-off cut-off is stored in the second storage space corresponding to each core;
storing the capacitance operating time information of the capacitance in the capacitance operating time storage space.
4. The method according to claim 3, wherein the storing the flag information during abnormal power down interruption in the first storage space corresponding to each core respectively comprises:
respectively starting a timer corresponding to each core, and respectively applying for the lock by each core; wherein the lock characterization is that only one of the cores is capable of operating the NOR FLASH at a time;
respectively judging whether each core applies for the lock;
if yes, writing the mark information during abnormal power-off interruption into the first storage space corresponding to the core, and releasing the lock;
and if not, adding the cores to a waiting queue, and returning to the step of respectively applying for the lock by each core.
5. The method according to claim 4, wherein the storing the flag information at the time of abnormal power-down cutoff in the second storage space corresponding to each core includes:
when the abnormal power-off cutoff time is determined to be reached according to the corresponding timers, the application of each core to the lock is carried out respectively;
respectively judging whether each core applies for the lock;
if so, writing the mark information when the abnormal power-off is cut off into the second storage space corresponding to the core, and releasing the lock;
if not, adding the cores to the waiting queue, and returning to the step of respectively applying for the lock by each core.
6. The method for determining a reason for missing a disk according to claim 3, wherein said storing the capacitance operation time information of the capacitance in the capacitance operation time storage space comprises:
selecting a preset core from the cores of the solid state hard disk controller;
starting a capacitor electric quantity timer of the preset core;
and writing the capacitor working time information into the capacitor working time storage space in a preset period through the capacitor electric quantity timer.
7. The method for determining the reason for the disc loss according to claim 3, wherein the determining the reason for the disc loss according to the flag bit information includes:
judging whether each core triggers abnormal power-off interruption or not according to the mark information in each first storage space when the power-off interruption is abnormal;
if the core is determined not to trigger abnormal power-off interruption, determining that the reason for the lost disk is the fault of the solid state hard disk controller;
if it is determined that each core triggers abnormal power-off interruption, respectively judging whether each core writes the flag information when abnormal power-off is cut off in the corresponding second storage space;
if at least one core writes the mark information when abnormal power-off cut-off exists in the corresponding second storage space, determining that the reason for the lost disk is software failure in the core;
if the mark information when abnormal power-off is cut off is not written into the corresponding second storage space by each core, acquiring the capacitance working time information stored in the capacitance working time storage space;
and if the capacitor working time information does not correspond to the abnormal power-off cut-off time, determining that the reason for the lost disk is the capacitor and hardware faults.
8. The method according to any one of claims 1 to 7, wherein when the solid state disk is powered on again after being powered off abnormally, if it is determined that the power-on state of the solid state disk is a normal state, the method further includes:
and erasing the flag bit information stored in the NOR FLASH.
9. The method for determining the reason for lost disk according to claim 8, after determining that the power-on state of the solid state disk is the lost disk state, further comprising:
and if the solid state disk is powered off abnormally again, the NOR FLASH reserves the flag bit information stored when the solid state disk is powered off abnormally for the first time.
10. A disc loss cause determining apparatus, comprising:
the judging module is used for judging whether the reason of the lost disk can be determined according to the operation log of the solid state disk if the solid state disk is determined to be in the lost disk state after being powered off abnormally and then being powered on again; if not, triggering the acquisition module;
the acquisition module is used for acquiring the flag bit information stored by the NOR FLASH when the solid state disk is powered off abnormally; the flag bit information comprises flag information of each core in the solid state hard disk controller during abnormal power-off and capacitance working time information of a capacitor;
and the determining module is used for determining the reason of the lost disc according to the zone bit information.
11. A disc loss cause determining apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of determining a cause of lost disc of any of claims 1 to 9 when executing said computer program.
12. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method for determining a cause of lost disk according to any one of claims 1 to 9.
CN202211521534.XA 2022-11-30 2022-11-30 Method, device and medium for determining reason of lost disk Pending CN115904787A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211521534.XA CN115904787A (en) 2022-11-30 2022-11-30 Method, device and medium for determining reason of lost disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211521534.XA CN115904787A (en) 2022-11-30 2022-11-30 Method, device and medium for determining reason of lost disk

Publications (1)

Publication Number Publication Date
CN115904787A true CN115904787A (en) 2023-04-04

Family

ID=86479224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211521534.XA Pending CN115904787A (en) 2022-11-30 2022-11-30 Method, device and medium for determining reason of lost disk

Country Status (1)

Country Link
CN (1) CN115904787A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117971610A (en) * 2024-03-29 2024-05-03 苏州元脑智能科技有限公司 Hard disk monitoring method, device, system, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117971610A (en) * 2024-03-29 2024-05-03 苏州元脑智能科技有限公司 Hard disk monitoring method, device, system, equipment and storage medium
CN117971610B (en) * 2024-03-29 2024-05-28 苏州元脑智能科技有限公司 Hard disk monitoring method, device, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN102135927B (en) Method and device for system booting based on NAND FLASH
CN102024502B (en) Flash device testing method and device as well as board and network equipment
US20170277603A1 (en) Data saving method, device and terminal
CN110618892A (en) Bug positioning method and device for solid state disk, electronic equipment and medium
CN112506745B (en) Memory temperature reading method and device and computer readable storage medium
CN112199053B (en) Log recording method, device and medium applied to small-capacity storage area
CN112685227A (en) Log management method, device and equipment and computer readable storage medium
CN115904787A (en) Method, device and medium for determining reason of lost disk
CN113366576A (en) Retention self-test for power loss operations on memory systems
CN115756984A (en) Memory test method, device, equipment and storage medium
CN114995760A (en) Backup recovery method, device and medium
CN113590405A (en) Hard disk error detection method and device, storage medium and electronic device
JP2018028830A (en) Electronic controller and information storage method thereof
CN115562593A (en) Abnormal RAID member disk processing method, device and medium
CN111475378B (en) Monitoring method, device and equipment for Expander
CN114461142A (en) Method, system, device and medium for reading and writing Flash data
EP3557422A1 (en) Method for accessing code sram, and electronic device
CN111124754A (en) Data recovery method, device, equipment and medium
JP6004115B2 (en) MEMORY CONTROL DEVICE, INFORMATION PROCESSING DEVICE, AND MEMORY CONTROL METHOD
CN111176572B (en) Method, device, equipment and medium for protecting stored data
CN118409921A (en) Storage test unit, test method thereof and electronic equipment
CN111666185A (en) Method for generating BIOS change record
CN115756517A (en) Method, device and medium for burning SSD (solid State disk)
CN106933558A (en) A kind of power control method and device
CN117270764A (en) NVMe hard disk zero writing method, device and storage medium

Legal Events

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