CN118585141A - A memory and data processing method thereof - Google Patents

A memory and data processing method thereof Download PDF

Info

Publication number
CN118585141A
CN118585141A CN202411067359.0A CN202411067359A CN118585141A CN 118585141 A CN118585141 A CN 118585141A CN 202411067359 A CN202411067359 A CN 202411067359A CN 118585141 A CN118585141 A CN 118585141A
Authority
CN
China
Prior art keywords
data
host data
host
physical address
certain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411067359.0A
Other languages
Chinese (zh)
Inventor
付应辉
苏忠益
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Kangxinwei Storage Technology Co Ltd
Original Assignee
Hefei Kangxinwei Storage Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Kangxinwei Storage Technology Co Ltd filed Critical Hefei Kangxinwei Storage Technology Co Ltd
Priority to CN202411067359.0A priority Critical patent/CN118585141A/en
Publication of CN118585141A publication Critical patent/CN118585141A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本发明提供一种存储器及其数据处理方法,存储器包括:闪存,包括多个区块,用以存储主机数据;以及主控制器,与闪存电性连接,主控制器用以在主机数据的写入过程中,为主机数据分配物理地址和写缓存区;其中,在一批次主机数据的写入过程中,主控制器为某一主机数据分配物理地址和写缓存区,统计该批次主机数据中,与某一主机数据完全相同的其他主机数据,并将其他主机数据与某一主机数据共用相同的物理地址与写缓存区,然后将其他主机数据和某一主机数据写入闪存中。本发明可提高主机中主机数据向存储器的写入效率,并可提高存储器的使用性能和使用寿命。

The present invention provides a memory and a data processing method thereof, wherein the memory comprises: a flash memory, comprising a plurality of blocks, for storing host data; and a main controller, electrically connected to the flash memory, and the main controller is used to allocate a physical address and a write buffer area for the host data during the writing process of the host data; wherein, during the writing process of a batch of host data, the main controller allocates a physical address and a write buffer area for a certain host data, counts other host data in the batch of host data that are completely identical to a certain host data, and shares the same physical address and write buffer area with the other host data, and then writes the other host data and the certain host data into the flash memory. The present invention can improve the writing efficiency of the host data in the host to the memory, and can improve the use performance and service life of the memory.

Description

一种存储器及其数据处理方法A memory and data processing method thereof

技术领域Technical Field

本发明涉及静态存储技术领域,尤其涉及一种存储器及其数据处理方法。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

存储芯片是嵌入式系统芯片的概念在存储行业的具体应用。无论是系统芯片还是存储芯片,都是通过在单一芯片中嵌入软件,以实现多功能、高性能以及对多种协议、多种硬件和不同应用的支持。存储芯片广泛应用于计算机、移动设备、物联网等领域,用于存储各种数据,如操作系统、应用程序、音乐、视频、照片等。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.

存储芯片的闪存中存储数据的使用性能受到数据写入性能的影响,目前存储芯片的写入性能较差,会发生存储系统运行缓慢的情况。因此,存在待改进之处。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

本发明提供一种存储器及其数据处理方法,以解决目前存储芯片的写入性能较差,会发生存储系统运行缓慢的技术问题。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.

本发明提供的一种存储器,包括: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.

在本发明的一个实施例中,所述闪存用以存储数据映射表,所述数据映射表存放主机数据的逻辑地址和物理地址的映射信息;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.

在本发明的一个实施例中,所述主控制器内设有数据寄存器,所述数据寄存器内设有重复数据标识位和写缓存区位;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 bit 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.

在本发明的一个实施例中,所述主控制器为某一主机数据分配物理地址和写缓存区后,当统计到该批次主机数据中,具有与某一主机数据完全相同的其他主机数据时,将所述数据寄存器中的重复数据标识位进行设置;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 other host data identical to the certain host data is counted in the batch of host data, a 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.

在本发明的一个实施例中,所述主控制在将所述数据寄存器中的重复数据标识位进行设置后,将其他主机数据共用某一主机数据的物理地址与写缓存区;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.

本发明还提出一种存储器的数据处理方法,包括: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.

在本发明的一个实施例中,所述在该批次主机数据中,统计与某一主机数据完全相同的其他主机数据,并将其他主机数据共用某一主机数据的物理地址与写缓存区的步骤之后,包括: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.

在本发明的一个实施例中,所述在该批次主机数据中,统计与某一主机数据完全相同的其他主机数据的步骤之后,包括: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 method includes:

在一批次主机数据中,将是否具有与某一主机数据完全相同的其他主机数据的信息表征为重复数据标志位;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.

在本发明的一个实施例中,所述在一批次主机数据中,将是否与某一主机数据完全相同的信息表征为重复数据标志位的步骤之后,包括: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.

在本发明的一个实施例中,所述将其他主机数据共用某一主机数据的物理地址与写缓存区的步骤,包括: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.

本发明的有益效果:本发明提出的一种存储器及其数据处理方法,本发明可提高主机中主机数据向存储器的写入效率,并可提高存储器的使用性能和使用寿命。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

为了更清楚地说明本申请具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。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 any creative work.

图1为本发明一实施例提供的存储器的结构示意图。FIG. 1 is a schematic diagram of the structure of a memory provided by an embodiment of the present invention.

图2为现有技术中存储器的写入主机数据示意图。FIG. 2 is a schematic diagram of writing host data into a memory in the prior art.

图3为本发明一实施例提供的存储器的写入主机数据示意图。FIG. 3 is a schematic diagram of writing host data into a memory provided by an embodiment of the present invention.

图4为本发明一实施例提供的存储器的数据处理方法的步骤示意图。FIG. 4 is a schematic diagram of steps of a data processing method for a memory provided by an embodiment of the present invention.

图5为本发明一实施例提供的图4中步骤S30之后的步骤示意图。FIG. 5 is a schematic diagram of steps after step S30 in FIG. 4 provided by an embodiment of the present invention.

图6为本发明又一实施例提供的图4中步骤S30之后的步骤示意图。FIG. 6 is a schematic diagram of steps after step S30 in FIG. 4 provided by another embodiment of the present invention.

图7为本发明一实施例提供的图6中步骤S321之后的步骤示意图。FIG. 7 is a schematic diagram of steps after step S321 in FIG. 6 provided by an embodiment of the present invention.

附图标号说明:10、主机;20、存储器;30、主控制器;31、中央处理单元;32、直接存储访问单元;40、闪存;41、区块;42、页。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

以下通过特定的具体实例说明本发明的实施方式,本领域技术人员可由本说明书所揭露的内容轻易地了解本发明的其他优点与功效。本发明还可以通过另外不同的具体实施方式加以实施或应用,本说明书中的各项细节也可以基于不同观点与应用,在没有背离本发明的精神下进行各种修饰或改变。需说明的是,在不冲突的情况下,以下实施例及实施例中的特征可以相互组合。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.

需要说明的是,以下实施例中所提供的图示仅以示意方式说明本发明的基本构想,遂图式中仅显示与本发明中有关的组件而非按照实际实施时的组件数目、形状及尺寸绘制,其实际实施时各组件的型态、数量及比例可为一种随意的改变,且其组件布局型态也可能更为复杂。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.

在下文描述中,探讨了大量细节,以提供对本发明实施例的更透彻的解释,然而,对本领域技术人员来说,可以在没有这些具体细节的情况下实施本发明的实施例是显而易见的,在其他实施例中,以方框图的形式而不是以细节的形式来示出公知的结构和设备,以避免使本发明的实施例难以理解。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.

请参阅图1至图7,本发明提出一种存储器及其数据处理方法,可应用在eMMC(Embedded Multi Media Card,嵌入式多媒体卡)、SSD(Solid State Disk,固态硬盘)、UFS(Univeral Flash Storage,通用闪存存储器)等存储设备中。本发明在写入主机数据的过程中,当主机数据中具有重复数据的情况下,将这些重复数据共用一个物理地址及一个写缓存区,主机数据是指主机10写入的应用数据。本发明在一次写入闪存40的操作下,可将上述重复数据保存至闪存40中。本发明可提高主机10中主机数据向存储器20的写入效率,可进一步的提高存储器20的使用性能和使用寿命。下面通过具体的实施例进行详细的描述。Please refer to Figures 1 to 7. The 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. 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.

请参阅图1,在本发明的一个实施例中,提出一种存储器20,存储器20上设有总线接口,存储器20通过总线接口与主机10电性连接,主机10可向存储器20写入主机数据及发送指令,或者主机10可从存储器20中读取主机数据及接收指令。主机10可为个人计算机(PC,Personal Computer)、平板电脑(Pad)、移动手机(Cell Phone)等通信设备。Referring to FIG. 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 a host 10 through the bus interface. The host 10 can write host data and send commands to the memory 20, or the host 10 can read host data and receive commands from the memory 20. The host 10 can be a communication device such as a personal computer (PC), a tablet computer (Pad), or a mobile phone (Cell Phone).

请参阅图1,在本发明的一个实施例中,存储器20可包括主控制器30和闪存40。其中,闪存40是一种非易失性存储器,通常用来存放主机数据和系统程序等。主控制器30主要用来对闪存40进行操作和管理,并且主控制器30还提供了缓存(Cache)、存储阵列(Memoryarray)及交叉存取(Interleave)等功能。主控制器30与闪存40电性连接,主控制器30可对闪存40的诸多功能进行控制,例如是坏快管理、磨损均衡、错误检查和纠正(ECC,ErrorChecking and Correcting)等,主控制器30可大大提高闪存40中主机数据的读写、搬移操作性能。Please refer to FIG. 1 . In one embodiment of the present invention, the memory 20 may include a main controller 30 and a flash memory 40. 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.

请参阅图1,在本发明的一个实施例中,在存储器20的内部,主控制器30上设有闪存接口,主控制器30与闪存40之间通过闪存接口电性连接。主控制器30可包括中央处理单元(CPU,Central Processing Unit)31和直接存储访问单元(DMA,Direct Memory Access)32,中央处理单元31是存储装置的运算核心和控制核心,例如是为主机数据分配物理地址(PBA,Physics Block Address)和写缓存区(WriteBuf)。直接存储访问单元32用于传输主机数据,并且不需要占用中央处理单元31。直接存储访问单元32在传输主机数据的时候,中央处理单元31可以处理其他的事情,工作过程类似于多线程方式。Please refer to FIG. 1 . In one embodiment of the present invention, inside the memory 20 , a flash memory interface is provided on the main controller 30 . 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.

具体的,物理地址是闪存40中区块41所对应的实际地址,也称为实地址。与物理地址相对应的是逻辑地址(LBA,Logical Block Address),逻辑地址是指用户程序中使用的相对地址,也称为虚拟地址,逻辑地址是由中央处理单元31生成的,用于访问闪存40中的数据。对于主控制器30将要写入到闪存40中的主机数据,可先临时存放到写缓存区中,然后写缓存区再以低速写入到闪存40中。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.

请参阅图1,在本发明的一个实施例中,闪存40可包括多个区块(Block)41,区块41可用以存储数据映射表(L2P,Logic Block Address to Physical Block Address Table及主机10写入的主机数据,一个区块41还可包括多个页(Page)42。数据映射表存放主机数据的逻辑地址和物理地址的映射信息。利用逻辑地址查询数据映射表中的映射信息,便可找到对应的物理地址,再对闪存40中相应物理地址上的主机数据进行读写、搬移等处理。Referring to FIG. 1 , in one embodiment of the present invention, a flash memory 40 may include a plurality of blocks 41. 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 querying the mapping information in the data mapping table using the logical address, 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.

具体的,在主机10向存储器20写入主机数据的情况下,中央处理单元31给主机数据分配物理地址和写缓存区。在直接存储访问单元32的作用下,将主机数据先存放至写缓存区中,然后写缓存区中的主机数据再写入到闪存40,之后可释放写缓存区上的存储空间,并记录主机数据关联的逻辑地址和物理地址之间的映射信息。在主机10从存储器20读取主机数据的情况下,主机10读取某一逻辑地址后,存储器20可查找数据映射表,找到某一逻辑地址对应的物理地址,读取该物理地址上的存储数据并传递给主机10上。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.

表1、用户空间的划分表Table 1: User space division table

在本发明的一个实施例中,如表1所示,可将用户空间以512字节为单位划分为LBA0-LBA(M-1)。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.

表2、闪存40位置的划分表Table 2: Partition table of flash memory 40 locations

在本发明的一个实施例中,如表2所示,可将闪存40位置以512字节为单位划分为PBA0-PBA(N-1),并且N≥M。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.

表3、写缓存区的划分表Table 3. Write cache area division table

在本发明的一个实施例中,如表3所示,可将写缓存区以512字节为单位划分为Buf0- Buf(L-1)。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.

一个逻辑地址和一个物理地址的映射关系,可使用一个数据映射条目表示,格式如下:The mapping relationship between a logical address and a physical address can be represented by a data mapping entry in the following format:

由存储器20记录并更新数据映射表(L2P Table),其中一个逻辑地址(LBA)与一个物理地址(LBA)进行对应,写过的逻辑地址有物理地址与之对应,没有写的逻辑地址没有物理地址与之对应,数据映射表(L2P Table)的格式如下: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:

表4、数据映射表的初始状态Table 4. Initial state of the data mapping table

在现有技术中,如图2所示,在主机10向存储器20写入主机数据的情况下,例如主机10写入主机数据对应的逻辑地址为LBA0-LBA(M-1),并且LBA0-LBA7的逻辑地址对应的主机数据是相同的,(M-1)>7。此时中央处理单元31可为LBA0-LBA7的逻辑地址,可分配8个物理地址和8个写缓存区。物理地址可为PBA4、PBA5、PBA6、PBA7、PBA8、PBA9、PBA10和PBA11,写缓存区可为Buf2、Buf3、Buf4、Buf5、Buf6、Buf7、Buf8和Buf9。In the prior art, as shown in FIG. 2 , 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 buffers can be allocated. The physical addresses can be PBA4, PBA5, PBA6, PBA7, PBA8, PBA9, PBA10 and PBA11, and the write buffers can be Buf2, Buf3, Buf4, Buf5, Buf6, Buf7, Buf8 and Buf9.

具体的,如图2所示,首先,在直接存储访问单元32的作用下,将主机数据先存放至写缓存区中,LBA0对应Buf2,LBA1对应Buf3,……,LBA7对应Buf9。其次,写缓存区中的主机数据再写入到闪存40,Buf2对应PBA4,Buf3对应PBA5,……,Buf9对应PBA11。然后,可释放写缓存区上的存储空间,并记录主机数据关联的逻辑地址和物理地址之间的映射信息。数据映射表(L2P Table)中的信息如下:Specifically, as shown in FIG2 , 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:

表5、数据映射表的第一状态Table 5. First state of data mapping table

由上述的数据映射表(L2P Table)可看出,LBA0-LBA7的逻辑地址所对应的物理地址为PBA4-PBA11。在现有技术中,在主机10向存储器20写入主机数据的过程中,即使逻辑地址为LBA0-LBA7上对应的8个主机数据是相同数据,仍需要使用到8个物理地址和8个写缓存区,而且需要多次写入到闪存40中。主机10写入主机数据的速度受到物理地址个数、写缓存区大小以及写入闪存40时间的限制。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.

在现有技术中,如图2所示,在主机10从存储器20读取主机数据的情况下,主机10读取某一逻辑地址为LBA1后,存储器20可查找数据映射表(L2P Table),找到逻辑地址为LBA1所对应的物理地址为PBA5,读取该物理地址PBA5上的存储数据并传递给主机10上。In the prior art, as shown in FIG. 2 , when the host 10 reads host data from the memory 20 , after the host 10 reads a logical address LBA1, the memory 20 can search the data mapping table (L2P Table), find the physical address PBA5 corresponding to the logical address LBA1, read the storage data at the physical address PBA5 and pass it to the host 10 .

请参阅图1和图3,为了提高主机10中主机数据向存储器20的写入效率,并提高存储器20的使用性能和使用寿命。在一批次主机数据的写入过程中,首先,主控制器30为某一主机数据分别分配物理地址和写缓存区,统计该批次主机数据中,与某一主机数据完全相同的其他主机数据。其次,将其他主机数据和某一主机数据共用相同的物理地址与写缓存区。然后,将其他主机数据和某一主机数据写入闪存40中。Please refer to FIG. 1 and FIG. 3 , in 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 physical addresses and write buffers to certain host data, and counts other host data in the batch of host data that are exactly 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. Then, the other host data and the certain host data are written into the flash memory 40.

具体的,如图3所示,在主机10向存储器20写入主机数据的情况下,例如主机10写入主机数据对应的逻辑地址为LBA0-LBA(M-1),并且LBA0-LBA7的逻辑地址对应的主机数据是相同的,(M-1)>7。Specifically, as shown in FIG3 , 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.

首先,主控制器30为某一主机数据分配物理地址和写缓存区,统计该批次主机数据中具有与某一主机数据相同数据的其他主机数据。例如是为逻辑地址为LBA0的某一主机数据分配写缓存区Buf2和物理地址PBA4。对该批次主机数据中进行统计,例如是直接存储访问单元32以512个字节为单位检查数据。在发现逻辑地址为LBA1-LBA7的主机数据与逻辑地址为LBA0的主机数据是相同数据后,可将逻辑地址为LBA1-LBA7的主机数据记为其他主机数据。其次,对于逻辑地址为LBA1-LBA7的其他主机数据,可与逻辑地址为LBA0的某一主机数据共用物理地址PBA4与写缓存区Buf2。然后,将逻辑地址为LBA1-LBA7的其他主机数据和逻辑地址为LBA0的某一主机数据写入闪存40中。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.

值得一提的是,为了对一批次的主机数据进行区分,可将其中一个主机数据记为某一主机数据,可将与某一主机数据完全相同的记为其他主机数据,可将一批次中剩余的主机数据记为剩余主机数据。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.

具体的,如图3所示,首先,在直接存储访问单元32的作用下,将主机数据先存放至写缓存区中,LBA0对应Buf2,LBA1对应Buf2,……,LBA7对应Buf2,即LBA0-LBA7的逻辑地址对应的写缓存区都为Buf2。其次,写缓存区Buf2中的主机数据再写入到闪存40,写缓存区Buf2对应物理地址PBA4。然后,可释放写缓存区Buf2上的存储空间,并记录主机数据关联的逻辑地址和物理地址之间的映射信息。数据映射表(L2P Table)中的信息如下:Specifically, as shown in FIG3 , 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 then 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:

表6、数据映射表的第二状态Table 6. Second state of data mapping table

请参阅图2、图3、表5和表6所示,由表6可看出,LBA0-LBA7的逻辑地址所对应的物理地址为PBA4。在本实施例中,在主机10向存储器20写入主机数据的过程中,对于逻辑地址为LBA0-LBA7上对应的8个主机数据是相同数据时,仅需要使用到1个物理地址和1个写缓存区,仅需要一次写入到闪存40中。本实施例不需要像图2和表5的现有技术中使用到8个物理地址和8个写缓存区,也不需要多次写入到闪存40中。在本实施例中,对于主机10写入主机数据的速度,受到物理地址个数、写缓存区大小以及写入闪存40时间的限制得到减少,本实施例可提升主机10的写速度。Please refer to FIG. 2, FIG. 3, 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 1 physical address and 1 write buffer area need to be used, and only one write to the flash memory 40 is needed. This embodiment does not need to use 8 physical addresses and 8 write buffer areas as in the prior art of FIG. 2 and Table 5, nor does it need to be written to the flash memory 40 multiple times. In this embodiment, the speed of the host 10 writing host data is reduced due to the restrictions of the number of physical addresses, the size of the write buffer area and the time of writing to the flash memory 40. This embodiment can improve the write speed of the host 10.

图7、现有技术与本实施例中写入主机数据的对照表FIG. 7 is a comparison table of the host data written in the prior art and the present embodiment.

请参阅图1,在本发明的一个实施例中,直接存储访问单元32内可设有数据寄存器,数据寄存器可包括重复数据标志位和写缓存区位,数据寄存器具有16位(bit),其格式如下表8所示。重复数据标志位表征在一批次主机数据中,是否与某一主机数据完全相同的其他主机数据,通过bit15进行反映。写缓存区位表征某一主机数据关联的写缓存区的序号,通过bit0-bit14反映。Please refer to FIG. 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.

具体的,主控制器30为某一主机数据分配物理地址和写缓存区后,当统计到该批次主机数据中,与某一主机数据完全相同的其他主机数据时,将数据寄存器中的重复数据标识位bit15进行设置,例如为1。主控制器30为某一主机数据分配物理地址和写缓存区后,当统计到该批次主机数据中,没有与某一主机数据相同数据的其他主机数据时,将数据寄存器中的重复数据标识位bit15不进行设置,例如保持为0。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.

表8、数据寄存器的格式表Table 8. Data register format

请参阅图1所示,在本发明的一个实施例中,存储器20可对数据映射表和数据寄存器进行扩展,形成数据映射表的扩展条目,可记录逻辑地址和物理地址之间的映射信息,还可记录数据寄存器中的信息。如下表9所示:Referring to FIG. 1 , 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, 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 Table 9 below:

表9、数据映射表的扩展条目Table 9. Extended entries in the data mapping table

请参阅图3和表9,在本发明的一个实施例中,在主机10向存储器20写入主机数据的过程中,结合数据寄存器进行分析。如图3所示,在主机10向存储器20写入主机数据的情况下,例如主机10写入主机数据对应的逻辑地址为LBA0-LBA(M-1),并且LBA0-LBA7的逻辑地址对应的主机数据是相同的,(M-1)>7。Please refer to FIG3 and Table 9. In one embodiment of the present invention, in the process of the host 10 writing host data to the memory 20, analysis is performed in combination with the data register. As shown in FIG3, in the case where 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.

具体的,主控制器30为逻辑地址为LBA0的某一主机数据分配写缓存区Buf2和物理地址PBA4。对该批次主机数据中进行统计,发现逻辑地址为LBA1-LBA7的主机数据与逻辑地址为LBA0的其他主机数据是相同数据。直接存储访问单元32发现完全相同,在数据寄存器中,重复数据标识位bit15进行设置,例如为1,写缓存区位可记下写缓存区的序号,为Buf2。其次,对于逻辑地址为LBA1-LBA7的其他主机数据,可共用逻辑地址为LBA0的某一主机数据的物理地址PBA4与写缓存区Buf2。并记录数据映射表的扩展条目表,如下表10所示。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.

表10、数据映射表的扩展条目表Table 10: Extended entry table of data mapping table

请参阅表8和表10所示,在本发明的一个实施例中,在将数据寄存器中的重复数据标识位bit15进行设置后,例如设置为1后,将其他主机数据共用某一主机数据的物理地址PBA4与写缓存区Buf2。另外,如果在将数据寄存器中的重复数据标识位bit15不进行设置后,例如保持为0后,为另一主机数据分配新的物理地址和新的写缓存区。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.

请参阅图4,在本发明的一个实施例中,本发明提出一种存储器的数据处理方法,可包括以下的步骤:Please refer to FIG. 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:

步骤S10、接收主机写入的主机数据,存储至闪存的多个区块中。Step S10: receiving host data written by the host, and storing the data in a plurality of blocks of the flash memory.

步骤S20、在一批次主机数据的写入过程中,为某一主机数据分配物理地址和写缓存区。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.

步骤S30、在该批次主机数据中,统计与某一主机数据完全相同的其他主机数据,并将其他主机数据与某一主机数据共用相同的物理地址与写缓存区。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.

步骤S40、将其他主机数据和某一主机数据写入闪存中。Step S40: write other host data and a certain host data into the flash memory.

下面通过具体的实施例进行详细的描述。The following is a detailed description through specific embodiments.

步骤S10、接收主机写入的主机数据,存储至闪存的多个区块中。Step S10: receiving host data written by the host, and storing the data in a plurality of blocks of the flash memory.

在本发明的一个实施例中,如图1所示,闪存40可包括多个区块(Block)41,区块41可用以存储数据映射表(L2P,Logic Block Address to Physical Block Address Table及主机10写入的主机数据,一个区块41还可包括多个页(Page)42。数据映射表存放主机数据的逻辑地址和物理地址的映射信息。利用逻辑地址查询数据映射表中的映射信息,便可找到对应的物理地址,再对闪存40中相应物理地址上的主机数据进行读写、搬移等处理。In one embodiment of the present invention, as shown in FIG. 1 , a 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 querying the mapping information in the data mapping table using the logical address, 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, and other processes.

步骤S20、在一批次主机数据的写入过程中,为某一主机数据分配物理地址和写缓存区。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.

在本发明的一个实施例中,如图3所示,在主机10向存储器20写入主机数据的情况下,中央处理单元31给主机数据分配物理地址和写缓存区。在直接存储访问单元32的作用下,将主机数据先存放至写缓存区中,然后写缓存区中的主机数据再写入到闪存40,之后可释放写缓存区上的存储空间,并记录主机数据关联的逻辑地址和物理地址之间的映射信息。在主机10从存储器20读取主机数据的情况下,主机10读取某一逻辑地址后,存储器20可查找数据映射表,找到某一逻辑地址对应的物理地址,读取该物理地址上的存储数据并传递给主机10上。In one embodiment of the present invention, as shown in FIG3 , 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.

步骤S30、在该批次主机数据中,统计与某一主机数据完全相同的其他主机数据,并将其他主机数据与某一主机数据共用相同的物理地址与写缓存区。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.

在本发明的一个实施例中,如图3所示,在主机10向存储器20写入主机数据的情况下,例如主机10写入主机数据对应的逻辑地址为LBA0-LBA(M-1),并且LBA0-LBA7的逻辑地址对应的主机数据是相同的,(M-1)>7。In one embodiment of the present invention, as shown in FIG3 , 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.

具体的,如图3所示,主控制器30为某一主机数据分配物理地址和写缓存区,统计该批次主机数据中具有与某一主机数据相同数据的其他主机数据。例如是为逻辑地址为LBA0的某一主机数据分配写缓存区Buf2和物理地址PBA4。对该批次主机数据中进行统计,例如是直接存储访问单元32以512个字节为单位检查数据。在发现逻辑地址为LBA1-LBA7的主机数据与逻辑地址为LBA0的主机数据是相同数据后,可将逻辑地址为LBA1-LBA7的主机数据记为其他主机数据。其次,对于逻辑地址为LBA1-LBA7的其他主机数据,可共用逻辑地址为LBA0的某一主机数据的物理地址PBA4与写缓存区Buf2。Specifically, as shown in FIG3 , 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.

步骤S40、将其他主机数据和某一主机数据写入闪存中。Step S40: write other host data and a certain host data into the flash memory.

在本发明的一个实施例中,将逻辑地址为LBA1-LBA7的其他主机数据和逻辑地址为LBA0的某一主机数据写入闪存40中。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.

请参阅图5,在本发明的一个实施例中,步骤S30之后可包括步骤S310和步骤S311。步骤S310可表示为将数据映射表存储至闪存40中,数据映射表存放主机数据的逻辑地址和物理地址的映射信息。步骤S311可表示为对于其他主机数据和某一主机数据对应的多个逻辑地址,关联相同的物理地址和相同的写缓存区。Referring to FIG. 5 , in 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 the logical address and the physical address of the 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.

具体的,如图3所示,在直接存储访问单元32的作用下,将主机数据先存放至写缓存区中,LBA0对应Buf2,LBA1对应Buf2,……,LBA7对应Buf2,即LBA0-LBA7的逻辑地址对应的写缓存区都为Buf2。其次,写缓存区Buf2中的主机数据再写入到闪存40,写缓存区Buf2对应物理地址PBA4。Specifically, as shown in FIG3 , 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.

请参阅图6,在本发明的一个实施例中,步骤S30之后还可包括步骤S320和步骤S321。步骤S320可表示为在一批次主机数据中,将是否具有与某一主机数据完全相同的其他主机数据的信息表征为重复数据标志位。步骤S321可表示为将某一主机数据关联的写缓存区的序号表征为写缓存区位。Please refer to FIG. 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.

在本发明的一个实施例中,如表8所示,可设有数据寄存器,数据寄存器可包括重复数据标志位和写缓存区位,数据寄存器具有16位(bit),其格式如下表8所示。重复数据标志位表征在一批次主机数据中,是否具有与某一主机数据相同数据的其他主机数据,并通过bit15进行反映。写缓存区位表征某一主机数据关联的写缓存区的序号,并通过bit0-bit14反映。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.

请参阅图7,在本发明的一个实施例中,步骤S321之后可包括步骤S322至步骤S325。步骤S322可表示为某一主机数据分配物理地址和写缓存区后,当检查到该批次主机数据中,具有与某一主机数据完全相同的其他主机数据时,将所述重复数据标识位进行设置,例如设置为1。步骤S323可表示为在将数据寄存器中的重复数据标识位进行设置后,例如设置为1后,将其他主机数据与某一主机数据共用相同的物理地址与写缓存区。步骤S324可表示为某一主机数据分配物理地址和写缓存区后,当检查到该批次主机数据中,没有与某一主机数据相同数据的其他主机数据时,将所述重复数据标识位不进行设置,例如保持为0。步骤S325可表示为在将数据寄存器中的重复数据标识位不进行设置后,例如保持为0后,为另一主机数据分配新的物理地址和新的写缓存区。Please refer to FIG. 7 . In one embodiment of the present invention, after step S321, steps S322 to S325 may be included. Step S322 may represent that after a physical address and a write buffer area are allocated to a certain host data, when it is checked 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 a physical address and a write buffer area are allocated to a certain host data, when it is checked 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, maintained at 0. Step S325 may represent that after the duplicate data identification bit in the data register is not set, for example, maintained at 0, a new physical address and a new write buffer area are allocated to another host data.

具体的,如表8所示,为某一主机数据分配物理地址和写缓存区后,当统计到该批次主机数据中,具有与某一主机数据相同数据的其他主机数据时,将数据寄存器中的重复数据标识位bit15进行设置,例如设置为1。主控制器30为某一主机数据分配物理地址和写缓存区后,当统计到该批次主机数据中,没有与某一主机数据相同数据的其他主机数据时,将数据寄存器中的重复数据标识位bit15不进行设置,例如保持为0。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.

综上所述,本发明提出一种存储器及其数据处理方法,本发明在写入主机数据的过程中,当主机数据中具有重复数据的情况下,将这些重复数据共用一个物理地址及一个写缓存区。本发明在一次写入闪存的操作下,可将上述重复数据保存至闪存中。本发明可提高主机中主机数据向存储器的写入效率,可进一步的提高存储装置的使用性能和使用寿命。In summary, the present invention provides a memory and a data processing method thereof. 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 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.

附图中的流程图和框图,图示了按照本公开各种实施例的方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。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 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 box can also occur in a sequence different from that marked in the accompanying drawings. For example, two 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 box in the block diagram and/or flow chart, and the combination of the 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 (10)

1. A memory, comprising:
the flash memory comprises a plurality of blocks for storing host data; and
The main controller is electrically connected with the flash memory and is used for distributing a physical address and a write buffer area for the host data in the writing process of the host data;
in the writing process of a batch of host data, the main controller allocates a physical address and a writing buffer area 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, shares the same physical address and the writing buffer area with the other host data, and then writes the other host data and the certain host data into the flash memory.
2. The memory of claim 1, wherein the flash memory is configured to store a data mapping table, the data mapping table storing mapping information of logical addresses and physical addresses of host data;
and the main controller associates the same physical address and the same write cache area with a plurality of logical addresses corresponding to the other host data and the certain host data.
3. The memory of claim 1, wherein a data register is provided in the main controller, and wherein a duplicate data identification bit and a write buffer bit are provided in the data register;
and the repeated data flag bit represents whether the repeated data flag bit has the information of the other host data which is completely the same as the certain host data in a batch of host data, and the writing buffer bit represents the serial number of the writing buffer area associated with the certain host data.
4. The memory according to claim 3, wherein after the host controller allocates a physical address and a write buffer for the certain host data, when the batch of host data is counted to have the other host data identical to the certain host data, the repeated data identification bit in the data register is set;
After the main controller allocates a physical address and a write buffer area for the host data, when the host data of the batch is counted to have no other host data with the same data as the host data, the repeated data identification bit in the data register is not set.
5. The memory of claim 4 wherein said main control, after setting said duplicate data identification bit in said data register, shares said physical address of said certain host data with said write buffer with said other host data;
And after the main control does not set the repeated data identification bit in the data register, a new physical address and a new write buffer area are allocated for the data of another host.
6. A data processing method of a memory, comprising:
Host data written by a host are received and stored in a plurality of blocks of the flash memory;
in the writing process of host data of a batch, a physical address and a writing buffer area are allocated for a certain host data;
In the batch of host data, counting other host data which are completely the same as the certain host data, and sharing the same physical address and write cache area with the other host data;
And writing the other host data and the certain host data into the flash memory.
7. The method according to claim 6, wherein after the step of counting the other host data which is identical to the certain host data in the batch of host data and sharing the same physical address and write buffer with the certain host data, the method further comprises:
storing a data mapping table into the flash memory, wherein the data mapping table stores mapping information of a logical address and a physical address of host data;
And associating the same physical address and the same write cache area with a plurality of logical addresses corresponding to the other host data and the certain host data.
8. The method according to claim 6, wherein after the step of counting the other host data identical to the certain host data in the batch of host data, the method comprises:
in a batch of host data, characterizing whether the information of the other host data which is completely the same as the certain host data is repeated data flag bits;
and characterizing the serial number of the write buffer area associated with the host data as a write buffer area bit.
9. The method according to claim 8, wherein after the step of characterizing whether the information identical to the certain host data is repeated data flag bits in a batch of host data, the method comprises:
After a physical address and a write buffer area are allocated to the certain host data, when the other host data with the same data as the certain host data in the batch of host data is detected, setting the repeated data identification bit;
After a physical address and a write buffer area are allocated to the certain host data, when the other host data which is not the same as the certain host data in the batch of host data is detected, the repeated data identification bit is not set.
10. The method of claim 9, wherein the step of sharing the same physical address and write buffer with the other host data and the certain host data comprises:
after setting the repeated data identification bit in the data register, sharing the same physical address and write buffer area with the other host data and the certain host data;
After the repeated data identification bit in the data register is not set, a new physical address and a new write buffer area are allocated for the data of another host.
CN202411067359.0A 2024-08-06 2024-08-06 A memory and data processing method thereof Pending CN118585141A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411067359.0A CN118585141A (en) 2024-08-06 2024-08-06 A memory and data processing method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411067359.0A CN118585141A (en) 2024-08-06 2024-08-06 A memory and data processing method thereof

Publications (1)

Publication Number Publication Date
CN118585141A true CN118585141A (en) 2024-09-03

Family

ID=92528496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411067359.0A Pending CN118585141A (en) 2024-08-06 2024-08-06 A memory and data processing method thereof

Country Status (1)

Country Link
CN (1) CN118585141A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150317083A1 (en) * 2014-05-05 2015-11-05 Virtium Technology, Inc. Synergetic deduplication
CN110389718A (en) * 2018-04-16 2019-10-29 东芝存储器株式会社 Storage system and control method of non-volatile memory
CN110543435A (en) * 2019-09-05 2019-12-06 北京兆易创新科技股份有限公司 Mixed mapping operation method, device and equipment of storage unit and storage medium
CN111881065A (en) * 2020-07-30 2020-11-03 北京浪潮数据技术有限公司 Physical address processing method, device, equipment and medium for data deduplication operation
CN112053735A (en) * 2019-06-05 2020-12-08 建兴储存科技(广州)有限公司 Repeated data processing method of solid-state storage device
CN112559388A (en) * 2020-12-14 2021-03-26 杭州宏杉科技股份有限公司 Data caching method and device
WO2023029417A1 (en) * 2021-08-31 2023-03-09 华为技术有限公司 Data storage method and device
CN116932426A (en) * 2022-04-07 2023-10-24 中山市江波龙电子有限公司 Method for managing stored data, electronic device and computer readable storage device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150317083A1 (en) * 2014-05-05 2015-11-05 Virtium Technology, Inc. Synergetic deduplication
CN110389718A (en) * 2018-04-16 2019-10-29 东芝存储器株式会社 Storage system and control method of non-volatile memory
CN112053735A (en) * 2019-06-05 2020-12-08 建兴储存科技(广州)有限公司 Repeated data processing method of solid-state storage device
CN110543435A (en) * 2019-09-05 2019-12-06 北京兆易创新科技股份有限公司 Mixed mapping operation method, device and equipment of storage unit and storage medium
CN111881065A (en) * 2020-07-30 2020-11-03 北京浪潮数据技术有限公司 Physical address processing method, device, equipment and medium for data deduplication operation
CN112559388A (en) * 2020-12-14 2021-03-26 杭州宏杉科技股份有限公司 Data caching method and device
WO2023029417A1 (en) * 2021-08-31 2023-03-09 华为技术有限公司 Data storage method and device
CN116932426A (en) * 2022-04-07 2023-10-24 中山市江波龙电子有限公司 Method for managing stored data, electronic device and computer readable storage device

Similar Documents

Publication Publication Date Title
US10198215B2 (en) System and method for multi-stream data write
US11249897B2 (en) Data storage device and operating method thereof
US11513948B2 (en) Controller and memory system
US20180239697A1 (en) Method and apparatus for providing multi-namespace using mapping memory
US10102118B2 (en) Memory system and non-transitory computer readable recording medium
US11762590B2 (en) Memory system and data processing system including multi-core controller for classified commands
US10296250B2 (en) Method and apparatus for improving performance of sequential logging in a storage device
CN105830059A (en) Fine pitch connector socket
US10552045B2 (en) Storage operation queue
KR20190090635A (en) Data storage device and operating method thereof
US20170255565A1 (en) Method and apparatus for providing a contiguously addressable memory region by remapping an address space
CN114371812B (en) Controller and operation method thereof
US20160124639A1 (en) Dynamic storage channel
US20240086113A1 (en) Synchronous write method and device, storage system and electronic device
CN112445422A (en) Memory controller, memory device, and method of operating memory controller
US12072797B2 (en) Memory system and non-transitory computer readable recording medium
CN118426707B (en) Storage device and data processing method thereof
KR102815402B1 (en) Controller, operating method thereof and storage device including the same
TW202318201A (en) Method and apparatus for performing data access control of memory device with aid of predetermined command
CN112148626A (en) Storage method and storage device for compressed data
CN114185480B (en) Memory systems and data processing systems
US10891239B2 (en) Method and system for operating NAND flash physical space to extend memory capacity
KR20200013956A (en) Data storage device capable of changing map cache buffer size
KR20220076803A (en) Data storage device and operating method thereof
CN108804338B (en) Data storage device and operation method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination