Format extension method, host, flash memory device and format extension system

By obtaining and processing the basic format and extended format of flash memory devices and generating command control data, the format expansion of flash memory devices is achieved, solving the problem of insufficient compatibility caused by solidifying formats during IC design of flash memory devices, and improving the scalability and compatibility of data transmission.

CN120447831APending Publication Date: 2025-08-08DAPUSTOR CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510455101.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The format of the flash memory device that is hardened during IC design cannot be flexibly increased, resulting in insufficient compatibility and inability to adapt to data transmission requirements in different formats.

Method used

The basic format and extended format of the flash memory device are obtained through the host, and the extended format control data is determined using the quantitative relationship of user data, and command control data is generated to realize the format expansion of the flash memory device and adapt to data transmission in different formats.

Benefits of technology

It improves the scalability of flash memory devices, ensures compatibility and consistency of data transmission, and solves the compatibility problems caused by format solidification of flash memory devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120447831A_ABST
    Figure CN120447831A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, and discloses a format expansion method, a host, flash memory equipment and a format expansion system.The method comprises the steps that a basic format and an expansion format sent by the flash memory equipment are obtained, and the basic format corresponds to basic format control data and first user data; the expansion format corresponds to the expansion format control data and the second user data, and the expansion format control data is determined based on the basic format control data by using the quantitative relationship between the first user data and the second user data so as to generate to-be-sent command control data; the first user data is acquired from the host through the to-be-sent command control data to be written into the flash memory device, or the first user data is read from the flash memory device, so that the flash memory device can adapt to the expansion format, format expansion of the flash memory device is realized, and the expandability of the flash memory device is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a format expansion method, a host, a flash memory device, and a format expansion system. Background Art

[0002] The format of flash memory devices, such as solid-state drives (SSDs), determines the granularity at which the host can read and write to the SSD. For example, the 512 format or 4K format means that the host can access the SSD in logical blocks of 512 bytes or 4KB. The minimum amount of data that can be accessed at one time is 512 bytes or 4KB.

[0003] However, the formats currently supported by flash memory devices are generally fixed during IC design, and there is no way to flexibly increase the number of formats, resulting in insufficient compatibility. Summary of the Invention

[0004] Embodiments of the present application provide a format expansion method, a host, a flash memory device, and a format expansion system, which can improve the scalability of the flash memory device.

[0005] To solve the above technical problems, the embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a format expansion method, which is applied to a host, wherein the host is communicatively connected to a flash memory device, and the method includes:

[0007] Obtaining format configuration information sent by the flash memory device, wherein the format configuration information includes a basic format and an extended format, both the basic format and the extended format include a first format attribute, the first format attribute includes first user data or second user data, the basic format corresponds to the first user data, and the extended format corresponds to the second user data;

[0008] Determining the extended format control data based on the basic format control data according to the quantity relationship between the first user data and the second user data;

[0009] generating command control data to be sent according to the extended format control data and the second user data;

[0010] The command control data to be sent is sent to the flash memory device, so that the flash memory device obtains the first user data from the host based on the command control data to be sent to write into the flash memory device; or reads the first user data from the flash memory device according to the command control data to be sent.

[0011] In a second aspect, an embodiment of the present application provides a format expansion method, which is applied to a flash memory device, the flash memory device being communicatively connected to a host, and the method comprising:

[0012] Sending format configuration information to the host, where the format configuration information includes a basic format and an extended format, both the basic format and the extended format include a first format attribute, the first format attribute includes first user data or second user data, the basic format corresponds to the first user data, and the extended format corresponds to the second user data;

[0013] receiving command control data to be sent from a host, wherein the command control data to be sent includes extended format control data;

[0014] The first user data is obtained from the host according to the extended format control data; or the first user data is sent to the host according to the extended format control data.

[0015] In a third aspect, an embodiment of the present application provides a host, including:

[0016] at least one processor; and,

[0017] a memory communicatively connected to at least one processor; wherein,

[0018] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.

[0019] In a fourth aspect, an embodiment of the present application provides a flash memory device, including:

[0020] at least one processor; and,

[0021] a memory communicatively connected to at least one processor; wherein,

[0022] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.

[0023] In a fifth aspect, an embodiment of the present application provides a format expansion system, including:

[0024] Such as the third party host;

[0025] The flash memory device of the fourth aspect is communicatively connected to a host.

[0026] The beneficial effects of the embodiments of the present application are: different from the prior art, the embodiments of the present application provide a format extension method, by obtaining the basic format and extended format sent by the flash memory device, the basic format corresponds to the basic format control data and the first user data, and the extended format corresponds to the extended format control data and the second user data, by utilizing the quantitative relationship between the first user data and the second user data, based on the basic format control data, the extended format control data is determined to generate the command control data to be sent, and the first user data is obtained from the host through the command control data to be sent to write into the flash memory device, or the first user data is read from the flash memory device, so that the flash memory device can adapt to the extended format, thereby realizing the format expansion of the flash memory device to improve the scalability of the flash memory device. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0028] Figure 1 This is a structural diagram of a format expansion system provided in an embodiment of the present application;

[0029] Figure 2 This is a flowchart of a format expansion method provided in an embodiment of the present application;

[0030] Figure 3 yes Figure 2 A detailed flow chart of step S202 in FIG.

[0031] Figure 4 yes Figure 3 A detailed flow chart of step S203 in FIG.

[0032] Figure 5 yes Figure 2 A detailed flow chart of step S204 in FIG.

[0033] Figure 6 yes Figure 2 A detailed flow chart of step S204 in FIG.

[0034] Figure 7 This is an example diagram of a data format provided in an embodiment of the present application;

[0035] Figure 8 yes Figure 2 A detailed flow chart of step S203 in FIG.

[0036] Figure 9 yes Figure 2A detailed flow chart of step S204 in FIG.

[0037] Figure 10 yes Figure 2 A detailed flow chart of step S204 in FIG.

[0038] Figure 11 yes Figure 2 Detailed flow chart of step S203 in FIG.

[0039] Figure 12 This is an example schematic diagram of constructing an SGL linked list provided in an embodiment of the present application;

[0040] Figure 13 yes Figure 11 A detailed flowchart of step S2031 in FIG.

[0041] Figure 14 This is an example schematic diagram of a data format change provided by an embodiment of the present application;

[0042] Figure 15 yes Figure 11 A detailed flowchart of step S2032 in FIG.

[0043] Figure 16 yes Figure 2 A detailed flow chart of step S204 in FIG.

[0044] Figure 17 yes Figure 2 A detailed flow chart of step S204 in FIG.

[0045] Figure 18 This is a flowchart of a format expansion method provided in an embodiment of the present application;

[0046] Figure 19 yes Figure 18 A detailed flowchart of step S1803 in FIG.

[0047] Figure 20 yes Figure 18 A detailed flowchart of step S1803 in FIG.

[0048] Figure 21 yes Figure 18 A detailed flowchart of step S1803 in FIG.

[0049] Figure 22 This is a structural diagram of a format expansion system provided in an embodiment of the present application;

[0050] Figure 23 This is a schematic diagram of the structure of a host provided in an embodiment of the present application;

[0051] Figure 24 This is a structural diagram of a flash memory device provided in an embodiment of the present application.

[0052] Description of Figure Numbers:

[0053] Label name Label name 100 Format Extension System 114 Memory 101 Host 102 Flash memory devices 111 Upper-layer applications 121 processor 112 Drivers 122 Memory 113 processor DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0055] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other and are all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device or the order in the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish between the same items or similar items with basically the same functions and effects.

[0056] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0057] Before explaining the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0058] Flash memory devices, such as USB flash drives, SD cards, microSD cards, CF cards, and solid-state drives (SSDs), are storage devices that use semiconductor flash memory (NAND Flash) as their medium. Their main components include the flash memory medium, a flash memory controller, and dynamic random access memory (DRAM). A key function of the flash memory controller is to act as a driver for the flash memory chip, performing storage operations such as erasing, writing, and reading.

[0059] Among them, SSDs are block devices. The access granularity of block devices is determined by the characteristics of NAND particles. NAND particles can only be erased, written, and read at a fixed granularity, which is generally a multiple of 4K. Each 4K unit may have an additional storage area. Based on this characteristic of NAND particles, combined with widely observed protocols and industry practices, block devices such as SSDs can only be accessed at a fixed granularity, that is, in the form of data blocks.

[0060] The format plays a key role in block device data access, determining the minimum granularity of host reads and writes to the SSD. For example, a 512B format means the host can access the SSD in logical blocks of 512 bytes. The minimum amount of data that can be accessed at any one time is 512 bytes, and the amount of data accessed must be a multiple of 512 bytes. Similarly, a 4K format means the minimum amount of data that can be accessed at any one time is 4KB, and can only be accessed in multiples of 4KB.

[0061] The technical solution of this application is described in detail below with reference to the accompanying drawings:

[0062] Example 1

[0063] See also Figure 1 , Figure 1 It is a structural diagram of a format expansion system provided in an embodiment of the present application.

[0064] like Figure 1 As shown, the format extension system 100 includes a host 101 and a flash memory device 102. The host 101 includes but is not limited to a computer terminal, a laptop computer, etc., and the flash memory device 102 includes but is not limited to a USB flash drive, an SD card, a microSD card, a CF card, a solid state drive (SSD), etc.

[0065] The host 101 is in communication with the flash memory device 102. The host 101 is used to obtain the format configuration information of the flash memory device 102 and expand the data format of the flash memory device 102 based on the format configuration information of the flash memory device 102 so that data can be transmitted between the host 101 and the flash memory device 102 in different data formats.

[0066] The flash memory device 102 is in communication with the host 101 . The flash memory device 102 is used to store data and exchange data with the host 101 , for example, writing data from the host 101 to the flash memory device 102 , or the host 101 reading data from the flash memory device 102 .

[0067] In the embodiment of the present application, the host 101 can expand the data format of the flash memory device 102 based on the data format originally supported by the flash memory device 102 to improve the scalability of the flash memory device 102.

[0068] See also Figure 2 , Figure 2 This is a flowchart of a format expansion method provided in an embodiment of the present application.

[0069] The format extension method is applied to a host. Specifically, the format extension method is executed by one or at least two processors of the host. The host is connected to a flash memory device, which includes a solid-state drive or other device. The format configuration information of the flash memory device is defined according to protocols such as the Small Computer System Interface (SCSI) and NVMe.

[0070] like Figure 2 As shown, the format extension method includes:

[0071] Step S201: Acquire format configuration information sent by a flash memory device.

[0072] Among them, the format configuration information includes a basic format and an extended format, the basic format corresponds to the basic format control data, the extended format corresponds to the extended format control data, both the basic format and the extended format include a first format attribute, the first format attribute includes first user data and second user data, the basic format corresponds to the first user data, and the extended format corresponds to the second user data.

[0073] Among them, the basic format control data and the extended format control data are both command control data. The basic format control data includes the data format of the flash memory device, and the extended format control data includes format attributes. The extended format control data is used to instruct the flash memory device to store or transmit data according to the format attributes.

[0074] The first user data and the second user data both include data amounts.

[0075] In an embodiment of the present application, each format includes two format attributes, namely a first format attribute and a second format attribute, wherein the first format attribute is used to determine format control data and user data, wherein the format control data includes the starting logical block address and the number of logical blocks, and the user data includes the logical block size and the metadata size; the second format attribute is used to determine the metadata space arrangement, for example: Dif and Dix.

[0076] It can be understood that the combination of the first format attribute and the second format attribute can form multiple formats.

[0077] The basic format control data includes a first starting logical block address and a first logical block quantity, and the extended format control data includes a second starting logical block address and a second logical block quantity.

[0078] The size of the second user data is N times the size of the first user data, where N is a positive integer and N≥2.

[0079] For example, if the size of the first user data is 512B, the size of the second user data is 512*N. When N is 8, the size of the second user data is 4K.

[0080] In an embodiment of the present application, the format of the first user data includes but is not limited to "512+0", and the format of the second user data includes but is not limited to "4K+0", where 512 indicates that the data granularity is 512 bytes and "4K+0" indicates that the data granularity is 4096 bytes.

[0081] Specifically, the host sends an identify command to the flash memory device, and the flash memory device sends format configuration information to the host according to the identify command, wherein the identify command is used to specify information that the host needs to obtain.

[0082] In an embodiment of the present application, the flash memory device sends format configuration information to the host according to the identify command, that is, the flash memory device writes specific information (that is, format configuration information) into the specific data area contained in the identify command in accordance with the format and specifications specified by the protocol. After receiving the response from the flash memory device, the host parses the identify command according to the protocol and can obtain the basic format and extended format of the flash memory device.

[0083] In the embodiment of the present application, the format of the flash memory device is the most basic attribute in the storage system. The host or upper-layer software needs to obtain the format reported by the flash memory device and use the matching data block size for read and write operations.

[0084] In the embodiments of the present application, the data format supported by the flash memory device is related to the software and hardware architecture of the flash memory device. When designing the flash memory device, the format supported by the flash memory device is pre-designed. After the flash memory device is formed, the data format supported by the flash memory device is difficult to change. Therefore, for some relatively niche formats, due to the lack of scalability of the flash memory device, there will be problems with adaptability and compatibility when transmitting data.

[0085] In order to solve the problem of incompatibility caused by the lack of scalability of flash memory devices, before performing a write operation on the flash memory device, the basic format and extended format of the flash memory device are first obtained, where the basic format is the data format supported by the flash memory device, and the extended format is the data format not supported by the flash memory device. The host obtains the basic format and extended format of the flash memory device, expands the basic format of the flash memory device to convert the basic format into the extended format, so that the data transmitted between the flash memory device and the host can be stored in different formats on different sides.

[0086] Step S202: Determine the extended format control data based on the basic format control data according to the quantity relationship between the first user data and the second user data.

[0087] Among them, the basic format control data includes a first starting logical block address and a first logical block quantity, and the extended format control data includes a second starting logical block address and a second logical block quantity. The first starting logical block address and the second starting logical block address both include the starting address of the logical block, and the first logical block quantity and the second logical block quantity both include the quantity of logical blocks.

[0088] Specifically, the size of the second user data is N times the size of the first user data, and the quantity relationship between the first user data and the second user data includes a size relationship between the size of the second user data and the size of the first user data. The extended format control data is determined based on the size relationship, the starting address of the logical block, and the number of logical blocks.

[0089] See also Figure 3 , Figure 3 yes Figure 2 Detailed flowchart of step S202 in .

[0090] like Figure 3 As shown, step S202 includes:

[0091] Step S221: Determine the second starting logical block address as N*the first starting logical block address, and determine the number of second logical blocks as N*the first logical block number.

[0092] Specifically, the size of the second user data is N times the size of the first user data, the second starting logical block address is determined to be N*the first starting logical block address, and the number of second logical blocks is determined to be N*the first number of logical blocks to determine the extended format control data, wherein the extended format control data includes the second starting logical block address and the second number of logical blocks.

[0093] For example, the size of the first user data is 512B, the size of the second user data is 4K, and the size of the second user data is 8 times the size of the first user data. Then the second starting logical block address is determined to be 8*the first starting logical block address, and the number of second logical blocks is determined to be 8*the number of first logical blocks.

[0094] Step S203: Generate command control data to be sent according to the extended format control data.

[0095] Specifically, based on the second starting logical block address and the second logical block number, command control data to be sent is generated, wherein the command control data to be sent is assembled into a data write command or a data read command. The data write command includes the command control data to be sent, and the data read command includes the command control data to be sent. The data write command is used to instruct the flash memory device to obtain data from the host and write the data to the flash memory device, and the data read command is used to instruct the flash memory device to send data to the host. For the specific process of generating the command control data to be sent, please refer to Figure 4 .

[0096] See also Figure 4 , Figure 4 yes Figure 3 Detailed flowchart of step S203 in .

[0097] like Figure 4 As shown, step S203 includes:

[0098] Step S231: construct a first data mapping table.

[0099] Specifically, a first data mapping table is constructed, which includes a mapping relationship between basic format control data and extended format control data. The basic format control data corresponds to the first user data in one-to-one correspondence, and the extended format control data corresponds to the second user data in one-to-one correspondence.

[0100] In an embodiment of the present application, since the granularity of erase, write and read in the flash memory device is different from that in the host, when transmitting data between the flash memory device and the host, the conversion of data of different granularities is achieved through the first data mapping table to realize data transmission, thereby improving the scalability of the flash memory device.

[0101] Step S232: Generate command control data to be sent according to the first data mapping table.

[0102] Specifically, based on the mapping relationship between the basic format control data and the extended format control data, N first user data are assembled to obtain a second user data to generate command control data to be sent, wherein the second user data includes N*first user data, and the command control data to be sent includes a first data mapping table.

[0103] It can be understood that the first data mapping table may include mapping relationships between a plurality of basic format control data and a plurality of extended format control data, so that the command control data to be sent can be used for processing a plurality of second user data.

[0104] Step S204: Send the command control data to be sent to the flash memory device, so that the flash memory device obtains the first user data from the host based on the command control data to be sent to write into the flash memory device; or, reads the first user data from the flash memory device according to the command control data to be sent.

[0105] Specifically, when the host writes data to the flash memory device, the command control data to be sent is sent to the flash memory device, so that the flash memory device obtains the first user data from the host based on the command control data to be sent, that is, based on the first data mapping table, the first user data is obtained from the host to write into the flash memory device.

[0106] See also Figure 5 , Figure 5 yes Figure 2 Detailed flowchart of step S204 in .

[0107] like Figure 5 As shown, step S204 includes:

[0108] Step S241: Obtain N first user data from the host according to the first data mapping table, and write each first user data into the flash memory device.

[0109] Specifically, when writing data to the flash memory device, based on the mapping relationship between the basic format control data and the extended format control data in the first data mapping table, a second logical block of second user data is read starting from a second starting logical block address in the extended format control data, each second user data including N first user data, and each first user data is written to the flash memory device separately, where N is a positive integer and N ≥ 2.

[0110] It can be understood that the first data mapping table is used to determine the amount of first user data. Specifically, the amount of first user data is determined by the mapping relationship between the basic format control data and the extended format control data in the first data mapping table. For example: the first data mapping table includes two extended format control data. Since the extended format control data corresponds one-to-one with the second user data, assuming that the size of the second user data is N times the size of the first user data, the amount of first user data obtained from the host is 2*N, so that 2*N first user data are written to the flash memory device according to the command control data to be sent.

[0111] In the embodiment of the present application, data transmission is achieved through the first data mapping table, which can ensure consistency during the transmission of data in different formats.

[0112] It can be understood that the above content is about writing user data into the flash memory device through the first data mapping table. Similarly, user data in the flash memory device can be read through the first data mapping table.

[0113] Specifically, when the host reads data from the flash memory device, the host controls the data according to the command to be sent and reads the first user data from the flash memory device.

[0114] See also Figure 6 , Figure 6 yes Figure 2 Detailed flowchart of step S204 in .

[0115] like Figure 6 As shown, step S204 includes:

[0116] Step S242: Read N first user data from the flash memory device according to the first data mapping table.

[0117] Specifically, when reading data from the flash memory device, N first user data are read from the flash memory device based on the mapping relationship between the basic format control data and the extended format control data in the first data mapping table.

[0118] In an embodiment of the present application, in some simple data processing scenarios or when the data management requirements are not high, the user data only includes logical block data but no metadata. For example, "512+0" indicates that there is logical block data and the logical block data granularity is 512 bytes, but there is no metadata.

[0119] In an embodiment of the present application, in some complex scenarios, user data includes logical block data and metadata (Meta). Metadata is usually used as a supplement or verification information for logical block data. Metadata combined with main data can form a new data format, such as the "512+8" format, where "512" represents the logical block size specified by the main data, and "+8" means that each logical block has an additional 8 bytes as a Meta area for storing metadata.

[0120] In an embodiment of the present application, when user data includes logical block data and metadata, in order to meet the needs of data integrity protection, different metadata space arrangement formats are provided to manage the logical block data and metadata, wherein the metadata space arrangement format includes a first metadata space arrangement format and a second metadata space arrangement format. The logical block data and metadata of the first metadata space arrangement format are stored independently, and the logical block data and metadata of the second metadata space arrangement format are stored continuously, that is, the addresses of the logical block data and metadata of the first metadata space arrangement format are discontinuous, and the addresses of the logical block data and metadata of the second metadata space arrangement format are continuous. The first metadata space arrangement format includes the Dix (Data Integrity Extension) format, and the second metadata space arrangement format includes the Dif (Data Integrity Field) format.

[0121] The Dif format is a data integrity field. When metadata is stored adjacent to logical block data, it can be considered a data integrity field. The Dif format is typically embedded in storage protocols (such as SCSI and SATA) and operates at the storage device or transport protocol layer. Each data block (e.g., 512 bytes) is appended with a checksum field (e.g., an 8-byte CRC) to verify data integrity by the storage controller.

[0122] The Dix format is a data integrity extension. When metadata is stored independently of logical block data, it can be considered an extended mechanism for data integrity. The Dix format is implemented on the host side (operating system, driver, or HBA) as a higher-level extension. It generates checksum information before data is transferred to the storage device, covering the entire path from application to storage. Compared to the Dif format, the Dix format provides end-to-end integrity protection and may support larger data blocks (such as 4KB) or more complex checksum mechanisms, extending the coverage of traditional Dif.

[0123] In an embodiment of the present application, when the logical block data and metadata are stored in the Dix format, the logical block data and metadata are stored in different cache spaces respectively; when the logical block data and metadata are stored in the Dif format, the logical block data and metadata are stored in the same cache space.

[0124] For example, see Figure 7 , Figure 7 This is an example diagram of a data format provided in an embodiment of the present application. Figure 7As shown, when the data format is the "512+8" Dif format, the logical block data Data and metadata Meta are stored in the same cache space, the metadata follows the main data, and the addresses of the main data and metadata are continuous. When the data format is the "512+8" Dix format, the logical block data Data and metadata Meta are stored in different cache spaces respectively, and the addresses of the logical block data and metadata are not continuous.

[0125] In the embodiment of the present application, when the user data includes logical block data and metadata, before writing the data to the flash memory device, it is necessary to confirm the metadata space arrangement format in the data in order to continue the write operation to the flash memory device. For the specific process, please refer to Figure 2 .

[0126] Please refer to Figure 2 , Figure 2 This is a flowchart of a format expansion method provided in an embodiment of the present application.

[0127] like Figure 2 As shown, the format extension method includes:

[0128] Step S201: Acquire format configuration information sent by a flash memory device.

[0129] In the embodiment of the present application, the format configuration information includes a basic format and an extended format.

[0130] Among them, the basic format corresponds to the basic format control data, the basic format includes a first format attribute and a second format attribute, the first format attribute includes the first user data, and the second format attribute includes the first metadata space arrangement format, that is, the format type of the basic format is the first metadata space arrangement format, the first user data includes the first logical block data and the first metadata, the first logical block data corresponds one-to-one to the first metadata, and the basic format control data includes the first starting logical block address and the first logical block quantity.

[0131] Among them, the extended format corresponds to the extended format control data, the extended format includes a first format attribute and a second format attribute, the first format attribute includes the second user data, and the second format attribute includes the first metadata space arrangement format, that is, the format type of the extended format is the first metadata space arrangement format, the second user data includes the second logical block data and the second metadata, the second logical block data corresponds one-to-one to the second metadata, and the extended format control data includes the second starting logical block address and the second logical block quantity.

[0132] The first metadata space arrangement format includes a Dix format, and the size of the second user data is N times the size of the first user data.

[0133] In an embodiment of the present application, the format of the first user data includes but is not limited to the "512+8" Dix format, and the format of the second user data includes but is not limited to the "4K+64" Dix format.

[0134] In an embodiment of the present application, the host includes a cache space, which is used to cache second user data. The cache space includes a first cache space and a second cache space. When the second user data in the host is stored in the first metadata space arrangement format, the second logical block data is stored in the first cache space, and the second metadata is stored in the second cache space.

[0135] Step S202: Determine the extended format control data based on the basic format control data according to the quantity relationship between the first user data and the second user data.

[0136] Specifically, the size of the second user data is N times the size of the first user data, the second starting logical block address corresponding to the second user data is determined to be N*the first starting logical block address, and the number of second logical blocks corresponding to the second user data is determined to be N*the first logical block number, so as to determine the extended format control data, wherein the extended format control data includes the second starting logical block address and the second logical block number.

[0137] Step S203: Generate command control data to be sent according to the extended format control data.

[0138] Specifically, based on the second starting logical block address, the second logical block number, and the second user data, command control data to be sent is generated, wherein the command control data to be sent is assembled into a data write command or a data read command. The data write command is used to write data to the flash memory device, and the data read command is used to read data from the flash memory device. For the specific generation process of the command control data to be sent, please refer to Figure 8 .

[0139] See also Figure 8 , Figure 8 yes Figure 2 Detailed flowchart of step S203 in .

[0140] like Figure 8 As shown, step S203 includes:

[0141] Step S233: Construct a second data mapping table.

[0142] Specifically, a second data mapping table is constructed, wherein the second data mapping table includes a mapping relationship between the first logic block data and the second logic block data, and a mapping relationship between the first metadata and the second metadata.

[0143] In an embodiment of the present application, the size of the second user data is N times the size of the first user data, the first user data includes first logical block data and first metadata, and the second user data includes second logical block data and second metadata. Then the size of the second logical block data is N times the size of the first logical block data, and the size of the second metadata is N times the size of the first metadata. Then the mapping relationship between the first logical block data and the second logical block data refers to mapping N first logical block data to one second logical block data, and the mapping relationship between the first metadata and the second metadata refers to mapping N first metadata to one second metadata.

[0144] Step S234: Generate command control data to be sent according to the second data mapping table.

[0145] Specifically, based on the mapping relationship between the first logical block data and the second logical block data, N first logical block data are assembled to obtain a second logical block data, and based on the mapping relationship between the first metadata and the second metadata, N first metadata are assembled to obtain a second metadata.

[0146] For example, when the format of the first user data of the flash memory device is the "512+8" Dif format and the format of the first user data needs to be expanded to the "4K+64" Dif format, 8 data blocks are continuously obtained from the first cache space, and 8 data blocks are continuously obtained from the second cache space. The 8 data blocks in the first cache space and the 8 data blocks in the second cache space are assembled into a second user data, so that "4K+64" = "(512+8)*8".

[0147] Specifically, the second logic block data and the second metadata are spliced to obtain the second user data, and the second data mapping table is encapsulated to generate command control data to be sent, and the command control data to be sent includes the second data mapping table.

[0148] Step S204: Send the command control data to be sent to the flash memory device, so that the flash memory device obtains the first user data from the host based on the command control data to be sent to write into the flash memory device; or, reads the first user data from the flash memory device according to the command control data to be sent.

[0149] Specifically, when writing data to the flash memory device, the command control data to be sent is sent to the flash memory device, so that the flash memory device obtains the first user data from the host based on the command control data to be sent, that is, obtains the first user data from the host based on the second data mapping table.

[0150] Specifically, when reading data from the flash memory device, the first user data is read from the flash memory device according to the command control data to be sent.

[0151] See also Figure 9 , Figure 9 yes Figure 2 Detailed flowchart of step S204 in .

[0152] like Figure 9 As shown, step S204 includes:

[0153] Step S243: Obtain N first user data from the host according to the second data mapping table.

[0154] The second data mapping table includes a mapping relationship between the first logic block data and the second logic block data, and a mapping relationship between the first metadata and the second metadata.

[0155] Specifically, based on the mapping relationship between the first logical block data and the second logical block data, the second logical block data of the second logical block quantity is read starting from the starting logical block address corresponding to the second logical block data in the extended format control data; based on the mapping relationship between the first metadata and the second metadata, the second metadata of the second logical block quantity is read starting from the starting logical block address corresponding to the second metadata in the extended format control data to obtain N first user data.

[0156] Step S244: Send the N first user data to the flash memory device through the first data transmission protocol.

[0157] In an embodiment of the present application, the first data transmission protocol is used to transmit data in a first metadata space arrangement format.

[0158] Specifically, the command control data to be sent is sent to the flash memory device through the first data transmission protocol, so as to obtain N first user data through the second data mapping table in the command control data to be sent, and each user data is stored in the flash memory device in the first metadata space arrangement format.

[0159] Specifically, N first logical block data in the first cache space and N first metadata in the second cache space in the host are read according to the second logical block address and the second logical block quantity in the second data mapping table to obtain N first user data.

[0160] For example, when the basic format of the host is the "4K+64" Dix format and the basic format of the flash memory device is the "512+8" Dif format, when writing data to the flash memory device, the starting logical block address and the number of logical blocks to be transmitted in the host are determined to be 8, and a data write command is obtained. The data write command is sent to the flash memory device. The flash memory device obtains data from the host based on the logical block address and the number of logical blocks in the data write command, and stores the data in the flash memory device. For example, if the data format of the flash memory device is determined to be "512+8" and the extended format reported by the flash memory device is "4K+64", data will be written to the flash memory device through the assembly command, host (SLBA1, Len8)->(SLBA1*8, Len8*8)->flash memory device (SLBA8, Len64).

[0161] See also Figure 10 , Figure 10 yes Figure 2 Detailed flowchart of step S204 in .

[0162] like Figure 10 As shown, step S204 includes:

[0163] Step S245: Read N first user data from the flash memory device according to the second data mapping table.

[0164] In an embodiment of the present application, the basic format control data includes a first starting logical block address and a first logical block quantity, and the extended format control data includes a second starting logical block address and a second logical block quantity.

[0165] Specifically, when reading data from the flash memory device, based on the mapping relationship between the first logical block data and the second logical block data in the second data mapping table, the first logical block quantity of logical block data is obtained starting from the first starting logical block address, and based on the mapping relationship between the first metadata and the second metadata, the first logical block quantity of metadata is read from the flash memory device to obtain N first user data, and the logical block data and metadata are assembled based on the quantity relationship between the first user data and the second user data to obtain second user data, and the second user data is sent to the host, that is, the host obtains N first user data from the flash memory device.

[0166] In the embodiment of the present application, the second data mapping table can be used to achieve data transmission between the flash memory device and the host without the need for data format conversion.

[0167] In the embodiment of the present application, when the user data includes metadata, and the format type of the extended format is the first metadata space arrangement format, and the format type of the basic format is the second metadata space arrangement format, that is, the format type of the extended format is the Dix format, and the format type of the basic format is the Dif format, the basic format is extended to continue the write operation to the flash memory device. For the specific process, please refer to Figure 2 .

[0168] Please refer to Figure 2 , Figure 2 This is a flowchart of a format expansion method provided in an embodiment of the present application.

[0169] like Figure 2 As shown, the format extension method includes:

[0170] Step S201: Acquire format configuration information sent by a flash memory device.

[0171] In the embodiment of the present application, the format configuration information includes a basic format and an extended format.

[0172] Among them, the basic format corresponds to the basic format control data, the basic format includes a first format attribute and a second format attribute, the first format attribute includes the first user data, and the second format attribute includes the second metadata space arrangement format, that is, the format type of the basic format is the second metadata space arrangement format, the first user data includes the first logical block data and the first metadata, the first logical block data corresponds one-to-one to the first metadata, and the basic format control data includes the first starting logical block address and the first logical block quantity.

[0173] Among them, the extended format corresponds to the extended format control data, the extended format includes a first format attribute and a second format attribute, the first format attribute includes the second user data, and the second format attribute includes the first metadata space arrangement format, that is, the format type of the extended format is the first metadata space arrangement format, the second user data includes the second logical block data and the second metadata, the second logical block data corresponds one-to-one to the second metadata, and the extended format control data includes the second starting logical block address and the second logical block quantity.

[0174] The first metadata space arrangement format includes a Dix format, the second metadata space arrangement format includes a Dif format, and the size of the second user data is N times the size of the first user data.

[0175] In an embodiment of the present application, the format of the first user data includes but is not limited to the "512+8" Dif format, and the format of the second user data includes but is not limited to the "4K+64" Dix format.

[0176] In an embodiment of the present application, the host includes a cache space, which is used to cache second user data. The cache space includes a first cache space and a second cache space. When the second user data in the host is stored in the first metadata space arrangement format, the second logical block data is stored in the first cache space, and the second metadata is stored in the second cache space.

[0177] Step S202: Determine the extended format control data based on the basic format control data according to the quantity relationship between the first user data and the second user data.

[0178] Specifically, the size of the second user data is N times the size of the first user data, the second starting logical block address corresponding to the second user data is determined to be N*the first starting logical block address, and the number of second logical blocks corresponding to the second user data is determined to be N*the first logical block number, so as to determine the extended format control data, wherein the extended format control data includes the second starting logical block address and the second logical block number.

[0179] Step S203: Generate command control data to be sent according to the extended format control data.

[0180] Specifically, the command control data to be sent is generated according to the second starting logical block address, the second logical block number, and the second user data, wherein the command control data to be sent includes a data write command, which is used to write data to the flash memory device. For the specific generation process of the command control data to be sent, please refer to Figure 11 .

[0181] See also Figure 11 , Figure 11 yes Figure 2 Detailed flowchart of step S203 in .

[0182] like Figure 11 As shown, step S203 includes:

[0183] Step S2031: Construct a data linked list.

[0184] In the embodiment of the present application, the data linked list includes but is not limited to an SGL (Scatter Gather List) linked list, a singly linked list, a doubly linked list, a custom linked list, etc. Preferably, the linked list in the embodiment of the present application is an SGL linked list.

[0185] As you can understand, SGL (Scatter-Gather List) is a data structure for efficiently managing the transfer of data across non-contiguous memory blocks. It is widely used in scenarios such as storage systems, network communications, and DMA (Direct Memory Access). SGL describes multiple non-contiguous memory regions (scattered), allowing the system to transfer data from these regions as a continuous logical stream (gathered) in a single operation. SGL is suitable for processing data blocks that are physically dispersed but logically contiguous in memory. For example, when data needs to be written from a device (such as a hard drive or network interface card) to memory, the device scatters the data across multiple non-contiguous memory blocks based on SGL entries. When data needs to be transferred from memory to the device, the device gathers the data from multiple memory blocks based on SGL entries and merges them into a continuous logical stream. Suppose an application needs to read a file from a hard drive, where the file content is split and stored across three physically non-contiguous memory blocks. The hard drive controller uses SGL to describe the addresses and lengths of these three blocks, allowing the read to be completed in a single DMA operation, eliminating the need for the CPU to copy the data piecemeal.

[0186] In an embodiment of the present application, user data includes metadata, and when the metadata space arrangement formats of data in the flash memory device and the host are different, the format extension in the present application is described in detail using the SGL linked list as an example.

[0187] In an embodiment of the present application, when the metadata space arrangement formats of data in the flash memory device and the host are different, it is necessary to construct a data linked list and perform data format conversion based on the data linked list, so that the flash memory device and the host can transmit data under different metadata space arrangement formats.

[0188] In an embodiment of the present application, before constructing the SGL linked list, the SGL function is enabled on both the host and the flash memory device. SGL is a data structure for efficient data transmission, used for I / O operations and memory management in computer systems, and is used to describe a data space, which can be the space where the data source is located or the data target space. The SGL function allows multiple data blocks (non-continuous memory areas) scattered in the memory to be combined into a logically continuous data stream, thereby reducing the number of data copies and improving data transmission efficiency. Among them, the data structure of SGL is represented by a linked list, which consists of one or more segments (SGL Segment), and each segment consists of one or more descriptors (SGLDescriptor).

[0189] In the embodiment of the present application, the following SGL rules are used when constructing the SGL linked list:

[0190] (1) A logical block data descriptor is created for each logical block data. The logical block data descriptor includes the starting address information and the number of logical blocks of the logical block data. A metadata descriptor is created for each metadata. The metadata descriptor includes the starting address information and the number of logical blocks of the metadata.

[0191] (2) The metadata descriptor is concatenated after the logical block data descriptor.

[0192] (3) The logical block data descriptor corresponding to each logical block data and the metadata descriptor corresponding to each metadata are arranged in sequence to form an SGL linked list.

[0193] See for example Figure 12 , Figure 12 This is an example schematic diagram of constructing an SGL linked list provided by an embodiment of the present application, such as Figure 12 As shown, when the basic format in the flash memory device is the "512+8" dif format and the extended format is the "4K+64" dix format, the "4K+64" dix format indicates that the logical block data and metadata are stored in different cache spaces. The host's cache space A (Hostmem addr A) is used to store logical block data, and the host's cache space B (Host mem addr B) is used to store metadata. A logical block data descriptor is constructed based on the logical block data in the basic format. The logical block data descriptor includes a starting logical block address and the number of logical blocks of a logical block data. For example, the logical block data descriptor (SGL Descriptor) includes LBAn and 4096B, LBA n is the address of the logical block data, 4096B is the length of the logical block data, 4096B=512*8, and a metadata descriptor is constructed based on the metadata in the basic format. The metadata descriptor includes a starting logical block address and the number of logical blocks of a logical block data in the cache space A. For example, the metadata descriptor (SGL Descriptor) includes LBA n and 64B, LBA n is the starting address of the logical block data in cache space B, 64B is the length of the metadata, the metadata descriptor is spliced to the logical block data descriptor, and multiple logical block data descriptors and metadata descriptors are spliced in sequence to obtain the SGL linked list.

[0194] In the embodiment of the present application, a data linked list is constructed by taking the construction of an SGL linked list as an example.

[0195] Specifically, based on the SGL rules, a data linked list is constructed. For the specific process, please refer to Figure 13 .

[0196] In an embodiment of the present application, the data linked list includes several data segments, each data segment includes N descriptors, the data segments correspond one-to-one to the second user data, and the descriptors correspond one-to-one to the first user data, wherein each descriptor includes a first starting logical block address and a first logical block quantity.

[0197] In an embodiment of the present application, the descriptor includes a first descriptor, which includes a first logical block data descriptor and a first metadata descriptor, wherein the first logical block data descriptor includes the starting logical block address and the number of logical blocks of the first logical block data, and the first metadata descriptor includes the starting logical block address and the number of logical blocks of the first metadata.

[0198] In an embodiment of the present application, the descriptor includes a second descriptor, the second descriptor includes a second logical block data descriptor and a second metadata descriptor, wherein the second logical block data descriptor includes the starting logical block address and the number of logical blocks of the second logical block data, and the second metadata descriptor includes the starting logical block address and the number of logical blocks of the second metadata.

[0199] See also Figure 13 , Figure 13 yes Figure 11 Detailed flowchart of step S2031 in .

[0200] like Figure 13 As shown, step S2031 includes:

[0201] Step S2311: construct a first logical block data descriptor and a first metadata descriptor for each first user data.

[0202] The first user data includes first logical block data and first metadata.

[0203] In an embodiment of the present application, the format of the first user data includes but is not limited to the "512+8" Dif format, and the format of the second user data includes but is not limited to the "4K+64" Dix format.

[0204] Specifically, when the format type of the extended format is the first metadata space arrangement format and the format type of the basic format is the second metadata space arrangement format, that is, the format type of the extended format is the Dix format and the format type of the basic format is the Dif format, a first logical block data descriptor and a first metadata descriptor are constructed for each first user data. The first logical block data descriptor is continuous with the first metadata descriptor. The first logical block data descriptor includes the starting logical block address and the number of logical blocks of the first logical block data, and the first metadata descriptor includes the starting logical block address and the number of logical blocks of the first metadata.

[0205] Step S2312: Combine the first logical block data descriptor and the first metadata descriptor to construct N descriptor groups.

[0206] Specifically, a first logical block data descriptor and a first metadata descriptor are combined to obtain a descriptor group, and the above steps of generating a descriptor group are repeated to obtain N descriptor groups, wherein each descriptor group includes a first logical block data descriptor and a first metadata descriptor, the first logical block data descriptor and the first metadata descriptor are continuous, and the descriptor group includes an SGL group.

[0207] Step S2313: Generate several data segments according to the descriptor group.

[0208] Specifically, N descriptor groups are combined into a plurality of data segments, wherein each data segment includes N descriptor groups.

[0209] In the embodiment of the present application, the number of data segments is created according to specific needs. For example, if 3 data segments are needed, 3 data segments are created.

[0210] In the embodiment of the present application, each data segment is represented as an SGL segment.

[0211] Step S2314: After generating a number of data segments, generate a data linked list based on the number of data segments.

[0212] Specifically, after generating a plurality of data segments, a data linked list is generated according to the plurality of data segments, that is, the data segments are spliced in the order in which the data segments are generated to obtain the data linked list.

[0213] Please refer again Figure 12 , Figure 12 This is an example schematic diagram of generating a data linked list provided in an embodiment of the present application.

[0214] like Figure 12 As shown, user data has metadata, and the metadata space arrangement format of the data in the host is Dix format. Its logical block data is stored in cache space A, and the metadata is stored in cache space B. The size of each logical block in cache space A is the same, and the size of each logical block in cache space B is the same. When the host and the flash memory device transmit data, the metadata space arrangement format of the data in the flash memory device is Dif format, and the metadata space arrangement format of the data in the host is Dix format. If the metadata space arrangement format of the host and the flash memory device is different, the host constructs an SGL data linked list. The construction process is as follows:

[0215] (1) Construct a logical block data descriptor (LBA n 4096B SGL Descriptor), which includes a logical block address (LBA n 4096B) in cache space A, and construct a metadata descriptor (LBA n 64B SGL Descriptor), which includes a logical block address (LBA n 64B) in cache space B. The LBA n 4096B SGL Descriptor and the LBA n 64B SGL Descriptor are combined into a descriptor group, which is the SGL group.

[0216] (2) Construct a logical block data descriptor (LBA n+1 4096B SGL Descriptor), which includes a logical block address (LBA n+14096B) in cache space A, and construct a metadata descriptor (LBA n+1 64B SGL Descriptor), which includes a logical block address (LBAn+164B) in cache space B. The LBA n+1 4096B SGL Descriptor and the LBA n+1 64B SGL Descriptor are combined into a descriptor group.

[0217] (3) Construct a logical block data descriptor (LBA n+2 4096B SGL Descriptor), which includes a logical block address (LBA n+24096B) in cache space A, and construct a metadata descriptor (LBA n+2 64B SGL Descriptor), which includes a logical block address (LBAn+264B) in cache space B. The LBA n+2 4096B SGL Descriptor and the LBA n+2 64B SGL Descriptor are combined into a descriptor group.

[0218] Repeat the above steps to construct n+m descriptor groups, and group n+m descriptors into a data segment, that is, an SGL Segment.

[0219] Repeat the above steps to form multiple SGL Segments, and connect multiple SGL Segments in sequence to obtain a data linked list.

[0220] It should be noted that the above description only uses a data block size of 4096B as an example, and the data block size is not limited to 4096B.

[0221] See also Figure 14 , Figure 14 This is an example schematic diagram of a data format change provided in an embodiment of the present application.

[0222] like Figure 14 As shown, the basic format of a flash memory device (such as an SSD) is the "512+8" Dif format, and the extended format is the "4K+64" Dix format. The host recognizes the extended format uploaded by the flash memory device. On the host side, an SGL Data Block descriptor is created for each 4096B logical block data, and an SGL DataBlock descriptor is created for each 64B Meta data. The SGL Data Block descriptor corresponding to the logical block data and the SGL Data Block descriptor corresponding to the Meta data are combined so that the Meta data follows the logical block data.

[0223] In an embodiment of the present application, when the metadata space arrangement formats of the host and the flash memory device are different, an SGL linked list is constructed. When the host writes data to the flash memory device, the flash memory device transmits and splices the data according to the SGL linked list to write the data into the flash memory device.

[0224] Step S2032: Generate command control data to be sent according to the data linked list.

[0225] In the embodiment of the present application, the data linked list is a data linked list generated when the format type of the extended format is the Dix format and the format type of the basic format is the Dif format.

[0226] In the embodiment of the present application, when the metadata space arrangement format of the host is Dix format and the metadata space arrangement format of the flash memory device is Dif format, a data write command is generated according to the data linked table and sent to the flash memory device, so that the flash memory device obtains N first data from the host based on each descriptor in each data segment. For the specific process, please refer to Figure 15 .

[0227] See also Figure 15 , Figure 15 yes Figure 11 Detailed flowchart of step S2032 in .

[0228] like Figure 15 As shown, step S2032 includes:

[0229] Step S2321: According to the data linked list, obtain N descriptor groups of several data segments.

[0230] The data linked list includes several data segments, each data segment includes N descriptors, the data segments correspond one-to-one to the second user data, and the descriptors correspond one-to-one to the first user data, wherein each descriptor includes a first starting logical block address and a first logical block quantity.

[0231] Specifically, according to the data linked list, N descriptor groups of several data segments are obtained.

[0232] Step S2322: Generate command control data to be sent according to the first logical block data descriptor and the first metadata descriptor in each descriptor group.

[0233] The first logical block data descriptor includes the starting logical block address and the number of logical blocks of the first logical block data, and the first metadata descriptor includes the starting logical block address and the number of logical blocks of the first metadata.

[0234] Specifically, according to the first logical block data descriptor and the first metadata descriptor in each descriptor group, N first user data are obtained, that is, according to the starting logical block address and the number of logical blocks of the first logical block data, N first logical block data are obtained, and according to the starting logical block address and the number of logical blocks of the first metadata, N first metadata are obtained, one first logical block data and one first metadata constitute one first user data, N first logical block data and N first metadata constitute N first user data, and N first user data are obtained.

[0235] Specifically, N first user data are assembled, that is, the N first user data are sequentially spliced to generate one second user data, and command control data to be sent are generated. The command control data to be sent includes a data linked list.

[0236] Step S204: Send the command control data to be sent to the flash memory device, so that the flash memory device obtains the first user data from the host based on the command control data to be sent to write into the flash memory device; or, reads the first user data from the flash memory device according to the command control data to be sent.

[0237] Specifically, when writing data to the flash memory device, the command control data to be sent is sent to the flash memory device, so that the flash memory device obtains the first user data from the host based on the command control data to be sent, that is, obtains the first user data from the host based on the data linked list.

[0238] Specifically, when reading data from the flash memory device, the command control data to be sent is sent to the flash memory device, so that the flash memory device reads the first user data from the flash memory device based on the command control data to be sent and returns the first user data to the host.

[0239] See also Figure 16 , Figure 16 yes Figure 2 Detailed flowchart of step S204 in .

[0240] like Figure 16 As shown, step S204 includes:

[0241] Step S246: Acquire N first user data according to the first logical block data descriptor and the first metadata descriptor in each descriptor group.

[0242] Specifically, when writing data to the flash memory device, N logical block data are read according to the starting logical address of the first logical block data in the first logical block data descriptor in each descriptor group, and N metadata are read according to the starting logical address of the first metadata in the first metadata descriptor in each descriptor group to obtain N first user data, each first user data including a logical block data and a metadata.

[0243] Step S247: Send the N first user data to the flash memory device through the second data transmission protocol.

[0244] In an embodiment of the present application, the second data transmission protocol is used to transmit data in a second metadata space arrangement format.

[0245] Specifically, the command control data to be sent is sent to the flash memory device through the second data transmission protocol, so as to obtain N first user data through the data linked list in the command control data to be sent, and each user data is stored in the flash memory device in the second metadata space arrangement format.

[0246] Specifically, N first logical block data in the first cache space and N first metadata in the second cache space in the host are read according to the second logical block address and the second logical block quantity in the data linked list to obtain N first user data.

[0247] See also Figure 17 , Figure 17 yes Figure 2 Detailed flowchart of step S204 in .

[0248] like Figure 17 As shown, step S204 includes:

[0249] Step S248: Read N first user data from the flash memory device according to the data linked list.

[0250] Specifically, when reading data from the flash memory device, N first user data are read into the host according to the starting logical block address of the flash memory device corresponding to the starting logical block address of the host in the data linked list.

[0251] It can be understood that since the metadata space arrangement formats of the host and the flash memory device are different, the format type corresponding to the host data is the first space arrangement format, and the format type corresponding to the flash memory device data is the second space arrangement format. Therefore, before storing the data in the flash memory device, it is necessary to first build a data linked list (such as an SGL linked list). Therefore, when reading data from the flash memory device, the data in the flash memory device can be obtained based on the logical address in the data linked list.

[0252] In an embodiment of the present application, when the metadata space arrangement formats of the host and the flash memory device are different, for example, the data in the host is stored in Dix format and the data in the flash memory device is stored in Dif format, when the host sends a read command to the flash memory device, the flash memory device transmits the data to the host in Dif format, the host constructs an SGL linked list, obtains the data sent by the flash memory device based on the SGL linked list, and converts the data in the SGL linked list into Dix format based on the first data transmission protocol, so that the host can obtain the data in the flash memory device.

[0253] In an embodiment of the present application, when the metadata space arrangement format in the host is the Dif format and the metadata space arrangement format in the flash memory device is the Dif format, the basic format of the flash memory device includes but is not limited to the "512+8" Dif format, and the extended format includes but is not limited to the "4K+64" Dif format. When the host writes data to the flash memory device, a data mapping table is constructed to expand the "512+8" Dif format to the "4K+64" Dif format, that is, "4K+64" = "(512+8)*8". For the method of constructing the data mapping table, please refer to Figure 4 .

[0254] In an embodiment of the present application, when the data includes metadata, the basic format of the flash memory device is the Dif format, and the data storage format in the host is also the Dif format. When performing a read operation on the flash memory device, the host constructs a data mapping table and obtains data from the flash memory device based on the data mapping table.

[0255] In an embodiment of the present application, when there is metadata, the basic format of the flash memory device is the Dix format, and the data storage format in the host is the Dif format, a logical block data descriptor corresponding to the logical block data and a metadata descriptor corresponding to the metadata are created. Based on the main data descriptor and the metadata descriptor, an SGL linked list is constructed, and a read command is sent to the flash memory device. The read command carries the SGL linked list information. The flash memory device reads the logical block data according to the descriptor and returns the logical block data to the host.

[0256] In an embodiment of the present application, data transmission between the flash memory device and the host is achieved by constructing an SGL linked list, which will not affect the format natively supported by the flash memory device, and the compatibility of the flash memory device is improved by expanding the format of the flash memory device on the host side.

[0257] In the embodiment of the present application, since the data format of the flash memory device is fixed at the factory, with the development of computer technology, other new data formats have been expanded. In order to enable smooth data transmission between the flash memory device and the host, an SGL linked list is constructed so that discontinuous data can be read in sequence, so that data in Dix format is converted into Dif format. Moreover, the SGL linked list is constructed by the host without modifying the flash memory device, thereby expanding the data format of the flash memory device and being able to maximize performance requirements.

[0258] In an embodiment of the present application, the construction of the SGL linked list is created by the host driver and does not need to rely on the hardware conditions of the host. It can realize the expansion of multiple new data formats and transmit data with the flash memory device based on the new data format, thereby increasing the flexibility of the flash memory device and improving the user experience.

[0259] Example 2

[0260] See also Figure 18 , Figure 18 This is a flowchart of a format expansion method provided in an embodiment of the present application.

[0261] The format extension method is applied to a flash memory device. Specifically, the method is performed by one or at least two processors of the flash memory device. The flash memory device is connected to a host computer and includes devices such as solid-state drives. The format configuration information of the flash memory device is defined according to protocols such as the Small Computer System Interface (SCSI) and NVMe.

[0262] like Figure 18 As shown, the format extension method includes:

[0263] Step S1801: Send format configuration information to the host.

[0264] Specifically, when the host writes data to the flash memory device, the flash memory device sends format configuration information to the host, wherein the format configuration information includes a basic format and an extended format, the basic format includes a first format attribute, the first format attribute includes basic format control data and first user data, and the extended format includes the first format attribute, the first format attribute includes extended format control data and second user data.

[0265] Among them, the basic format control data includes a first starting logical block address and a first logical block quantity, and the extended format control data includes a second starting logical block address and a second logical block quantity, that is, the first starting logical block address and the second starting logical block address both include the starting address of the logical block, and the first logical block quantity and the second logical block quantity both include the number of logical blocks.

[0266] In an embodiment of the present application, the format of the first user data includes but is not limited to "512+0", and the format of the second user data includes but is not limited to "4K+0", where 512 indicates that the data granularity is 512 bytes and "4K+0" indicates that the data granularity is 4096 bytes.

[0267] In the embodiment of the present application, the basic format sent to the host is a format supported by the flash memory device, and the extended format is a format not currently supported by the flash memory device.

[0268] Step S1802: Receive command control data to be sent from the host.

[0269] Among them, the command control data to be sent includes a mapping relationship between basic format control data and extended format control data, the basic format control data corresponds one-to-one to the first user data, the extended format control data corresponds one-to-one to the second user data, and the command control data to be sent includes the extended format control data and the second user data.

[0270] In an embodiment of the present application, the command control data to be sent is used to obtain first user data from a host and write the first user data to a flash memory device.

[0271] Step S1803: Obtain the first user data from the host according to the extended format control data and the second user data.

[0272] Specifically, according to the second starting logical block address in the extended format control data, second user data of the second logical block quantity is continuously obtained. The size of the second user data is N times the size of the first user data, that is, one second user data includes N*first user data. When the second user data is obtained, N first user data are obtained.

[0273] See also Figure 19 , Figure 19 yes Figure 18 Detailed flowchart of step S1803 in .

[0274] like Figure 18 As shown, step S1803 includes:

[0275] Step S1831: query the first data mapping table according to the extended format control data to obtain N basic format control data.

[0276] The first data mapping table includes a mapping relationship between basic format control data and extended format control data. The basic format control data corresponds to the first user data in a one-to-one manner, and the extended format control data corresponds to the second user data in a one-to-one manner.

[0277] Specifically, according to the extended format control data, the first data mapping table is searched, and N basic format control data are obtained based on the mapping relationship between the basic format control data and the extended format control data.

[0278] Step S1832: Obtain N first user data from the host according to the N basic format control data.

[0279] In an embodiment of the present application, the basic format control data corresponds one-to-one to the first user data, and the basic format control data includes a first starting logical block address and a first logical block quantity. According to the first starting logical block address in the N basic format control data, N first user data are obtained from the host, and each first user data is written to the flash memory device.

[0280] In an embodiment of the present application, in some simple data processing scenarios or when the data management requirements are not high, only logical block data exists, for example, "512+0", which means that logical block data exists and the logical block data granularity is 512 bytes, and there is no metadata.

[0281] In an embodiment of the present application, in some complex scenarios, data includes logical block data and metadata (Meta). Metadata is usually used as a supplement or verification information for logical block data. Metadata combined with main data can form a new data format, such as the "512+8" format, where "512" represents the logical block size specified by the main data, and "+8" means that each logical block has an additional 8 bytes as a Meta area for storing metadata.

[0282] In an embodiment of the present application, when user data includes logical block data and metadata, in order to meet the needs of data integrity protection, different metadata space arrangement formats are provided to manage the logical block data and metadata, wherein the metadata space arrangement format includes a first metadata space arrangement format and a second metadata space arrangement format. The logical block data and metadata of the first metadata space arrangement format are stored independently, and the logical block data and metadata of the second metadata space arrangement format are stored continuously, that is, the addresses of the logical block data and metadata of the first metadata space arrangement format are discontinuous, and the addresses of the logical block data and metadata of the second metadata space arrangement format are continuous. The first metadata space arrangement format includes the Dix (Data Integrity Extension) format, and the second metadata space arrangement format includes the Dif (Data Integrity Field) format.

[0283] Among them, Dif is the data integrity field. When metadata is stored next to logical block data, the metadata under this storage structure can be regarded as a data integrity field. Dix is the data integrity extension. When metadata is stored independently of logical block data, it can be regarded as an extension mechanism for data integrity.

[0284] In the embodiment of the present application, Dix protects the integrity of data from the host application to the flash memory device. Dif is also called T10 PI (T10 Protection Information). T10 PI protects the integrity of data from the flash memory device to the host application. Dix and T10 PI together protect the end-to-end integrity of data from the host application to the flash memory device.

[0285] In an embodiment of the present application, when the logical block data and metadata are stored in the Dix format, the logical block data and metadata are respectively stored in different cache spaces; when the logical block data and metadata are stored in the Dif format, the logical block data and metadata are stored in the same cache space.

[0286] In the embodiment of the present application, when the user data includes logical block data and metadata, before writing the data to the flash memory device, it is necessary to confirm the metadata space arrangement format of the data in the flash memory device in order to continue the data writing operation. For the specific process, please refer to Figure 15 .

[0287] Please refer to Figure 18 , Figure 18 This is a flowchart of a format expansion method provided in an embodiment of the present application.

[0288] like Figure 18 As shown, the format extension method includes:

[0289] Step S1801: Send format configuration information to the host.

[0290] Specifically, when the host writes data to the flash memory device, the flash memory device sends format configuration information to the host, where the format configuration information includes a basic format and an extended format.

[0291] Among them, the basic format corresponds to the basic format control data, the basic format includes a first format attribute and a second format attribute, the first format attribute includes the first user data, and the second format attribute includes the first metadata space arrangement format, that is, the format type of the basic format is the first metadata space arrangement format, the first user data includes the first logical block data and the first metadata, the first logical block data corresponds one-to-one to the first metadata, and the basic format control data includes the first starting logical block address and the first logical block quantity.

[0292] Among them, the extended format corresponds to the extended format control data, the extended format includes a first format attribute and a second format attribute, the first format attribute includes the second user data, and the second format attribute includes the first metadata space arrangement format, that is, the format type of the extended format is the first metadata space arrangement format, the second user data includes the second logical block data and the second metadata, the second logical block data corresponds one-to-one to the second metadata, and the extended format control data includes the second starting logical block address and the second logical block quantity.

[0293] Step S1802: Receive command control data to be sent from the host.

[0294] Among them, the command control data to be sent includes a mapping relationship between basic format control data and extended format control data, the basic format control data corresponds one-to-one to the first user data, the extended format control data corresponds one-to-one to the second user data, and the command control data to be sent includes the extended format control data and the second user data.

[0295] In an embodiment of the present application, the command control data to be sent is used to obtain first user data from a host and write the first user data to a flash memory device.

[0296] Step S1803: Obtain first user data from the host according to the extended format control data; or send the first user data to the host according to the extended format control data.

[0297] The second user data includes second logical block data and second metadata.

[0298] Specifically, when data is stored in a flash memory device, second user data of a second logical block quantity is continuously obtained according to the second starting logical block address in the extended format control data. The size of the second user data is N times the size of the first user data, that is, one second user data includes N*first user data. When the second user data is obtained, N first user data are obtained.

[0299] Specifically, when data is sent to the host, the data is controlled according to the extended format and the first user data is sent to the host.

[0300] See also Figure 20 , Figure 20 yes Figure 18 Detailed flow chart of step S1803 in FIG.

[0301] like Figure 20 As shown, step S1803 includes:

[0302] Step S1833: Determine the second user data according to the extended format control data.

[0303] Specifically, the extended format control data includes a second starting logical block address and a second logical block quantity. The second starting logical block address is a starting address of the second logical block data. The second user data is determined based on the second starting logical block address.

[0304] Step S1834: query the second data mapping table according to the second logical block data and the second metadata to obtain the first logical block data and the first metadata.

[0305] The second data mapping table includes a mapping relationship between the first logic block data and the second logic block data, and a mapping relationship between the first metadata and the second metadata.

[0306] Specifically, according to the second logical block data and the second metadata, the second data mapping table is queried to obtain N first logical block data based on the mapping relationship between the first logical block data and the second logical block data, and to obtain N first metadata based on the mapping relationship between the first metadata and the second metadata.

[0307] Step S1835: Assemble the first logical block data and the first metadata in a first metadata space arrangement format to obtain N first user data.

[0308] Specifically, N first logical block data and N first metadata are assembled in a first metadata space arrangement format to obtain N first user data, and the first user data corresponds one-to-one to the first logical block data and the first metadata.

[0309] In the embodiment of the present application, when the user data includes metadata, and the format type of the extended format is the first metadata space arrangement format, and the format type of the basic format is the second metadata space arrangement format, that is, the format type of the extended format is the Dix format, and the format type of the basic format is the Dif format, the basic format is extended to continue the write operation to the flash memory device. For the specific process, please refer to Figure 18 .

[0310] Please refer to Figure 18 , Figure 18 This is a flowchart of a format expansion method provided in an embodiment of the present application.

[0311] like Figure 18 As shown, the format extension method includes:

[0312] Step S1801: Send format configuration information to the host.

[0313] Specifically, when the host writes data to the flash memory device, the flash memory device sends format configuration information to the host, where the format configuration information includes a basic format and an extended format.

[0314] Among them, the basic format corresponds to the basic format control data, the basic format includes a first format attribute and a second format attribute, the first format attribute includes the first user data, and the second format attribute includes the second metadata space arrangement format, that is, the format type of the basic format is the second metadata space arrangement format, the first user data includes the first logical block data and the first metadata, the first logical block data corresponds one-to-one to the first metadata, and the basic format control data includes the first starting logical block address and the first logical block quantity.

[0315] Among them, the extended format corresponds to the extended format control data, the extended format includes a first format attribute and a second format attribute, the first format attribute includes the second user data, and the second format attribute includes the first metadata space arrangement format, that is, the format type of the extended format is the first metadata space arrangement format, the second user data includes the second logical block data and the second metadata, the second logical block data corresponds one-to-one to the second metadata, and the extended format control data includes the second starting logical block address and the second logical block quantity.

[0316] Step S1802: Receive command control data to be sent from the host.

[0317] The command control data to be sent includes a data linked list, which includes but is not limited to an SGL (ScatterGather List) linked list.

[0318] In an embodiment of the present application, when metadata exists and the metadata space arrangement formats of data in the flash memory device and the host are different, the format extension in the present application is described in detail using the SGL linked list as an example.

[0319] In an embodiment of the present application, when the metadata space arrangement formats of data in the flash memory device and the host are different, it is necessary to construct a data linked list and convert the data format based on the data linked list so that the flash memory device and the host can transmit data under different metadata space arrangement formats.

[0320] In an embodiment of the present application, the data linked list includes several data segments, each data segment includes N descriptors, the data segments correspond one-to-one to the second user data, and the descriptors correspond one-to-one to the first user data, wherein each descriptor includes a first starting logical block address and a first logical block quantity.

[0321] In an embodiment of the present application, the data linked list includes an SGL linked list, the data segment includes an SGL segment, and the descriptor includes an SGL descriptor.

[0322] In an embodiment of the present application, the data linked list includes an SGL linked list, the data segment includes an SGL segment, and the descriptor includes an SGL descriptor.

[0323] In the embodiment of the present application, taking the data linked list as an SGL linked list as an example, the data linked list construction process includes the following rules:

[0324] (1) A separate logical block data descriptor is created for each logical block of data. The logical block data descriptor includes the starting address information and the number of logical blocks of the logical block data. A separate metadata descriptor is created for each piece of metadata. The metadata descriptor includes the starting address information and the number of logical blocks of the metadata. It is understood that the number of logical blocks is used to represent the length of the data.

[0325] (2) The metadata descriptor is concatenated after the logical block data descriptor.

[0326] (3) The logical block data descriptor corresponding to each logical block data and the logical block data descriptor corresponding to each metadata are arranged in sequence to form an SGL linked list.

[0327] In an embodiment of the present application, the command control data to be sent is used to obtain first user data from a host and write the first user data to a flash memory device.

[0328] Step S1803: Obtain first user data from the host according to the extended format control data; or send the first user data to the host according to the extended format control data.

[0329] The second user data includes second logical block data and second metadata.

[0330] Specifically, when data is stored in a flash memory device, second user data of a second logical block quantity is continuously obtained according to the second starting logical block address in the extended format control data. The size of the second user data is N times the size of the first user data, that is, one second user data includes N*first user data. When the second user data is obtained, N first user data are obtained.

[0331] Specifically, when sending data to the host, the first user data is sent to the host according to the data linked list in the extended format control data.

[0332] See also Figure 21 , Figure 21 yes Figure 18 Detailed flow chart of step S1803 in FIG.

[0333] like Figure 21 As shown, step S1803 includes:

[0334] Step S1836: Determine the second user data according to the extended format control data.

[0335] The second user data corresponds to the data segments one-to-one, each data segment includes N descriptors, and the descriptors correspond to the first user data one-to-one.

[0336] The extended format control data includes a second starting logical block address and a second logical block quantity.

[0337] The second user data includes second logical block data and second metadata.

[0338] Specifically, according to the first logical block data descriptor and the first metadata descriptor in each descriptor group, N first user data are acquired, and the N first user data are assembled to obtain the second user data.

[0339] Step S1837: According to each descriptor in the data segment, obtain N first user data from the host.

[0340] Among them, the first descriptor includes a first logical block data descriptor and a first metadata descriptor, the first logical block data descriptor includes the starting logical block address and the number of logical blocks of the first logical block data, and the first metadata descriptor includes the starting logical block address and the number of logical blocks of the first metadata.

[0341] Among them, the descriptor includes a second descriptor, the second descriptor includes a second logical block data descriptor and a second metadata descriptor, the second logical block data descriptor includes the starting logical block address and the number of logical blocks of the second logical block data, and the second metadata descriptor includes the starting logical block address and the number of logical blocks of the second metadata.

[0342] Specifically, N first user data are obtained from the host according to the first logical block data descriptor and the first metadata descriptor in each descriptor group.

[0343] In an embodiment of the present application, when the metadata space arrangement formats of data in the flash memory device and the host are different, the data format is converted through a data linked table, so that the flash memory device and the host can transmit data under different metadata space arrangement formats.

[0344] In an embodiment of the present application, when the metadata space arrangement format in the host is the first metadata space arrangement format, and the metadata space arrangement format in the flash memory device is the first metadata space arrangement format, after obtaining the first logical block data and the first metadata, the first logical block data and the first metadata are assembled in the Dix format, and the assembled first data is sent to the flash memory device. After the flash memory device receives the first user data, it stores the first user data in the flash memory device in the Dix format.

[0345] In an embodiment of the present application, when the metadata space arrangement format in the host is the first assembly format and the metadata space arrangement format in the flash memory device is the second assembly format, the data stored in the host is read based on the data linked list, and the data stored in the host is stored in the flash memory device based on the Dif format.

[0346] In an embodiment of the present application, since the data linked list enables discontinuous data to be read in the order of construction, for example, in the Dix format, the logical block data and metadata in the user data are stored in different cache spaces respectively, an SGL linked list is constructed so that the logical block data and metadata can be read in sequence, thereby enabling the host and the flash memory device to perform data read and write operations based on the SGL linked list in different formats.

[0347] Example 3

[0348] See also Figure 22 , Figure 22 It is a structural diagram of a format expansion system provided in an embodiment of the present application.

[0349] like Figure 22 As shown, the format expansion system 100 includes a host 101 and a flash memory device 102, which are communicatively connected to each other. The host 101 includes but is not limited to a computer terminal, a laptop computer, etc., and the flash memory device 102 includes but is not limited to a USB flash drive, an SD card, a microSD card, a CF card, a solid-state drive (SSD), etc.

[0350] The host 101 is used to obtain the basic format and the extended format of the flash memory device 102, and splice the obtained data based on the extended format, and send the spliced data to the flash memory device according to the basic format.

[0351] The flash memory device 102 is configured to send a data acquisition request to the host 101 , and based on a data command sent by the host 101 , store the data in the extended format corresponding to the data in the basic format in the flash memory device 102 .

[0352] Specifically, the host 101 includes an upper-layer application 111 and a driver 112. When the host 101 writes data to the flash memory device 102, the flash memory device 102 reports the basic format (i.e., the original format in the figure) and the extended format. If the data format in the current host 101 is the Dix format and the data format in the flash memory device 102 is the Dif format, the driver 112 constructs an SGL linked list, obtains the data to be written to the flash memory device 102 from the upper-layer application 111, and organizes the scattered logical block data and metadata in sequence based on the SGL linked list, and converts the logical block data and metadata into the Dif format based on the SGL linked list, so as to convert the Dix format data in the host into the Dif format, and store the data in the Dif format in the flash memory device.

[0353] In an embodiment of the present application, based on the original format of the flash memory device, the format required to be expanded by the flash memory device is simulated through the SGL linked list, so that the original flash memory device can support the Dix format, thereby increasing the flexibility of the flash memory device.

[0354] Example 4

[0355] See also Figure 23 , Figure 23 This is a schematic diagram of the structure of a host provided in an embodiment of the present application.

[0356] like Figure 23 As shown, the host 101 includes one or more processors 113 and a memory 114, wherein: Figure 23 A processor 113 is taken as an example.

[0357] The processor 113 and the memory 114 are connected via a bus or other means. Figure 23 The bus connection is taken as an example.

[0358] The processor 113 is configured to execute the format expansion method of the first embodiment.

[0359] The processor 113 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or any combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0360] The memory 114 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the program instructions / modules corresponding to the format expansion method in the embodiment of the present application. The processor 113 can implement the format expansion method in any of the above method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 114. Specifically, the memory 114 includes volatile memory (VM), such as random access memory (RAM); the memory 114 may include non-volatile memory (NVM), such as read-only memory (ROM), flash memory, hard disk drive (HDD) or solid-state drive (SSD) or other non-transitory solid-state storage devices; the memory 114 may include a combination of the above types of memories.

[0361] The memory 114 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 114 may optionally include a memory remotely located relative to the processor 113. Such remote memory may be connected to the processor 113 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0362] One or more modules are stored in the memory 114, and when executed by one or more processors 113, the format expansion method in the above embodiment is executed, for example, the above described Figure 2 The steps shown.

[0363] In the embodiment of the present application, the host 101 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The host 101 may also include other components for realizing device functions, which will not be described in detail here.

[0364] Example 5

[0365] See also Figure 24 , Figure 24 This is a structural diagram of a flash memory device provided in an embodiment of the present application.

[0366] like Figure 24 As shown, the flash memory device 102 includes one or more processors 121 and a memory 122. Figure 24 A processor 121 is taken as an example.

[0367] The processor 121 and the memory 122 may be connected via a bus or other means. Figure 24 The bus connection is taken as an example.

[0368] The processor 121 is configured to execute the format expansion method of the second embodiment.

[0369] The processor 121 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or any combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0370] The memory 122 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the program instructions / modules corresponding to the format extension method in the embodiment of the present application. The processor 121 can implement the format extension method in any of the above method embodiments by running the non-transient software programs, instructions and modules stored in the memory 122. Specifically, the memory 122 may include a volatile memory (VM), such as a random access memory (RAM); the memory 122 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory (flash memory), a hard disk drive (HDD) or a solid-state drive (SSD) or other non-transient solid-state storage device; the memory 122 may also include a combination of the above types of memories.

[0371] The memory 122 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some embodiments, the memory 122 may optionally include a memory remotely located relative to the processor 121, and such remote memory may be connected to the processor 121 via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0372] One or more modules are stored in the memory 122, and when one or more processors 121 are used, the format expansion method in the above embodiment 2 is executed, for example, the above described format expansion method is executed. Figure 18 The steps shown.

[0373] In an embodiment of the present application, the flash memory device 102 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The flash memory device 102 may also include other components for realizing device functions, which will not be described in detail here.

[0374] The present application also provides a non-volatile computer-readable storage medium, such as a memory including program code, wherein the program code can be executed by a processor to perform the format expansion method in the above embodiment. For example, the non-volatile computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0375] The present application also provides a computer program product comprising one or more program codes stored in a non-volatile computer-readable storage medium. A processor of a flash memory device reads the program codes from the non-volatile computer-readable storage medium and executes the program codes to perform the steps of the format expansion method provided in the above-described embodiment.

[0376] Those skilled in the art will understand that all or part of the steps for implementing the above embodiments may be accomplished by hardware, or by hardware related to program code, and the program may be stored in a non-volatile computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk, or an optical disk, etc.

[0377] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the relevant technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or certain parts of the embodiment.

[0378] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Based on the idea of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the present application as above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A format expansion method, characterized in that: Applied to a host, the host being communicatively connected to a flash memory device, the method comprising: Obtaining format configuration information sent by the flash memory device, wherein the format configuration information includes a basic format and an extended format, the basic format corresponds to basic format control data, the extended format corresponds to extended format control data, the basic format and the extended format both include a first format attribute, the first format attribute includes first user data or second user data, the basic format corresponds to the first user data, and the extended format corresponds to the second user data; determining the extended format control data based on the basic format control data according to a quantity relationship between the first user data and the second user data; generating command control data to be sent according to the extended format control data; The command control data to be sent is sent to the flash memory device so that the flash memory device obtains the first user data from the host based on the command control data to be sent to write into the flash memory device; or, the first user data is read from the flash memory device according to the command control data to be sent.

2. The method according to claim 1, characterized in that The basic format control data includes a first starting logical block address and a first logical block quantity; The extended format control data includes a second starting logical block address and a second logical block quantity; wherein, The size of the second user data is N times the size of the first user data, where N is a positive integer and N≥2; The determining the extended format control data based on the basic format control data according to the quantity relationship between the first user data and the second user data includes: The second starting logical block address is determined to be N*the first starting logical block address, and the number of the second logical blocks is determined to be N*the first logical block number.

3. The method according to claim 1, characterized in that The step of generating command control data to be sent according to the extended format control data includes: Constructing a first data mapping table, wherein the first data mapping table includes a mapping relationship between the basic format control data and the extended format control data, the basic format control data corresponds to the first user data in a one-to-one manner, and the extended format control data corresponds to the second user data in a one-to-one manner; generating the command control data to be sent according to the first data mapping table, wherein the command control data to be sent includes the first data mapping table; The acquiring the first user data from the host based on the command control data to be sent includes: Obtaining N first user data from the host according to the first data mapping table, and writing each first user data into the flash memory device, where N is a positive integer and N≥2; The reading the first user data from the flash memory device according to the command control data to be sent includes: According to the first data mapping table, N first user data are read from the flash memory device.

4. The method according to claim 1, wherein The first user data includes first logical block data and first metadata, and the first logical block data corresponds to the first metadata in a one-to-one manner; The second user data includes second logical block data and second metadata, and the second logical block data corresponds to the second metadata in a one-to-one manner; The size of the second logical block data is N times the size of the first logical block data, and the size of the second metadata is N times the size of the first metadata, where N is a positive integer and N≥2; The host includes a cache space, and the cache space includes a first cache space and a second cache space, which are respectively used to cache the second logic block data and the second metadata; The basic format and the extended format both include a second format attribute, and the second format attribute includes a first metadata space arrangement format or a second metadata space arrangement format; The logical block data and metadata in the first metadata space arrangement format are stored independently, and the logical block data and metadata in the second metadata space arrangement format are stored continuously.

5. The method according to claim 4, characterized in that The format type of the extended format is the first metadata space arrangement format, and the format type of the basic format is the first metadata space arrangement format; The step of generating command control data to be sent according to the extended format control data includes: Constructing a second data mapping table, wherein the second data mapping table includes a mapping relationship between the first logic block data and the second logic block data, and a mapping relationship between the first metadata and the second metadata; generating the command control data to be sent according to the second data mapping table, wherein the command control data to be sent includes the second data mapping table; The acquiring the first user data from the host based on the command control data to be sent includes: Obtaining N first user data from the host according to the second data mapping table, wherein each first user data includes one first logical block data and one first metadata, wherein the N first logical block data constitute one second logical block data, and the N first metadata constitute one second metadata; Sending the N first user data to the flash memory device through a first data transmission protocol, wherein the first data transmission protocol is used to transmit data in a first metadata space arrangement format; The reading the first user data from the flash memory device according to the command control data to be sent includes: According to the second data mapping table, N first user data are read from the flash memory device.

6. The method according to claim 4, characterized in that The format type of the extended format is the first metadata space arrangement format, and the format type of the basic format is the second metadata space arrangement format; The step of generating command control data to be sent according to the extended format control data includes: Constructing a data linked list, the data linked list including a plurality of data segments, each data segment including N descriptors, the data segments corresponding one-to-one to the second user data, the descriptors corresponding one-to-one to the first user data, wherein each descriptor includes a first starting logical block address and a first logical block quantity; Generate command control data to be sent according to the data linked list, wherein the command control data to be sent includes the data linked list.

7. The method according to claim 6, characterized in that The descriptor includes a first descriptor, the first descriptor including a first logical block data descriptor and a first metadata descriptor, wherein the first logical block data descriptor includes a starting logical block address and a number of logical blocks of the first logical block data, and the first metadata descriptor includes a starting logical block address and a number of logical blocks of the first metadata; The descriptor includes a second descriptor, the second descriptor includes a second logical block data descriptor and a second metadata descriptor, wherein the second logical block data descriptor includes a starting logical block address and a number of logical blocks of the second logical block data, and the second metadata descriptor includes a starting logical block address and a number of logical blocks of the second metadata; The constructing of the data linked list includes: Constructing a first logical block data descriptor and a first metadata descriptor for each first user data; combining the first logical block data descriptor and the first metadata descriptor to construct N descriptor groups, wherein each descriptor group includes a first logical block data descriptor and a first metadata descriptor, and the first logical block data descriptor is continuous with the first metadata descriptor; generating a plurality of data segments according to the descriptor groups, wherein each data segment includes N descriptor groups; After generating a plurality of data segments, a data linked list is generated according to the plurality of data segments.

8. The method according to claim 7, characterized in that Generating command control data to be sent according to the data linked list includes: According to the data linked list, obtain N descriptor groups of a plurality of data segments; generating the command control data to be sent according to the first logical block data descriptor and the first metadata descriptor in each descriptor group; The acquiring the first user data from the host based on the command control data to be sent includes: Acquire N first user data according to the first logical block data descriptor and the first metadata descriptor in each descriptor group; Sending the N first user data to the flash memory device through a second data transmission protocol, wherein the second data transmission protocol is used to transmit data in a second metadata space arrangement format; The reading the first user data from the flash memory device according to the command control data to be sent includes: According to the data linked list, N first user data are read from the flash memory device.

9. A format expansion method, characterized in that: Applied to a flash memory device, the flash memory device being communicatively connected to a host, the method comprising: Sending format configuration information to the host, wherein the format configuration information includes a basic format and an extended format, the basic format and the extended format both include a first format attribute, the first format attribute includes first user data or second user data, the basic format corresponds to the first user data, and the extended format corresponds to the second user data; receiving command control data to be sent from the host, wherein the command control data to be sent includes the extended format control data; Acquire first user data from the host according to the extended format control data; or send the first user data to the host according to the extended format control data.

10. A host, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

11. A flash memory device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to claim 9.

12. A format expansion system, characterized in that: include: The host according to claim 10; The flash memory device of claim 11, communicatively connected to the host.