[go: up one dir, main page]

CN107357535A - A kind of method and device for determining the cold and hot grade of data - Google Patents

A kind of method and device for determining the cold and hot grade of data Download PDF

Info

Publication number
CN107357535A
CN107357535A CN201710596164.9A CN201710596164A CN107357535A CN 107357535 A CN107357535 A CN 107357535A CN 201710596164 A CN201710596164 A CN 201710596164A CN 107357535 A CN107357535 A CN 107357535A
Authority
CN
China
Prior art keywords
data
cold
hot
mark value
writing
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
CN201710596164.9A
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710596164.9A priority Critical patent/CN107357535A/en
Publication of CN107357535A publication Critical patent/CN107357535A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • G06F3/0649Lifecycle management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0683Plurality of storage devices

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

本发明公开了一种确定数据冷热等级的方法及装置,所述方法包括:根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值;对所述数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级。本发明对数据属性进行分析确定的依据为数据的历史处理方式比如数据由host写入、数据由垃圾回收写入等,而非时间,即使出现掉电现象本发明的依据也不会受其影响,而是依旧保持准确,因此数据不需要进行多次确定过程就能够确定数据冷热等级,从而本发明可以准确全面地对数据的冷热属性进行确定。

The invention discloses a method and device for determining the hot and cold grades of data. The method includes: calculating the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data; marking the hot data mark of the data The weighted calculation is performed on the value and the cold data mark value, and the hot and cold level of the data is determined according to the corresponding relationship between the weighted calculation result and the hot and cold level. The basis of the present invention to analyze and determine data attributes is the historical processing method of data, such as data written by host, data written by garbage collection, etc., rather than time, even if power failure occurs, the basis of the present invention will not be affected by it , but remains accurate, so the data does not need to go through multiple determination processes to determine the hot and cold grades of the data, so that the present invention can accurately and comprehensively determine the hot and cold attributes of the data.

Description

一种确定数据冷热等级的方法及装置A method and device for determining data cold and hot levels

技术领域technical field

本发明涉及数据存储技术领域,特别是涉及一种确定数据冷热等级的方法及装置。The present invention relates to the technical field of data storage, in particular to a method and device for determining the hot and cold levels of data.

背景技术Background technique

随着互联网、云计算、物联网等技术的发展及广泛的应用,时时刻刻都会产生海量的数据需要处理及存储,这对存储系统的性能提出了更高的要求,而固态硬盘因其读写速度快、能耗较低而被广泛采用。为了延长固态硬盘的使用寿命,提高固态硬盘的性能,需要通过垃圾回收和磨损均衡算法对其进行处理,而对数据冷热属性的有效分析及确定是提高垃圾回收和磨损均衡算法效果的必经途径。With the development and wide application of technologies such as the Internet, cloud computing, and the Internet of Things, massive data needs to be processed and stored all the time, which puts forward higher requirements for the performance of the storage system. It is widely used due to its fast writing speed and low power consumption. In order to prolong the service life of solid-state drives and improve the performance of solid-state drives, it is necessary to process them through garbage collection and wear leveling algorithms, and effective analysis and determination of hot and cold attributes of data is necessary to improve the effects of garbage collection and wear leveling algorithms way.

现有的分析确定数据冷热属性的方法是以数据访问的时间作为依据的,即记录并分析数据访问的时间,访问时间间隔较长的为冷数据,访问时间间隔较短的为热数据。然而固态硬盘中通常没有晶振来保证掉电过程中的时钟,如果固态硬盘出现了掉电现象,那么固态硬盘再次上电后,时间就会从零开始,但是保存在数据中作为依据的时间标记却不会随之改变,这样就导致了数据访问的时间间隔不准确,从而使得不能准确全面地对数据的冷热属性进行确定。The existing method of analyzing and determining the hot and cold attributes of data is based on the time of data access, that is, recording and analyzing the time of data access. The data with a longer access time interval is cold data, and the data with a shorter access time interval is hot data. However, there is usually no crystal oscillator in the solid-state hard disk to ensure the clock during the power-off process. If the solid-state hard disk has a power-off phenomenon, the time will start from zero after the solid-state hard disk is powered on again, but the time stamp stored in the data as a basis However, it will not change accordingly, which leads to inaccurate time intervals of data access, thus making it impossible to accurately and comprehensively determine the hot and cold attributes of the data.

发明内容Contents of the invention

本发明的目的是提供一种确定数据冷热等级的方法及装置,以解决不能准确全面地对数据的冷热属性进行确定的问题。The object of the present invention is to provide a method and device for determining the hot and cold grades of data, so as to solve the problem that the hot and cold attributes of data cannot be determined accurately and comprehensively.

为解决上述技术问题,本发明提供一种确定数据冷热等级的方法,包括:In order to solve the above technical problems, the present invention provides a method for determining the hot and cold grades of data, including:

根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值;calculating a hot data mark value and a cold data mark value of the data according to a historical processing manner of the data;

对所述数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级。Carry out weighted calculation on the hot data mark value and cold data mark value of the data, and determine the cold or hot level of the data according to the corresponding relationship between the weighted calculation result and the cold or hot level.

可选地,所述根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值,包括:Optionally, the calculating the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data includes:

所述数据的历史处理方式为host写入时增加热数据标记值;The historical processing method of the data is to increase the hot data mark value when the host writes;

所述数据的历史处理方式为垃圾回收写入时增加冷数据标记值;The historical processing method of the data is to increase the cold data mark value when garbage collection is written;

所述数据的历史处理方式为错误处理回收写入时增加冷数据标记值。The historical processing method of the data is to increase the cold data mark value when error handling is recovered and written.

可选地,所述根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值,包括:Optionally, the calculating the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data includes:

所述数据的历史处理方式为host写入时增加热数据标记值;The historical processing method of the data is to increase the hot data mark value when the host writes;

所述数据的历史处理方式为垃圾回收写入时增加冷数据标记值;The historical processing method of the data is to increase the cold data mark value when garbage collection is written;

所述数据的历史处理方式为错误处理回收写入时冷数据标记值和热数据标记值均不改变。The historical processing method of the data is that the cold data mark value and the hot data mark value do not change when error processing is recovered and written.

可选地,在所述根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级之后,还包括:Optionally, after determining the hot and cold grades of the data according to the correspondence between the weighted calculation results and the hot and cold grades, the method further includes:

将所述数据的冷热等级存储在FTL表中或存储在闪存芯片中。Store the hot and cold levels of the data in the FTL table or in the flash memory chip.

可选地,在所述根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级之后,还包括:Optionally, after determining the hot and cold grades of the data according to the correspondence between the weighted calculation results and the hot and cold grades, the method further includes:

根据所述数据的冷热等级与全局擦除情况选择数据写入的目的块,并将数据写入。According to the hot and cold level of the data and the global erasure situation, the target block for data writing is selected, and the data is written.

本发明还提供了一种确定数据冷热等级的装置,包括:计算模块和加权判定模块;The present invention also provides a device for determining the hot and cold grades of data, including: a calculation module and a weighted judgment module;

其中,所述计算模块,用于根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值;Wherein, the calculation module is used to calculate the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data;

所述加权判定模块,用于对所述数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级。The weighted determination module is configured to perform weighted calculation on the hot data mark value and the cold data mark value of the data, and determine the cold or hot level of the data according to the corresponding relationship between the weighted calculation result and the cold or hot level.

可选地,所述计算模块包括:热数据计算单元和第一冷数据计算单元;Optionally, the calculation module includes: a thermal data calculation unit and a first cold data calculation unit;

其中,所述热数据计算单元,用于当所述数据的历史处理方式为host写入时增加热数据标记值;Wherein, the hot data calculation unit is used to increase the hot data mark value when the historical processing mode of the data is host writing;

所述第一冷数据计算单元,用于当所述数据的历史处理方式为垃圾回收写入时增加冷数据标记值;当所述数据的历史处理方式为错误处理回收写入时增加冷数据标记值。The first cold data calculation unit is used to increase the cold data mark value when the historical processing mode of the data is garbage collection and writing; increase the cold data mark when the historical processing mode of the data is error processing recovery writing value.

可选地,所述计算模块包括:热数据计算单元和第二冷数据计算单元;Optionally, the calculation module includes: a thermal data calculation unit and a second cold data calculation unit;

其中,所述热数据计算单元,用于当所述数据的历史处理方式为host写入时增加热数据标记值;Wherein, the hot data calculation unit is used to increase the hot data mark value when the historical processing mode of the data is host writing;

所述第二冷数据计算单元,用于当所述数据的历史处理方式为垃圾回收写入时增加冷数据标记值。The second cold data calculation unit is configured to increase the cold data mark value when the historical processing mode of the data is garbage collection and writing.

可选地,所述装置还包括:存储模块,用于将所述数据的冷热等级存储在FTL表中或存储在闪存芯片中。Optionally, the device further includes: a storage module, configured to store the hot and cold levels of the data in an FTL table or in a flash memory chip.

可选地,所述装置还包括:写入模块,用于根据所述数据的冷热等级与全局擦除情况选择数据写入的目的块,并将数据写入。Optionally, the device further includes: a writing module, configured to select a target block for data writing according to the hot and cold levels of the data and the global erasure situation, and write the data.

本发明所提供的确定数据冷热等级方法及装置,先根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值,然后对所述数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级。本发明对数据属性进行分析确定的依据为数据的历史处理方式比如数据由host写入、数据由垃圾回收写入等,而非时间,即使出现掉电现象本发明的依据也不会受其影响,而是依旧保持准确,因此数据不需要进行多次确定过程就能够确定数据冷热等级,从而本发明可以准确全面地对数据的冷热属性进行确定。The method and device for determining the hot and cold grades of data provided by the present invention firstly calculate the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data, and then mark the hot data mark value and the cold data mark value of the data The value is weighted and calculated, and the hot and cold level of the data is determined according to the corresponding relationship between the weighted calculation result and the hot and cold level. The basis of the present invention to analyze and determine data attributes is the historical processing method of data, such as data written by host, data written by garbage collection, etc., rather than time, even if power failure occurs, the basis of the present invention will not be affected by it , but remains accurate, so the data can determine the hot and cold grades of the data without performing multiple determination processes, so that the present invention can accurately and comprehensively determine the hot and cold attributes of the data.

附图说明Description of drawings

为了更清楚的说明本发明实施例或现有技术的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without any creative work.

图1为本发明实施例所提供的确定数据冷热等级的方法的流程图;FIG. 1 is a flow chart of a method for determining the hot and cold levels of data provided by an embodiment of the present invention;

图2为本发明实施例所提供的确定数据冷热等级的方法的第一具体实施方式的流程图;Fig. 2 is a flow chart of the first embodiment of the method for determining the hot and cold level of data provided by the embodiment of the present invention;

图3为本发明实施例所提供的确定数据冷热等级的方法的第二具体实施方式的流程图;Fig. 3 is a flow chart of the second specific implementation of the method for determining the hot and cold level of data provided by the embodiment of the present invention;

图4为本发明实施例所提供的确定数据冷热等级的装置的结构框图。Fig. 4 is a structural block diagram of an apparatus for determining data coldness and hotness levels provided by an embodiment of the present invention.

具体实施方式detailed description

本发明的核心是提供一种确定数据冷热等级的方法及装置,以解决不能准确全面地对数据的冷热属性进行确定的问题。The core of the present invention is to provide a method and device for determining the hot and cold grades of data, so as to solve the problem that the hot and cold attributes of data cannot be accurately and comprehensively determined.

为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. Apparently, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

请参考图1,图1为本发明实施例所提供的确定数据冷热等级的方法的流程图,包括以下步骤:Please refer to Fig. 1, Fig. 1 is a flowchart of a method for determining the hot and cold levels of data provided by an embodiment of the present invention, including the following steps:

步骤101:根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值。Step 101: Calculate the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data.

固态硬盘中的数据的处理方式有多种情况,一种是host写入,一种是垃圾回收写入,还有一种是错误回收处理写入。host写入的数据可以认为其偏向于热数据,垃圾回收写入的数据可以认为其偏向于冷数据,错误处理回收的数据保持其原有的冷热属性,但是更偏向于冷数据。固态硬盘中的数据可能会进行过多次处理,比如数据被host写入后,也可能会被垃圾回收,而数据被host写入时是偏向于热数据的,但是在被垃圾回收后,其会慢慢变冷,因此在确定数据的冷热等级时要结合其以前的处理情况,不同的处理方式就影响不同的冷、热标记值,数据每进行过一次处理,都要根据该次处理的方式计算一次数据的冷、热标记值。There are many ways to process data in solid-state drives, one is host writing, one is garbage collection writing, and the other is error recovery processing writing. The data written by the host can be considered to be biased towards hot data, the data written by garbage collection can be considered to be biased towards cold data, and the data recovered by error processing maintains its original hot and cold attributes, but is more biased towards cold data. The data in the solid-state disk may be processed many times. For example, after the data is written by the host, it may also be garbage collected. When the data is written by the host, it is biased towards hot data, but after being garbage collected, other It will gradually become colder, so when determining the hot and cold level of the data, it should be combined with its previous processing situation. Different processing methods will affect different cold and hot tag values. Every time the data is processed, it must be based on the processing Calculate the cold and hot tag values of the data once.

步骤102:对数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定数据的冷热等级。Step 102: Carry out weighted calculations on the hot and cold data flag values of the data, and determine the hot and cold grades of the data according to the correspondence between the weighted calculation results and the hot and cold grades.

进行加权计算时,可以根据实际的情况为热数据标记值和冷数据标记值赋予权重进行计算。加权计算得到的结果根据实际中具体的计算可以直接对应冷热等级,也可以是与冷热等级之间存在一定的对应关系,例如加权计算得到的结果与冷热等级之间相差10倍等,具体是什么对应关系需要根据实际的要求来对其进行设置。冷热等级的级数也可以根据实际的情况设置,比如将冷热等级设置为1-10级,级别越低说明数据越冷,级别越高说明数据越热。When performing weighted calculations, weights can be assigned to hot data flag values and cold data flag values for calculation according to actual conditions. The results obtained by the weighted calculation can directly correspond to the hot and cold grades according to the specific calculations in practice, or there may be a certain correspondence between the hot and cold grades. For example, the difference between the results obtained by the weighted calculation and the hot and cold grades is 10 times, etc. The specific corresponding relationship needs to be set according to actual requirements. The number of hot and cold levels can also be set according to the actual situation. For example, set the hot and cold levels to 1-10. The lower the level, the colder the data, and the higher the level, the hotter the data.

本发明实施例中对数据属性进行分析确定的依据为数据的历史处理方式比如数据由host写入、数据由垃圾回收写入等,而非时间,即使出现掉电现象本发明的依据也不会受其影响,而是依旧保持准确,因此数据不需要进行多次确定过程就能够确定数据冷热等级,从而本发明可以准确全面地对数据的冷热属性进行确定。In the embodiment of the present invention, the basis for analyzing and determining the data attributes is the historical processing method of data, such as data written by host, data written by garbage collection, etc., rather than time, even if there is a power failure phenomenon, the basis of the present invention will not Affected by it, it remains accurate, so the data does not need to go through multiple determination processes to determine the hot and cold grades of the data, so that the present invention can accurately and comprehensively determine the hot and cold attributes of the data.

为了便于对本发明的进一步理解,下面结合本发明的具体实施方式对本发明进行详细的描述。In order to facilitate a further understanding of the present invention, the present invention will be described in detail below in conjunction with specific embodiments of the present invention.

请参考图2,图2为本发明实施例所提供的确定数据冷热等级的方法的第一具体实施方式的流程图,包括以下步骤:Please refer to FIG. 2. FIG. 2 is a flow chart of the first specific implementation of the method for determining the hot and cold levels of data provided by the embodiment of the present invention, including the following steps:

步骤201:当数据的历史处理方式为host写入时增加热数据标记值;当数据的历史处理方式为垃圾回收写入时增加冷数据标记值;当数据的历史处理方式为错误处理回收写入时增加冷数据标记值。Step 201: Increase the hot data mark value when the historical data processing method is host write; increase the cold data mark value when the data historical processing method is garbage collection write; when the data historical processing method is error processing recycling write Increase the cold data flag value when .

因为固态硬盘中的数据可能会进行过多次处理,所以数据每进行过一次处理,都要根据该次处理的方式计算一次数据的冷、热标记值,例如,当该数据的历史处理方式中有两次host写入时,两次历史处理方式写入,两次错误处理回收写入,热数据标记值就要增加两次,冷数据标记值要增加四次。Because the data in the solid-state disk may have been processed many times, each time the data is processed, the cold and hot tag values of the data must be calculated according to the processing method. For example, when the historical processing method of the data When there are two host writes, two writes in the historical processing mode, and two error processing recovery writes, the hot data mark value will be increased twice, and the cold data mark value will be increased four times.

步骤202:对数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定数据的冷热等级。Step 202: Carry out weighted calculations on the hot and cold data flag values of the data, and determine the hot and cold grades of the data according to the correspondence between the weighted calculation results and the hot and cold grades.

请参考图3,图3为本发明实施例所提供的确定数据冷热等级的方法的第二具体实施方式的流程图,包括以下步骤:Please refer to FIG. 3. FIG. 3 is a flow chart of the second specific implementation of the method for determining the hot and cold levels of data provided by the embodiment of the present invention, including the following steps:

步骤301:当数据的历史处理方式为host写入时增加热数据标记值;当数据的历史处理方式为垃圾回收写入时增加冷数据标记值;当数据的历史处理方式为错误处理回收写入时冷数据标记值和热数据标记值均不改变。Step 301: When the historical data processing method is host writing, increase the hot data mark value; when the data historical processing method is garbage collection and writing, increase the cold data mark value; when the data historical processing method is error processing recovery and writing Neither the cold data tag value nor the hot data tag value is changed.

步骤302:对数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定数据的冷热等级。Step 302: Carry out weighted calculations on the hot and cold data flag values of the data, and determine the hot and cold grades of the data according to the correspondence between the weighted calculation results and the hot and cold grades.

在第二种具体实施方式中,大部分都与第一种具体实施方式相同,相同的部分就不再进行赘述,下面对不同的部分进行说明。In the second specific implementation mode, most of them are the same as the first specific implementation mode, and the same parts will not be described again, and the different parts will be described below.

本具体实施方式中当数据的历史处理方式为错误处理回收写入时冷数据标记值和热数据标记值均不改变,在第一具体实施方式中当数据的历史处理方式为错误处理回收写入时增加冷数据标记值,具体使用哪一种,需要根据实际中的测试来决定。In this specific embodiment, when the historical processing mode of data is error handling, recycling and writing, neither the cold data tag value nor the hot data tag value changes. In the first specific embodiment, when the historical processing mode of data is error processing, recycling and writing When increasing the cold data mark value, which one to use depends on the actual test.

可以对上述两个具体实施方式中的方法进行进一步的改进,改进方法如下:The methods in the above two specific embodiments can be further improved, and the improved methods are as follows:

将数据的冷热等级存储在FTL表中或存储在闪存芯片中。Store the hot and cold levels of data in FTL tables or in flash memory chips.

这样可以使数据进行处理时也能对数据的冷热等级做出相应的分析确定,当对数据进行访问时可以知道数据的冷热等级是否发生了改变,发生了怎样的改变。In this way, when the data is processed, the hot and cold grades of the data can be analyzed and determined accordingly, and when the data is accessed, it can be known whether the hot and cold grades of the data have changed, and what kind of changes have occurred.

还可以根据数据的冷热等级与全局擦除情况选择数据写入的目的块,并将数据写入。It is also possible to select the target block for data writing according to the hot and cold level of the data and the global erasure situation, and write the data.

在固态硬盘中对于每个块的擦除次数是不一样的,有的块擦除次数偏多,有的块擦除次数偏少。为冷热等级最低的数据选择擦除次数最多的目的块,并将其写入到目的块中;为冷热等级偏低的数据选择擦除次数偏多的目的块,并将其写入到目的块中,冷数据的内容在长时间内不会发生变动,这样就可以将擦除次数多的块的擦除频率降低;为冷热等级最高的数据选择擦除次数最少的目的块,并将其写入到目的块中;为冷热等级偏高的数据选择擦除次数偏少的目的块,并将其写入到目的块中,热数据被重写的频率高,这样就可以将擦除次数少的块的擦除频率提高,达到磨损均衡。In the solid-state hard disk, the number of erasing times for each block is different, some blocks have more times of erasing, and some blocks have less times of erasing. Select the destination block with the most erasure times for the data with the lowest cold and hot grade, and write it into the destination block; In the target block, the content of the cold data will not change for a long time, so that the erasure frequency of the block with a large number of erasures can be reduced; for the data with the highest level of cold and hot, select the target block with the least number of erasures, and Write it into the target block; select the target block with less erasure times for data with high cold and hot grades, and write it into the target block. The frequency of hot data being rewritten is high, so that the The erase frequency of blocks with a small number of erasures is increased to achieve wear leveling.

下面对本发明实施例提供的确定数据冷热等级的装置进行介绍,下文描述的确定数据冷热等级的装置与上文描述的确定数据冷热等级的方法可相互对应参照。The following is an introduction to the device for determining the data coldness level provided by the embodiment of the present invention. The device for determining the data coldness level described below and the method for determining the data coldness level described above can be referred to for each other.

请参考图4,图4为本发明实施例所提供的确定数据冷热等级的装置的结构框图,确定数据冷热等级的装置包括:计算模块401和加权判定模块402;Please refer to FIG. 4. FIG. 4 is a structural block diagram of an apparatus for determining data coldness and heat levels provided by an embodiment of the present invention. The apparatus for determining data coldness and heat levels includes: a calculation module 401 and a weighted determination module 402;

其中,计算模块401,用于根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值;Wherein, the calculation module 401 is used to calculate the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data;

加权判定模块402,用于对所述数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级。The weighting determination module 402 is configured to perform weighted calculation on the hot data mark value and the cold data mark value of the data, and determine the cold or hot level of the data according to the correspondence between the weighted calculation result and the cold or hot level.

计算模块401包括热数据计算单元403,第一冷数据计算单元404和第二冷数据计算单元405。The calculation module 401 includes a hot data calculation unit 403 , a first cold data calculation unit 404 and a second cold data calculation unit 405 .

其中,热数据计算单元403,用于当所述数据的历史处理方式为host写入时增加热数据标记值;Wherein, the hot data calculation unit 403 is used to increase the hot data mark value when the historical processing mode of the data is host writing;

第一冷数据计算单元404,用于当所述数据的历史处理方式为垃圾回收写入时增加冷数据标记值;当所述数据的历史处理方式为错误处理回收写入时增加冷数据标记值;The first cold data calculation unit 404 is configured to increase the cold data mark value when the historical processing mode of the data is garbage collection write; increase the cold data mark value when the historical processing mode of the data is error processing recovery write ;

第二冷数据计算单元405,用于当所述数据的历史处理方式为垃圾回收写入时增加冷数据标记值。The second cold data calculation unit 405 is configured to increase the cold data mark value when the historical processing mode of the data is garbage collection and writing.

为了使数据进行处理时也能对数据的冷热等级做出相应的分析确定,当对数据进行访问时可以知道数据的冷热等级是否发生了改变,发生了怎样的改变,本发明实施例提供的确定数据冷热等级的装置还可以进一步包括:In order to make a corresponding analysis and determination of the hot and cold grades of the data when the data is processed, and to know whether the hot and cold grades of the data have changed and what kind of changes have occurred when accessing the data, the embodiments of the present invention provide The means for determining the hot and cold grades of data may further include:

存储模块,用于将所述数据的冷热等级存储在FTL表中或存储在闪存芯片中。The storage module is used to store the cold and hot levels of the data in the FTL table or in the flash memory chip.

为了达到磨损均衡,本发明实施例提供的确定数据冷热等级的装置还可以进一步包括:In order to achieve wear leveling, the device for determining the hot and cold levels of data provided by the embodiments of the present invention may further include:

写入模块,用于根据所述数据的冷热等级与全局擦除情况选择数据写入的目的块,并将数据写入。The writing module is used for selecting the target block for data writing according to the hot and cold grades of the data and the global erasing situation, and writing the data.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.

专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.

以上对本发明所提供的确定数据冷热等级的方法以及装置进行了详细介绍。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The method and device for determining the hot and cold levels of data provided by the present invention have been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention, and the descriptions of the above embodiments are only used to help understand the method and core idea of the present invention. It should be pointed out that for those skilled in the art, without departing from the principles of the present invention, some improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims (10)

1.一种确定数据冷热等级的方法,其特征在于,包括:1. A method for determining the hot and cold grades of data, comprising: 根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值;calculating a hot data mark value and a cold data mark value of the data according to a historical processing manner of the data; 对所述数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级。Carry out weighted calculation on the hot data mark value and cold data mark value of the data, and determine the cold or hot level of the data according to the corresponding relationship between the weighted calculation result and the cold or hot level. 2.如权利要求1所述的方法,其特征在于,所述根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值,包括:2. The method according to claim 1, wherein the calculating the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data comprises: 当所述数据的历史处理方式为host写入时,增加热数据标记值;When the historical processing mode of the data is written by host, increase the hot data mark value; 当所述数据的历史处理方式为垃圾回收写入时,增加冷数据标记值;When the historical processing mode of the data is garbage collection and writing, increase the cold data mark value; 当所述数据的历史处理方式为错误处理回收写入时,增加冷数据标记值。When the historical processing mode of the data is error handling recovery write, increase the cold data mark value. 3.如权利要求1所述的方法,其特征在于,所述根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值,包括:3. The method according to claim 1, wherein the calculating the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data comprises: 当所述数据的历史处理方式为host写入时,增加热数据标记值;When the historical processing mode of the data is written by host, increase the hot data mark value; 当所述数据的历史处理方式为垃圾回收写入时,增加冷数据标记值;When the historical processing mode of the data is garbage collection and writing, increase the cold data mark value; 当所述数据的历史处理方式为错误处理回收写入时,冷数据标记值和热数据标记值均不改变。When the history processing mode of the data is error processing recovery writing, the cold data mark value and the hot data mark value do not change. 4.如权利要求1-3任意一项所述的方法,其特征在于,在所述根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级之后,还包括:4. The method according to any one of claims 1-3, characterized in that, after determining the hot and cold grades of the data according to the correspondence between the weighted calculation results and the hot and cold grades, further comprising: 将所述数据的冷热等级存储在FTL表中或存储在闪存芯片中。Store the hot and cold levels of the data in the FTL table or in the flash memory chip. 5.如权利要求1-3任意一项所述的方法,其特征在于,在所述根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级之后,还包括:5. The method according to any one of claims 1-3, characterized in that, after determining the hot and cold grades of the data according to the correspondence between the weighted calculation results and the hot and cold grades, further comprising: 根据所述数据的冷热等级与全局擦除情况选择数据写入的目的块,并将数据写入。According to the hot and cold level of the data and the global erasure situation, the target block for data writing is selected, and the data is written. 6.一种确定数据冷热等级的装置,其特征在于,包括:计算模块和加权判定模块;6. A device for determining the hot and cold grades of data, comprising: a calculation module and a weighted judgment module; 其中,所述计算模块,用于根据数据的历史处理方式计算所述数据的热数据标记值和冷数据标记值;Wherein, the calculation module is used to calculate the hot data mark value and the cold data mark value of the data according to the historical processing mode of the data; 所述加权判定模块,用于对所述数据的热数据标记值和冷数据标记值进行加权计算,根据加权计算的结果与冷热等级之间的对应关系判定所述数据的冷热等级。The weighted determination module is configured to perform weighted calculation on the hot data mark value and the cold data mark value of the data, and determine the cold or hot level of the data according to the corresponding relationship between the weighted calculation result and the cold or hot level. 7.如权利要求6所述的装置,其特征在于,所述计算模块包括:热数据计算单元和第一冷数据计算单元;7. The device according to claim 6, wherein the calculation module comprises: a thermal data calculation unit and a first cold data calculation unit; 其中,所述热数据计算单元,用于当所述数据的历史处理方式为host写入时,增加热数据标记值;Wherein, the hot data calculation unit is used to increase the hot data mark value when the historical processing mode of the data is host write; 所述第一冷数据计算单元,用于当所述数据的历史处理方式为垃圾回收写入时,增加冷数据标记值;当所述数据的历史处理方式为错误处理回收写入时,增加冷数据标记值。The first cold data calculation unit is used to increase the cold data mark value when the historical processing method of the data is garbage collection and writing; when the historical processing method of the data is error processing recovery writing, increase the cold Data tag value. 8.如权利要求6所述的装置,其特征在于,所述计算模块包括:热数据计算单元和第二冷数据计算单元;8. The device according to claim 6, wherein the calculation module comprises: a thermal data calculation unit and a second cold data calculation unit; 其中,所述热数据计算单元,用于当所述数据的历史处理方式为host写入时增加热数据标记值;Wherein, the hot data calculation unit is used to increase the hot data mark value when the historical processing mode of the data is host writing; 所述第二冷数据计算单元,用于当所述数据的历史处理方式为垃圾回收写入时增加冷数据标记值。The second cold data calculation unit is configured to increase the cold data mark value when the historical processing mode of the data is garbage collection and writing. 9.如权利要求6-8任意一项所述的装置,其特征在于,所述装置还包括:9. The device according to any one of claims 6-8, further comprising: 存储模块,用于将所述数据的冷热等级存储在FTL表中或存储在闪存芯片中。The storage module is used to store the cold and hot levels of the data in the FTL table or in the flash memory chip. 10.如权利要求6-8任意一项所述的装置,其特征在于,所述装置还包括:10. The device according to any one of claims 6-8, further comprising: 写入模块,用于根据所述数据的冷热等级与全局擦除情况选择数据写入的目的块,并将数据写入。The writing module is used for selecting the target block for data writing according to the hot and cold grades of the data and the global erasing situation, and writing the data.
CN201710596164.9A 2017-07-20 2017-07-20 A kind of method and device for determining the cold and hot grade of data Pending CN107357535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710596164.9A CN107357535A (en) 2017-07-20 2017-07-20 A kind of method and device for determining the cold and hot grade of data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710596164.9A CN107357535A (en) 2017-07-20 2017-07-20 A kind of method and device for determining the cold and hot grade of data

Publications (1)

Publication Number Publication Date
CN107357535A true CN107357535A (en) 2017-11-17

Family

ID=60284536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710596164.9A Pending CN107357535A (en) 2017-07-20 2017-07-20 A kind of method and device for determining the cold and hot grade of data

Country Status (1)

Country Link
CN (1) CN107357535A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108563730A (en) * 2018-04-04 2018-09-21 北京蓝杞数据科技有限公司天津分公司 A kind of cold and hot data automatic switching method, device, electronic equipment and storage medium
CN108920107A (en) * 2018-07-13 2018-11-30 深圳忆联信息系统有限公司 Screen method, apparatus, computer equipment and the storage medium of cold data
CN117271997A (en) * 2023-09-25 2023-12-22 中移信息技术有限公司 Data hot and cold assessment methods, devices, equipment and storage media

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081576A (en) * 2011-03-01 2011-06-01 华中科技大学 Flash memory wear balance method
CN102799534A (en) * 2012-07-18 2012-11-28 上海宝存信息科技有限公司 Storage system and method based on solid state medium and cold-hot data identification method
CN102902628A (en) * 2012-09-18 2013-01-30 记忆科技(深圳)有限公司 Flash memory and method and system for automatically separating cold and hot data based on same
US20160253287A1 (en) * 2013-10-24 2016-09-01 Nec Corporation Information processing device, information processing method, and recording medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081576A (en) * 2011-03-01 2011-06-01 华中科技大学 Flash memory wear balance method
CN102799534A (en) * 2012-07-18 2012-11-28 上海宝存信息科技有限公司 Storage system and method based on solid state medium and cold-hot data identification method
CN102902628A (en) * 2012-09-18 2013-01-30 记忆科技(深圳)有限公司 Flash memory and method and system for automatically separating cold and hot data based on same
US20160253287A1 (en) * 2013-10-24 2016-09-01 Nec Corporation Information processing device, information processing method, and recording medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108563730A (en) * 2018-04-04 2018-09-21 北京蓝杞数据科技有限公司天津分公司 A kind of cold and hot data automatic switching method, device, electronic equipment and storage medium
CN108920107A (en) * 2018-07-13 2018-11-30 深圳忆联信息系统有限公司 Screen method, apparatus, computer equipment and the storage medium of cold data
CN108920107B (en) * 2018-07-13 2022-02-01 深圳忆联信息系统有限公司 Method and device for screening cold data, computer equipment and storage medium
CN117271997A (en) * 2023-09-25 2023-12-22 中移信息技术有限公司 Data hot and cold assessment methods, devices, equipment and storage media

Similar Documents

Publication Publication Date Title
US9846641B2 (en) Variability aware wear leveling
CN102841852B (en) Wear leveling method, storing device and information system
US8458417B2 (en) Garbage collection in a storage device
CN106775474B (en) Nand Flash wear leveling method and device and memory
US20150169442A1 (en) Garbage collection scaling
US9928166B2 (en) Detecting hot spots through flash memory management table snapshots
CN108681435A (en) A kind of abrasion equilibrium method of solid state disk, device, equipment and storage medium
CN102301427A (en) Analyzing monitor data information from memory devices having finite endurance and/or retention
CN106339324A (en) Method and device for selecting garbage collection block
US10922234B2 (en) Method and system for online recovery of logical-to-physical mapping table affected by noise sources in a solid state drive
WO2019174205A1 (en) Trash recovery method and device and storage equipment
CN106990926A (en) A kind of processing method of solid state hard disc abrasion equilibrium
CN106484761A (en) For improving the method and system of storage daily record
US12436883B2 (en) Method and device for data storage
US10628301B1 (en) System and method for optimizing write amplification of non-volatile memory storage media
CN108959118A (en) A kind of method and device of data write-in
CN107357535A (en) A kind of method and device for determining the cold and hot grade of data
US20240361947A1 (en) Managing and ranking memory resources
US7366871B2 (en) Apparatus and method for determining stack distance including spatial locality of running software for estimating cache miss rates based upon contents of a hash table
US7373480B2 (en) Apparatus and method for determining stack distance of running software for estimating cache miss rates based upon contents of a hash table
CN105446848A (en) Electronic device data processing performance test method and device
CN105304140A (en) Method and apparatus for testing memory performance of electronic equipment
US10055304B2 (en) In-memory continuous data protection
CN101752008B (en) Test method for reliability of solid-state storage media
WO2015154431A1 (en) Method and device for detecting authorized memory access

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20171117

RJ01 Rejection of invention patent application after publication