Storage device and system area data storage method and device of storage device
By dividing system area storage blocks into sub-blocks based on data requirements, the method optimizes storage space utilization, enhancing performance and reliability in storage devices.
Patent Information
- Application Number
- CN202411076510.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-12-06
AI Technical Summary
Existing storage devices face inefficiencies in managing system area data, leading to wasted storage space and reduced performance and reliability due to fixed allocation of storage blocks without considering the actual data requirements.
The system area storage blocks are divided into sub-blocks, allowing for allocation based on actual data needs, reducing the number of blocks required and optimizing storage space utilization.
This approach enhances storage device performance and reliability by minimizing waste and improving space utilization in the system area.
Smart Images

Figure CN119088292A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically, to a storage device and a method and device for storing data in a system area of the storage device. Background Art
[0002] Storage devices, such as Solid State Drives (SSDs), are one of the key components in computer storage systems. They are widely used in the storage field of computer systems due to their high data access speed and reliable performance. In addition to maintaining user data, storage devices also need to maintain some system area data. How to effectively manage system area data to improve storage device performance and reliability is crucial. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a storage device and a method and apparatus for storing system area data of a storage device, so as to divide the system area storage blocks and store the system area data in the divided sub-blocks, thereby allocating sub-blocks according to the actual storage requirements of the system area data, reducing the number of storage blocks required for the system area data, that is, using fewer storage blocks to store the system area data, reducing the waste of storage space, improving the utilization rate of the system area storage space, and thus increasing the performance and reliability of the storage device system.
[0004] In a first aspect, an embodiment of the present invention provides a storage device, the storage device comprising:
[0005] User storage area, used to store non-system area data;
[0006] The system storage area is used to store system area data of the storage device, wherein the system storage area includes at least one system area storage block, and the system area storage block includes at least one sub-block.
[0007] Optionally, the number of sub-blocks into which the system area storage block is divided is configured according to a predetermined requirement, and the predetermined requirement is determined according to a data type of the system area data and a data volume of each data type.
[0008] Optionally, the system storage area is a flash memory storage area.
[0009] Optionally, the system storage area includes but is not limited to an SLC area, an MLC area and / or a TLC area.
[0010] In a second aspect, an embodiment of the present invention provides a method for storing system area data of a storage device, wherein the storage device includes a system storage area, the system storage area includes at least one system area storage block, the system area storage block includes at least one sub-block, and the method includes:
[0011] Reading system area data of the storage device;
[0012] The system area data is written into the corresponding sub-block.
[0013] Optionally, the storage device has system area data of at least one data type, and writing the system area data into the corresponding sub-block includes:
[0014] Determine the number and address of target sub-blocks of each system area data according to the data amount of the system area data of each data type;
[0015] Each of the system area data is written into the corresponding target sub-block.
[0016] Optionally, the method further includes:
[0017] receiving a system area data operation instruction, wherein the system area data operation instruction includes a data type and an instruction type of the system area data to be processed, and the instruction type includes an erase instruction, a write instruction, and a read instruction;
[0018] Determining a corresponding sub-block to be processed from the system storage area according to the data type in the system area data operation instruction;
[0019] Execute an operation instruction corresponding to the instruction type on the sub-block to be processed.
[0020] In a third aspect, an embodiment of the present invention provides a system area data storage device of a storage device, wherein the storage device includes a system storage area, the system storage area includes at least one system area storage block, the system area storage block includes at least one sub-block, and the device includes:
[0021] A data reading unit, configured to read system area data of the storage device;
[0022] The data writing unit is configured to write the system area data into the corresponding sub-block.
[0023] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions or data, wherein the one or more computer program instructions are executed by the processor to implement the method as described above.
[0024] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program or data is stored, and the computer program implements the method described above when executed by a processor.
[0025] In a sixth aspect, an embodiment of the present invention provides a computer program product, which, when executed on a computer, enables the computer to execute the method described above.
[0026] The storage device of the embodiment of the present invention includes a user storage area for storing non-system area data and a system storage area for storing system area data of the storage device, wherein the system storage area includes at least one system area storage block, and the system area storage block includes at least one sub-block. Therefore, the embodiment of the present invention can divide the system area storage block and store various types of system area data through the divided sub-blocks, thereby allocating sub-blocks according to the actual storage requirements of the system area data, reducing the waste of storage space, improving the utilization rate of the system area storage space, and thus increasing the performance and reliability of the storage device system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0028] Figure 1 is a schematic diagram of the system storage area for a comparative proportion;
[0029] Figure 2 is a schematic diagram of a storage device according to an embodiment of the present invention;
[0030] Figure 3 is a schematic diagram of a storage block according to an embodiment of the present invention;
[0031] Figure 4 is a schematic diagram of a system storage area in an embodiment of the present invention;
[0032] Figure 5 is a flow chart of a method for storing data in a system area of a storage device according to an embodiment of the present invention;
[0033] Figure 6 is a schematic diagram of a system area data storage process according to an embodiment of the present invention;
[0034] Figure 7 is a flow chart of a system area data management method according to an embodiment of the present invention;
[0035] Figure 8 is a schematic diagram of a system area data storage device of a storage device according to an embodiment of the present invention;
[0036] Fig. 9 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The present application is described below based on embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, some specific details are described in detail. It is possible for those skilled in the art to fully understand the present application without the description of these details. In order to avoid confusing the essence of the present application, known methods, processes, flows, components and circuits are not described in detail.
[0038] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.
[0039] Unless the context clearly requires otherwise, the words "include", "comprising" and similar words throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is "including but not limited to".
[0040] In the description of this application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" is two or more.
[0041] The embodiments of the present invention are mainly described in detail by taking the storage device as a solid state hard disk as an example. It should be understood that the storage device of this embodiment may also be other solid state storage devices, such as an SD card.
[0042] A solid-state drive is a hard drive that uses non-volatile memory to store data, usually implemented using flash memory technology. The solid-state drive consists of a control unit and a storage unit. The storage unit uses flash memory, such as NAND flash memory. The control unit is responsible for data reading, writing, and erasing operations, as well as error correction, garbage collection, and wear leveling to ensure the life of the solid-state drive.
[0043] NAND flash memory is a non-volatile storage technology that keeps data unchanged even when the power is off. NAND flash memory is a common storage medium in solid-state storage devices (such as USB flash drives, solid-state drives SSDs, SD cards, etc.). The basic storage unit of NAND flash memory is composed of a metal-oxide-semiconductor field-effect transistor (MOSFET), which contains a floating gate or charge storage layer. The floating gate or charge storage layer is located below the control gate and is separated by an insulating layer. This floating gate or charge storage layer is where the charge is actually stored, and the presence or absence of charge determines the state of the storage unit.
[0044] Data is stored in NAND flash memory in the form of charge, and the amount of stored charge is controlled by the voltage applied to the control gate. When the voltage of the control gate is high enough, electrons can pass from the source through the thin oxide layer under the floating gate to the floating gate. This process is called programming (writing). If the voltage of the control gate is not enough for electrons to pass through the oxide layer, the charge of the floating gate will be retained until it is cleared by an erase operation. Data is read by detecting whether the charge on the floating gate exceeds a specific threshold voltage Vth. If there is enough charge on the floating gate, the threshold voltage increases, so that when the standard read voltage is applied to the control gate, the transistor is in the off state, which represents the data "0". Conversely, if there is no charge or very little charge on the floating gate, the transistor is in the on state, which represents the data "1".
[0045] NAND flash memory is divided into different types of flash memory according to the number of bits that each storage cell can store, such as SLC (single-level cell), MLC (multi-level cell), TLC (triple-level cell), QLC (quadruple-level cell) and PLC (quintuple-level cell). SLC (single-level cell), that is, each cell stores 1 bit of data, providing high speed and long life. MLC (multi-level cell), that is, each cell stores 2 bits of data, increasing storage density and reducing costs. TLC (triple-level cell), that is, each cell stores 3 bits of data, further increasing storage density and reducing costs. QLC (quadruple-level cell), that is, each cell stores 4 bits of data, further increasing storage density and reducing costs. PLC (quintuple-level cell), that is, each cell stores 5 bits of data, providing the maximum storage density. NAND flash memory technology is constantly evolving, continuously improving storage density and reducing costs, while optimizing performance and life to meet various storage needs.
[0046] SSD needs to maintain some system area data to ensure the function realization and performance of SSD. System area data may include various table items (such as partition table items, file allocation table items, address mapping table items, etc.) and related log logs and other system data that need to be stored inside. For example, the data types of system area data may include FW bin data, Log log data, PowerLoss data and L2P data, etc. Among them, FW bin data includes all firmware codes and configuration information required for SSD operation, and is a binary file of SSD firmware. Optionally, the area where FW bin data is stored can be called firmware area. SSD firmware is software embedded in SSD, which is responsible for controlling and managing SSD hardware operations, including data reading and writing, error correction, garbage collection, wear leveling, etc. Log log data includes log files recorded inside SSD, such as various events and status information during SSD operation, which can be used to diagnose SSD faults, optimize performance and data recovery, etc. Power Loss data mainly involves the data protection mechanism of SSD in the case of power outage, to ensure that SSD can protect the data in cache from loss when power is interrupted. L2P (Logic to Physical) data includes data such as an address mapping table, which is used to map a logical address to an actual physical address to achieve data access.
[0047] Figure 1 This is a schematic diagram of a comparative system storage area. In some comparative system area data storage implementations, the SSD needs to allocate a certain amount of storage blocks (blocks) to the system area data. Optionally, if the SSD uses NAND flash memory and the storage unit is of SLC type, the storage area in the SSD can be divided into multiple SLC blocks. Similarly, if the SSD uses NAND flash memory and the storage unit is of MLC type, the storage area in the SSD can be divided into multiple MLC blocks. With the development of flash memory technology, the number of stacked layers of flash memory continues to increase, the size of a single storage block (block size) increases, the number of storage blocks allocated to the system area data remains unchanged, but the system area data has not increased significantly in proportion, resulting in idle storage blocks in the system area, causing a waste of SSD space. Figure 1As shown, the storage unit of the SSD is divided into a system storage area 11 and a user storage area 12. The system storage area 11 and the user storage area 12 are both pre-selected logical partitions in the SSD, which can be implemented by any logical partitioning tool or method. When the flash memory is used as the storage medium, in the comparative example, since each storage block corresponding to the flash memory is the smallest erase unit, that is, the data of the entire storage block will be erased as a whole, multiple types of system area data cannot generally be stored in the storage block, and thus, each type of system area data needs to be allocated at least one storage block. Optionally, the areas of the system storage area 11 and the user storage area 12 can be identified by a partition table, wherein the partition table may include storage blocks corresponding to the system storage area 11 and storage blocks corresponding to the user storage area 12. The storage areas in the storage unit of the SSD except the system storage area 11 can be configured as the user storage area 12, and other areas can also be reserved as backup. The system storage area 11 is allocated with a predetermined number of storage blocks, and the user storage area is also divided into a plurality of storage blocks. The number of storage blocks of the system storage area 11 can be determined according to the number of categories of system area data and the amount of system area data in each category. Figure 1 As shown, storage blocks b1-b4 store different types of system area data respectively, for example, storage block b1 is used to store FW bin data, storage block b2 is used to store Log data, storage block b3 is used to store Power Loss data, and storage block b4 is used to store L2P data. As the number of stacked layers of flash memory continues to increase, the size of a single storage block increases, but the system area data has not increased significantly, resulting in insufficient storage blocks in the system storage area 11 to be fully consumed. For example, most of the storage blocks b1-b3 have idle storage areas, resulting in a certain amount of storage space waste. Therefore, the embodiment of the present invention provides a storage device and a method and device for storing system area data of a storage device, which divides the system area storage blocks and stores the system area data through the divided sub-blocks, thereby allocating sub-blocks according to the actual storage requirements of the system area data, reducing the waste of storage space, improving the utilization rate of the system area storage space, and thus increasing the performance of the storage device system.
[0048] This embodiment mainly takes a storage device as a solid state drive SSD and uses NAND flash memory as an example for detailed description. It should be understood that this embodiment does not limit the type of storage device and the flash memory technology used.
[0049] Figure 2 Schematic diagram of a storage device according to an embodiment of the present invention. Figure 2As shown, the storage device is a solid state drive SSD. The solid state drive SSD includes a control unit 21 and a storage unit 22. Among them, the control unit 21 can be an integrated circuit chip with corresponding signal processing capabilities, which is used to perform operations such as reading, writing and erasing on the data in the storage unit 22. The storage unit 22 includes a system storage area 221 and a user storage area 222. The user storage area 222 user storage area is used to store non-system area data, such as user data. The system storage area 221 is used to store system area data of the solid state drive SSD. Among them, the system storage area 221 includes at least one system area storage block, and the system area storage block includes at least one sub block. Among them, the number of system area storage blocks allocated to the system storage area 221 can be predetermined according to the size of the storage area, the size of the sub block, and the data volume of each type of system area data. Optionally, the system area storage block can be composed of multiple continuous pages (page), and the page is the basic storage unit of the flash memory, which is used for writing and reading data. Further optionally, the system storage area 221 can be further divided into multiple planes (Plane), each Plane includes multiple blocks (Block). In an optional implementation, the embodiment of the present invention can divide a set of multiple pages in a system area storage block into a sub-block, or divide a set of multiple pages in a plane in a system area storage block into a sub-block. Optionally, the sub-block division method can be determined according to the flash memory technology used by the specific solid-state drive or the amount of system area data.
[0050] Figure 3 Schematic diagram of a storage block in an embodiment of the present invention. Optionally, in this embodiment, the sub-block division may be a physical area division of the SSD storage area or a logical level division. Figure 5 As shown, assuming that the system area storage block b0 is composed of a group of continuous pages p1-p6, and the size of the sub-block includes 2 pages, then pages p1-p2 can be configured as a sub-block sub1, pages b3-b4 can be configured as a sub-block sub2, and pages b5-b6 can be configured as a sub-block sub3. Further, optionally, the sub-blocks of this embodiment use current flash memory technology (such as NAND flash memory, etc.) or other flash memory technologies to be developed in the future to divide the storage block into physical areas, and can also use software division to divide the logical areas, and this embodiment is not limited to this.
[0051] In an optional implementation, the system storage area 221 is a flash memory storage area. Further optionally, if the solid state drive SSD adopts NAND flash memory technology, the system storage area 221 can adopt an SLC area and / or an MLC area. In other optional implementations, the system storage area 221 can also be stored in a TLC, QLC, PLC, etc., which can be set according to actual needs, and this embodiment does not limit this.
[0052] Figure 4 Schematic diagram of the system storage area of an embodiment of the present invention. Figure 4 As shown, the embodiment of the present invention can divide the storage block in the system storage area 221 into multiple sub-blocks, and use the sub-block as the smallest erase unit to store various types of system area storage blocks. Taking logical partition as an example, this embodiment can logically divide the storage block block in the system storage area 221 into multiple sub-blocks, and maintain a logical to physical mapping table through the corresponding control unit, map the logical address of each sub-block with the corresponding physical address, and obtain multiple sub-blocks corresponding to the storage block in the system storage area 221. Figure 3 Taking the system area storage block b0 as an example, this embodiment can logically divide the system area storage block b0 into three sub-blocks for data management.
[0053] Furthermore, this embodiment can predetermine the required number of sub-blocks based on the size of the storage block, the configured sub-block size, and the data volume of each type of system area data, and then determine the number of storage blocks required to store the system area data, and configure a corresponding number of storage blocks from the SSD based on the required number of storage blocks to form a system storage area 221.
[0054] Furthermore, the present embodiment allocates corresponding sub-blocks to each type of system area data according to the data volume of each type of system area data to realize the storage of each type of system area data. Therefore, the present embodiment can make full use of the storage space of each storage block, realize the allocation of sub-blocks according to the actual storage demand of the system area data, reduce the number of storage blocks required for the system area data, that is, use fewer storage blocks to realize the storage of the system area data, reduce the waste of storage space, improve the utilization rate of the system area storage space, and thus increase the performance of the storage device system.
[0055] like Figure 4 As shown, the storage block in the system storage area 221 is divided into three sub-blocks. Taking the storage blocks b1 and b2 in the system storage area 221 as an example, the storage block b1 is divided into sub-blocks sub11, sub-block sub12 and sub-block sub13, and the storage block b2 is divided into sub-blocks sub21, sub-block sub22 and sub-block sub23. It should be understood that the storage block division method of this embodiment is different from the above-mentioned implementation method (for example Figure 3 The embodiment shown in FIG. 1 is similar to that shown in FIG. 1 and will not be described in detail here.
[0056] In an optional implementation, the number of sub-blocks into which the system area storage block is divided is configured according to a predetermined requirement. The predetermined requirement may be determined according to the data type of the system area data and the data volume of each data type. Figure 4As shown, still taking the system area data including storage of FW bin data, Log data, Power Loss data and L2P data as an example, assuming that based on the size of the sub-block and the amount of data of each type of system area data, the storage of FW bin data, Log data and Power Loss data only requires one sub-block, and the storage of L2P data requires three sub-blocks, then the FW bin data can be stored in sub-block sub11, the Log data can be stored in sub-block sub12, the Power Loss data can be stored in sub-block sub13, and the L2P data can be stored in sub21-sub23 respectively. Therefore, relative to Figure 1 In the comparative example shown, for the same type of system area data, the comparative example needs to configure 4 storage blocks as the system storage area, while this embodiment only needs 2 storage blocks as the system storage area.
[0057] Therefore, this embodiment can divide the system area storage block into multiple sub-blocks, so that the method of performing erase operations in units of storage blocks (blocks) can be converted into a method of performing erase operations in units of sub-blocks, and then the sub-blocks can be allocated according to the actual storage requirements of the system area data, thereby reducing the waste of storage space, improving the utilization rate of the system area storage space, and thus increasing the performance and reliability of the storage device system.
[0058] In a further optional implementation, if some sub-blocks in the system storage block are configured to be in an idle state, they can be used as reserved sub-blocks for use when the system area data increases, and they can also be used as user data storage blocks, and based on the address mapping table, the mapping relationship between the user logical address and the physical address of the idle sub-block can be recorded to further improve the space utilization of the storage device.
[0059] Figure 5 1 is a flow chart of a method for storing system data in a storage device according to an embodiment of the present invention. The method for storing system data in the storage device according to this embodiment can be applied to any storage device in the above-mentioned implementation mode. Figure 5 As shown, the system area data storage method of the storage device according to the embodiment of the present invention comprises the following steps:
[0060] Step S110, reading the system area data of the storage device. In an embodiment of the present invention, in the process of applying the storage device, corresponding system area data is generated, and then the generated system area data to be written into the system storage area is read and written into the corresponding sub-block. Among them, the storage device has system area data of at least one data type, such as various types of table entries, related logs, etc. Step S120, writing the system area data into the corresponding sub-block. In an optional implementation, this embodiment determines the number and address of target sub-blocks of each system area data according to the data volume of the system area data of each data type, and writes each system area data into the corresponding target sub-block according to the address of the target sub-block. Further, this embodiment can allocate corresponding target sub-blocks based on corresponding system area data when the storage device is partitioned, and can also determine the target sub-block of each data type from the pre-divided sub-blocks based on the data volume of the system area data of each data type when the system area data is written.
[0061] Optionally, due to the quality differences between different storage blocks or different sub-blocks, the probability of data errors in storage blocks or sub-blocks with poor quality is higher. Therefore, this embodiment can also identify the quality of sub-blocks in the system storage area, and determine the target sub-block based on the quality ranking of the sub-blocks and the data volume of the read system area data. For example, if the sub-block required for the read system area data is 1, the sub-block with the best quality among the idle sub-blocks is determined as the target sub-block, and the read system area data is stored in the target sub-block.
[0062] Further optionally, the present embodiment may determine the quality of the sub-block by the number of erasures of the sub-block, for example, determining the sub-block with the least number of erasures as the sub-block with the best quality, and determining the sub-block with the worst number of erasures as the sub-block with the worst quality. In other optional implementations, the present embodiment may also determine the quality of the sub-block by the average number of bit flips of the sub-block, and the method for determining the quality of the sub-block is not limited herein.
[0063] In an optional implementation, the present embodiment may also identify bad sub-blocks and record the bad sub-blocks in a bad sub-block table to avoid the situation where data in the system area is written into the bad sub-blocks causing subsequent data errors. Further optionally, the present embodiment may determine a sub-block that fails to be erased as a bad sub-block by performing an erase operation on the sub-blocks in the system storage area, or may determine a sub-block that fails to be programmed as a bad sub-block by performing a preset programming operation on the sub-blocks.
[0064] In an optional implementation, if the number of bad sub-blocks in the system storage area increases, resulting in that the good sub-blocks in the system storage area are insufficient to store the system area data, this embodiment can also update the system storage area and the user storage area of the storage device, for example, by dividing some good free storage blocks in the user storage area into the system storage area, and updating the corresponding partition table to ensure the reliability of the storage device.
[0065] In an optional implementation, after the system area data is written, a corresponding mapping table can be generated based on the data type and sub-block identifier or sub-block address of the system area data, so as to facilitate the subsequent determination of the sub-block based on the mapping table and the data type in the system area data operation instruction, and perform corresponding data operations on the data in the sub-block.
[0066] Figure 6 FIG. 2 is a schematic diagram of a system area data storage process according to an embodiment of the present invention. Figure 6 As shown, each storage block in the system storage area is divided into three sub-blocks. The storage device obtains the system area data data to be written, determines that three sub-blocks need to be allocated according to the data amount of the system area data data to be written, determines three free good sub-blocks with the best quality from the system storage area as target sub-blocks, such as sub-blocks sub61, sub-block sub62 and sub-block sub63 in storage block b6 as target sub-blocks, and writes the system area data data into sub-blocks sub61, sub-block sub62 and sub-block sub63.
[0067] Figure 7 is a flow chart of the system area data management method of an embodiment of the present invention. Further, the system area data storage method of this embodiment also includes the management of the stored system area data. Figure 7 As shown, the system area data management method of the embodiment of the present invention includes the following steps:
[0068] Step S210, receiving a system area data operation instruction. The system area data operation instruction includes a data type and an instruction type of the system area data to be processed. The instruction type includes an erase instruction, a write instruction, and a read instruction. Optionally, the system area data operation instruction of this embodiment can be issued by a control unit of the storage device, or by a host computer, and this embodiment does not limit this.
[0069] Among them, the system area data operation instruction includes a data type field and an instruction type field. After receiving the system area data operation instruction, this embodiment can identify the data type field and the instruction type field in the system area data operation instruction to obtain the data type and the instruction type. In an optional implementation, the system area data operation instruction may also include an identifier for indicating that the system area data is operated, so that after the storage device receives and identifies the field in the instruction, the instruction is determined to be a system area data operation instruction. In another optional implementation, the system area data operation instruction may also include address information accessed by the instruction, and this embodiment may determine that it is a system area data operation instruction through the address information. In other optional implementations, since the field types in the system area data operation instruction and the user area data operation instruction are different, this embodiment may also determine that the received instruction is a system area data operation instruction by identifying the unique field in the system area operation instruction. This embodiment does not limit the method of how to identify the received instruction as a system area operation instruction.
[0070] Step S220, determine the corresponding sub-block to be processed from the system storage area according to the data type in the system area data operation instruction. In an optional implementation, if the instruction type of the system area data operation instruction is a read instruction or an erase instruction, the sub-block to be processed can be determined according to the data type in the system area data operation instruction and the mapping table corresponding to the data type and the sub-block identifier or sub-block address. If the instruction type of the system area data operation instruction is a write instruction, that is, writing data to an idle sub-block, the sub-block to be processed can be determined according to the following example: Figure 6 The illustrated implementation method determines the sub-block to be processed, which will not be described in detail here.
[0071] Step S230: Execute the operation instruction corresponding to the instruction type on the sub-block to be processed. Figure 6 Taking the system area data data shown in the figure as an example, assuming that a data erasing instruction for the system area data data is received, the corresponding sub-blocks to be processed sub61-sub63 are queried from the system storage area. Since the present embodiment performs overall erasing with sub-blocks as erasing units, an erasing operation is performed to erase all system area data in the sub-blocks to be processed sub61-sub63. Therefore, the present embodiment can divide the system area storage block into multiple sub-blocks to implement an erasing operation with sub-blocks as units, thereby implementing storage of various types of system area data through sub-blocks, reducing the waste of storage space, improving the utilization rate of the system area storage space, and thereby increasing the performance and reliability of the storage device system.
[0072] The storage device of the embodiment of the present invention includes a user storage area for storing non-system area data and a system storage area for storing system area data of the storage device, wherein the system storage area includes at least one system area storage block, and the system area storage block includes at least one sub-block. Therefore, the embodiment of the present invention can divide the system area storage block, and classify and store the system area data through the divided sub-blocks, so as to realize the allocation of sub-blocks according to the actual storage demand of the system area data, reduce the number of storage blocks required for the system area data, that is, the storage of the system area data can be realized by using fewer storage blocks, and realize the method of performing the erasing operation in units of sub-blocks, thereby reducing the waste of storage space, improving the utilization rate of the system area storage space, and further increasing the performance and reliability of the storage device system.
[0073] Figure 8 Schematic diagram of a system area data storage device of a storage device according to an embodiment of the present invention. The storage device includes a system storage area, the system storage area includes at least one system area storage block, and the system area storage block includes at least one sub-block. Figure 8 As shown, the system area data storage device 8 of the storage device of this embodiment includes a data reading unit 81 and a data writing unit 82. The data reading unit 81 is configured to read the system area data of the storage device. The data writing unit 82 is configured to write the system area data into the corresponding sub-block.
[0074] In an optional implementation, the storage device has system area data of at least one data type, and the data write unit 82 is further configured to perform: determining the number and address of target sub-blocks of each system area data according to the data amount of the system area data of each data type, and writing each system area data into the corresponding target sub-block.
[0075] In an optional implementation, the system area data storage device 8 of the storage device also includes a data management unit, which is configured to execute: receiving a system area data operation instruction, the system area data operation instruction includes a data type and an instruction type of the system area data to be processed, the instruction type includes an erase instruction, a write instruction, and a read instruction, determining a corresponding sub-block to be processed from the system storage area according to the data type in the system area data operation instruction, and executing an operation instruction corresponding to the instruction type on the sub-block to be processed.
[0076] The storage device of the embodiment of the present invention includes a user storage area for storing non-system area data and a system storage area for storing system area data of the storage device, wherein the system storage area includes at least one system area storage block, and the system area storage block includes at least one sub-block. Therefore, the embodiment of the present invention can divide the system area storage block, and classify and store the system area data through the divided sub-blocks, so as to realize the allocation of sub-blocks according to the actual storage demand of the system area data, reduce the number of storage blocks required for the system area data, that is, the storage of the system area data can be realized by using fewer storage blocks, and realize the method of performing the erasing operation in units of sub-blocks, thereby reducing the waste of storage space, improving the utilization rate of the system area storage space, and further increasing the performance and reliability of the storage device system.
[0077] Fig. 9 Schematic diagram of an electronic device according to an embodiment of the present invention. In this embodiment, the electronic device 9 may be a control unit inside the storage device in the above embodiment, or may be a host computer of the storage device. Fig. 9 As shown, the electronic device 9: includes at least one processor 91; and a memory 92 that is communicatively connected to at least one processor 91; and a communication component 93 that is communicatively connected to a scanning device, and the communication component 93 receives and sends data under the control of the processor 91; wherein the memory 92 stores instructions that can be executed by at least one processor 91, and the instructions are executed by at least one processor 91 to implement the system area data storage method of the above-mentioned storage device.
[0078] Specifically, the electronic device includes: one or more processors 91 and a memory 92, Fig. 9 A processor 91 is taken as an example. The processor 91 and the memory 92 may be connected via a bus or other means. Fig. 9 In the example, the bus connection is used. The memory 92 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 91 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 92, that is, the system area data storage method of the above-mentioned storage device is realized.
[0079] The memory 92 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store a list of options, etc. In addition, the memory 92 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 92 may optionally include a memory remotely arranged relative to the processor 91, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0080] One or more modules are stored in the memory 92, and when executed by one or more processors 91, the system area data storage method of the storage device in any of the above method embodiments is executed.
[0081] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.
[0082] The storage device of the embodiment of the present invention includes a user storage area for storing non-system area data and a system storage area for storing system area data of the storage device, wherein the system storage area includes at least one system area storage block, and the system area storage block includes at least one sub-block. Therefore, the embodiment of the present invention can divide the system area storage block, and classify and store the system area data through the divided sub-blocks, so as to realize the allocation of sub-blocks according to the actual storage demand of the system area data, reduce the number of storage blocks required for the system area data, that is, the storage of the system area data can be realized by using fewer storage blocks, and realize the method of performing the erasing operation in units of sub-blocks, thereby reducing the waste of storage space, improving the utilization rate of the system area storage space, and further increasing the performance and reliability of the storage device system.
[0083] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used for a computer to execute part or all of the above method embodiments.
[0084] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0085] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A storage device, characterized in that: The storage device comprises: User storage area, used to store non-system area data; The system storage area is used to store system area data of the storage device, wherein the system storage area includes at least one system area storage block, and the system area storage block includes at least one sub-block.
2. The storage device according to claim 1, characterized in that The number of sub-blocks into which the system area storage block is divided is configured according to a predetermined requirement, and the predetermined requirement is determined according to the data type of the system area data and the data volume of each data type.
3. The storage device according to claim 1, characterized in that: The system storage area is a flash memory storage area.
4. The storage device according to claim 3, characterized in that: The system storage area includes an SLC area, an MLC area and / or a TLC area.
5. A method for storing system area data of a storage device, characterized in that: The storage device includes a system storage area, the system storage area includes at least one system storage block, the system storage block includes at least one sub-block, and the method includes: Reading system area data of the storage device; The system area data is written into the corresponding sub-block.
6. The method according to claim 5, characterized in that The storage device has system area data of at least one data type, and writing the system area data into the corresponding sub-block comprises: Determine the number and address of target sub-blocks of each system area data according to the data amount of the system area data of each data type; Each of the system area data is written into the corresponding target sub-block.
7. The method according to claim 5, characterized in that The method further comprises: receiving a system area data operation instruction, wherein the system area data operation instruction includes a data type and an instruction type of the system area data to be processed, and the instruction type includes an erase instruction, a write instruction, and a read instruction; Determining a corresponding sub-block to be processed from the system storage area according to the data type in the system area data operation instruction; Execute an operation instruction corresponding to the instruction type on the sub-block to be processed.
8. A system area data storage device of a storage device, characterized in that: The storage device includes a system storage area, the system storage area includes at least one system storage block, the system storage block includes at least one sub-block, and the apparatus includes: A data reading unit, configured to read system area data of the storage device; The data writing unit is configured to write the system area data into the corresponding sub-block.
9. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions or data, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 5 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or data, and when the computer program is executed by a processor, the method according to any one of claims 5 to 7 is implemented.
11. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 5 to 7.
Citation Information
Patent Citations
Memory device and method for protecting its protection partition
CN101271426A
Data storage method and device
CN101271429A
Method and device for storing data of set top box
CN103440205A
A method and apparatus for metadata brushing
CN109407989A
Nonvolatile memory device and operating method thereof
CN110554836A
