Power-off protection method for solid-state hard disk, solid-state hard disk, and computing device
When the main control chip is powered off, it determines and supplies the specific block to store data based on the power down identification of the storage block list, which solves the problem of large-capacity power backup systems in the prior art, and realizes the cost reduction of the smaller-capacity power backup systems and improves data security.
Patent Information
- Application Number
- CN202310089471.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-06
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2043-02-06
AI Technical Summary
In the prior art, when the solid-state drive is powered off, a large capacity power supply system is required to store volatile memory chip data, resulting in high costs.
When the main control chip detects power failure, the power backup system controls power supply to the main control chip and volatile memory chip, and determines the power down identification block based on the power down identification of the memory block list, and only power supply to these blocks to store data to avoid full power supply.
It realizes the reduction of the capacity of the power backup system under the same hard disk specifications, provides more lasting power supply capabilities, ensures safe data storage, and reduces costs.
Smart Images

Figure CN116185713B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of solid-state hard disks, and in particular to a power-off protection method for a solid-state hard disk, a solid-state hard disk, and a computing device. Background Art
[0002] A solid-state drive (SSD), also known as a solid-state drive (SSD), is a hard drive made with an array of solid-state electronic memory chips. To improve read and write performance, SSDs typically write data to a volatile memory chip first, then to a non-volatile memory chip.
[0003] When a solid-state drive loses power, the data in the volatile memory chip is completely lost, affecting the data storage efficiency. In the prior art, a large-capacity backup power system can be used to power the entire solid-state drive, allowing the data in the volatile memory chip to be written to the non-volatile memory chip even when the solid-state drive loses power.
[0004] However, in the prior art, when the solid-state drive loses power, the only way to store data in the volatile memory chip into the non-volatile memory chip is to use a large-capacity backup power system to power the entire solid-state drive. This method requires configuring a large-capacity backup power system for the solid-state drive, resulting in a high cost problem for the solid-state drive. Summary of the Invention
[0005] The present application provides a power-off protection method for a solid-state hard drive, a solid-state hard drive, and a computing device, which are used to solve the problem in the prior art that, when a solid-state hard drive loses power, the data in the volatile memory chip can only be stored in the non-volatile memory chip by utilizing a large-capacity backup power system to power the entire solid-state hard drive. This method requires configuring a large-capacity backup power system for the solid-state hard drive, resulting in high costs for the solid-state hard drive.
[0006] In a first aspect, an embodiment of the present application provides a power-off protection method for a solid-state drive, comprising:
[0007] When the main control chip detects that the solid state hard disk is in a power-off state, the main control chip controls the backup power system to supply power to the main control chip and the volatile memory chip;
[0008] The main control chip determines the power-off identification block based on the power-off identification of each storage block in the read storage block list, controls the backup power system to supply power to the power-off identification block, and stores the acquired data to be stored in the volatile memory chip into the power-off identification block; wherein the storage block list includes the power-off identifications of multiple storage blocks divided by the non-volatile memory chip.
[0009] The beneficial effects of this embodiment are as follows: This application does not need to power the entire non-volatile memory chip when the solid-state hard drive loses power abnormally or is unplugged. Instead, it only needs to power the power-off identification block in the non-volatile memory chip to ensure that the data to be stored in the volatile memory chip can be stored in the non-volatile memory chip. On the one hand, compared with the current technology of full-disk power supply, this application can realize the configuration of a smaller capacity backup power system under the same hard drive specifications to reduce costs; on the other hand, when configured with a backup power system of the same specifications and capacity, this application can provide a more durable power supply capability to the solid-state hard drive, ensuring the safe storage of data.
[0010] In the preferred technical solution of the power-off protection method for the solid-state hard disk described above, the main control chip determines the power-off identification block according to the power-off identification of each storage block in the read storage block list, including:
[0011] The main control chip reads a storage block list stored in the volatile memory chip, or reads a storage block list stored in a storage block in an enabled state;
[0012] The main control chip determines the power-off identification block according to the power-off identification of each storage block in the storage block list.
[0013] The beneficial effects of this embodiment are as follows: The main control chip can read the storage block list stored in the volatile memory chip, or it can read the storage block list stored in any enabled storage block. This embodiment ensures the security and reliability of the information in the storage block list through multi-party backup storage of the storage block list, avoiding the problem of storing the storage block list in only one storage block and then losing the storage block list due to a failure of that storage block, which in turn causes the main control chip to be unable to determine the power-off identification block.
[0014] In the preferred technical solution of the above-mentioned power-off protection method for a solid-state hard disk, the following is further included:
[0015] The main control chip monitors and obtains parameters of each storage block, and updates the storage block list stored in the volatile memory chip and / or each storage block in an enabled state;
[0016] The parameters include: physical location, status, wear level, power-off flag and available capacity.
[0017] The beneficial effects of this embodiment are as follows: the main control chip can monitor and obtain the parameters of each storage block, and update the storage block list stored in the volatile memory chip and / or each storage block in the enabled state, so that the storage block list can accurately reflect the current status of each storage block. On the one hand, the main control chip can accurately determine the power-off identification block based on the power-off identification of each storage block in the storage block list, and then control the volatile memory chip to store the data to be stored in the power-off identification block that can safely store data, thereby improving the security of data storage. On the other hand, when the solid-state hard disk is powered on, the main control chip and each storage block can determine the storage block used to store the data to be stored in the volatile memory chip when the solid-state hard disk is powered off through the storage block list, thereby ensuring the traceability of the data storage process.
[0018] In the preferred technical solution of the above-mentioned power-off protection method for a solid-state hard disk, when the main control chip reads the storage block list stored in the storage block in the enabled state, the method further includes:
[0019] When the main control chip detects that the solid-state hard disk is in the power-off state, the main control chip controls the backup power system to supply power to the storage block in the enabled state;
[0020] When the main control chip determines the power-off identification block, it controls the backup power system to stop supplying power to the other storage blocks in the enabled state except the power-off identification block.
[0021] The beneficial effects of this embodiment are as follows: when the main control chip detects that the solid-state hard disk is in a power-off state, it can control the backup power system to supply power to the storage block in the enabled state, and read the storage block list stored in the storage block in the enabled state to determine the power-off identification block, and when the power-off identification block is determined, stop supplying power to the other storage blocks in the enabled state except the power-off identification block, so as to reduce the amount of power supplied to the solid-state hard disk by the backup power system, thereby increasing the number of times the backup power system supplies power to the solid-state hard disk.
[0022] In the preferred technical solution of the above-mentioned power-off protection method for a solid-state hard disk, the following is further included:
[0023] When the main control chip detects that the solid-state hard disk is not in the power-off state, the main control chip determines the storage block to be modified according to the wear degree and state of each storage block in the storage block list; wherein the wear degree of the storage block to be modified is less than the wear degree of other storage blocks except the storage block to be modified, and the storage block to be modified is in an enabled state;
[0024] The main control chip modifies the power-off flag corresponding to the storage block to be modified in the storage block list into an available power-off flag.
[0025] Beneficial effects of this embodiment: This embodiment describes an implementation method in which the main control chip determines the power-off flag of a storage block based on the state and wear of the storage block. By determining the storage block with the least wear among the storage blocks in the enabled state (which can be used to store data) as the power-off flag block, the ability of the power-off flag block to safely store the data to be stored is guaranteed, thereby avoiding the problem of the data to be stored being lost in the power-off flag block.
[0026] In the preferred technical solution of the above-mentioned power-off protection method for a solid-state hard disk, the following is further included:
[0027] When the main control chip detects that the solid-state hard disk is not in the power-off state, it determines whether there is a storage block in the storage block list that is not in the enabled state, and when it is determined that there is a storage block in the storage block list that is not in the enabled state, it determines whether the power-off identifier corresponding to the storage block in the disabled state is the available power-off identifier;
[0028] When the main control chip determines that the power-off flag corresponding to the storage block that is not in the enabled state is the available power-off flag, the main control chip modifies the power-off flag corresponding to the storage block that is not in the enabled state into an unavailable power-off flag.
[0029] The beneficial effects of this embodiment are as follows: This embodiment monitors in real time whether the status of the power-off identification block is in the enabled state, promptly modifies the power-off identification of the storage block, and then promptly reselects a storage block from the enabled storage blocks as the power-off identification block to ensure that the power-off identification block can safely store the data to be stored that is flushed from the volatile memory chip when the solid-state hard disk loses power, avoiding the problem that the data to be stored that is flushed from the volatile memory chip cannot be stored due to the power-off identification block not being in the enabled state, thereby improving the ability of the non-volatile memory chip to safely store the data to be stored.
[0030] In the preferred technical solution of the power-off protection method for the solid-state hard disk, the step of storing the acquired data to be stored in the volatile memory chip into the power-off identification block includes:
[0031] The main control chip modifies the flash memory space allocation range in the flash translation layer mapping table according to the physical position corresponding to the power-off identification block in the storage block list;
[0032] The main control chip stores the acquired data to be stored in the volatile memory chip into the power-off identification block according to the flash memory space allocation range in the modified flash translation layer mapping table.
[0033] The beneficial effects of this embodiment are as follows: the main control chip modifies the flash memory space allocation range in the flash memory translation layer mapping table according to the physical position corresponding to the power-off identification block in the storage block list, and stores the data to be stored in the acquired volatile memory chip into the power-off identification block according to the flash memory space allocation range in the modified flash memory translation layer mapping table, so as to ensure that the data to be stored in the volatile memory chip can be stored only in the power-off identification block, thereby improving the security of the non-volatile memory chip storing the data to be stored.
[0034] In the preferred technical solution of the above-mentioned power-off protection method for a solid-state hard disk, the following is further included:
[0035] After detecting that the volatile memory chip finishes storing the data to be stored in the power-off identification block, the main control chip controls the backup power system to stop supplying power to the main control chip, the volatile memory chip, and the power-off identification block.
[0036] The beneficial effects of this embodiment are as follows: after detecting that the volatile memory chip has finished storing the data to be stored in the power-off identification block, the main control chip can control the backup power system to stop supplying power to the main control chip, the volatile memory chip and the power-off identification block, so as to reduce the amount of power supplied to the solid-state hard disk by the backup power system, thereby increasing the number of times the backup power system supplies power to the solid-state hard disk.
[0037] In a second aspect, the present application provides a power-off protection device for a solid-state drive, comprising:
[0038] A control module, configured to control the backup power system to supply power to the main control chip and the volatile memory chip when detecting that the solid-state hard disk is in a power-off state;
[0039] A processing module is configured to determine a power-failure identification block based on the power-failure identification of each storage block in a read storage block list, control the backup power system to supply power to the power-failure identification block, and store the acquired data to be stored in the volatile memory chip in the power-failure identification block; wherein the storage block list includes the power-failure identifications of multiple storage blocks divided by the non-volatile memory chip.
[0040] The beneficial effects of this embodiment are as follows: the control module does not need to control the backup power system to supply power to the entire non-volatile memory chip when the solid-state hard drive loses power abnormally or is unplugged. Instead, it only needs to supply power to the power failure identification block in the non-volatile memory chip when the processing module determines the power failure identification block, so that the data to be stored in the volatile memory chip can be stored in the non-volatile memory chip. On the one hand, compared with the current full-disk power supply technology, this application can realize the configuration of a smaller capacity backup power system under the same hard drive specifications to reduce costs; on the other hand, when the backup power system of the same specification and capacity is configured, this application can provide a more durable power supply capability to the solid-state hard drive, ensuring the safe storage of data.
[0041] In the preferred technical solution of the power-off protection device for the solid-state hard disk described above, the processing module is specifically configured to:
[0042] Reading a storage block list stored in the volatile memory chip, or reading a storage block list stored in a storage block in an enabled state;
[0043] The power-off identification block is determined according to the power-off identification of each storage block in the storage block list.
[0044] The beneficial effects of this embodiment are as follows: The processing module can read the storage block list stored in the volatile memory chip, or it can read the storage block list stored in any enabled storage block. This embodiment ensures the security and reliability of the information in the storage block list through multi-party backup storage of the storage block list, avoiding the problem of storing the storage block list in only one storage block and then losing the storage block list due to a failure of that storage block, which in turn causes the main control chip to be unable to determine the power-off identification block.
[0045] In the preferred technical solution of the above-mentioned power-off protection device for a solid-state hard disk, the processing module is further configured to:
[0046] Monitor and obtain parameters of each storage block, and update the storage block list stored in the volatile memory chip and / or each storage block in an enabled state;
[0047] The parameters include: physical location, status, wear level, power-off flag and available capacity.
[0048] The beneficial effects of this embodiment are as follows: the processing module can monitor and obtain the parameters of each storage block, and update the storage block list stored in the volatile memory chip and / or each storage block in an enabled state, so that the storage block list can accurately reflect the current status of each storage block. On the one hand, the processing module can accurately determine the power-off identification block based on the power-off identification of each storage block in the storage block list, and then control the volatile memory chip to store the data to be stored in the power-off identification block that can safely store data, thereby improving the security of data storage. On the other hand, when the solid-state hard disk is powered on, each storage block can determine the storage block used to store the data to be stored in the volatile memory chip when the solid-state hard disk is powered off through the storage block list, thereby ensuring the traceability of the data storage process.
[0049] In the preferred technical solution of the above-mentioned power-off protection device for a solid-state hard disk, the control module is further configured to:
[0050] When detecting that the solid-state hard disk is in the power-off state, controlling the backup power system to supply power to the storage block in the enabled state;
[0051] When the power-off identification block is determined, the backup power system is controlled to stop supplying power to the other storage blocks in the enabled state except the power-off identification block.
[0052] The beneficial effects of this embodiment are as follows: when the control module detects that the solid-state hard disk is in a power-off state, the control module can control the backup power system to supply power to the storage block in the enabled state, and read the storage block list stored in the storage block in the enabled state to determine the power-off identification block, and when the power-off identification block is determined, stop supplying power to the other storage blocks in the enabled state except the power-off identification block, so as to reduce the amount of power supplied to the solid-state hard disk by the backup power system, thereby increasing the number of times the backup power system supplies power to the solid-state hard disk.
[0053] In the preferred technical solution of the above-mentioned power-off protection device for a solid-state hard disk, the processing module is further configured to:
[0054] When it is detected that the solid-state drive is not in the power-off state, determining a storage block to be modified according to the wear degree and state of each storage block in the storage block list; wherein the wear degree of the storage block to be modified is less than the wear degree of other storage blocks except the storage block to be modified, and the storage block to be modified is in an enabled state;
[0055] The power-off flag corresponding to the storage block to be modified in the storage block list is modified to an available power-off flag.
[0056] Beneficial effects of this embodiment: This embodiment describes an implementation method in which the processing module determines the power-off identification of a storage block based on the state and wear of the storage block. By determining the storage block with the least wear among the storage blocks in the enabled state (which can be used to store data) as the power-off identification block, the ability of the power-off identification block to safely store the data to be stored is guaranteed, thereby avoiding the problem of the data to be stored being lost in the power-off identification block.
[0057] In the preferred technical solution of the above-mentioned power-off protection device for a solid-state hard disk, the processing module is further configured to:
[0058] When it is detected that the solid-state hard disk is not in the power-off state, determining whether there is a storage block in the storage block list that is not in the enabled state, and when it is determined that there is a storage block in the storage block list that is not in the enabled state, determining whether the power-off identifier corresponding to the storage block in the disabled state is the available power-off identifier;
[0059] When it is determined that the power-off flag corresponding to the storage block that is not in the enabled state is the available power-off flag, the power-off flag corresponding to the storage block that is not in the enabled state is modified to an unavailable power-off flag.
[0060] The beneficial effects of this embodiment are as follows: the processing module monitors in real time whether the status of the power-off identification block is in the enabled state, promptly modifies the power-off identification of the storage block, and then promptly re-selects a storage block from the enabled storage blocks as the power-off identification block, so as to ensure that the power-off identification block can safely store the data to be stored that is flushed from the volatile memory chip when the solid-state hard disk loses power, avoids the problem that the data to be stored that is flushed from the volatile memory chip cannot be stored due to the power-off identification block not being in the enabled state, and improves the ability of the non-volatile memory chip to safely store the data to be stored.
[0061] In the preferred technical solution of the power-off protection device for the solid-state hard disk described above, the control module is specifically configured to:
[0062] Modify the flash memory space allocation range in the flash translation layer mapping table according to the physical position corresponding to the power-off identification block in the storage block list;
[0063] According to the flash memory space allocation range in the modified flash translation layer mapping table, the acquired data to be stored in the volatile memory chip is stored in the power-off identification block.
[0064] The beneficial effects of this embodiment are as follows: the control module modifies the flash memory space allocation range in the flash memory translation layer mapping table according to the physical position corresponding to the power-off identification block in the storage block list, and stores the data to be stored in the acquired volatile memory chip into the power-off identification block according to the flash memory space allocation range in the modified flash memory translation layer mapping table, so as to ensure that the data to be stored in the volatile memory chip can be stored only in the power-off identification block, thereby improving the security of the non-volatile memory chip storing the data to be stored.
[0065] In the preferred technical solution of the above-mentioned power-off protection device for a solid-state hard disk, the control module is further configured to:
[0066] After detecting that the volatile memory chip finishes storing the data to be stored in the power-off identification block, the backup power system is controlled to stop supplying power to the main control chip, the volatile memory chip, and the power-off identification block.
[0067] The beneficial effects of this embodiment are as follows: after detecting that the volatile memory chip has finished storing the data to be stored in the power-off identification block, the control module can control the backup power system to stop supplying power to the main control chip, the volatile memory chip and the power-off identification block, so as to reduce the amount of power supplied by the backup power system to the solid-state hard disk, thereby increasing the number of times the backup power system supplies power to the solid-state hard disk.
[0068] In a third aspect, the present application provides a solid-state drive, comprising:
[0069] Main control chip, volatile memory chip, non-volatile memory chip and backup power system; among them,
[0070] The main control chip is used to control the backup power system to supply power to the main control chip and the volatile memory chip when detecting that the solid state hard disk is in a power-off state;
[0071] The main control chip is further used to determine a power-off identification block based on the power-off identification of each storage block in the read storage block list, control the backup power system to supply power to the power-off identification block, and store the acquired data to be stored in the volatile memory chip in the power-off identification block; wherein the storage block list includes the power-off identifications of multiple storage blocks divided by the non-volatile memory chip.
[0072] Beneficial effects of this embodiment: This application provides a solid-state hard disk, including a main control chip, a volatile memory chip, a non-volatile memory chip and a backup power system. The main control chip does not need to control the backup power system to supply power to the entire non-volatile memory chip when the solid-state hard disk is abnormally powered off or unplugged. It only needs to control the backup power system to supply power to the power-off identification block in the non-volatile memory chip to ensure that the data to be stored in the volatile memory chip can be stored in the non-volatile memory chip. On the one hand, compared with the current full-disk power supply technology, this application can realize the configuration of a smaller capacity backup power system under the same hard disk specifications to reduce costs; on the other hand, when configured with the same specification and capacity backup power system, this application can provide a more lasting power supply capability to the solid-state hard disk to ensure the safe storage of data.
[0073] In a fourth aspect, the present application provides a computing device, comprising a motherboard and a solid-state drive;
[0074] Wherein, the mainboard includes a mainboard interface, and the solid-state hard disk includes a hard disk connector;
[0075] The mainboard is connected to the solid state hard disk through the mainboard interface and the hard disk connector.
[0076] Beneficial effects of this embodiment: In this application, when the solid-state hard disk in the computing device is not connected to the motherboard, that is, when the solid-state hard disk experiences an abnormal power outage, the backup power system in the solid-state hard disk can be controlled to supply power to the entire non-volatile memory chip, and the backup power system can be controlled to supply power to the power-off identification block in the non-volatile memory chip, thereby ensuring that the data to be stored in the volatile memory chip can be stored in the non-volatile memory chip. On the one hand, compared with the current full-disk power supply technology, this application can realize the configuration of a smaller capacity backup power system under the same hard disk specifications to reduce costs; on the other hand, when configured with the same specification and capacity backup power system, this application can provide a more durable power supply capability to the solid-state hard disk to ensure the safe storage of data.
[0077] In a fifth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the power-off protection method for the solid-state hard disk described in the first aspect.
[0078] Beneficial effects of this embodiment: In this application, the processor does not need to control the backup power system to supply power to the entire non-volatile memory chip when the solid-state hard drive loses power abnormally or is unplugged. Instead, it only needs to control the backup power system to supply power to the power-off identification block in the non-volatile memory chip to ensure that the data to be stored in the volatile memory chip can be stored in the non-volatile memory chip. On the one hand, compared with the current full-disk power supply technology, this application can realize the configuration of a smaller capacity backup power system under the same hard drive specifications to reduce costs; on the other hand, this application can provide a more durable power supply capability to the solid-state hard drive when configured with a backup power system of the same specifications and capacity, thereby ensuring the safe storage of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0080] Figure 1 A structural diagram of a solid-state hard disk provided in an embodiment of the present application;
[0081] Figure 2 A flowchart of a first embodiment of a power-off protection method for a solid-state drive provided in an embodiment of the present application;
[0082] Figure 3 A flowchart of a third embodiment of a power-off protection method for a solid-state drive provided in an embodiment of the present application;
[0083] Figure 4 A flowchart of a fourth embodiment of a power-off protection method for a solid-state drive provided in an embodiment of the present application;
[0084] Figure 5 A flowchart of a fifth embodiment of a power-off protection method for a solid-state drive provided in an embodiment of the present application;
[0085] Figure 6 A schematic structural diagram of an embodiment of a power-off protection device for a solid-state hard disk provided in an embodiment of the present application;
[0086] Figure 7 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0087] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments made by ordinary technicians in this field based on the inspiration of these embodiments fall within the scope of protection of this application.
[0088] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the numbers used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0089] Glossary:
[0090] Solid State Disk (SSD), also known as a solid-state drive (SSD), is a hard drive made from an array of solid-state electronic memory chips. An SSD internally includes multiple channels (CHs), each of which includes multiple chip enables (CEs). Each CE includes multiple cores (DIEs), each DIE includes multiple planes, and each plane includes multiple blocks, with a block being the smallest erase unit. Each block includes multiple pages, with a page being the smallest read / write unit.
[0091] Memory chips: These are general-purpose integrated circuits, representing the specific application of the embedded system-on-chip concept in the storage industry. By embedding software within a single chip, they achieve multifunctionality and high performance, as well as support for multiple protocols, diverse hardware, and diverse applications. Within the semiconductor memory industry, the most commonly used memory chips include volatile memory chips (such as dynamic random access memory (DRAM)) and non-volatile memory chips (such as NAND Flash).
[0092] Flash Translation Layer (FTL) mapping table: This table maps the logical block addresses (LBAs) maintained within the SSD (user-visible addresses) to the physical block addresses (PBAs) within the SSD's internal flash memory allocation. This table controls the physical location of stored data.
[0093] In the prior art, to ensure that data in the volatile memory chip can be safely written to the non-volatile memory chip during a power outage, a large-capacity backup power system is required to power the entire SSD. However, this method, which requires a large-capacity backup power system to ensure data is securely stored in the non-volatile memory chip, results in high costs for SSDs.
[0094] Based on the above technical problems, an embodiment of the present application proposes a method for ensuring the safe storage of data in a volatile memory chip by only providing a small amount of power to the solid-state drive when the solid-state drive loses power.
[0095] The power-off protection scheme of the solid-state drive in the embodiment of the present application is described in detail below.
[0096] For example, Figure 1 A structural diagram of a solid state hard disk provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the solid state drive 10 may include: a main control chip 101 , a volatile memory chip 102 , a non-volatile memory chip and a backup power system 103 .
[0097] The main control chip 101 is connected to the volatile memory chip 102, the non-volatile memory chip and the backup power system 103. It should be noted that the non-volatile memory chip can be divided into multiple storage blocks. For example, Figure 1 Five storage blocks are shown, namely storage block 104, storage block 105, storage block 106, storage block 107 and storage block 108. It should be noted that the non-volatile memory chip is the set of all non-volatile memory chips in the solid-state drive, that is, the set of all CEs. In addition, it should be noted that a storage block can correspond to at least one CE, a storage block can also correspond to at least one DIE in at least one CE, a storage block can also correspond to at least one Plane in at least one CE, a storage block can also correspond to at least one Block in at least one CE, and a storage block can also correspond to at least one Page in at least one CE. The embodiments of the present application are not limited to this.
[0098] In addition, the solid state drive 10 may further include a hard disk connector ( Figure 1 (not shown) so that the solid state drive 10 can be connected to a computing device via a hard drive connector. The computing device can be a terminal device (such as a mobile phone, a computer), a server, or other equipment.
[0099] It should be noted that the backup power system 103 is a backup power supply device provided on the solid state drive 10. For example, the backup power system 103 may be a backup battery unit (BBU) or an uninterruptible power supply (UPS).
[0100] It should be noted that Figure 1 This is only a structural diagram of a solid state drive provided in the embodiment of the present application. Figure 1 The actual form of the various devices included in the Figure 1 The interaction mode between devices is limited and can be set according to actual needs in the application of the solution.
[0101] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0102] Figure 2 This is a flow chart of a first embodiment of a power-off protection method for a solid-state hard disk provided in an embodiment of the present application. Figure 2 , the method specifically comprises the following steps:
[0103] S201: When the main control chip detects that the solid state drive is in a power-off state, the main control chip controls the backup power system to supply power to the main control chip and the volatile memory chip.
[0104] In this embodiment, the solid-state hard disk can be plugged into the motherboard of the computing device through a hard disk connector. The computing device can be a terminal device (such as a mobile phone, a computer), a server, or other devices.
[0105] When a solid-state drive is plugged into a computing device's motherboard via a hard drive connector, the computing device can power the solid-state drive. The main control chip can control the computing device to act as the primary power supply system, allowing the computing device to power the entire solid-state drive, namely the main control chip, volatile memory chip, and non-volatile memory chip.
[0106] The main control chip can detect whether the solid-state drive is in a power-off state, that is, detect whether the computing device is currently acting as the main power supply system and providing power to the entire solid-state drive through the hard drive connector. Optionally, the main control chip can determine whether the solid-state drive is in a power-off state based on whether the power supply voltage value of the computing device used to power the solid-state drive is lower than a preset voltage value. Optionally, the main control chip can determine whether the solid-state drive is in a power-off state based on whether the power supply current value of the computing device used to power the solid-state drive is lower than a preset current value. Optionally, the main control chip can determine whether the solid-state drive is in a power-off state based on whether the power supply frequency of the computing device used to power the solid-state drive is lower than a preset power supply frequency.
[0107] When the main control chip detects that the solid-state drive is in a power-off state, that is, when it determines that the computing device is not currently acting as the primary power supply system to power the entire solid-state drive, it controls the backup power system to supply power to the main control chip, allowing the main control chip to execute the solid-state drive's power-off protection method. Furthermore, because volatile memory chips are volatile media and are susceptible to data loss upon power failure, the main control chip also needs to control the backup power system to supply power to the volatile memory chips to prevent the volatile memory chips from losing their stored data due to power failure.
[0108] It should be noted that the main control chip serves as the control unit of the solid-state drive, coordinating the operation and data storage of the entire solid-state drive. For example, the data to be stored in the volatile memory chip needs to be stored in the non-volatile memory chip via the main control chip. That is, the main control chip obtains the data to be stored in the volatile memory chip and stores the data to be stored in the non-volatile memory chip. It should also be noted that the main control chip can be a system-on-chip (SoC) or a chip-level chip (MCU).
[0109] S202: The main control chip determines the power failure identification block according to the power failure identification of each storage block in the read storage block list, controls the backup power system to supply power to the power failure identification block, and stores the acquired data to be stored in the volatile memory chip into the power failure identification block.
[0110] In this embodiment, the main control chip can divide the non-volatile memory chip into multiple storage blocks based on the physical space size of the non-volatile memory chip that can be turned off or put into hibernation. Since the non-volatile memory chip is composed of multiple memory chips, each storage block can correspond to a single memory chip, a portion of the flash memory space within a single memory chip, or multiple memory chips, which is not limited in this application.
[0111] After controlling the backup power system to supply power to the main control chip and the volatile memory chip, the main control chip can read a storage block list containing a power-off identifier of each storage block. Optionally, the main control chip can read a storage block list stored in the volatile memory chip. Optionally, the main control chip can read a storage block list stored in any storage block that is in an enabled state.
[0112] After reading the storage block list, the main control chip can determine the power-off flag of each storage block in the storage block list and determine the power-off flag block based on whether the power-off flag of each storage block is an available power-off flag. The power-off flag indicates whether the storage block can be used to store data to be stored in the volatile memory chip when the solid-state drive loses power. When the power-off flag of the storage block is an available power-off flag, the storage block can store data to be stored in the volatile memory chip when the solid-state drive loses power; when the power-off flag of the storage block is an unavailable power-off flag, the storage block cannot store data to be stored in the volatile memory chip when the solid-state drive loses power.
[0113] After the main control chip determines the power failure identification block, it can control the backup power system to supply power to the power failure identification block, read the data to be stored in the volatile memory chip, and flush the acquired data to be stored to the power failure identification block. It should be noted that after the main control chip determines the power failure identification block, it controls the backup power system to supply power only to the power failure identification block and controls the backup power system to not supply power to other storage blocks except the power failure identification block, so as to ensure the subsequent power supply capacity of the backup power system.
[0114] It should be noted that, optionally, the power-off flag of each storage block in the storage block list is determined by the main control chip based on the wear and status of each storage block. Optionally, the power-off flag of each storage block in the storage block list is determined by the main control chip based on the wear, status, available capacity, and preset capacity of each storage block. Optionally, the power-off flag of each storage block in the storage block list is manually set in advance.
[0115] It should also be noted that, optionally, the main control chip can continuously control the backup power system to supply power to the main control chip, the volatile memory chip and the power-off identification block; optionally, the main control chip can detect in real time whether the main control chip has completed storing the data to be stored in the volatile memory chip to the power-off identification block, and after detecting that the main control chip has completed storing the data to be stored in the volatile memory chip to the power-off identification block, control the backup power system to stop supplying power to the main control chip, the volatile memory chip and the power-off identification block to ensure the subsequent power supply capacity of the backup power system.
[0116] In this embodiment, when the main control chip detects that the solid-state drive is in a power-off state, it controls the backup power system to supply power to the main control chip and the volatile memory chip, and determines the power-off identification block based on the power-off identification of each storage block in the read storage block list, controls the backup power system to supply power to the power-off identification block, and stores the acquired data to be stored in the volatile memory chip in the power-off identification block; wherein the storage block list includes the power-off identifications of multiple storage blocks divided by the non-volatile memory chip. Compared with the prior art method in which the solid-state drive can only store the data in the volatile memory chip in the non-volatile memory chip when the solid-state drive is powered off by using a large-capacity backup power system to power the entire solid-state drive, which requires a large-capacity backup power system to be configured for the solid-state drive, resulting in high cost of the solid-state drive, the present application does not need to supply power to the entire non-volatile memory chip when the solid-state drive is abnormally powered off or unplugged. It only needs to supply power to the power-off identification block in the non-volatile memory chip to ensure that the data to be stored in the volatile memory chip can be stored in the non-volatile memory chip. On the one hand, compared with the current full-disk power supply technology, this application can realize the configuration of a smaller capacity backup power system under the same hard disk specifications to reduce costs; on the other hand, this application can provide a more lasting power supply capability to the solid-state hard disk when configured with the same specification and capacity backup power system, thereby ensuring the safe storage of data.
[0117] Based on the above method embodiment 1, the following method embodiment 2 is used to describe in detail the process of the main control chip updating the storage block list stored in the volatile memory chip and / or the storage block in the enabled state.
[0118] In this embodiment, the main control chip can monitor and obtain parameters of each storage block, wherein the parameters of each storage block include: physical location, status, wear degree, power-off flag and available capacity.
[0119] The physical location indicates a physical location of a storage block. For example, the physical location of a storage block may be CH1-CE1-capacity.
[0120] Wear indicates the total number of times a memory block has been written to.
[0121] The power-off flag indicates whether the storage block needs to be powered on when power is lost.
[0122] Available capacity indicates the capacity of a storage block that can be used to store data.
[0123] The status indicates the current status of the storage block. The status of the storage block can be any one of the following states: enabled (indicating that the storage block can be used), energy-saving (indicating that the storage block is temporarily shut down or dormant to enter the energy-saving state and does not provide data access services), disabled (indicating that the storage block is undergoing data migration and is preparing to enter energy-saving), and faulty (indicating that the storage block has failed and cannot provide data access services). It should be noted that the main control chip can control some storage blocks that are temporarily not needed by the computer to enter the energy-saving state based on the preset target capacity and the available capacity of each storage block to reduce the power consumption of the solid-state drive. For example, when the available capacity of the non-faulty storage block 104 is 3000, the available capacity of the non-faulty storage block 106 is 3000, and the available capacity of the non-faulty storage block 108 is 2000, and the preset target capacity is 5000, the main control chip can control the storage block 106 or the storage block 104 to enter the energy-saving state to reduce the power consumption of the solid-state drive.
[0124] After obtaining the parameters of each storage block, the main control chip can update the parameters of the storage block to the storage block list stored in the volatile memory chip and / or each storage block in the enabled state. The specific situation of the storage block list can be taken as an example of the storage block list in Table 1.
[0125] Table 1 Storage block list
[0126]
[0127] In addition, it should be noted that when the storage block list is stored in an enabled storage block, the storage location of the storage block list is preset. For example, the storage block list can be preset to be stored at the beginning, end or middle of the storage block.
[0128] In this embodiment, the main control chip can monitor and obtain the parameters of each storage block, and update the storage block list stored in the volatile memory chip and / or each storage block in an enabled state, so that the storage block list can accurately reflect the current status of each storage block. On the one hand, the main control chip can accurately determine the power-off identification block based on the power-off identification of each storage block in the storage block list, and then control the volatile memory chip to store the data to be stored in the power-off identification block that can safely store data, thereby improving the security of data storage. On the other hand, when the solid-state hard drive is powered on, the main control chip and each storage block can use the storage block list to determine the storage block used to store the data to be stored in the volatile memory chip when the solid-state hard drive is powered off, thereby ensuring the traceability of the data storage process.
[0129] Based on the aforementioned method embodiment 1, the following method embodiment 3 describes in detail the process of the main control chip executing the power-off protection scheme of the solid-state hard disk when the storage block list read by the main control chip is stored in the storage block in the enabled state.
[0130] Figure 3 This is a flow chart of a third embodiment of a power-off protection method for a solid-state drive provided in an embodiment of the present application. The method specifically includes the following steps:
[0131] S301: When the main control chip detects that the solid state drive is in a power-off state, the main control chip controls the backup power system to supply power to the main control chip and the volatile memory chip.
[0132] S302: When the main control chip detects that the solid state drive is in a power-off state, it controls the backup power system to supply power to the storage block in the enabled state.
[0133] In this embodiment, when the solid-state drive is not in a powered-off state, the computing device can supply power to all enabled storage blocks via the drive connector and the main control chip, and the main control chip can record the number of enabled storage blocks. When the main control chip detects that the solid-state drive is in a powered-off state, it can control the backup power system to supply power to the main control chip and the volatile memory chip, and also control the backup power system to supply power to all enabled storage blocks.
[0134] S303: The main control chip reads the storage block list stored in the storage block in the enabled state.
[0135] In this embodiment, when the main control chip controls the backup power system to supply power to all enabled storage blocks, it can read the storage block list stored in any one of all enabled storage blocks to obtain the power-off identifier of each storage block.
[0136] S304: The main control chip determines a power-off identification block according to the power-off identification of each storage block in the storage block list.
[0137] In this embodiment, after reading the storage block list stored in the enabled storage block, the main control chip can obtain the power-off identifier of each storage block and determine the power-off identifier block based on whether the power-off identifier of each storage block is an available power-off identifier. It should be noted that the storage block list read by the main control chip can be stored in the power-off identifier block or in other enabled power-off identifier blocks, and this application is not limited to this. It should also be noted that there can be one or more power-off identifier blocks, and this embodiment is not limited to this.
[0138] S305: When the main control chip determines the block with power-off identification, it controls the backup power system to stop supplying power to the other memory blocks in the enabled state except the block with power-off identification.
[0139] In this embodiment, since the main control chip only needs to store the data to be stored in the volatile memory chip into the power-off identification block, after determining the power-off identification block among multiple enabled storage blocks, the main control chip can control the backup power system to stop supplying power to all enabled storage blocks except the power-off identification block, so as to reduce the amount of power supplied to the solid-state hard drive by the backup power system.
[0140] S306: The main control chip stores the acquired data to be stored in the volatile memory chip into the power-off identification block.
[0141] In this embodiment, when the main control chip detects that the solid-state hard disk is in a power-off state, it can control the backup power system to supply power to the storage block in the enabled state, and read the storage block list stored in the storage block in the enabled state to determine the power-off identification block, and after determining the power-off identification block, stop supplying power to all storage blocks in the enabled state except the power-off identification block, so as to reduce the amount of power supplied to the solid-state hard disk by the backup power system, thereby increasing the number of times the backup power system supplies power to the solid-state hard disk.
[0142] The following describes in detail the process of the main control chip modifying the power-off flag of the storage block through the fourth method embodiment.
[0143] Figure 4 This is a flow chart of a fourth embodiment of a method for protecting a solid-state drive from power failure provided by the present application. The method specifically includes the following steps:
[0144] S401: When the main control chip detects that the solid state drive is not in a power-off state, it determines a storage block to be modified according to the wear and status of each storage block in the storage block list.
[0145] In this embodiment, in the initial state, the power-off flag of each storage block in the storage block list is pre-set to an unavailable power-off flag.
[0146] When the main control chip detects that the solid-state drive is not in a power-off state, it can compare the wear level of each enabled storage block to determine at least one storage block to be modified. The wear level of the storage block to be modified is less than the wear level of other storage blocks except the storage block to be modified, and the storage block to be modified is in an enabled state.
[0147] It should be noted that when the main control chip determines the storage block to be modified from multiple storage blocks, it can also incorporate the available capacity and the preset power-off available capacity into the process of determining the storage block to be modified to determine at least one storage block to be modified. For example, among storage block 104, storage block 105, storage block 106, storage block 107 and storage block 108, when only storage block 104, storage block 106 and storage block 108 are in the enabled state, the main control chip can determine that the storage block 108 and storage block 104 with the smallest wear are the storage blocks to be modified based on the wear degree of storage block 104 being 65, the available capacity of the storage block being 3000, the wear degree of storage block 106 being 120, the available capacity of storage block 106 being 3000, the wear degree of storage block 108 being 21, the available capacity of storage block 108 being 2000, and the preset power-off available capacity being 5000.
[0148] S402: The main control chip modifies the power-off flag corresponding to the storage block to be modified in the storage block list to an available power-off flag.
[0149] In this embodiment, after determining the storage block to be modified, the main control chip can change the power-off flag corresponding to the storage block to be modified in the storage block list from an unavailable power-off flag to an available power-off flag, so as to determine the storage block to be modified as a power-off flag block.
[0150] In this embodiment, when the main control chip detects that the solid-state drive is not in a power-off state, it determines the storage block to be modified based on the wear and status of each storage block in the storage block list, and modifies the power-off flag corresponding to the storage block to be modified in the storage block list to an available power-off flag. This embodiment describes an implementation method for the main control chip to determine the power-off flag of a storage block based on the status and wear of the storage block. By determining the storage block with the least wear among the storage blocks in the enabled state (can be used to store data) as the power-off flag block, the power-off flag block's ability to safely store the data to be stored is ensured, preventing the problem of data to be stored being lost in the power-off flag block.
[0151] The following describes in detail a process in which the main control chip modifies the power failure flag of a storage block when the storage block with the power failure flag set as the available power failure flag is unavailable, through a fifth method embodiment.
[0152] Figure 5 This is a flowchart of a fifth embodiment of a power-off protection method for a solid-state drive provided in an embodiment of the present application. The method specifically includes the following steps:
[0153] S501: When the main control chip detects that the solid state drive is not in a power-off state, it determines whether there is a storage block in a storage block list that is not in an enabled state.
[0154] In this embodiment, when the main control chip detects that the solid-state drive is not in a power-off state, it can determine whether there is a non-enabled storage block in the storage block list based on the state corresponding to each storage block in the storage block list. When the main control chip determines that there is no non-enabled storage block in the storage block list, the process ends, that is, the power-off flag corresponding to the storage block is not modified. When it is determined that there is a non-enabled storage block in the storage block list, S502 is executed. For example, when the main control chip determines that a storage block in the storage block list is in a faulty state, S502 is executed.
[0155] S502: The main control chip determines whether the power-off flag corresponding to the storage block that is not in the enabled state is an available power-off flag.
[0156] In this embodiment, when the main control chip determines that there are storage blocks that are not in the enabled state in the storage block list, it determines, for each storage block that is not in the enabled state, whether the power-off flag corresponding to the storage block that is not in the enabled state is an available power-off flag, that is, determines whether the storage block that is not in the enabled state is a power-off flag block. When the main control chip determines that the power-off flag corresponding to the storage block that is not in the enabled state is an available power-off flag, it executes S503; when it determines that the power-off flag corresponding to the storage block that is not in the enabled state is not an available power-off flag, it determines that the storage block that is not in the enabled state is not a power-off flag block, the power-off flag of the storage block matches the current status of the storage block, and at this time, there is no need to modify the power-off flag corresponding to the storage block, and the process ends.
[0157] S503: The main control chip changes the power-off flag corresponding to the storage block that is not in the enabled state to an unavailable power-off flag.
[0158] In this embodiment, when the main control chip determines that the power-off identifier corresponding to a storage block that is not in an enabled state is an available power-off identifier, it determines that the storage block is a power-off identifier block. Since the storage block is currently not in an enabled state, it cannot be used to store the data to be stored in the volatile memory chip. Therefore, the main control chip needs to modify the power-off identifier corresponding to the storage block that is not in an enabled state in the storage block list to an unavailable power-off identifier.
[0159] It should be noted that when the main control chip modifies the power-off flag of the storage block that is not in the enabled state to an unavailable power-off flag, that is, when the storage block is modified from a power-off flag block to a non-power-off flag block, it is necessary to reselect a storage block from other enabled storage blocks and modify the power-off flag of the reselected storage block to an available power-off flag, so that the storage block can serve as the power-off flag block. The process of the main control chip reselecting a storage block from other enabled storage blocks to serve as the power-off flag block is the same as in the aforementioned embodiment and will not be repeated in this embodiment.
[0160] In this embodiment, when the main control chip detects that the solid-state drive is not in a power-off state, it determines whether there is a storage block in the storage block list that is not in an enabled state, and when it is determined that there is a storage block in the storage block list that is not in an enabled state, it determines whether the power-off flag corresponding to the storage block in the non-enabled state is an available power-off flag; when the main control chip determines that the power-off flag corresponding to the storage block in the non-enabled state is an available power-off flag, it modifies the power-off flag corresponding to the storage block in the non-enabled state to an unavailable power-off flag. This embodiment monitors whether the state of the power-off flag block is in an enabled state in real time, promptly modifies the power-off flag of the storage block, and then promptly reselects a storage block from the enabled state as the power-off flag block, so as to ensure that the power-off flag block can safely store the data to be stored that was flushed from the volatile memory chip when the solid-state drive loses power, avoiding the problem of being unable to store the data to be stored that was flushed from the volatile memory chip due to the power-off flag block not being in an enabled state, thereby improving the ability of the non-volatile memory chip to safely store the data to be stored.
[0161] Based on the above method embodiment 1, the process of the main control chip "storing the acquired data to be stored in the volatile memory chip into the power-off identification block" in S202 is further described below through method embodiment 6.
[0162] In this embodiment, a flash translation layer mapping table is maintained within the solid-state drive. This flash translation layer mapping table can reflect the correspondence between LBA addresses (space addresses visible to the user) and the actual flash memory space within the solid-state drive. When the main control chip determines the power-off identification block, it can modify the flash memory space allocation range in the flash translation layer mapping table based on the physical location corresponding to the power-off identification block recorded in the storage block list. The main control chip can then store the to-be-stored data obtained from the volatile memory chip at the physical location corresponding to the power-off identification block, i.e., within the power-off identification block, based on the modified flash memory space allocation range in the flash translation layer mapping table.
[0163] In this embodiment, the main control chip modifies the flash memory space allocation range in the flash memory translation layer mapping table according to the physical position corresponding to the power-off identification block in the storage block list, and stores the data to be stored in the acquired volatile memory chip into the power-off identification block according to the flash memory space allocation range in the modified flash memory translation layer mapping table, so as to ensure that the data to be stored in the volatile memory chip can be stored only in the power-off identification block, thereby improving the security of the non-volatile memory chip storing the data to be stored.
[0164] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0165] Figure 6 This is a schematic structural diagram of an embodiment of a power-off protection device for a solid-state hard disk provided in this application; Figure 6 As shown, the power-off protection device 60 for a solid-state drive includes a control module 61 and a processing module 62. The control module 61 is configured to control the backup power system to supply power to the main control chip and the volatile memory chip upon detecting that the solid-state drive is in a power-off state. The processing module 62 is configured to determine a power-off identification block based on the power-off identification of each storage block in a read storage block list, control the backup power system to supply power to the power-off identification block, and store the acquired data to be stored in the volatile memory chip in the power-off identification block. The storage block list includes the power-off identifications of multiple storage blocks divided by the non-volatile memory chip.
[0166] The power-off protection device for a solid-state hard disk provided in the embodiment of the present application can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0167] In a possible implementation scheme, the processing module 62 is specifically used to: read a storage block list stored in a volatile memory chip, or read a storage block list stored in a storage block in an enabled state; and determine a power-off identification block based on the power-off identification of each storage block in the storage block list.
[0168] The power-off protection device for a solid-state hard disk provided in the embodiment of the present application can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0169] In one possible implementation, the processing module 62 is further used to monitor and obtain parameters of each storage block, and update the storage block list stored in the volatile memory chip and / or each enabled storage block; wherein the parameters include: physical location, status, wear level, power-off flag, and available capacity.
[0170] The power-off protection device for a solid-state hard disk provided in the embodiment of the present application can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0171] In a possible implementation scheme, the control module 61 is also used to: when it is detected that the solid-state hard disk is in a power-off state, control the backup power system to supply power to the storage block in the enabled state; when a power-off identification block is determined, control the backup power system to stop supplying power to other storage blocks in the enabled state except the power-off identification block.
[0172] The power-off protection device for a solid-state hard disk provided in the embodiment of the present application can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0173] In a possible implementation scheme, the processing module 62 is further used to: when it is detected that the solid-state hard disk is not in a power-off state, determine the storage block to be modified based on the wear and status of each storage block in the storage block list; wherein the wear of the storage block to be modified is less than the wear of other storage blocks except the storage block to be modified, and the storage block to be modified is in an enabled state; and modify the power-off flag corresponding to the storage block to be modified in the storage block list to an available power-off flag.
[0174] The power-off protection device for a solid-state hard disk provided in the embodiment of the present application can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0175] In a possible implementation scheme, the processing module 62 is further used to: when it is detected that the solid-state hard disk is not in a power-off state, determine whether there is a storage block in the storage block list that is not in an enabled state, and when it is determined that there is a storage block in the storage block list that is not in an enabled state, determine whether the power-off identifier corresponding to the storage block that is not in an enabled state is an available power-off identifier; when it is determined that the power-off identifier corresponding to the storage block that is not in an enabled state is an available power-off identifier, modify the power-off identifier corresponding to the storage block that is not in an enabled state to an unavailable power-off identifier.
[0176] The power-off protection device for a solid-state hard disk provided in the embodiment of the present application can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0177] In a possible implementation scheme, the control module 61 is specifically used to: modify the flash memory space allocation range in the flash memory translation layer mapping table according to the physical position corresponding to the power-off identification block in the storage block list; and store the data to be stored in the acquired volatile memory chip into the power-off identification block according to the flash memory space allocation range in the modified flash memory translation layer mapping table.
[0178] The power-off protection device for a solid-state hard disk provided in the embodiment of the present application can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0179] In a possible implementation scheme, the control module 61 is further used to: after detecting that the volatile memory chip has finished storing the data to be stored in the power-off identification block, control the backup power system to stop supplying power to the main control chip, the volatile memory chip and the power-off identification block.
[0180] The power-off protection device for a solid-state hard disk provided in the embodiment of the present application can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.
[0181] An embodiment of the present application also provides a solid-state hard disk, comprising: a main control chip, a volatile memory chip, a non-volatile memory chip and a backup power system, wherein the main control chip is used to control the backup power system to supply power to the main control chip and the volatile memory chip when detecting that the solid-state hard disk is in a power-off state; the main control chip is also used to determine a power-off identification block based on the power-off identification of each storage block in a read storage block list, control the backup power system to supply power to the power-off identification block, and store the data to be stored in the acquired volatile memory chip in the power-off identification block; wherein the storage block list includes the power-off identifications of multiple storage blocks divided by the non-volatile memory chip.
[0182] The technical solution shown in this embodiment, its implementation principle and beneficial effects are similar to those of the aforementioned method embodiment, and will not be repeated here.
[0183] Figure 7 This is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. Figure 7 As shown, computing device 70 includes motherboard 71 and solid state drive 72. Motherboard 71 includes motherboard interface 711, and solid state drive 72 includes hard drive connector 722. Motherboard 71 is connected to solid state drive 72 via motherboard interface 711 and hard drive connector 722.
[0184] In one possible implementation, the computing device 70 may further include an adapter cable, and the mainboard 71 may be connected to the solid-state drive 72 via the mainboard interface 711 , the adapter cable, and the hard drive connector 722 .
[0185] Among them, the computing device can be a terminal device (mobile phone, computer) and server and other devices.
[0186] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution provided by any of the aforementioned method embodiments.
[0187] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0188] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A power-off protection method for a solid-state hard disk, characterized in that: include: When the main control chip detects that the solid state hard disk is in a power-off state, the main control chip controls the backup power system to supply power to the main control chip and the volatile memory chip; The main control chip determines a power-off identification block based on the power-off identification of each storage block in the read storage block list, controls the backup power system to supply power to the power-off identification block, and stores the acquired data to be stored in the volatile memory chip in the power-off identification block; wherein, the storage block list includes the power-off identifications of multiple storage blocks divided by the non-volatile memory chip; wherein, the power-off identification indicates whether the storage block can be used to store the data to be stored in the volatile memory chip when the solid-state hard disk loses power; the power-off identification block refers to a storage block marked as an available power-off identification in the storage block list.
2. The power-off protection method for a solid-state hard disk according to claim 1, wherein: The main control chip determines the power-off identification block according to the power-off identification of each storage block in the read storage block list, including: The main control chip reads a storage block list stored in the volatile memory chip, or reads a storage block list stored in a storage block in an enabled state; The main control chip determines the power-off identification block according to the power-off identification of each storage block in the storage block list.
3. The power-off protection method for a solid-state hard disk according to claim 1, wherein: Also includes: The main control chip monitors and obtains parameters of each storage block, and updates the storage block list stored in the volatile memory chip and / or each storage block in an enabled state; The parameters include: physical location, status, wear level, power-off flag and available capacity.
4. The power-off protection method for a solid-state hard disk according to claim 2, wherein: When the main control chip reads the storage block list stored in the storage block in the enabled state, the method further includes: When the main control chip detects that the solid-state hard disk is in the power-off state, the main control chip controls the backup power system to supply power to the storage block in the enabled state; When the main control chip determines the power-off identification block, it controls the backup power system to stop supplying power to the other storage blocks in the enabled state except the power-off identification block.
5. The power-off protection method for a solid-state hard disk according to claim 4, wherein: Also includes: When the main control chip detects that the solid-state hard disk is not in the power-off state, the main control chip determines the storage block to be modified according to the wear degree and state of each storage block in the storage block list; wherein the wear degree of the storage block to be modified is less than the wear degree of other storage blocks except the storage block to be modified, and the storage block to be modified is in an enabled state; The main control chip modifies the power-off flag corresponding to the storage block to be modified in the storage block list into an available power-off flag.
6. The power-off protection method for a solid-state hard disk according to claim 5, wherein: Also includes: When the main control chip detects that the solid-state hard disk is not in the power-off state, it determines whether there is a storage block in the storage block list that is not in the enabled state, and when it is determined that there is a storage block in the storage block list that is not in the enabled state, it determines whether the power-off identifier corresponding to the storage block in the disabled state is the available power-off identifier; When the main control chip determines that the power-off flag corresponding to the storage block that is not in the enabled state is the available power-off flag, the main control chip modifies the power-off flag corresponding to the storage block that is not in the enabled state into an unavailable power-off flag.
7. The power-off protection method for a solid-state hard disk according to claim 1, wherein: The step of storing the acquired data to be stored in the volatile memory chip into the power-off identification block includes: The main control chip modifies the flash memory space allocation range in the flash translation layer mapping table according to the physical position corresponding to the power-off identification block in the storage block list; The main control chip stores the acquired data to be stored in the volatile memory chip into the power-off identification block according to the flash memory space allocation range in the modified flash translation layer mapping table.
8. The power-off protection method for a solid-state hard disk according to claim 1, wherein: Also includes: After detecting that the volatile memory chip finishes storing the data to be stored in the power-off identification block, the main control chip controls the backup power system to stop supplying power to the main control chip, the volatile memory chip, and the power-off identification block.
9. A solid state hard disk, characterized in that: include: Main control chip, volatile memory chip, non-volatile memory chip and backup power system; among them, The main control chip is used to control the backup power system to supply power to the main control chip and the volatile memory chip when detecting that the solid state hard disk is in a power-off state; The main control chip is further used to determine a power-off identification block based on the power-off identification of each storage block in the read storage block list, control the backup power system to supply power to the power-off identification block, and store the acquired data to be stored in the volatile memory chip in the power-off identification block; wherein, the storage block list includes the power-off identification of multiple storage blocks divided by the non-volatile memory chip; wherein, the power-off identification indicates whether the storage block can be used to store the data to be stored in the volatile memory chip when the solid-state hard disk loses power; the power-off identification block refers to a storage block marked as an available power-off identification in the storage block list.
10. A computing device, configured to implement the method according to any one of claims 1 to 8, characterized in that: The computing device includes a motherboard and a solid-state drive; Wherein, the mainboard includes a mainboard interface, and the solid-state hard disk includes a hard disk connector; The mainboard is connected to the solid state hard disk through the mainboard interface and the hard disk connector.
Citation Information
Patent Citations
Standby power system and solid state disk
CN113760074A
Data writing method and device, equipment and storage medium
CN115167784A