Memory and data processing method thereof

By using the main controller in the memory to allocate physical addresses and write cache areas for host data, and sharing addresses and cache areas when duplicate data is detected, the problem of low write performance of memory chips is solved and the operating efficiency of the storage system is improved. and memory life.

CN118585141AInactive Publication Date: 2024-09-03合肥康芯威存储技术有限公司

Patent Information

Application Number
CN202411067359.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The memory chip has poor write performance, causing the storage system to run slowly.

Method used

By introducing the main controller into the memory, the host data is allocated a physical address and write cache area during the writing process, and when duplicate data is detected, it shares the same physical address and write cache area, reducing the physical address and write buffer area. The number of cache areas to improve writing efficiency.

Benefits of technology

It improves the efficiency of writing host data to the memory, extends the service life of the memory, and improves the overall performance of the memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585141A
    Figure CN118585141A
Patent Text Reader

Abstract

The invention provides a memory and a data processing method thereof, and the memory comprises a flash memory which comprises a plurality of blocks and is used for storing host data; the main controller is electrically connected with the flash memory, and the main controller is used for distributing a physical address and a write cache region for the host data in the write-in process of the host data; wherein in the write-in process of a batch of host data, a main controller allocates a physical address and a write cache region for a certain host data, counts other host data which are completely the same as the certain host data in the batch of host data, and enables the other host data and the certain host data to share the same physical address and write cache region; and then other host data and certain host data are written into the flash memory. The efficiency of writing the host data into the memory in the host can be improved, the use performance of the memory can be improved, and the service life of the memory can be prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of static storage technology, and in particular to a memory and a data processing method thereof. Background Art

[0002] Memory chips are the specific application of the concept of embedded system chips in the storage industry. Both system chips and memory chips embed software in a single chip to achieve multi-function, high performance and support for multiple protocols, multiple hardware and different applications. Memory chips are widely used in computers, mobile devices, the Internet of Things and other fields to store various data, such as operating systems, applications, music, videos, photos, etc.

[0003] The performance of data stored in the flash memory of the storage chip is affected by the data writing performance. Currently, the writing performance of the storage chip is poor, which may cause the storage system to run slowly. Therefore, there is room for improvement. Summary of the invention

[0004] The present invention provides a memory and a data processing method thereof, so as to solve the technical problem that the writing performance of the current memory chip is poor and the memory system runs slowly.

[0005] The present invention provides a memory, comprising: A flash memory including a plurality of blocks for storing host data; and A main controller, electrically connected to the flash memory, and configured to allocate a physical address and a write buffer area to the host data during the writing process of the host data; Among them, during the writing process of a batch of host data, the main controller allocates a physical address and a write cache area to a certain host data, counts other host data in the batch of host data that are exactly the same as the certain host data, and makes the other host data share the same physical address and write cache area with the certain host data, and then writes the other host data and the certain host data into the flash memory.

[0006] In one embodiment of the present invention, the flash memory is used to store a data mapping table, and the data mapping table stores mapping information between logical addresses and physical addresses of host data; The main controller associates the same physical address and the same write cache area with respect to multiple logical addresses corresponding to other host data and a certain host data.

[0007] In one embodiment of the present invention, a data register is provided in the main controller, and a duplicate data identification bit and a write cache bit are provided in the data register; The duplicate data flag indicates whether there is information of other host data that is completely identical to a certain host data in a batch of host data, and the write cache area bit indicates the serial number of the write cache area associated with a certain host data.

[0008] In one embodiment of the present invention, after the main controller allocates a physical address and a write buffer area for a certain host data, when counting other host data in the batch of host data that are exactly the same as the certain host data, the duplicate data identification bit in the data register is set; After the main controller allocates a physical address and a write buffer area for a certain host data, when there is no other host data with the same data as the certain host data in the batch of host data, the duplicate data identification bit in the data register is not set.

[0009] In one embodiment of the present invention, the master control, after setting the duplicate data identification bit in the data register, shares the physical address and write buffer area of ​​a certain host data with other host data; The master control allocates a new physical address and a new write buffer area for another host data after the duplicate data identification bit in the data register is not set.

[0010] The present invention also provides a data processing method of a memory, comprising: receiving host data written by the host and storing the data in a plurality of blocks of the flash memory; In the process of writing a batch of host data, a physical address and a write buffer area are allocated for a certain host data; In the batch of host data, other host data that are completely identical to a certain host data are counted, and the other host data and the certain host data share the same physical address and write buffer area; Other host data and certain host data are written into the flash memory.

[0011] In one embodiment of the present invention, after the step of counting other host data that are identical to a certain host data in the batch of host data and sharing the physical address and write buffer area of ​​the certain host data with the other host data, the method includes: Storing a data mapping table in the flash memory, wherein the data mapping table stores mapping information between logical addresses and physical addresses of host data; For other host data and multiple logical addresses corresponding to a certain host data, the same physical address and the same write buffer area are associated.

[0012] In one embodiment of the present invention, after the step of counting other host data that are completely identical to a certain host data in the batch of host data, the following steps are included: In a batch of host data, whether there is other host data that is completely identical to a certain host data is represented as a duplicate data flag; The serial number of the write cache area associated with a certain host data is represented as a write cache area bit.

[0013] In one embodiment of the present invention, after the step of representing information in a batch of host data as a duplicate data flag whether it is completely identical to a certain host data, the method includes: After allocating a physical address and a write buffer area for a certain host data, when checking that other host data in the batch of host data has the same data as the certain host data, the duplicate data identification bit is set; After allocating a physical address and a write buffer area for a certain host data, when it is checked that there is no other host data with the same data as the certain host data in the batch of host data, the duplicate data identification bit is not set.

[0014] In one embodiment of the present invention, the step of sharing the physical address and write buffer area of ​​a certain host data with other host data includes: After the duplicate data identification bit in the data register is set, other host data share the physical address and write buffer area of ​​a certain host data; After the duplicate data identification bit in the data register is not set, a new physical address and a new write buffer area are allocated for another host data.

[0015] Beneficial effects of the present invention: The present invention proposes a memory and a data processing method thereof, which can improve the efficiency of writing host data into the memory in the host, and can improve the performance and service life of the memory. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 A schematic diagram of the structure of a memory provided by an embodiment of the present invention.

[0018] Figure 2 The figure is a schematic diagram of writing host data into a memory in the prior art.

[0019] Figure 3 A schematic diagram of writing host data into a memory provided by an embodiment of the present invention.

[0020] Figure 4 A schematic diagram of the steps of a data processing method for a memory provided by an embodiment of the present invention.

[0021] Figure 5 An embodiment of the present invention provides Figure 4 Schematic diagram of steps after step S30 in FIG.

[0022] Figure 6 Another embodiment of the present invention provides Figure 4 Schematic diagram of steps after step S30 in FIG.

[0023] Figure 7 An embodiment of the present invention provides Figure 6 Schematic diagram of the steps after step S321 in FIG.

[0024] Description of the accompanying drawings: 10, host; 20, memory; 30, main controller; 31, central processing unit; 32, direct storage access unit; 40, flash memory; 41, block; 42, page. DETAILED DESCRIPTION

[0025] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0026] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0027] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0028] See also Figures 1 to 7The present invention proposes a memory and a data processing method thereof, which can be applied to storage devices such as eMMC (Embedded Multi Media Card), SSD (Solid State Disk), and UFS (Univeral Flash Storage). In the process of writing host data, when there is duplicate data in the host data, the duplicate data share a physical address and a write cache area, and the host data refers to the application data written by the host 10. The present invention can save the above-mentioned duplicate data in the flash memory 40 under the operation of writing to the flash memory 40 once. The present invention can improve the writing efficiency of the host data in the host 10 to the memory 20, and can further improve the performance and service life of the memory 20. The following is a detailed description through specific embodiments.

[0029] See also Figure 1 In one embodiment of the present invention, a memory 20 is provided, and a bus interface is provided on the memory 20. The memory 20 is electrically connected to the host 10 through the bus interface. The host 10 can write host data and send instructions to the memory 20, or the host 10 can read host data and receive instructions from the memory 20. The host 10 can be a communication device such as a personal computer (PC), a tablet computer (Pad), a mobile phone (Cell Phone), etc.

[0030] See also Figure 1 In one embodiment of the present invention, the memory 20 may include a main controller 30 and a flash memory 40. Among them, the flash memory 40 is a non-volatile memory, which is usually used to store host data and system programs. The main controller 30 is mainly used to operate and manage the flash memory 40, and the main controller 30 also provides functions such as cache, memory array and interleave. The main controller 30 is electrically connected to the flash memory 40. The main controller 30 can control many functions of the flash memory 40, such as bad block management, wear leveling, error checking and correction (ECC, Error Checking and Correcting), etc. The main controller 30 can greatly improve the read, write and move operation performance of the host data in the flash memory 40.

[0031] See also Figure 1In one embodiment of the present invention, inside the memory 20, a flash memory interface is provided on the main controller 30, and the main controller 30 is electrically connected to the flash memory 40 through the flash memory interface. The main controller 30 may include a central processing unit (CPU) 31 and a direct memory access unit (DMA) 32. The central processing unit 31 is the computing core and control core of the storage device, for example, it allocates a physical address (PBA) and a write buffer (WriteBuf) for host data. The direct memory access unit 32 is used to transmit host data and does not need to occupy the central processing unit 31. When the direct memory access unit 32 transmits host data, the central processing unit 31 can handle other things, and the working process is similar to a multi-threaded method.

[0032] Specifically, the physical address is the actual address corresponding to the block 41 in the flash memory 40, also known as the real address. Corresponding to the physical address is the logical address (LBA, Logical Block Address), which refers to the relative address used in the user program, also known as the virtual address. The logical address is generated by the central processing unit 31 and is used to access the data in the flash memory 40. For the host data that the main controller 30 is going to write into the flash memory 40, it can be temporarily stored in the write cache area, and then the write cache area is written into the flash memory 40 at a low speed.

[0033] See also Figure 1 In one embodiment of the present invention, the flash memory 40 may include a plurality of blocks 41, and the blocks 41 may be used to store a data mapping table (L2P, Logic Block Address to Physical Block Address Table) and host data written by the host 10. A block 41 may also include a plurality of pages 42. The data mapping table stores mapping information of the logical address and the physical address of the host data. By using the logical address to query the mapping information in the data mapping table, the corresponding physical address can be found, and then the host data at the corresponding physical address in the flash memory 40 can be read, written, moved, etc.

[0034] Specifically, when the host 10 writes host data to the memory 20, the central processing unit 31 allocates a physical address and a write buffer area to the host data. Under the action of the direct storage access unit 32, the host data is first stored in the write buffer area, and then the host data in the write buffer area is written to the flash memory 40, after which the storage space on the write buffer area can be released, and the mapping information between the logical address and the physical address associated with the host data is recorded. When the host 10 reads the host data from the memory 20, after the host 10 reads a certain logical address, the memory 20 can search the data mapping table, find the physical address corresponding to a certain logical address, read the storage data at the physical address and pass it to the host 10.

[0035] Table 1: User space division table

[0036] In one embodiment of the present invention, as shown in Table 1, the user space may be divided into LBA0-LBA(M-1) in units of 512 bytes.

[0037] Table 2: Partition table of flash memory 40 locations

[0038] In one embodiment of the present invention, as shown in Table 2, the flash memory 40 location can be divided into PBA0-PBA(N-1) in units of 512 bytes, and N≥M.

[0039] Table 3. Write cache area division table

[0040] In one embodiment of the present invention, as shown in Table 3, the write buffer area may be divided into Buf0-Buf(L-1) in units of 512 bytes.

[0041] The mapping relationship between a logical address and a physical address can be represented by a data mapping entry in the following format:

[0042] The memory 20 records and updates the data mapping table (L2P Table), in which a logical address (LBA) corresponds to a physical address (LBA). A written logical address has a physical address corresponding to it, and an unwritten logical address has no physical address corresponding to it. The format of the data mapping table (L2P Table) is as follows: Table 4. Initial state of the data mapping table

[0043] In the prior art, Figure 2As shown, when the host 10 writes host data to the memory 20, for example, the logical address corresponding to the host data written by the host 10 is LBA0-LBA (M-1), and the host data corresponding to the logical addresses of LBA0-LBA7 are the same, (M-1)>7. At this time, the central processing unit 31 can be the logical address of LBA0-LBA7, and 8 physical addresses and 8 write buffer areas can be allocated. The physical addresses can be PBA4, PBA5, PBA6, PBA7, PBA8, PBA9, PBA10 and PBA11, and the write buffer areas can be Buf2, Buf3, Buf4, Buf5, Buf6, Buf7, Buf8 and Buf9.

[0044] Specifically, Figure 2 As shown, first, under the action of the direct storage access unit 32, the host data is first stored in the write cache area, LBA0 corresponds to Buf2, LBA1 corresponds to Buf3, ..., LBA7 corresponds to Buf9. Secondly, the host data in the write cache area is then written to the flash memory 40, Buf2 corresponds to PBA4, Buf3 corresponds to PBA5, ..., Buf9 corresponds to PBA11. Then, the storage space on the write cache area can be released, and the mapping information between the logical address and the physical address associated with the host data can be recorded. The information in the data mapping table (L2P Table) is as follows: Table 5. First state of data mapping table

[0045] It can be seen from the above data mapping table (L2P Table) that the physical addresses corresponding to the logical addresses LBA0-LBA7 are PBA4-PBA11. In the prior art, when the host 10 writes host data to the memory 20, even if the 8 host data corresponding to the logical addresses LBA0-LBA7 are the same data, 8 physical addresses and 8 write buffers are still needed, and they need to be written to the flash memory 40 multiple times. The speed at which the host 10 writes host data is limited by the number of physical addresses, the size of the write buffer, and the time to write to the flash memory 40.

[0046] In the prior art, Figure 2 As shown, in the case where the host 10 reads host data from the memory 20, after the host 10 reads a certain logical address as LBA1, the memory 20 can search the data mapping table (L2P Table), find that the physical address corresponding to the logical address LBA1 is PBA5, read the storage data on the physical address PBA5 and pass it to the host 10.

[0047] See also Figure 1 and Figure 3In order to improve the writing efficiency of the host data in the host 10 to the memory 20, and to improve the performance and service life of the memory 20. In the process of writing a batch of host data, first, the main controller 30 allocates a physical address and a write buffer area to a certain host data, and counts other host data in the batch of host data that are completely the same as the certain host data. Secondly, the other host data and the certain host data share the same physical address and write buffer area. Then, the other host data and the certain host data are written into the flash memory 40.

[0048] Specifically, Figure 3 As shown, when the host 10 writes host data to the memory 20, for example, the logical address corresponding to the host data written by the host 10 is LBA0-LBA (M-1), and the host data corresponding to the logical addresses LBA0-LBA7 are the same, (M-1)>7.

[0049] First, the main controller 30 allocates a physical address and a write cache area to a certain host data, and counts other host data in the batch of host data that have the same data as the certain host data. For example, a write cache area Buf2 and a physical address PBA4 are allocated to a certain host data with a logical address of LBA0. Statistics are performed on the batch of host data, for example, the direct storage access unit 32 checks the data in units of 512 bytes. After it is found that the host data with logical addresses LBA1-LBA7 is the same data as the host data with logical address LBA0, the host data with logical addresses LBA1-LBA7 can be recorded as other host data. Secondly, for other host data with logical addresses LBA1-LBA7, the physical address PBA4 and the write cache area Buf2 can be shared with a certain host data with a logical address of LBA0. Then, the other host data with logical addresses LBA1-LBA7 and a certain host data with a logical address of LBA0 are written into the flash memory 40.

[0050] It is worth mentioning that in order to distinguish a batch of host data, one of the host data can be recorded as a certain host data, the host data that is exactly the same as a certain host data can be recorded as other host data, and the remaining host data in a batch can be recorded as remaining host data.

[0051] Specifically, Figure 3As shown, first, under the action of the direct storage access unit 32, the host data is first stored in the write cache area, LBA0 corresponds to Buf2, LBA1 corresponds to Buf2, ..., LBA7 corresponds to Buf2, that is, the write cache area corresponding to the logical address of LBA0-LBA7 is Buf2. Secondly, the host data in the write cache area Buf2 is written to the flash memory 40, and the write cache area Buf2 corresponds to the physical address PBA4. Then, the storage space on the write cache area Buf2 can be released, and the mapping information between the logical address and the physical address associated with the host data can be recorded. The information in the data mapping table (L2P Table) is as follows: Table 6. Second state of data mapping table

[0052] See also Figure 2 , Figure 3 As shown in Table 5 and Table 6, it can be seen from Table 6 that the physical address corresponding to the logical address of LBA0-LBA7 is PBA4. In this embodiment, when the host 10 writes host data to the memory 20, when the 8 host data corresponding to the logical addresses LBA0-LBA7 are the same data, only one physical address and one write buffer area are needed, and only one write buffer area is needed to be written to the flash memory 40. This embodiment does not need to be like Figure 2 As in the prior art of Table 5, 8 physical addresses and 8 write buffers are used, and there is no need to write to the flash memory 40 multiple times. In this embodiment, the speed at which the host 10 writes host data is limited by the number of physical addresses, the size of the write buffer, and the time to write to the flash memory 40, and this embodiment can improve the write speed of the host 10.

[0053] Figure 7 , Comparison table of host data written in the prior art and in this embodiment

[0054] See also Figure 1 In one embodiment of the present invention, a data register may be provided in the direct storage access unit 32. The data register may include a duplicate data flag bit and a write cache area bit. The data register has 16 bits, and its format is shown in Table 8 below. The duplicate data flag bit indicates whether other host data in a batch of host data is completely identical to a certain host data, and is reflected by bit 15. The write cache area bit indicates the serial number of the write cache area associated with a certain host data, and is reflected by bit 0-bit 14.

[0055] Specifically, after the main controller 30 allocates a physical address and a write buffer area for a certain host data, when other host data identical to the certain host data is counted in the batch of host data, the duplicate data identification bit 15 in the data register is set, for example, to 1. After the main controller 30 allocates a physical address and a write buffer area for a certain host data, when other host data identical to the certain host data is counted in the batch of host data, the duplicate data identification bit 15 in the data register is not set, for example, maintained at 0.

[0056] Table 8. Data register format

[0057] See also Figure 1 As shown, in one embodiment of the present invention, the memory 20 can expand the data mapping table and the data register to form an extended entry of the data mapping table, which can record the mapping information between the logical address and the physical address, and can also record the information in the data register. As shown in the following Table 9: Table 9. Extended entries in the data mapping table

[0058] See also Figure 3 As shown in Table 9, in one embodiment of the present invention, when the host 10 writes host data to the memory 20, the data register is analyzed. Figure 3 As shown, when the host 10 writes host data to the memory 20, for example, the logical address corresponding to the host data written by the host 10 is LBA0-LBA (M-1), and the host data corresponding to the logical addresses LBA0-LBA7 are the same, (M-1)>7.

[0059] Specifically, the main controller 30 allocates a write cache area Buf2 and a physical address PBA4 for a host data with a logical address of LBA0. Statistics are taken on the host data of this batch, and it is found that the host data with logical addresses LBA1-LBA7 are the same data as other host data with a logical address of LBA0. The direct storage access unit 32 finds that they are exactly the same. In the data register, the duplicate data identification bit bit15 is set, for example, to 1, and the write cache area bit can record the serial number of the write cache area, which is Buf2. Secondly, for other host data with logical addresses LBA1-LBA7, the physical address PBA4 and the write cache area Buf2 of a host data with a logical address of LBA0 can be shared. And record the extended entry table of the data mapping table, as shown in Table 10 below.

[0060] Table 10: Extended entry table of data mapping table

[0061] Please refer to Table 8 and Table 10. In one embodiment of the present invention, after the duplicate data identification bit 15 in the data register is set, for example, to 1, the physical address PBA4 and write buffer area Buf2 of a certain host data are shared by other host data. In addition, if the duplicate data identification bit 15 in the data register is not set, for example, it is kept at 0, a new physical address and a new write buffer area are allocated to another host data.

[0062] See also Figure 4 In one embodiment of the present invention, the present invention provides a data processing method for a memory, which may include the following steps: Step S10: receiving host data written by the host, and storing the data in a plurality of blocks of the flash memory.

[0063] Step S20: during the writing process of a batch of host data, a physical address and a write buffer area are allocated for a certain host data.

[0064] Step S30 , counting other host data that are completely identical to a certain host data in the batch of host data, and making the other host data and the certain host data share the same physical address and write buffer area.

[0065] Step S40: write other host data and a certain host data into the flash memory.

[0066] The following is a detailed description through specific embodiments.

[0067] Step S10: receiving host data written by the host, and storing the data in a plurality of blocks of the flash memory.

[0068] In one embodiment of the present invention, Figure 1 As shown, the flash memory 40 may include a plurality of blocks 41, and the blocks 41 may be used to store a data mapping table (L2P, Logic Block Address to Physical Block Address Table) and host data written by the host 10. A block 41 may also include a plurality of pages 42. The data mapping table stores mapping information of the logical address and the physical address of the host data. By using the logical address to query the mapping information in the data mapping table, the corresponding physical address can be found, and then the host data at the corresponding physical address in the flash memory 40 can be read, written, moved, etc.

[0069] Step S20: during the writing process of a batch of host data, a physical address and a write buffer area are allocated for a certain host data.

[0070] In one embodiment of the present invention, Figure 3 As shown, when the host 10 writes host data to the memory 20, the central processing unit 31 allocates a physical address and a write buffer area to the host data. Under the action of the direct storage access unit 32, the host data is first stored in the write buffer area, and then the host data in the write buffer area is written to the flash memory 40, after which the storage space on the write buffer area can be released, and the mapping information between the logical address and the physical address associated with the host data is recorded. When the host 10 reads the host data from the memory 20, after the host 10 reads a certain logical address, the memory 20 can search the data mapping table, find the physical address corresponding to a certain logical address, read the storage data at the physical address and pass it to the host 10.

[0071] Step S30 , counting other host data that are completely identical to a certain host data in the batch of host data, and making the other host data and the certain host data share the same physical address and write buffer area.

[0072] In one embodiment of the present invention, Figure 3 As shown, when the host 10 writes host data to the memory 20, for example, the logical address corresponding to the host data written by the host 10 is LBA0-LBA (M-1), and the host data corresponding to the logical addresses LBA0-LBA7 are the same, (M-1)>7.

[0073] Specifically, Figure 3 As shown, the main controller 30 allocates a physical address and a write cache area to a certain host data, and counts other host data in the batch of host data that have the same data as the certain host data. For example, a write cache area Buf2 and a physical address PBA4 are allocated to a certain host data with a logical address of LBA0. Statistics are performed on the batch of host data, for example, the direct storage access unit 32 checks the data in units of 512 bytes. After it is found that the host data with logical addresses LBA1-LBA7 is the same data as the host data with logical address LBA0, the host data with logical addresses LBA1-LBA7 can be recorded as other host data. Secondly, for other host data with logical addresses LBA1-LBA7, the physical address PBA4 and the write cache area Buf2 of a certain host data with a logical address of LBA0 can be shared.

[0074] Step S40: write other host data and a certain host data into the flash memory.

[0075] In one embodiment of the present invention, other host data with logical addresses LBA1-LBA7 and a certain host data with logical address LBA0 are written into the flash memory 40.

[0076] See also Figure 5In one embodiment of the present invention, step S30 may include step S310 and step S311. Step S310 may be represented by storing a data mapping table in the flash memory 40, wherein the data mapping table stores mapping information of logical addresses and physical addresses of host data. Step S311 may be represented by associating the same physical address and the same write buffer area for multiple logical addresses corresponding to other host data and a certain host data.

[0077] Specifically, Figure 3 As shown, under the action of the direct storage access unit 32, the host data is first stored in the write buffer area, LBA0 corresponds to Buf2, LBA1 corresponds to Buf2, ..., LBA7 corresponds to Buf2, that is, the write buffer area corresponding to the logical address of LBA0-LBA7 is Buf2. Secondly, the host data in the write buffer area Buf2 is then written to the flash memory 40, and the write buffer area Buf2 corresponds to the physical address PBA4.

[0078] See also Figure 6 In one embodiment of the present invention, step S30 may further include step S320 and step S321. Step S320 may be represented as representing information about whether there are other host data that are completely identical to a certain host data in a batch of host data as a duplicate data flag. Step S321 may be represented as representing the serial number of the write cache area associated with a certain host data as a write cache area bit.

[0079] In one embodiment of the present invention, as shown in Table 8, a data register may be provided, and the data register may include a duplicate data flag bit and a write cache area bit. The data register has 16 bits, and its format is shown in Table 8. The duplicate data flag bit indicates whether there are other host data with the same data as a certain host data in a batch of host data, and is reflected through bit 15. The write cache area bit indicates the serial number of the write cache area associated with a certain host data, and is reflected through bit 0-bit 14.

[0080] See also Figure 7In one embodiment of the present invention, step S321 may include steps S322 to S325. Step S322 may represent that after allocating a physical address and a write buffer area for a certain host data, when it is detected that there are other host data in the batch of host data that are exactly the same as the certain host data, the duplicate data identification bit is set, for example, to 1. Step S323 may represent that after the duplicate data identification bit in the data register is set, for example, to 1, the other host data and the certain host data share the same physical address and write buffer area. Step S324 may represent that after allocating a physical address and a write buffer area for a certain host data, when it is detected that there are no other host data with the same data as the certain host data in the batch of host data, the duplicate data identification bit is not set, for example, kept at 0. Step S325 may represent that after the duplicate data identification bit in the data register is not set, for example, kept at 0, a new physical address and a new write buffer area are allocated to another host data.

[0081] Specifically, as shown in Table 8, after a physical address and a write buffer area are allocated to a certain host data, when other host data with the same data as the certain host data are counted in the batch of host data, the duplicate data identification bit 15 in the data register is set, for example, to 1. After the main controller 30 allocates a physical address and a write buffer area to a certain host data, when other host data with the same data as the certain host data are counted in the batch of host data, the duplicate data identification bit 15 in the data register is not set, for example, maintained at 0.

[0082] In summary, the present invention provides a memory and a data processing method thereof. In the process of writing host data, when there are duplicate data in the host data, the duplicate data share a physical address and a write buffer area. The present invention can save the duplicate data in the flash memory in a one-time write operation. The present invention can improve the writing efficiency of the host data in the host to the memory, and can further improve the performance and service life of the storage device.

[0083] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

Claims

1. A memory, characterized in that: include: Flash memory, including multiple blocks, for storing host data; as well as A main controller, electrically connected to the flash memory, and configured to allocate a physical address and a write buffer area to the host data during the writing process of the host data; Among them, during the writing process of a batch of host data, the main controller allocates a physical address and a write cache area to a certain host data, counts other host data in the batch of host data that are exactly the same as the certain host data, and makes the other host data share the same physical address and write cache area with the certain host data, and then writes the other host data and the certain host data into the flash memory.

2. The memory according to claim 1, characterized in that: The flash memory is used to store a data mapping table, and the data mapping table stores mapping information between a logical address and a physical address of host data; The main controller associates the same physical address and the same write cache area with respect to the multiple logical addresses corresponding to the other host data and the certain host data.

3. The memory according to claim 1, characterized in that: The main controller is provided with a data register, and the data register is provided with a duplicate data identification bit and a write cache bit; The duplicate data flag indicates whether a batch of host data contains information of other host data that is completely identical to the certain host data, and the write cache area bit indicates a serial number of a write cache area associated with the certain host data.

4. The memory according to claim 3, characterized in that: After the main controller allocates a physical address and a write buffer area for the certain host data, when counting the other host data in the batch of host data that is completely identical to the certain host data, setting a duplicate data identification bit in the data register; After the main controller allocates a physical address and a write cache area for the certain host data, when counting the host data in the batch and there is no other host data with the same data as the certain host data, the duplicate data identification bit in the data register is not set.

5. The memory according to claim 4, characterized in that: After setting the duplicate data identification bit in the data register, the master control makes the other host data share the physical address and write buffer area of ​​the certain host data; The master control allocates a new physical address and a new write buffer area for another host data after the duplicate data identification bit in the data register is not set.

6. A data processing method for a memory, characterized in that: include: receiving host data written by the host and storing the data in a plurality of blocks of the flash memory; In the process of writing a batch of host data, a physical address and a write buffer area are allocated for a certain host data; In the batch of host data, other host data that are completely identical to the certain host data are counted, and the other host data and the certain host data share the same physical address and write buffer area; The other host data and the certain host data are written into the flash memory.

7. The memory data processing method according to claim 6, characterized in that: After the step of counting the other host data that are identical to the certain host data in the batch of host data and making the other host data and the certain host data share the same physical address and write buffer area, the method includes: Storing a data mapping table in the flash memory, wherein the data mapping table stores mapping information between logical addresses and physical addresses of host data; For the multiple logical addresses corresponding to the other host data and the certain host data, the same physical address and the same write buffer area are associated.

8. The memory data processing method according to claim 6, characterized in that: After the step of counting the other host data that are completely identical to the certain host data in the batch of host data, the method further includes: In a batch of host data, whether there is other host data that is completely identical to the certain host data is represented as a duplicate data flag; The serial number of the write cache area associated with the certain host data is represented as a write cache area bit.

9. The memory data processing method according to claim 8, characterized in that: After the step of representing information in a batch of host data as a duplicate data flag whether it is completely identical to the certain host data, the method includes: After allocating a physical address and a write buffer area for the certain host data, when detecting that the other host data in the batch of host data has the same data as the certain host data, setting the duplicate data identification bit; After allocating a physical address and a write buffer area for the certain host data, when it is detected that there is no other host data having the same data as the certain host data in the batch of host data, the duplicate data identification bit is not set.

10. The memory data processing method according to claim 9, characterized in that: The step of sharing the same physical address and write buffer area with the certain host data comprises: After setting the duplicate data identification bit in the data register, the other host data and the certain host data share the same physical address and write buffer area; After the duplicate data identification bit in the data register is not set, a new physical address and a new write buffer area are allocated for another host data.

Citation Information

Patent Citations

  • Memory system and method for controlling nonvolatile memory

    CN110389718A

  • Hybrid mapping operation method, device and equipment for storage unit and storage medium

    CN110543435A

  • Physical address processing method and device for data deduplication operation, equipment and medium

    CN111881065A

  • Repeated data processing method of solid-state storage device

    CN112053735A

  • Data caching method and device

    CN112559388A

Cited By

  • Storage device, electronic device, data storage method and storage medium

    CN120723169A