Data storage method and related device

By obtaining the concurrent storage area feature information of ZNS SSD and selecting the appropriate storage unit for data writing, the problem of difficult to achieve performance improvement and life extension of ZNS SSD in the prior art is solved, and more efficient data writing and longer device life are achieved.

CN112148226BActive Publication Date: 2025-04-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011024579.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-25
Publication Date
2025-04-18
Estimated Expiration
2040-09-25

AI Technical Summary

Technical Problem

When writing data, existing ZNS SSDs lack effective storage unit selection methods, which makes it difficult to achieve performance improvement and life expectancy.

Method used

By acquiring the characteristic information of at least two concurrent storage areas of the storage device, including the number of open storage units, data read and write traffic and operation parameters of blank storage units, the target storage unit is reasonably selected for data writing.

Benefits of technology

This method helps improve the data writing performance of SSD, balance read and write traffic, and extend the service life of SSD.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112148226B_ABST
    Figure CN112148226B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a data storage method and related device, the method comprising: when detecting the existence of data to be written, obtaining characteristic information of each concurrent storage area of ​​at least two concurrent storage areas of a storage device, the characteristic information comprising one or more of the number of open storage units, data read and write flow, and operation parameters of blank storage units; determining a target storage unit from a plurality of storage units included in the at least two concurrent storage areas according to the characteristic information of each concurrent storage area; and writing the data to be written into the target storage unit. By adopting the embodiment of the present application, a storage unit can be reasonably selected for the data to be written based on the characteristic information of the storage area, which is conducive to improving the performance of the storage device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a data storage method, a data storage device, an electronic device, and a computer-readable storage medium. Background Art

[0002] Storage devices are devices used to store information, usually digitizing the information and then storing it in media using electrical, magnetic or optical methods. Solid State Disk (SSD), as a type of storage device, is a hard disk made of a solid-state electronic storage chip array. Among them, Zoned Namespaces (ZNS) is a new interface for solid-state hard disks. It uses partitions to manage data, divides the SSD into several storage units (zones), and performs sequential write mode in each partition. ZNS can effectively reduce write amplification and increase the life of the SSD through sequential writing. In addition, ZNS technology can also increase the available space of the SSD for users to use and reduce the user's storage cost. The technology is currently being standardized in the Non-Volatile Memory Express (NVME) standard.

[0003] However, how to select storage units when writing data to ZNS SSD to further improve the performance of the storage device is an urgent problem that needs to be solved. Summary of the invention

[0004] The embodiments of the present application provide a data storage method and related apparatus, which can reasonably select a storage unit for data to be written based on characteristic information of a storage area, thereby helping to improve the performance of a storage device.

[0005] On the one hand, an embodiment of the present application provides a data storage method, including:

[0006] When detecting that there is data to be written, acquiring characteristic information of each concurrent storage area of ​​at least two concurrent storage areas of the storage device;

[0007] Determining a target storage unit from a plurality of storage units included in the at least two concurrent storage areas according to the characteristic information of each concurrent storage area;

[0008] Writing the data to be written into the target storage unit;

[0009] The characteristic information includes one or more of the number of open storage cells, data read and write traffic, and operating parameters of blank storage cells; the open storage cells are storage cells that are performing data write operations, and the blank storage cells are storage cells that do not store data.

[0010] In one aspect, a data storage device, corresponding to an electronic device, comprises:

[0011] a communication unit, configured to obtain characteristic information of each of at least two concurrent storage areas of a storage device when detecting the presence of data to be written;

[0012] a processing unit, configured to determine a target storage unit from a plurality of storage units included in the at least two concurrent storage areas according to the characteristic information of each concurrent storage area;

[0013] The processing unit is further used to write the data to be written into the target storage unit;

[0014] The characteristic information includes one or more of the number of open storage cells, data read / write traffic, and operation parameters of blank storage cells; the open storage cells are storage cells that are performing data write operations.

[0015] In one possible example, in terms of determining the target storage unit from the multiple storage units included in the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processing unit is specifically used to determine at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area; and determine the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area.

[0016] In one possible example, in terms of determining at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processing unit is specifically configured to determine, based on the number of open storage units in each concurrent storage area, a concurrent storage area with the least number of open storage units from the at least two concurrent storage areas; and select the concurrent storage area with the least number of open storage units as a candidate concurrent storage area, wherein the concurrent storage area with the least number of open storage units is one or more.

[0017] In a possible example, in terms of determining at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processing unit is specifically configured to determine, based on the data read and write traffic of each concurrent storage area, a concurrent storage area with the smallest data read and write traffic from the concurrent storage areas with blank storage cells in the at least two concurrent storage areas; and use the concurrent storage area with the smallest data read and write traffic as a candidate concurrent storage area, wherein the number of the concurrent storage areas with the smallest data read and write traffic is one or more.

[0018] In one possible example, in the aspect of determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, the processing unit is specifically used to determine the target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage areas; and determine the blank storage unit ranked first among the multiple storage units included in the target concurrent storage area as the target storage unit.

[0019] In one possible example, in the aspect of determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, wherein the characteristic information includes the operating parameters of the blank storage unit, the processing unit is specifically used to determine the target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage areas; and determine, among the multiple storage units included in the target concurrent storage area, the blank storage unit having the smallest value indicated by the operating parameters of the blank storage unit as the target storage unit.

[0020] In one possible example, in terms of determining the target storage unit from the multiple storage units included in the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processing unit is specifically used to determine, based on the operating parameters of the blank storage units in each concurrent storage area, a blank storage unit having the smallest value indicated by the operating parameters of the blank storage units from the multiple storage units included in the at least two concurrent storage areas; and determine the blank storage unit having the smallest value indicated by the operating parameters of the blank storage units as the target storage unit.

[0021] On the one hand, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the method.

[0022] Accordingly, an embodiment of the present application provides a chip, which includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface and executes a method such as the above method example and any possible example implementation method.

[0023] Accordingly, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute some or all of the steps described in the above method.

[0024] Accordingly, the embodiment of the present application further provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above method.

[0025] In the embodiment of the present application, the data storage device pre-sets concurrent storage areas for storage units in the storage device, obtains characteristic information of at least two concurrent storage areas, and then determines a target storage unit from multiple storage units included in the at least two concurrent storage areas based on one or more of the number of open storage units, data read and write traffic, and operating parameters of blank storage units included in the characteristic information, and then writes the data to be written into the target storage unit determined based on the characteristic information. A storage unit can be reasonably selected for the data to be written based on the characteristic information of the storage area, which is conducive to improving the performance of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1A It is a structural schematic diagram of a data storage system provided in an embodiment of the present application;

[0028] Figure 1B is a schematic diagram of an SSD backend topology structure provided in an embodiment of the present application;

[0029] Figure 1C This is a schematic diagram of the structure of a silicon wafer provided in an embodiment of the present application;

[0030] Figure 1DIt is a schematic diagram of the structure of a ZNS provided in an embodiment of the present application;

[0031] Figure 1E is a structural schematic diagram of a storage unit provided in an embodiment of the present application;

[0032] Figure 1F is a schematic diagram of the structure of a super block provided in an embodiment of the present application;

[0033] Figure 2A It is a flowchart of a data storage method provided by an embodiment of the present application;

[0034] Figure 2B It is a structural diagram of a concurrent storage area provided in an embodiment of the present application;

[0035] Figure 3A It is a flowchart of another data storage method provided by an embodiment of the present application;

[0036] Figure 3B is a schematic diagram of a process for determining a target storage unit provided by an embodiment of the present application;

[0037] Figure 3C is another flowchart of determining a target storage unit provided by an embodiment of the present application;

[0038] Figure 3D is a schematic diagram of operating parameter values ​​of a blank storage area provided in an embodiment of the present application;

[0039] Figure 3E is a schematic diagram of operating parameter values ​​of another blank storage area provided in an embodiment of the present application;

[0040] Figure 4 is a schematic diagram of a functional unit of a data storage device provided in an embodiment of the present application;

[0041] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. 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 limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0044] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0045] Currently, there is a lack of relevant technology to explain how to allow the written data to select the different zones divided inside the ZNS SSD, so as to further improve the performance of the SSD and extend its life.

[0046] In view of the above problems, an embodiment of the present application provides a data storage method, which is applied to a data storage device and is described in detail below with reference to the accompanying drawings.

[0047] First, see Figure 1A The structural schematic diagram of the data storage system 100 shown includes a data storage device 110 and a storage device 120 .

[0048] The data storage device 110 can serve as a host of the storage device 120 , access the storage device through a logical block address (LBA), and control the reading and writing of data in the storage device.

[0049] The data storage device 110 may be the electronic device itself, or an internal or external device of the electronic device. The electronic device may include, for example, a distributed storage server, a traditional server, a large storage system, a desktop computer, a laptop computer, a tablet computer, a PDA, a smart phone, a portable digital player, a smart watch, and a smart bracelet.

[0050] The above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application does not limit this.

[0051] The storage device 120 may be a solid state drive (SSD), and the SSD may be a zoned namespace (Zoned Namespaces, ZNS) SSD. The backend topology of the SSD may be as follows: Figure 1B As shown, Figure 1B The example shows four data transmission channels, Channel0-Channel4, and data can be transmitted in parallel between different channels. On the same channel, silicon wafers (die) are placed in series, and the dies can be numbered sequentially, such as (Channel0, CE0), (Channel1, CE0), etc.

[0052] A single Die can be understood as a bare silicon chip taken out of the SSD wafer. It is the smallest individual with a chip enable (CE) signal, or a chip select signal (CE). SSD will encapsulate many Dies, and the master control must select this Die when operating on a certain Die. During operation, the CE signal of this Die is pulled high so that subsequent read and write operations can be performed. The more CEs in a solid-state drive, the higher the concurrent execution capability and the faster the theoretical performance. The actual number of channels, dies, and CEs can be adjusted according to the specific product, and there is no unique limitation here.

[0053] As the smallest unit that independently executes commands inside the flash memory, a die can be composed of multiple blocks. In order to improve the read and write concurrency of the die, it is composed of 1 to N planes. Figure 1C The left side shows a die with two planes. Block0 and block1 are on plane0 and plane1 respectively, so block0 and block1 can be read and written at the same time. However, block0 and block2 are both on plane0, so reading and writing cannot be performed at the same time. Figure 1CThe right side shows a die with one plane. Similarly, block0, block1, etc. on plane0 cannot be read or written at the same time. A die can also have other numbers of planes.

[0054] In addition, the ZNS (Zoned Namespace) partition namespace SSD is different from the current SSD random read and write. Figure 1D As shown in a, for upper layer applications, ZNS divides LBA into storage units (zones), such as zone0, zone1...zoneX, and then writes data in each zone sequentially. Multiple zones can start sequential writing at the same time. Figure 1D As shown in b, for a specific zone, a write command is used to advance the write pointer, or a reset write pointer command is used to move the write pointer back.

[0055] Each ZNS zone is smaller than the size of a super block. When ZNS is implemented inside an SSD, a zone is usually composed of one or more blocks. Figure 1E As shown in the figure, each zone can be composed of 2 blocks, spanning 2 dies. Of course, in addition to the example in 1E, the composition of zones can also be adjusted according to the specific storage data content and size.

[0056] Super block, such as Figure 1F As shown in the figure, taking a silicon chip (die) with only one plane as an example, each die in the SSD takes a block to form a super block, such as block0 selected from each die in the dotted box, that is, each horizontal row is a super block. All blocks1 or block2 can also constitute a super block. In order to maximize concurrency, the SSD performs erase and write operations in units of super blocks. That is, when the SSD operates, the super block will be erased at the same time, and data will be written at the same time. When a die has multiple planes, the super block can also include each CE of each channel and the block selected by each plane.

[0057] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.

[0058] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.

[0059] The technical solution of the embodiment of the present application can be based on Figure 1A The communication system of the architecture shown in the example or its modified architecture is specifically implemented.

[0060] See also Figure 2A , Figure 2A : is a flow chart of a data storage method provided by an embodiment of the present application, which is applied to an electronic device, wherein the electronic device is configured with a storage device, which can be understood as comprising at least two concurrent storage areas, each of the at least two concurrent storage areas comprising a plurality of storage units, and the method may include but is not limited to the following steps:

[0061] 201. When it is detected that there is data to be written, characteristic information of each of at least two concurrent storage areas of the storage device is obtained; wherein the characteristic information includes one or more of the number of open storage units, data read and write traffic, and operating parameters of blank storage units; the open storage unit is a storage unit that is performing a data write operation.

[0062] Specifically, the data storage device may pre-set multiple zones as logically associated areas, that is, concurrent storage areas. Figure 2BAs shown, for a specific concurrent storage area, it can include multiple storage units (zones), and these multiple zones can belong to multiple data transmission channels (channels) and multiple chip select signals (CE / Die); of course, it can also be a zone composed of different chip select signals (CE / Die) on the same channel (channel). Figure 2B For example, a storage unit (zone) composed of different chip select signals (CE / Die) on different channels (channel) constitutes a concurrent storage area, such as a first concurrent storage area, a second concurrent storage area, etc. In a single SSD or a storage system composed of multiple SSDs, there may be at least one or more of the above concurrent storage areas.

[0063] Furthermore, when the data storage device detects that there is data to be written, it will obtain the characteristic information of each of the at least two concurrent storage areas. For example, if there are two concurrent storage areas, the characteristic information of the two concurrent storage areas will be obtained separately or obtained to distinguish the two concurrent storage areas. The data to be written can be the data storage device receiving a data write request instruction from another user terminal, and the instruction contains the data to be written; or it can be determined by the data storage device after automatic detection.

[0064] In addition, the characteristic information includes the number of open storage units, as described above Figure 2B As shown, the open storage unit is a storage unit that is performing a data write operation, such as zone0. The number of open storage units in the first concurrent storage area composed of zone0 and position 1 is 1. Similarly, since zone1 has completed the data write operation, the number of open storage units in the second concurrent storage area composed of zone1 and position 2 is 0. The above-mentioned blank storage unit is a storage unit that does not store data, such as Figure 2B The storage cells (zones) such as position 1, position 2, etc. shown in the figure can be defined as blank storage cells because no data is stored. The operation parameter of the blank storage cell can be a PE (Program Erase) value. When the data is written to a block, the data is erased immediately, and the PE value corresponding to the block is increased by 1. The PE value can be used to represent a parameter of the SSD life.

[0065] 202. Determine a target storage unit from a plurality of storage units included in the at least two concurrent storage areas according to the characteristic information of each concurrent storage area.

[0066] Specifically, the data storage device obtains characteristic information of each of the at least two concurrent storage areas, and then determines the target storage unit according to the characteristic information of each concurrent storage area. The target storage unit may be one of the multiple storage units included in any one of the at least two concurrent storage areas; or multiple storage units that meet the conditions may be selected from at least the two concurrent storage areas as the target storage unit. The process of determining the target unit according to the characteristic information may be determined by taking the concurrent storage area as the unit of comparison; or may be determined based on the specific storage unit (zone) included in the concurrent storage area as the unit of comparison.

[0067] 203. Write the data to be written into the target storage unit.

[0068] Specifically, it can be understood that after determining the target storage unit, the data storage device writes the aforementioned data to be written into the target storage unit. The aforementioned characteristic information includes one or more of the number of open storage units, data read and write flow, and operation parameters of blank storage units.

[0069] It can be seen that the data storage device pre-sets concurrent storage areas for storage units in the storage device. And obtains characteristic information of at least two concurrent storage areas, and then determines the target storage unit from the multiple storage units included in the at least two concurrent storage areas based on one or more of the number of open storage units, data read and write traffic, and operating parameters of blank storage units included in the characteristic information, so that the selection of the target storage unit can improve the concurrency of SSD data writing, or the balanced distribution of read and write traffic, and extend the service life of the SSD.

[0070] With the above Figure 2A The embodiment shown is consistent with that shown in FIG. Figure 3A , Figure 3A 1 is a flow chart of another data storage method provided by an embodiment of the present application, which is applied to an electronic device, wherein the electronic device is configured with a storage device, wherein the storage device includes at least two concurrent storage areas, and each of the at least two concurrent storage areas includes a plurality of storage units. The method may include but is not limited to the following steps:

[0071] 301. When it is detected that there is data to be written, characteristic information of each of at least two concurrent storage areas of the storage device is obtained; wherein the characteristic information includes one or more of the number of open storage units, data read and write traffic, and operating parameters of blank storage units; the open storage unit is a storage unit that is performing a data write operation.

[0072] 302. Determine at least one candidate concurrent storage region from the at least two concurrent storage regions according to the feature information of each concurrent storage region.

[0073] Specifically, after acquiring the characteristic information of each concurrent storage area, the data storage device may first determine at least one candidate concurrent storage area from at least two concurrent storage areas based on the characteristic information. The characteristic information includes one or more of the number of open storage units, data read / write flow, and operating parameters of blank storage units. When determining at least one candidate concurrent storage area, the candidate concurrent storage area may be determined based on one or more of the number of open storage units, data read / write flow, and operating parameters of blank storage units of each concurrent storage area.

[0074] 303. Determine a target storage unit from a plurality of storage units included in the at least one candidate concurrent storage area.

[0075] Specifically, after determining at least one candidate concurrent storage area, the data storage device may determine a target storage unit from a plurality of storage units included in each of the at least one candidate concurrent storage area.

[0076] 304. Write the data to be written into the target storage unit.

[0077] Step 301 and step 304 refer to the aforementioned step 201 and step 203, which will not be described again.

[0078] It can be seen that the data storage device pre-sets concurrent storage areas for the storage units in the ZNS SSD. And obtains the characteristic information of at least two concurrent storage areas, and then determines at least one candidate concurrent storage area from the at least two concurrent storage areas based on the number of open storage units, data read and write traffic, and one or more of the operating parameters of the blank storage units included in the characteristic information, and then determines the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, and then writes the data to be written into the target storage unit determined based on the characteristic information. Effectively simplifies the computational complexity when selecting the target storage unit. And the selection of the target storage unit can improve the concurrency of SSD data writing, or the balanced distribution of read and write traffic, and extend the service life of the SSD.

[0079] In a possible example, the characteristic information includes the number of open storage units, and determining at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area includes: determining a concurrent storage area with the least number of open storage units from the at least two concurrent storage areas based on the number of open storage units in each concurrent storage area; and taking the concurrent storage area with the least number of open storage units as a candidate concurrent storage area, wherein the concurrent storage area with the least number of open storage units is one or more.

[0080] Specifically, in the embodiment of the present application, in combination with the step of determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, the process of determining the target storage unit according to the number of open storage units can be as follows: Figure 3B As shown. Figure 2B As shown, currently zone0, zone1, zone2, and zone3 belong to the first concurrent storage area, the second concurrent storage area, the third concurrent storage area, and the Nth concurrent storage area, respectively. Zone0 in the first concurrent storage area is still writing data and is an open storage unit. Zone1, zone2, and zone3 have already written data. Therefore, except for the number of development areas in the first concurrent storage area, which is 1, the number of open areas in other concurrent storage areas is 0. The second concurrent storage area, the third concurrent storage area, and the Nth concurrent storage area have the least number of open storage units and can all be used as candidate concurrent storage areas.

[0081] For another example, the number of open storage units in the first concurrent storage region is 3, the number of open storage units in the second concurrent storage region is 2, the number of open storage units in the third concurrent storage region is 0, and the number of open storage units in the Nth concurrent storage region is 1. The second concurrent storage region is the concurrent storage region with the least number of open storage units, and the second concurrent storage region can be used as a candidate concurrent storage region.

[0082] In addition, the embodiment of the present application does not distinguish between the number of planes contained in a Die. Whether a Die contains a single plane or multiple planes, the candidate concurrent storage area can be determined by referring to this method.

[0083] It can be seen that when the characteristic information includes the number of open storage units, taking the concurrent storage area with the least number of open storage units as the candidate concurrent storage area is conducive to improving the concurrency of data writing.

[0084] In a possible example, the characteristic information includes the data read and write traffic, and determining at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area includes: determining, based on the data read and write traffic of each concurrent storage area, a concurrent storage area with the smallest data read and write traffic from concurrent storage areas with blank storage cells among the at least two concurrent storage areas; and using the concurrent storage area with the smallest data read and write traffic as a candidate concurrent storage area, wherein the number of the concurrent storage areas with the smallest data read and write traffic is one or more.

[0085] Specifically, the embodiment of the present application combines the step of determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, and the process of determining the target storage unit according to the data read and write traffic, which can be as follows: Figure 3C As shown. The data storage device records the data read and write traffic of each concurrent storage area in the recent period, that is, the input and output traffic (IO traffic) of each concurrent storage area when reading and writing data, including the traffic of reading data and the traffic of writing data. When the characteristic information includes the data read and write traffic, at least one candidate concurrent storage area is determined from the at least two concurrent storage areas according to the characteristic information of each concurrent storage area, that is, according to the data read and write traffic of each concurrent storage area, the concurrent storage area with the smallest data read and write traffic is selected as the candidate concurrent storage area.

[0086] It can be seen that when selecting candidate concurrent storage areas, the data storage device selects the concurrent storage area with the smallest data read and write traffic as the candidate concurrent storage area, which is beneficial to balancing the IO traffic of each concurrent storage area.

[0087] In one possible example, determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area includes: determining the target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage areas; and determining a blank storage unit ranked first among the multiple storage units included in the target concurrent storage area as the target storage unit.

[0088] Specifically, after the data storage device determines a candidate concurrent storage area according to the above algorithm, for example, according to the number of open storage units and / or data read and write traffic, it can determine the target concurrent storage area from at least one candidate concurrent storage area according to the priority order of the preset concurrent storage areas. The priority order includes the order of data transmission channels (channel), then CE, and then Plane. As mentioned above Figure 2BAs shown, the determined candidate concurrent storage areas are the second concurrent storage area, the third concurrent storage area and the Nth concurrent storage area. Since there are open storage units in the first concurrent storage area in channe0 and channe1, the second concurrent storage area located at (channe2, CE0) and channe3, CE0) is preferentially selected as the target concurrent storage area.

[0089] Furthermore, since the target concurrent storage area includes multiple storage units, when determining the target storage unit from the target concurrent storage area, selection can be made according to the internal sorting. For example, in the second concurrent storage area, there are other blank zones below position 2, and position 2 is the blank storage unit ranked first in the second concurrent storage area, then position 2 is determined as the target storage unit.

[0090] It can be seen that when there are multiple candidate concurrent storage areas, the data storage device can determine the target concurrent storage area according to a preset priority order, such as channel order, CE order, or plane order, etc. Then the blank storage unit ranked first in the target concurrent storage area is determined as the target storage unit. This can effectively improve data writing efficiency, reduce data write amplification, and reduce the waste of SSD storage space.

[0091] In one possible example, the characteristic information includes operating parameters of the blank storage unit, and determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area includes: determining the target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage areas; and determining, among the multiple storage units included in the target concurrent storage area, a blank storage unit having the smallest value indicated by the operating parameters of the blank storage unit as the target storage unit.

[0092] Specifically, after the data storage device determines a candidate concurrent storage area according to the above algorithm, for example, according to the number of open storage units and / or data read and write traffic, it can determine the target concurrent storage area from at least one candidate concurrent storage area according to the priority order of the preset concurrent storage areas. After determining the target concurrent storage area, the data storage device determines the blank storage unit with the smallest value as the target storage unit according to the operating parameters of each blank storage unit, that is, the PE value. Figure 3D As shown, in the target concurrent storage area, the PE values ​​of the blank storage cells are 87, 30, and 65 respectively, and the blank storage cell with a PE value of 30 is used as the target storage cell.

[0093] It can be seen that after determining the target concurrent storage area, the data storage device uses the blank storage unit with the smallest PE value in the target concurrent storage area as the target storage unit. By balancing the number of times each storage unit is used, the overall service life of the SSD is improved.

[0094] In one possible example, the characteristic information includes operating parameters of the blank storage cell, and determining the target storage cell from the multiple storage cells included in the at least two concurrent storage areas based on the characteristic information of each concurrent storage area includes: determining, from the multiple storage cells included in the at least two concurrent storage areas, a blank storage cell having the smallest value indicated by the operating parameters of the blank storage cells based on the operating parameters of the respective blank storage cells in each concurrent storage area; and determining the blank storage cell having the smallest value indicated by the operating parameters of the blank storage cells as the target storage cell.

[0095] Specifically, when the data storage device determines the target storage unit from the multiple storage units included in at least two concurrent storage areas according to the operating parameters of the blank storage units included in the feature information, i.e., the PE value, it determines the target storage unit according to the operating parameters of each blank storage unit in each concurrent storage area. Figure 3E As shown, the PE values ​​of the blank storage cells are 87, 30, 65, 47, 100, 80, 87, 27, 77, etc. Among them, the blank storage cell with a PE value of 27 is the blank storage cell with the smallest PE value, and the blank storage cell with a PE value of 27 is used as the target storage cell.

[0096] It can be seen that when determining the target storage unit, the data storage device compares the PE values ​​of all blank storage units and uses the blank storage unit with the smallest PE value as the target storage unit. By balancing the number of times each storage unit is used, the overall service life of the SSD is improved.

[0097] Optionally, the data storage device may pre-set the proportion of the algorithm corresponding to each feature information when determining which one or more feature information in the feature information is used to determine the target storage unit. For example, setting the target storage unit determined according to the number of open storage units to Algorithm 1, for example, Figure 2BAs shown, the number of open storage units in the first concurrent storage area is 3, the number of open storage units in the second concurrent storage area is 2, the number of open storage units in the second concurrent storage area is 0, and the number of open storage units in the Nth concurrent storage area is 1. Then the second concurrent storage area is the concurrent storage area with the least number of open storage units, and the second concurrent storage area can be used as the candidate concurrent storage area. Determining the target storage unit according to the data read / write traffic is set as Algorithm 2, that is, according to the data read / write traffic of each concurrent storage area, the concurrent storage area with the smallest data read / write traffic is selected as the candidate concurrent storage area. Determining the target storage unit according to the operation parameters of the blank storage units is set as Algorithm 3. For example, as Figure 3D shown, in the target concurrent storage area, the PE values of each blank storage unit are 87, 30, and 65 respectively. Then the blank storage unit with a PE value of 30 is used as the target storage unit. Different selection weights and selection scores are set for different algorithms to determine the algorithm for finally determining the target storage unit. The weight system can be shown as the following formula:

[0098] P = αP1 + βP2 + γP3

[0099] where P1 is the selection score of Algorithm 1, P2 is the selection score of Algorithm 2, and P3 is the selection score of Algorithm 3. α is the selection weight of Algorithm 1, β is the selection weight of Algorithm 2, and γ is the selection weight of Algorithm 3. The values of α, β, and γ are in the range of [0, 1], and α + β + γ = 1. Finally, the algorithm to be finally adopted is determined according to the calculated P value. For example, if the calculated P value ≤ 5, then Algorithm 1 is adopted; 5 < P value ≤ 10, then Algorithm 2 is adopted; 10 < P value ≤ 20, then Algorithm 3 is adopted, etc. The combination of various algorithms is realized.

[0100] Please refer to again Figure 4 , which is a schematic diagram of the functional units of a data storage device 400 according to an embodiment of the present invention. The data storage device 400 in the embodiment of the present application can be an internal device of an electronic device or can also be an external device of an electronic device. The data storage device is configured with a storage device, and the storage device includes at least two concurrent storage areas, and each of the at least two concurrent storage areas includes a plurality of storage units.

[0101] In one implementation manner of the device according to the embodiment of the present invention, the data storage device includes:

[0102] A communication unit 410, configured to obtain the characteristic information of each of the at least two concurrent storage areas of the storage device when it is detected that there is data to be written.

[0103] The processing unit 420 is configured to determine a target storage unit from the plurality of storage units included in the at least two concurrent storage areas according to the characteristic information of each concurrent storage area.

[0104] The processing unit 420 is further configured to write the data to be written into the target storage unit.

[0105] The characteristic information includes one or more of the number of open storage cells, data read and write traffic, and operating parameters of blank storage cells; the open storage cells are storage cells that are performing data write operations, and the blank storage cells are storage cells that do not store data.

[0106] In one possible example, in terms of determining the target storage unit from the multiple storage units included in the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processing unit 420 is specifically used to determine at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area; and determine the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area.

[0107] In a possible example, in terms of determining at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processing unit 420 is specifically configured to determine, based on the number of open storage units in each concurrent storage area, a concurrent storage area with the least number of open storage units from the at least two concurrent storage areas; and use the concurrent storage area with the least number of open storage units as a candidate concurrent storage area, wherein the concurrent storage area with the least number of open storage units is one or more.

[0108] In a possible example, in which the characteristic information includes the data read and write traffic, and in terms of determining at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processing unit 420 is specifically configured to determine, based on the data read and write traffic of each concurrent storage area, a concurrent storage area with the smallest data read and write traffic from the concurrent storage areas with blank storage cells in the at least two concurrent storage areas; and use the concurrent storage area with the smallest data read and write traffic as a candidate concurrent storage area, wherein the number of the concurrent storage areas with the smallest data read and write traffic is one or more.

[0109] In one possible example, in terms of determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, the processing unit 420 is specifically used to determine the target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage areas; and determine the blank storage unit ranked first among the multiple storage units included in the target concurrent storage area as the target storage unit.

[0110] In one possible example, in which the characteristic information includes the operating parameters of the blank storage unit, and in terms of determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, the processing unit 420 is specifically used to determine the target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage areas; and determine, among the multiple storage units included in the target concurrent storage area, the blank storage cell with the smallest value indicated by the operating parameters of the blank storage unit as the target storage unit.

[0111] In one possible example, in terms of determining the target storage unit from the multiple storage units included in the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processing unit 420 is specifically configured to determine, based on the operating parameters of the blank storage units in each concurrent storage area, a blank storage unit having the smallest value indicated by the operating parameters of the blank storage unit from the multiple storage units included in the at least two concurrent storage areas; and determine the blank storage unit having the smallest value indicated by the operating parameters of the blank storage unit as the target storage unit.

[0112] In some embodiments, the data storage device may further include an input / output interface, a communication interface, a power supply, and a communication bus.

[0113] The embodiment of the present application can divide the data storage device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0114] See also Figure 5, is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention, the electronic device includes a power supply module and other structures, and includes a processor 501, a storage device 502 and a communication interface 503. The processor 501, the storage device 502 and the communication interface 503 can exchange data.

[0115] The storage device 502 may include a volatile memory, such as a random-access memory (RAM); the storage device 502 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the storage device 502 may also include a combination of the above-mentioned types of memory. The communication interface 503 is an interface for data exchange between internal devices of the electronic device, such as: between the storage device 502 and the processor 501.

[0116] The processor 501 may be a central processing unit (CPU) 501. In one embodiment, the processor 501 may also be a graphics processing unit (GPU) 501. The processor 501 may also be a combination of a CPU and a GPU. In one embodiment, the storage device 502 is used to store program instructions. The processor 501 may call the program instructions and execute the following steps:

[0117] When detecting that there is data to be written, acquiring characteristic information of each concurrent storage area of ​​at least two concurrent storage areas of the storage device;

[0118] Determining a target storage unit from a plurality of storage units included in the at least two concurrent storage areas according to the characteristic information of each concurrent storage area;

[0119] Writing the data to be written into the target storage unit;

[0120] The characteristic information includes one or more of the number of open storage cells, data read and write traffic, and operating parameters of blank storage cells; the open storage cells are storage cells that are performing data write operations, and the blank storage cells are storage cells that do not store data.

[0121] In one possible example, in terms of determining the target storage unit from the multiple storage units included in the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processor 501 is specifically used to: determine at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area; determine the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area.

[0122] In a possible example, in which the characteristic information includes the number of open storage units, and in terms of determining at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processor 501 is specifically used to: determine, based on the number of open storage units in each concurrent storage area, a concurrent storage area with the least number of open storage units from the at least two concurrent storage areas; and use the concurrent storage area with the least number of open storage units as a candidate concurrent storage area, wherein the concurrent storage area with the least number of open storage units is one or more.

[0123] In a possible example, in which the characteristic information includes the data read and write traffic, and in terms of determining at least one candidate concurrent storage area from the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processor 501 is specifically used to: determine, based on the data read and write traffic of each concurrent storage area, a concurrent storage area with the smallest data read and write traffic from the concurrent storage areas with blank storage cells in the at least two concurrent storage areas; and use the concurrent storage area with the smallest data read and write traffic as a candidate concurrent storage area, wherein the number of the concurrent storage areas with the smallest data read and write traffic is one or more.

[0124] In one possible example, in terms of determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, the processor 501 is specifically used to: determine the target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage areas; and determine a blank storage unit ranked first among the multiple storage units included in the target concurrent storage area as the target storage unit.

[0125] In one possible example, in which the characteristic information includes the operating parameters of the blank storage unit, and in terms of determining the target storage unit from the multiple storage units included in the at least one candidate concurrent storage area, the processor 501 is specifically used to: determine the target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage areas; and determine, among the multiple storage units included in the target concurrent storage area, the blank storage unit with the smallest value indicated by the operating parameters of the blank storage unit as the target storage unit.

[0126] In one possible example, in which the characteristic information includes the operating parameters of the blank storage unit, and in terms of determining the target storage unit from the multiple storage units included in the at least two concurrent storage areas based on the characteristic information of each concurrent storage area, the processor 501 is specifically used to: determine, from the multiple storage units included in the at least two concurrent storage areas, a blank storage unit having the smallest value indicated by the operating parameters of the blank storage unit based on the operating parameters of the respective blank storage units in each concurrent storage area; and determine the blank storage unit having the smallest value indicated by the operating parameters of the blank storage unit as the target storage unit.

[0127] In a specific implementation, the processor 501, the storage device 502, and the communication interface 503 described in the embodiment of the present invention can execute the embodiment of the present invention. Figure 2A or Figure 3A The implementation described in the related embodiments of the data storage method provided can also be implemented in the embodiments of the present invention. Figure 4 The implementation method described in the relevant embodiments of the provided data storage method will not be repeated here.

[0128] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method recorded in the above method embodiments.

[0129] The embodiment of the present application also provides a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs some or all steps of any method recorded in the above method embodiment.

[0130] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0131] The above disclosure is only part of the embodiments of the present invention, which certainly cannot be used to limit the scope of the rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiments and equivalent changes made according to the claims of the present invention are still within the scope of the invention.

Claims

1. A data storage method, characterized in that: include: When it is detected that there is data to be written, characteristic information of each concurrent storage area of ​​at least two concurrent storage areas of the storage device is obtained; wherein the characteristic information includes one or more of the number of open storage cells, data read and write traffic, and operation parameters of blank storage cells; the open storage cells are storage cells that are performing data write operations; the blank storage cells are storage cells that do not store data, and the operation parameters are used to indicate the number of times the blank storage cells are used, and the operation parameters are determined according to the number of times the data is erased after writing data to the blank storage cells; Determine at least one candidate concurrent storage area from the at least two concurrent storage areas according to one or both of the number of open storage units and the data read / write traffic of each concurrent storage area; Determine a target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of the concurrent storage area; Determine the first blank storage unit in the order of the plurality of storage units included in the target concurrent storage area as the target storage unit; or determine the blank storage unit with the smallest value indicated by the operation parameter of the blank storage unit in the plurality of storage units included in the target concurrent storage area as the target storage unit; The data to be written is written into the target storage unit.

2. The method according to claim 1, characterized in that The determining at least one candidate concurrent storage area from the at least two concurrent storage areas according to one or both of the number of open storage units and the data read / write flow of each concurrent storage area comprises: According to the number of open storage units in each of the concurrent storage areas, determining a concurrent storage area with the least number of open storage units from the at least two concurrent storage areas; The concurrent storage region with the least number of open storage units is taken as a candidate concurrent storage region, wherein the concurrent storage region with the least number of open storage units is one or more.

3. The method according to claim 1, characterized in that The determining at least one candidate concurrent storage area from the at least two concurrent storage areas according to one or both of the number of open storage units and the data read / write flow of each concurrent storage area comprises: According to the data read and write flow of each concurrent storage area, determining a concurrent storage area with the smallest data read and write flow from the concurrent storage areas with blank storage cells in the at least two concurrent storage areas; The concurrent storage area with the smallest data read / write traffic is taken as a candidate concurrent storage area, wherein the concurrent storage area with the smallest data read / write traffic is one or more.

4. The method according to claim 1, characterized in that: The method further comprises: According to the operation parameters of each blank storage unit in each concurrent storage area, determining a blank storage unit having a minimum value indicated by the operation parameter of the blank storage unit from the plurality of storage units included in the at least two concurrent storage areas; The blank memory cell having the smallest value indicated by the operation parameter of the blank memory cell is determined as the target memory cell.

5. A data storage device, corresponding to an electronic device, characterized in that: The data storage device comprises: A communication unit, configured to obtain characteristic information of each of at least two concurrent storage areas of a storage device when detecting the presence of data to be written; wherein the characteristic information includes one or more of the number of open storage cells, data read / write traffic, and operation parameters of blank storage cells; the open storage cells are storage cells that are performing data write operations; the blank storage cells are storage cells that do not store data, and the operation parameters are used to indicate the number of times the blank storage cells are used, and the operation parameters are determined according to the number of times data is written to and then erased from the blank storage cells; a processing unit, configured to determine at least one candidate concurrent storage area from the at least two concurrent storage areas according to one or both of the number of open storage units and the data read and write traffic of each concurrent storage area; The processing unit is further configured to: determine a target concurrent storage area from the at least one candidate concurrent storage area according to a preset priority order of concurrent storage areas; determine a blank storage unit ranked first among a plurality of storage units included in the target concurrent storage area as the target storage unit; or determine a blank storage unit with the smallest value indicated by an operation parameter of the blank storage unit among a plurality of storage units included in the target concurrent storage area as the target storage unit; The processing unit is further used to write the data to be written into the target storage unit.

6. An electronic device, characterized in that: The method comprises a processor, a storage device, a communication interface, and one or more programs, wherein the one or more programs are stored in the storage device and are configured to be executed by the processor according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 4.

8. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Solid hard disk and equilibrium method of the same

    CN101441599A

  • Method and device for writing storage data in storage medium based on flash memory

    CN107025066A

  • Zone write distribution method and system based on ZNS solid state disk

    CN111694515A