CN115793984B - Data storage method, device, computer equipment and storage medium - Google Patents
Data storage method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN115793984B CN115793984B CN202310001205.0A CN202310001205A CN115793984B CN 115793984 B CN115793984 B CN 115793984B CN 202310001205 A CN202310001205 A CN 202310001205A CN 115793984 B CN115793984 B CN 115793984B
- Authority
- CN
- China
- Prior art keywords
- data
- lrc
- switching
- coding
- block
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 238000013500 data storage Methods 0.000 title claims abstract description 17
- 230000000737 periodic effect Effects 0.000 claims abstract 3
- 238000004422 calculation algorithm Methods 0.000 claims description 28
- 230000004044 response Effects 0.000 claims description 26
- 230000015654 memory Effects 0.000 claims description 14
- 238000004364 calculation method Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 10
- 230000001960 triggered effect Effects 0.000 claims 4
- 239000003550 marker Substances 0.000 claims 2
- 230000015556 catabolic process Effects 0.000 abstract description 3
- 238000006731 degradation reaction Methods 0.000 abstract description 3
- 239000011159 matrix material Substances 0.000 description 12
- 238000010586 diagram Methods 0.000 description 11
- 230000005540 biological transmission Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 7
- 238000005457 optimization Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000011084 recovery Methods 0.000 description 4
- 238000012937 correction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 239000012634 fragment Substances 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Quality & Reliability (AREA)
- Error Detection And Correction (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
技术领域technical field
本发明涉及存储技术领域,尤其涉及一种数据存储方法、装置、计算机设备及存储介质。The present invention relates to the technical field of storage, in particular to a data storage method, device, computer equipment and storage medium.
背景技术Background technique
伴随着通讯技术和网络科技的迅速发展,数字化信息呈指数爆炸式增长,数据存储技术也因此迎来了巨大的挑战。存储系统中数据的可靠性问题以及存储系统的能耗问题越来越被人们所关注。现如今面对如此庞大的数据规模,存储系统中数据的可靠性和存储系统中包含的组件数量成反比关系,即存储系统组件数越多,那么存储系统中数据的可靠性就越低。根据相关调查显示,在一个由600个磁盘构成的互联网数据中心中,每月大约会有30个磁盘出现损坏的情况,在大规模存储系统中,磁盘故障造成的数据可靠性下降是相当严重的问题,对此人们展开了相关容错技术的研究。With the rapid development of communication technology and network technology, digital information is growing exponentially, and data storage technology is therefore facing huge challenges. The reliability of data in the storage system and the energy consumption of the storage system are more and more concerned by people. Nowadays, in the face of such a huge data scale, the reliability of the data in the storage system is inversely proportional to the number of components contained in the storage system, that is, the more components in the storage system, the lower the reliability of the data in the storage system. According to relevant surveys, in an Internet data center composed of 600 disks, about 30 disks will be damaged every month. In a large-scale storage system, the decline in data reliability caused by disk failure is quite serious. For this problem, people have launched research on related fault-tolerant technologies.
纠删码(Erasure Code)属于编码理论中的一种前向纠错技术,最早应用于通信领域以解决数据传输中的丢失与损耗这类问题。由于纠删码技术在防止数据丢失方面取得了较好的效果,因此被引入存储领域。纠删码可以在保证相同可靠性的前提下有效地降低存储开销,因此纠删码技术被广泛地应用于各大存储系统以及数据中心。Erasure code (Erasure Code) belongs to a kind of forward error correction technology in coding theory, which was first applied in the field of communication to solve problems such as loss and loss in data transmission. Since the erasure code technology has achieved good results in preventing data loss, it has been introduced into the storage field. Erasure coding can effectively reduce storage overhead while ensuring the same reliability, so erasure coding technology is widely used in major storage systems and data centers.
纠删码(erasure coding,EC)是一种数据保护方法,它将数据分割成片段,把冗余数据扩展、编码,并将其存储在不同的位置,比如磁盘、存储节点或者其它地理位置。将原始数据分割成k个数据块,并根据编码矩阵生成m编码块,将n(n=k+m)块分布到不同的服务器上。只需要k个块就可以恢复原来的数据。Erasure coding (EC) is a data protection method that divides data into fragments, expands and encodes redundant data, and stores it in different locations, such as disks, storage nodes, or other geographic locations. Divide the original data into k data blocks, generate m coding blocks according to the coding matrix, and distribute n (n=k+m) blocks to different servers. Only k blocks are needed to restore the original data.
大多数采用纠删码的存储系统对数据只采用一种纠删码进行存储。然而,只采用一种纠删码很难在保持低存储开销的前提下降低退化读延迟。Most storage systems using erasure codes store data using only one erasure code. However, it is difficult to reduce degraded read latency while maintaining low storage overhead by using only one erasure code.
发明内容Contents of the invention
有鉴于此,本发明提出了一种数据存储方法、装置、计算机设备及存储介质,采用多种编码方式存储数据,针对数据的特性选择适合的编码以在保持低存储开销的前提下降低退化读延迟。In view of this, the present invention proposes a data storage method, device, computer equipment, and storage medium, which uses multiple encoding methods to store data, and selects an appropriate encoding according to the characteristics of the data to reduce degradation reading while maintaining low storage overhead. Delay.
基于上述目的,本发明实施例的一方面提供了一种数据存储方法,具体包括如下步骤:Based on the above purpose, an aspect of the embodiments of the present invention provides a data storage method, which specifically includes the following steps:
按周期对存储系统数据标记进行检查,其中,所述存储系统数据标记包括冷数据和热数据,所述存储系统配置用于基于第一编码存储所述标记为冷数据的数据,并基于第二编码存储所述标记为热数据的数据;The storage system data mark is checked periodically, wherein the storage system data mark includes cold data and hot data, and the storage system is configured to store the data marked as cold data based on the first code, and to store the data marked as cold data based on the second encoding and storing the data marked as hot data;
响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式以基于切换后的编码方式存储对应的数据。In response to the detected data mark triggering the mark switching condition, the detected data mark is switched, and the encoding mode is switched correspondingly to store corresponding data based on the switched encoding mode.
在一些实施方式中,所述第一编码包括RS编码,所述第二编码包括LRC编码。In some embodiments, the first encoding comprises RS encoding and the second encoding comprises LRC encoding.
在一些实施方式中,所述RS编码为(kRS,gRS)RS编码,所述LRC编码为(kLRC,lLRC,gLRC)LRC编码,其中,kRS表示所述RS编码中数据块的数量和gRS表示RS编码中全局校验块的数量,由kLRC表示所述LRC编码中数据块的数量、lLRC表示所述LRC编码中局部校验块的数量、gLRC表示所述LRC编码中全局校验块的数量,其中,kRS=kLRC,gRS=gLRC+1。In some embodiments, the RS code is (k RS , g RS ) RS code, and the LRC code is (k LRC , l LRC , g LRC ) LRC code, where k RS represents the data in the RS code The number of blocks and g RS represent the number of global parity blocks in the RS code, k LRC represents the number of data blocks in the LRC code, l LRC represents the number of local parity blocks in the LRC code, and g LRC represents all The number of global check blocks in the LRC encoding, where k RS =k LRC , g RS =g LRC +1.
在一些实施方式中,响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式包括:In some embodiments, in response to the checked data flag triggering a flag switching condition, switching the checked data flag and correspondingly switching the encoding method includes:
响应于检查到的数据标记为热数据,判断所述数据的访问次数是否达到第一阈值;In response to the detected data being marked as hot data, determine whether the number of accesses to the data reaches a first threshold;
响应于所述数据的访问次数未达到所述第一阈值,则将所述数据标记由所述热数据切换为冷数据,并将所述数据的编码方式由第二编码存储切换为第一编码。In response to the number of access times of the data not reaching the first threshold, the data tag is switched from the hot data to the cold data, and the encoding method of the data is switched from the second encoding storage to the first encoding .
在一些实施方式中,响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式包括:In some embodiments, in response to the checked data flag triggering a flag switching condition, switching the checked data flag and correspondingly switching the encoding method includes:
响应于检查到的数据标记为冷数据,判断所述数据的访问次数是否达到第二阈值;In response to the checked data being marked as cold data, it is determined whether the number of accesses to the data reaches a second threshold;
响应于所述数据的访问次数达到所述第二阈值,则将所述数据标记由所述冷数据切换为热数据,并将所述数据的编码方式由第一编码切换为第二编码。In response to the number of accesses to the data reaching the second threshold, the data tag is switched from the cold data to the hot data, and the encoding method of the data is switched from the first encoding to the second encoding.
在一些实施方式中,将所述数据的编码方式由第二编码存储切换为第一编码包括:In some embodiments, switching the encoding method of the data from the second encoding storage to the first encoding includes:
基于第一编码切换算法将所述数据的编码方式由第二编码存储切换为第一编码。The encoding method of the data is switched from the second encoding storage to the first encoding based on the first encoding switching algorithm.
在一些实施方式中,将所述数据的编码方式由第一编码切换为第二编码包括:In some implementation manners, switching the encoding method of the data from the first encoding to the second encoding includes:
基于第二编码切换算法将所述数据的编码方式由第一编码切换为第二编码。The encoding mode of the data is switched from the first encoding to the second encoding based on the second encoding switching algorithm.
在一些实施方式中,基于第一编码切换算法将所述数据的编码方式由第二编码存储切换为第一编码包括:In some implementations, switching the encoding method of the data from the second encoding storage to the first encoding based on the first encoding switching algorithm includes:
基于所述LRC编码的数据块得到所述RS编码的数据块;Obtaining the RS-encoded data block based on the LRC-encoded data block;
基于所述LRC编码的全局校验块和局部校验块得到所述RS编码的全局校验块。The RS-coded global check block is obtained based on the LRC-coded global check block and the local check block.
在一些实施方式中,基于所述LRC编码的数据块得到所述RS编码的数据块包括:In some embodiments, obtaining the RS-coded data block based on the LRC-coded data block includes:
获取所述LRC编码的数据块,并将获取的数据块作为所述RS编码的数据块。Acquire the LRC encoded data block, and use the acquired data block as the RS encoded data block.
在一些实施方式中,基于所述LRC编码的全局校验块和局部校验块得到所述RS编码的全局校验块包括:In some implementation manners, obtaining the RS-coded global check block based on the LRC-coded global check block and the local check block includes:
将所述LRC编码的gLRC个全局校验块作为所述RS编码的gRS-1个全局校验块;Using the g LRC global check blocks of the LRC code as the g RS -1 global check blocks of the RS code;
对所述LRC编码的lLRC个局部校验块进行异或计算,并将异或计算结果作为所述RS编码的最后一个全局校验块。Perform XOR calculation on the 1 LRC local check blocks of the LRC code, and use the XOR calculation result as the last global check block of the RS code.
在一些实施方式中,基于第二编码切换算法将所述数据的编码方式由第一编码切换为第二编码包括:In some implementation manners, switching the encoding mode of the data from the first encoding to the second encoding based on the second encoding switching algorithm includes:
基于所述RS编码的数据块得到所述LRC编码的数据块;obtaining the LRC-coded data block based on the RS-coded data block;
基于所述RS编码的全局校验块得到所述LRC编码的全局校验块;Obtaining the LRC-coded global check block based on the RS-coded global check block;
基于所述RS编码的数据块与最后一个全局校验块得到所述LRC编码的局部校验块。The LRC-coded local check block is obtained based on the RS-coded data block and the last global check block.
在一些实施方式中,基于所述RS编码的数据块得到所述LRC编码的数据块包括:In some embodiments, obtaining the LRC-coded data block based on the RS-coded data block includes:
获取所述RS编码的数据块,并将获取的数据块作为所述LRC编码的数据块。Obtain the RS-encoded data block, and use the obtained data block as the LRC-encoded data block.
在一些实施方式中,基于所述RS编码的全局校验块得到所述LRC编码的全局校验块包括:In some embodiments, obtaining the LRC-coded global check block based on the RS-coded global check block includes:
将所述RS编码的gRS-1个全局校验块作为所述LRC编码的gLRC个全局校验块。The g RS -1 global check blocks encoded by the RS are used as the g LRC global check blocks encoded by the LRC.
在一些实施方式中,基于所述RS编码的数据块与最后一个全局校验块得到所述LRC编码的局部校验块包括:In some embodiments, obtaining the local check block of the LRC code based on the RS coded data block and the last global check block includes:
基于所述RS编码的数据块得到所述LRC编码的后lLRC-1个局部校验块,并将所述RS编码的最后一个全局校验块与所述LRC编码的后lLRC-1个局部校验块对应的数据块进行异或得到第1个局部校验块。Obtain the last l LRC -1 local check blocks of the LRC encoding based on the RS encoded data block, and combine the last global check block of the RS encoding with the last l LRC -1 of the LRC encoding The data block corresponding to the partial check block is XORed to obtain the first partial check block.
在一些实施方式中,基于所述RS编码的数据块得到所述LRC编码的后lLRC-1个局部校验块包括:In some implementation manners, obtaining the last 1 LRC -1 local check blocks of the LRC code based on the RS coded data block includes:
基于所述RS编码的后kRS/lLRC*(lLRC-1)个数据块得到所述LRC编码的后lLRC-1个局部校验块。The last l LRC -1 local check blocks of the LRC encoding are obtained based on the last k RS /l LRC *(l LRC -1) data blocks of the RS encoding.
在一些实施方式中,所述RS编码的最后一个全局校验块由kRS个数据块进行异或计算得到。In some implementation manners, the last global parity block of the RS code is obtained by XOR calculation of k RS data blocks.
本发明实施例的另一方面,还提供了一种数据存储装置,包括:Another aspect of the embodiments of the present invention also provides a data storage device, including:
检查模块,所述检查模块配置用于按周期对存储系统数据标记进行检查,其中,所述存储系统数据标记包括冷数据和热数据,所述存储系统配置用于基于第一编码存储所述标记为冷数据的数据,并基于第二编码存储所述标记为热数据的数据;A check module, the check module is configured to periodically check the storage system data tags, wherein the storage system data tags include cold data and hot data, and the storage system is configured to store the tags based on the first code data that is cold data, and storing said data marked as hot data based on a second encoding;
切换模块,所述切换模块配置用于响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式以基于切换后的编码方式存储对应的数据。A switching module configured to trigger a flag switching condition in response to the detected data flag, switch the detected data flag, and switch the coding mode accordingly to store corresponding data based on the switched coding mode.
在一些实施方式中,所述第一编码包括RS编码,所述第二编码包括LRC编码。In some embodiments, the first encoding comprises RS encoding and the second encoding comprises LRC encoding.
本发明实施例的又一方面,还提供了一种计算机设备,包括:至少一个处理器;以及存储器,所述存储器存储有可在所述处理器上运行的计算机程序,所述计算机程序由所述处理器执行时实现如上方法的步骤。In still another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory, the memory stores a computer program that can run on the processor, and the computer program is executed by the The steps of the above method are realized when the processor executes.
本发明实施例的再一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有被处理器执行时实现如上方法步骤的计算机程序。In yet another aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, and the computer-readable storage medium stores a computer program for implementing the above method steps when executed by a processor.
本发明至少具有以下有益技术效果:通过按周期对存储系统数据标记进行检查,其中,存储系统数据标记包括冷数据和热数据,存储系统配置用于基于第一编码存储所述标记为冷数据的数据,并基于第二编码存储所述标记为热数据的数据;响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式以基于切换后的编码方式存储对应的数据的方案,降低了存储系统总体的退化读延迟和存储开销。The present invention has at least the following beneficial technical effects: by periodically checking the data marks of the storage system, wherein the data marks of the storage system include cold data and hot data, the storage system is configured to store the data marked as cold data based on the first code data, and store the data marked as hot data based on the second code; in response to the detected data mark triggering the mark switching condition, the detected data mark is switched, and the encoding mode is switched correspondingly based on the switched encoding mode The solution for storing corresponding data reduces the overall degraded read latency and storage overhead of the storage system.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the 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 These are some embodiments of the present invention, and those skilled in the art can obtain other embodiments according to these drawings without any creative effort.
图1为本发明提供的数据存储方法的一实施例的框图;Fig. 1 is the block diagram of an embodiment of the data storage method provided by the present invention;
图2为本发明提供的基于范德蒙矩阵的RS编码示意图;FIG. 2 is a schematic diagram of RS coding based on Vandermonde matrix provided by the present invention;
图3为基于柯西矩阵的RS编码示意图;Fig. 3 is a schematic diagram of RS coding based on Cauchy matrix;
图4为RS编码恢复数据示意图;Fig. 4 is a schematic diagram of RS code recovery data;
图5为本发明提供的(6,3)RS编码的一实施例的示意图;FIG. 5 is a schematic diagram of an embodiment of (6,3) RS coding provided by the present invention;
图6为本发明提供的(6,3,2)LRC编码的一实施例的框图;FIG. 6 is a block diagram of an embodiment of (6, 3, 2) LRC encoding provided by the present invention;
图7为本发明提供的(6,3,2)LRC编码向(6,3)RS编码切换的一实施例的示意图;Fig. 7 is a schematic diagram of an embodiment of switching from (6, 3, 2) LRC coding to (6, 3) RS coding provided by the present invention;
图8为本发明提供的(6,3)RS编码向(6,3,2)LRC编码切换的一实施例的示意图;FIG. 8 is a schematic diagram of an embodiment of switching from (6,3) RS coding to (6,3,2) LRC coding provided by the present invention;
图9为本发明提供的数据存储装置的一实施例的结构示意图;FIG. 9 is a schematic structural diagram of an embodiment of a data storage device provided by the present invention;
图10为本发明提供的计算机设备的一实施例的结构示意图;FIG. 10 is a schematic structural diagram of an embodiment of a computer device provided by the present invention;
图11为本发明提供的计算机可读存储介质的一实施例的结构示意图。FIG. 11 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are to distinguish two entities with the same name but different parameters or parameters that are not the same, see "first" and "second" It is only for the convenience of expression, and should not be construed as a limitation on the embodiments of the present invention, which will not be described one by one in the subsequent embodiments.
基于上述目的,本发明实施例的第一个方面,提出了一种数据存储方法的实施例。如图1所示,其包括如下步骤:Based on the above objective, the first aspect of the embodiments of the present invention proposes an embodiment of a data storage method. As shown in Figure 1, it includes the following steps:
S10、按周期对存储系统数据标记进行检查,其中,所述存储系统数据标记包括冷数据和热数据,所述存储系统配置用于基于第一编码存储所述标记为冷数据的数据,并基于第二编码存储所述标记为热数据的数据;S10. Periodically check the storage system data mark, wherein the storage system data mark includes cold data and hot data, and the storage system is configured to store the data marked as cold data based on the first code, and based on the second encoding stores the data marked as hot data;
S20、响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式以基于切换后的编码方式存储对应的数据。S20. In response to the checked data label triggering a label switching condition, switch the checked data label, and switch the coding mode accordingly to store corresponding data based on the switched coding mode.
具体的,对存储系统中存储的数据进行周期性的检查,数据包括冷数据和热数据。当一个热数据一定时间内访问次数没有达到一个设定值,则该热数据会被标记为冷数据;而当一个冷数据一定时间内的访问次数达到了该设定值,则该冷数据会被标记为热数据。冷热数据标记的切换也涉及到编码的切换,在本实施例中,冷数据基于第一编码存储,热数据基于第二编码存储,第一编码和第二编码为不同类型的纠删码。第一编码和第二编码基于数据的特性选择,热数据的访问频率较高,因此第二编码将采用低恢复延迟的纠删码,冷数据的访问频率较低,因此选用低存储开销的纠删码,以此降低了存储系统总体的退化读延迟和存储开销。Specifically, the data stored in the storage system is checked periodically, and the data includes cold data and hot data. When the number of visits of a hot data does not reach a set value within a certain period of time, the hot data will be marked as cold data; and when the number of visits of a cold data reaches the set value within a certain period of time, the cold data will be marked is marked as hot data. The switching of hot and cold data marks also involves the switching of encoding. In this embodiment, cold data is stored based on the first encoding, and hot data is stored based on the second encoding. The first encoding and the second encoding are different types of erasure codes. The first encoding and the second encoding are selected based on the characteristics of the data. The access frequency of hot data is high, so the second encoding will use the erasure code with low recovery delay, and the access frequency of cold data is low, so the correction code with low storage overhead will be used. Code erasure reduces the overall degraded read latency and storage overhead of the storage system.
在一具体实施例中,数据刚进入存储系统时,可以将其默认标记为热数据。被标记为热数据的数据基于低退化读延迟的第二编码存储,被标记为冷数据的数据基于低存储开销的第一编码存储。对存储系统中存储的数据进行周期性的检查。当一个热数据一定时间内访问次数没有达到一个设定值,则该热数据会被标记为冷数据;而当一个冷数据一定时间内的访问次数达到了该设定值,则该冷数据会被标记为热数据。冷热数据标记的切换同时切换冷热数据标记对应的编码,以此降低了存储系统总体的退化读延迟和存储开销。In a specific embodiment, when data first enters the storage system, it may be marked as hot data by default. Data marked as hot data is stored based on the second encoding with low degradation read latency, and data marked as cold data is stored based on the first encoding with low storage overhead. Periodically check the data stored in the storage system. When the number of visits of a hot data does not reach a set value within a certain period of time, the hot data will be marked as cold data; and when the number of visits of a cold data reaches the set value within a certain period of time, the cold data will be marked is marked as hot data. The switching of the hot and cold data tags simultaneously switches the codes corresponding to the hot and cold data tags, thereby reducing the overall degraded read latency and storage overhead of the storage system.
在一些实施方式中,所述第一编码包括RS编码,所述第二编码包括LRC编码。In some embodiments, the first encoding comprises RS encoding and the second encoding comprises LRC encoding.
具体的,对被访问频率较高的热数据,采用低恢复延迟的(k,l,r-1)LRC编码;对被访问频率较低的冷数据,采用(k,r)RS编码,其中,k表示数据块数量,l表示局部校验块数量,r表示全局校验块数量。基于此,不管冷热数据,存储系统都能容忍r个数据块的损坏。Specifically, for hot data with high frequency of access, (k, l, r-1) LRC coding with low recovery delay is used; for cold data with low frequency of access, (k, r) RS coding is used, where , k represents the number of data blocks, l represents the number of local check blocks, and r represents the number of global check blocks. Based on this, regardless of hot or cold data, the storage system can tolerate the damage of r data blocks.
RS编码(Reed-solomon codes,一种前向纠错的信道编码),与两个参数k和r相关。给定两个正整数k和r,RS码将k个数据块编码为r个额外的校验块,r个校验块可以基于范德蒙矩阵或柯西矩阵进行编码的方式形成。如图2和图3所示,分别为基于范德蒙矩阵和柯西矩阵的RS编码。上部分的k*k矩阵对应的是k个原始数据块,下部分的r*k矩阵对应的是编码矩阵,通过与原始数据D1到Dk相乘,得到新添加的P1到Pr就是编码所得到的r个校验数据。当其中任意r个数据在传输中出错或丢失,需要纠错时,即用剩余数据对应矩阵的逆矩阵与数据相乘,即会得到原始数据块D1到Dk。以D1到Dr数据丢失,进行解码为例,过程如图4所示。(k,r)RS码是MDS(Maximum Distance Separayle,最大距离可分码)码,任意r个块失效时,都可以根据剩余的数据块和校验块进行恢复。RS coding (Reed-solomon codes, a forward error correction channel coding), is related to two parameters k and r. Given two positive integers k and r, the RS code encodes k data blocks into r additional check blocks, and the r check blocks can be formed based on Vandermonde matrix or Cauchy matrix. As shown in Figure 2 and Figure 3, they are RS codes based on Vandermonde matrix and Cauchy matrix respectively. The k*k matrix in the upper part corresponds to k original data blocks, and the r*k matrix in the lower part corresponds to the encoding matrix. By multiplying the original data D 1 to D k , the newly added P 1 to P r It is the r verification data obtained by encoding. When any r pieces of data are wrong or lost during transmission and need to be corrected, the inverse matrix of the matrix corresponding to the remaining data is multiplied by the data to obtain the original data blocks D 1 to D k . Taking data loss from D 1 to D r and decoding as an example, the process is shown in Figure 4. (k, r) RS code is MDS (Maximum Distance Separayle, maximum distance separable code) code, when any r blocks fail, it can be recovered according to the remaining data blocks and check blocks.
LRC编码(Locxl Reconstruction Codes,一种局部纠删码),(k,l,r-1)LRC将k个数据块划分为l个局部组。它编码l个局部部分,每个局部组一个局部校验块,以及r个全局校验块。任何单个数据块故障都可以从其本地组内的k/l片段中解码。LRC编码最多可以容忍r+1任意片段故障,并且还可以容忍超过r(高达l+r-1)的故障,前提是这些信息在理论上是可解码的。最后,LRC提供了较低的存储开销。在所有能够从k/l片段中解码单个数据块故障并容忍r故障的代码中,LRC要求最少的校验块。同时,LRC与RS码相比降低了重建成本。因此,LRC有较低的恢复延迟。LRC coding (Locxl Reconstruction Codes, a local erasure code), (k, l, r-1) LRC divides k data blocks into l local groups. It encodes l local parts, one local parity block per local group, and r global parity blocks. Any single block failure can be decoded from the k/l fragments within its local group. LRC encoding can tolerate up to r+1 arbitrary segment failures, and can also tolerate more than r (up to l+r-1) failures, provided the information is theoretically decodable. Finally, LRC provides lower storage overhead. Of all codes that can decode single block failures from k/l fragments and tolerate r failures, LRC requires the fewest parity blocks. At the same time, LRC reduces the reconstruction cost compared with RS codes. Therefore, LRC has a lower recovery delay.
因此,本实施例通过采用两种不同的纠删码进行混合存储的策略来降低存储系统总体的退化读延迟和存储开销。Therefore, this embodiment reduces the overall degraded read delay and storage overhead of the storage system by using two different erasure codes for hybrid storage.
在一具体实施例中,由于编码的切换也需要非常高的数据传输量,因此,配置高效的编码切换算法,来降低因编码切换引起的高数据传输量和计算量。本发明实施例,根据LRC编码和RS编码的性质,提出一种( k, l, g-1)LRC编码和( k, g)RS编码的高效切换算法,保证冷热数据的切换不会成为系统中的瓶颈,降低编码切换时的数据传输量和计算量。 In a specific embodiment, because code switching also requires a very high data transmission volume, an efficient code switching algorithm is configured to reduce the high data transmission volume and calculation volume caused by code switching. In the embodiment of the present invention, according to the properties of LRC coding and RS coding, an efficient switching algorithm for ( k , l , g-1 ) LRC coding and ( k , g ) RS coding is proposed to ensure that the switching of hot and cold data will not become The bottleneck in the system reduces the amount of data transmission and calculation during encoding switching.
在一些实施方式中,所述RS编码为(kRS,gRS)RS编码,所述LRC编码为(kLRC,lLRC,gLRC)LRC编码,其中,kRS表示所述RS编码中数据块的数量和gRS表示RS编码中全局校验块的数量,由kLRC表示所述LRC编码中数据块的数量、lLRC表示所述LRC编码中局部校验块的数量、gLRC表示所述LRC编码中全局校验块的数量,其中,kRS=kLRC,gRS=gLRC+1。In some embodiments, the RS code is (k RS , g RS ) RS code, and the LRC code is (k LRC , l LRC , g LRC ) LRC code, where k RS represents the data in the RS code The number of blocks and g RS represent the number of global parity blocks in the RS code, k LRC represents the number of data blocks in the LRC code, l LRC represents the number of local parity blocks in the LRC code, and g LRC represents all The number of global check blocks in the LRC encoding, where k RS =k LRC , g RS =g LRC +1.
具体的,为了保证RS编码和LRC编码之间可以高效切换,RS编码和LRC编码需满足以下条件:Specifically, in order to ensure efficient switching between RS coding and LRC coding, RS coding and LRC coding must meet the following conditions:
1) k RS= k LRC且 g RS= g LRC+1; 1) k RS = k LRC and g RS = g LRC +1;
2)RS的 g RS个全局校验块的最后一个是由所有kRS个数据块的异或得到; 2) The last one of the g RS global parity blocks of RS is obtained by XOR of all k RS data blocks;
3)LRC的 g LRC个全局校验块与RS的 g RS-1个全局校验块一致。 3) The g LRC global parity blocks of the LRC are consistent with the g RS -1 global parity blocks of the RS.
在一些实施方式中,响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式包括:In some embodiments, in response to the checked data flag triggering a flag switching condition, switching the checked data flag and correspondingly switching the encoding method includes:
响应于检查到的数据标记为热数据,判断所述数据的访问次数是否达到第一阈值;In response to the detected data being marked as hot data, determine whether the number of accesses to the data reaches a first threshold;
响应于所述数据的访问次数未达到所述第一阈值,则将所述数据标记由所述热数据切换为冷数据,并将所述数据的编码方式由第二编码存储切换为第一编码。In response to the number of access times of the data not reaching the first threshold, the data tag is switched from the hot data to the cold data, and the encoding method of the data is switched from the second encoding storage to the first encoding .
具体的,为了降低存储系统总体的退化读延迟和存储开销,当数据标记由热数据切换为冷数据时,存储该数据的编码方式随之切换。Specifically, in order to reduce the overall degraded read latency and storage overhead of the storage system, when the data tag is switched from hot data to cold data, the encoding method for storing the data is switched accordingly.
在一些实施方式中,响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式包括:In some embodiments, in response to the checked data flag triggering a flag switching condition, switching the checked data flag and correspondingly switching the encoding method includes:
响应于检查到的数据标记为冷数据,判断所述数据的访问次数是否达到第二阈值;In response to the checked data being marked as cold data, it is determined whether the number of accesses to the data reaches a second threshold;
响应于所述数据的访问次数达到所述第二阈值,则将所述数据标记由所述冷数据切换为热数据,并将所述数据的编码方式由第一编码切换为第二编码。In response to the number of accesses to the data reaching the second threshold, the data tag is switched from the cold data to the hot data, and the encoding method of the data is switched from the first encoding to the second encoding.
具体的,为了降低存储系统总体的退化读延迟和存储开销,当数据标记由冷数据切换为热数据时,存储该数据的编码方式随之切换。Specifically, in order to reduce the overall degraded read latency and storage overhead of the storage system, when the data tag is switched from cold data to hot data, the encoding method for storing the data is switched accordingly.
在一些实施方式中,将所述数据的编码方式由第二编码存储切换为第一编码包括:In some embodiments, switching the encoding method of the data from the second encoding storage to the first encoding includes:
基于第一编码切换算法将所述数据的编码方式由第二编码存储切换为第一编码。The encoding method of the data is switched from the second encoding storage to the first encoding based on the first encoding switching algorithm.
在一些实施方式中,将所述数据的编码方式由第一编码切换为第二编码包括:In some implementation manners, switching the encoding method of the data from the first encoding to the second encoding includes:
基于第二编码切换算法将所述数据的编码方式由第一编码切换为第二编码。The encoding mode of the data is switched from the first encoding to the second encoding based on the second encoding switching algorithm.
在一些实施方式中,基于第一编码切换算法将所述数据的编码方式由第二编码存储切换为第一编码包括:In some implementations, switching the encoding method of the data from the second encoding storage to the first encoding based on the first encoding switching algorithm includes:
基于所述LRC编码的数据块得到所述RS编码的数据块;Obtaining the RS-encoded data block based on the LRC-encoded data block;
基于所述LRC编码的全局校验块和局部校验块得到所述RS编码的全局校验块。The RS-coded global check block is obtained based on the LRC-coded global check block and the local check block.
在一些实施方式中,基于所述LRC编码的数据块得到所述RS编码的数据块包括:In some embodiments, obtaining the RS-coded data block based on the LRC-coded data block includes:
获取所述LRC编码的数据块,并将获取的数据块作为所述RS编码的数据块。Acquire the LRC encoded data block, and use the acquired data block as the RS encoded data block.
在一些实施方式中,基于所述LRC编码的全局校验块和局部校验块得到所述RS编码的全局校验块包括:In some implementation manners, obtaining the RS-coded global check block based on the LRC-coded global check block and the local check block includes:
将所述LRC编码的gLRC个全局校验块作为所述RS编码的gRS-1个全局校验块;Using the g LRC global check blocks of the LRC code as the g RS -1 global check blocks of the RS code;
对所述LRC编码的lLRC个局部校验块进行异或计算,并将异或计算结果作为所述RS编码的最后一个全局校验块。Perform XOR calculation on the 1 LRC local check blocks of the LRC code, and use the XOR calculation result as the last global check block of the RS code.
在一些实施方式中,基于第二编码切换算法将所述数据的编码方式由第一编码切换为第二编码包括:In some implementation manners, switching the encoding mode of the data from the first encoding to the second encoding based on the second encoding switching algorithm includes:
基于所述RS编码的数据块得到所述LRC编码的数据块;obtaining the LRC-coded data block based on the RS-coded data block;
基于所述RS编码的全局校验块得到所述LRC编码的全局校验块;Obtaining the LRC-coded global check block based on the RS-coded global check block;
基于所述RS编码的数据块与最后一个全局校验块得到所述LRC编码的局部校验块。The LRC-coded local check block is obtained based on the RS-coded data block and the last global check block.
在一些实施方式中,基于所述RS编码的数据块得到所述LRC编码的数据块包括:In some embodiments, obtaining the LRC-coded data block based on the RS-coded data block includes:
获取所述RS编码的数据块,并将获取的数据块作为所述LRC编码的数据块。Obtain the RS-encoded data block, and use the obtained data block as the LRC-encoded data block.
在一些实施方式中,基于所述RS编码的全局校验块得到所述LRC编码的全局校验块包括:In some embodiments, obtaining the LRC-coded global check block based on the RS-coded global check block includes:
将所述RS编码的gRS-1个全局校验块作为所述LRC编码的gLRC个全局校验块。The g RS -1 global check blocks encoded by the RS are used as the g LRC global check blocks encoded by the LRC.
在一些实施方式中,基于所述RS编码的数据块与最后一个全局校验块得到所述LRC编码的局部校验块包括:In some embodiments, obtaining the local check block of the LRC code based on the RS coded data block and the last global check block includes:
基于所述RS编码的数据块得到所述LRC编码的后lLRC-1个局部校验块,并将所述RS编码的最后一个全局校验块与所述LRC编码的后lLRC-1个局部校验块对应的数据块进行异或得到第1个局部校验块。Obtain the last l LRC -1 local check blocks of the LRC encoding based on the RS encoded data block, and combine the last global check block of the RS encoding with the last l LRC -1 of the LRC encoding The data block corresponding to the partial check block is XORed to obtain the first partial check block.
在一些实施方式中,基于所述RS编码的数据块得到所述LRC编码的后lLRC-1个局部校验块包括:In some implementation manners, obtaining the last 1 LRC -1 local check blocks of the LRC code based on the RS coded data block includes:
基于所述RS编码的后kRS/lLRC*(lLRC-1)个数据块得到所述LRC编码的后lLRC-1个局部校验块。The last l LRC -1 local check blocks of the LRC encoding are obtained based on the last k RS /l LRC *(l LRC -1) data blocks of the RS encoding.
在一些实施方式中,所述RS编码的最后一个全局校验块由kRS个数据块进行异或计算得到。In some implementation manners, the last global parity block of the RS code is obtained by XOR calculation of k RS data blocks.
在一具体实施例中,对被访问频率较高的热数据,采用(kLRC,lLRC, gLRC)LRC编码;对被访问频率较低的冷数据,采用(kRS,gRS)RS编码,其中,kRS、kLRC,表示数据块数量,lLRC表示局部校验块数量,gRS、gLRC,表示全局校验块数量。In a specific embodiment, (k LRC , l LRC , g LRC ) LRC encoding is used for hot data with high frequency of access; (k RS , g RS ) RS is used for cold data with low frequency of access Coding, where k RS and k LRC represent the number of data blocks, l LRC represents the number of local check blocks, and g RS and g LRC represent the number of global check blocks.
由图5和图6可见,当 k RS= k LRC且 g RS= g LRC+1时且RS编码的第三个全局冗余块是由所有k个数据块的异或得到时,相应的RS编码和LRC编码能够共用同一个RS码的冗余块。在此条件下,RS编码和LRC编码之间的切换是相当高效的,下面对实际的切换算法进行介绍。为避免混淆,在此切换算法中,记 k= k RS= k LRC及g= g RS= g LRC+1,即存储系统中所采用的两种编码分别为( k, g)RS码和( k, l, g-1)LRC。 It can be seen from Figure 5 and Figure 6 that when k RS = k LRC and g RS = g LRC +1 and the third global redundant block of RS coding is obtained by XOR of all k data blocks, the corresponding RS Encoding and LRC encoding can share the redundant block of the same RS code. Under this condition, switching between RS coding and LRC coding is quite efficient, and the actual switching algorithm will be introduced below. To avoid confusion, in this switching algorithm, record k = k RS = k LRC and g = g RS = g LRC +1, that is, the two codes used in the storage system are ( k , g ) RS code and ( k , l , g-1 ) LRC.
S1:对被访问频率较高的热数据,采用( k, l, g-1)LRC编码;对被访问频率较低的冷数据,采用( k, g)RS编码,且满足 k RS= k LRC和 g RS= g LRC+1并且RS编码最后一个全局冗余块 f g (x),由所有k个数据块的异或得到。 S1: For hot data with high frequency of access, use ( k , l , g-1 ) LRC coding; for cold data with low frequency of access, use ( k , g ) RS coding, and satisfy k RS = k LRC and g RS = g LRC +1 and RS encodes the last global redundant block f g (x) , obtained by XORing all k data blocks.
S2:当数据标记由热数据转换为冷数据时,编码方式由LRC编码转换成RS编码,跳至S3;当数据标记由冷数据转换成热数据时,编码方式由RS编码切换成LRC编码,跳至S4。S2: When the data label is converted from hot data to cold data, the encoding method is converted from LRC encoding to RS encoding, and skip to S3; when the data label is converted from cold data to hot data, the encoding method is switched from RS encoding to LRC encoding, Skip to S4.
S3:LRC编码切换成RS编码,对于( k, g)RS码和( k, l, g-1)LRC ,参数 k RS= k LRC及 g RS= g LRC+1。对于( k, g)RS码的最后一个全局冗余块 f g (x),需要将( k, l, g-1)LRC编码的 l个局部校验块进行异或得到,然后将( k, l, g-1)LRC编码的 l个局部校验块删除即可。举例如下: S3: LRC code is switched to RS code, for ( k , g ) RS code and ( k , l , g-1 ) LRC , the parameter k RS = k LRC and g RS = g LRC +1. For the last global redundant block f g (x) of the ( k , g ) RS code, it is necessary to XOR the l local check blocks of the ( k , l , g-1 ) LRC code, and then ( k , l , g-1 ) l local check blocks of LRC encoding can be deleted. Examples are as follows:
如图7所示,对于(6,3,2)LRC码,当需要切换到(6,3)RS码时,将第二个和第三个局部校验块的数据传输到第一个局部校验块,进行异或即可得到 f 3 (x),然后将第二个和第三个局部校验块删除即可。 As shown in Figure 7, for the (6, 3, 2) LRC code, when it is necessary to switch to the (6, 3) RS code, the data of the second and third local parity blocks are transmitted to the first local For the check block, f 3 (x) can be obtained by XOR, and then the second and third partial check blocks can be deleted.
S4:RS编码切换成LRC编码,对于( k, g)RS码和( k, l, g-1)LRC码,参数 k = k RS= k LRC及 g RS= g LRC+1,因此( k, g)RS码全局校验块的前 g-1个全局校验块保持不变;其中后( l-1)个局部校验块由对应的数据块进行异或得到,第1个局部校验块由最后一个全局校验块 f g (x)和后( l-1)个局部校验块由对应的所有数据块进行异或得到。举例如下: S4: RS code is switched to LRC code, for ( k , g ) RS code and ( k , l , g-1 ) LRC code, parameter k = k RS = k LRC and g RS = g LRC +1, so ( k , g ) The first g-1 global check blocks of the RS code global check block remain unchanged; the last ( l-1 ) local check blocks are obtained by XORing the corresponding data blocks, and the first local check block The check block is obtained by XORing the last global check block f g (x) and the next ( l-1 ) local check blocks from all corresponding data blocks. Examples are as follows:
如图8所示,对于(6,3)RS码切换到(6,3,2)LRC码时,前2个全局校验块保持不变;后2个局部校验块由对应的数据块进行异或得到,第1个局部校验块由最后一个全局校验块 f 3 (x)和后2个局部校验块由对应的所有数据块进行异或得到。 As shown in Figure 8, when the (6,3) RS code is switched to the (6,3,2) LRC code, the first two global check blocks remain unchanged; the last two local check blocks are determined by the corresponding data block XOR is performed, and the first local check block is obtained by XORing the last global check block f 3 (x) and the last two local check blocks from all corresponding data blocks.
通过上述方案,在系统需要将热数据转换为冷数据时,会将( k, l, g-1)LRC切换为( k, g)RS码。若采用重新编码算法,在重新编码前需要获取全部数据块,并在编码后再将新的冗余块发送到各个节点,因此至少需要传输( k+ g-1)块。若采用本发明实施例的切换算法,只需要将( k, l, g-1)LRC编码的后 l-1个局部校验块的数据传输到第一个局部校验块寄了,本发明实施例的切换算法数据传输量为( l-1)块。 Through the above scheme, when the system needs to convert hot data into cold data, it will switch ( k , l , g-1 ) LRC to ( k , g ) RS code. If the re-encoding algorithm is used, all data blocks need to be obtained before re-encoding, and new redundant blocks are sent to each node after encoding, so at least ( k + g -1) blocks need to be transmitted. If the switching algorithm of the embodiment of the present invention is adopted, it is only necessary to transmit the data of the last l-1 local check blocks encoded by ( k , l , g-1 ) to the first local check block. The data transmission amount of the switching algorithm in the embodiment is ( 1-1 ) blocks.
在系统需要将冷数据转换为热数据时,会将( k, g)RS码切换为( k, l, g-1)LRC码。若采用重新编码算法,至少需要传输( k+ l+ g-1)块。若采用本文提出的算法,需要传输(( k/ l) *( l-1))块。当 k=6, l=3且 g=3时,本发明实施例的切换算法需要数据传输量为4,重新编码需要数据传输量为11块。 When the system needs to convert cold data into hot data, the ( k , g ) RS code will be switched to ( k , l , g-1 ) LRC code. If the re-encoding algorithm is used, at least ( k + l + g -1) blocks need to be transmitted. If the algorithm proposed in this paper is adopted, (( k / l ) * ( l-1 )) blocks need to be transmitted. When k =6, l=3 and g =3, the handover algorithm of the embodiment of the present invention requires 4 data transmissions, and the re-encoding requires 11 data transmissions.
综合上述两种切换过程,可以看出本发明提出的高效切换算法相较于重新编码算法有着明显的优化。值得注意的是,一般而言,由于系统中数据一般会不断增加,且数据访问有着时间局部性,因此热数据变为冷数据的情况应当会比冷数据变为热数据的情况多得多。又由于本发明提出的切换算法在热数据变冷时优化效果明显,因此总体上的性能优化是相当显著的。Combining the above two switching processes, it can be seen that the high-efficiency switching algorithm proposed by the present invention has obvious optimization compared with the re-encoding algorithm. It is worth noting that, generally speaking, since the data in the system generally increases continuously, and data access has time locality, there should be much more cases where hot data becomes cold data than cold data becomes hot data. Moreover, since the switching algorithm proposed by the present invention has an obvious optimization effect when the hot data becomes cold, the overall performance optimization is quite remarkable.
在计算效率方面,本发明提出算法只需要进行XOR(异或)运算,且涉及范围相对整一组数据较小,这对比于重新编码算法需要整份数据进行的伽罗华域运算也有了明显优化。虽然计算时间并不是编码切换的瓶颈所在,但计算效率的大幅提升,能有效地帮助系统节省计算资源,从而能为上层实际应用分配更多计算资源,进一步提升系统总体性能。In terms of computational efficiency, the algorithm proposed in the present invention only needs to perform XOR (exclusive OR) operation, and the scope involved is relatively small compared with the entire set of data, which is also obvious compared to the Galois field operation that requires the entire set of data for the re-encoding algorithm optimization. Although computing time is not the bottleneck of encoding switching, the substantial increase in computing efficiency can effectively help the system save computing resources, thereby allocating more computing resources for upper-layer practical applications and further improving the overall system performance.
基于同一发明构思,根据本发明的另一个方面,如图9所示,本发明的实施例还提供了一种数据存储装置,包括:Based on the same inventive concept, according to another aspect of the present invention, as shown in FIG. 9 , an embodiment of the present invention also provides a data storage device, including:
检查模块110,所述检查模块110配置用于按周期对存储系统数据标记进行检查,其中,所述存储系统数据标记包括冷数据和热数据,所述存储系统配置用于基于第一编码存储所述标记为冷数据的数据,并基于第二编码存储所述标记为热数据的数据;A
切换模块120,所述切换模块120配置用于响应于检查到的数据标记触发标记切换条件,对检查到的数据标记进行切换,并相应切换编码方式以基于切换后的编码方式存储对应的数据。The
在一些实施方式中,所述第一编码包括RS编码,所述第二编码包括LRC编码。In some embodiments, the first encoding comprises RS encoding and the second encoding comprises LRC encoding.
基于同一发明构思,根据本发明的另一个方面,如图10所示,本发明的实施例还提供了一种计算机设备30,在该计算机设备30中包括处理器310以及存储器320,存储器320存储有可在处理器上运行的计算机程序321,处理器310执行程序时执行如上的方法的步骤。Based on the same inventive concept, according to another aspect of the present invention, as shown in FIG. 10 , the embodiment of the present invention also provides a
其中,存储器作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的所述数据存储方法对应的程序指令/模块。处理器通过运行存储在存储器中的非易失性软件程序、指令以及模块,从而执行装置的各种功能应用以及数据处理,即实现上述方法实施例的数据存储方法。Wherein, the memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the data storage method in the embodiment of the present application corresponds to program instructions/modules. The processor executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory, that is, implements the data storage method of the above method embodiment.
存储器可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据装置的使用所创建的数据等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至本地模块。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function; the data storage area may store data created according to usage of the device, and the like. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory may optionally include memory located remotely from the processor, and these remote memories may be connected to the local module via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
基于同一发明构思,根据本发明的另一个方面,如图11所示,本发明的实施例还提供了一种计算机可读存储介质40,计算机可读存储介质40存储有被处理器执行时执行如上方法的计算机程序410。Based on the same inventive concept, according to another aspect of the present invention, as shown in FIG. 11 , the embodiment of the present invention also provides a computer-
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,程序的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer programs, and the programs can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium of the program may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). The foregoing computer program embodiments can achieve the same or similar effects as any of the foregoing method embodiments corresponding thereto.
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。Those of skill would also appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described generally in terms of their functionality. Whether such functionality is implemented as software or as hardware depends upon the particular application and design constraints imposed on the overall system. Those skilled in the art may implement the functions in various ways for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope disclosed in the embodiments of the present invention.
以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are the exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications can be made without departing from the scope of the disclosed embodiments of the present invention defined in the claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. The serial numbers of the embodiments disclosed in the above-mentioned embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in an individual form, they may also be understood as a plurality unless explicitly limited to a singular number.
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。It should be understood that as used herein, the singular form "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is exemplary only, and is not intended to imply that the disclosed scope (including claims) of the embodiments of the present invention is limited to these examples; under the idea of the embodiments of the present invention , the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present invention, which are not provided in details for the sake of brevity. Therefore, within the spirit and principle of the embodiments of the present invention, any omissions, modifications, equivalent replacements, improvements, etc., shall be included in the protection scope of the embodiments of the present invention.
Claims (19)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310001205.0A CN115793984B (en) | 2023-01-03 | 2023-01-03 | Data storage method, device, computer equipment and storage medium |
PCT/CN2023/121857 WO2024146186A1 (en) | 2023-01-03 | 2023-09-27 | Data storage method and apparatus, and computer device and non-volatile readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310001205.0A CN115793984B (en) | 2023-01-03 | 2023-01-03 | Data storage method, device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115793984A CN115793984A (en) | 2023-03-14 |
CN115793984B true CN115793984B (en) | 2023-04-28 |
Family
ID=85428487
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310001205.0A Active CN115793984B (en) | 2023-01-03 | 2023-01-03 | Data storage method, device, computer equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115793984B (en) |
WO (1) | WO2024146186A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115793984B (en) * | 2023-01-03 | 2023-04-28 | 苏州浪潮智能科技有限公司 | Data storage method, device, computer equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105956128A (en) * | 2016-05-09 | 2016-09-21 | 南京大学 | Self-adaptive encoding storage fault-tolerant method based on simple regenerating code |
CN106100801A (en) * | 2016-08-29 | 2016-11-09 | 湖南大学 | A kind of non-homogeneous erasure code method of cloud storage system |
CN106844098A (en) * | 2016-12-29 | 2017-06-13 | 中国科学院计算技术研究所 | A kind of fast data recovery method and system based on right-angled intersection erasure code |
CN110764950A (en) * | 2019-10-31 | 2020-02-07 | 深圳信息职业技术学院 | Hybrid coding method, data repair method, and system based on RS code and regeneration code |
CN115454712A (en) * | 2022-11-11 | 2022-12-09 | 苏州浪潮智能科技有限公司 | Check code recovery method, system, electronic equipment and storage medium |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9595979B2 (en) * | 2015-01-20 | 2017-03-14 | International Business Machines Corporation | Multiple erasure codes for distributed storage |
US10187083B2 (en) * | 2015-06-26 | 2019-01-22 | Microsoft Technology Licensing, Llc | Flexible erasure coding with enhanced local protection group structures |
CN106649406B (en) * | 2015-11-04 | 2020-04-28 | 华为技术有限公司 | Method and device for self-adaptively storing files |
CN107357685B (en) * | 2017-07-11 | 2019-06-18 | 清华大学 | A fault-tolerant redundancy method and device for data storage |
US11531593B2 (en) * | 2018-09-03 | 2022-12-20 | Here Data Technology | Data encoding, decoding and recovering method for a distributed storage system |
CN114253917B (en) * | 2021-12-06 | 2025-03-04 | 北京信息科技大学 | Distributed adaptive storage method and system based on file access characteristics |
CN114281270B (en) * | 2022-03-03 | 2022-05-27 | 山东云海国创云计算装备产业创新中心有限公司 | A data storage method, system, device and medium |
CN115357425A (en) * | 2022-07-13 | 2022-11-18 | 阿里巴巴(中国)有限公司 | Code configuration conversion method, erasure code coding method, device and system |
CN115793984B (en) * | 2023-01-03 | 2023-04-28 | 苏州浪潮智能科技有限公司 | Data storage method, device, computer equipment and storage medium |
-
2023
- 2023-01-03 CN CN202310001205.0A patent/CN115793984B/en active Active
- 2023-09-27 WO PCT/CN2023/121857 patent/WO2024146186A1/en unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105956128A (en) * | 2016-05-09 | 2016-09-21 | 南京大学 | Self-adaptive encoding storage fault-tolerant method based on simple regenerating code |
CN106100801A (en) * | 2016-08-29 | 2016-11-09 | 湖南大学 | A kind of non-homogeneous erasure code method of cloud storage system |
CN106844098A (en) * | 2016-12-29 | 2017-06-13 | 中国科学院计算技术研究所 | A kind of fast data recovery method and system based on right-angled intersection erasure code |
CN110764950A (en) * | 2019-10-31 | 2020-02-07 | 深圳信息职业技术学院 | Hybrid coding method, data repair method, and system based on RS code and regeneration code |
CN115454712A (en) * | 2022-11-11 | 2022-12-09 | 苏州浪潮智能科技有限公司 | Check code recovery method, system, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115793984A (en) | 2023-03-14 |
WO2024146186A1 (en) | 2024-07-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103688514B (en) | A kind of minimum memory regenerates the coding and memory node restorative procedure of code | |
CN103688515B (en) | The coding of a kind of minimum bandwidth regeneration code and memory node restorative procedure | |
CN103645861B (en) | The reconstructing method of failure node in a kind of correcting and eleting codes cluster | |
CN110212923A (en) | A kind of distributed correcting and eleting codes memory system data restorative procedure based on simulated annealing | |
CN105518996B (en) | A kind of data decoding method based on binary field reed-solomon code | |
TW201228246A (en) | Hybrid codec apparatus and method for data transferring | |
CN113297000A (en) | RAID (redundant array of independent disks) coding circuit and coding method | |
CN112799875B (en) | Method, system, equipment and medium for verification restoration based on Gaussian elimination | |
CN110532126A (en) | Correcting and eleting codes memory system data quick recovery method, device and storage medium | |
CN114153651B (en) | A data encoding method, device, equipment and medium | |
CN116501553B (en) | Data recovery method, device, system, electronic equipment and storage medium | |
CN115793984B (en) | Data storage method, device, computer equipment and storage medium | |
CN113391946B (en) | A method for encoding and decoding erasure codes in distributed storage | |
CN115113816A (en) | Erasure code data processing system, method, computer device and medium | |
CN110895497A (en) | Method and device for reducing erasure code repair in distributed storage | |
CN107153661A (en) | A kind of storage, read method and its device of the data based on HDFS systems | |
Zhu et al. | Adaptive fractional repetition codes for dynamic storage systems | |
CN107615248B (en) | Distributed data storage method, control equipment and system | |
CN112181707B (en) | Distributed storage data recovery scheduling method, system, device and storage medium | |
WO2017041232A1 (en) | Encoding and decoding framework for binary cyclic code | |
CN108628697B (en) | A binary-based node repair method and system | |
Chen et al. | A new Zigzag MDS code with optimal encoding and efficient decoding | |
CN116312726B (en) | Data storage method and device, electronic equipment and storage medium | |
CN108199720B (en) | Node repairing method and system for reducing storage overhead and improving repairing efficiency | |
CN116400862A (en) | Method, device, equipment and medium for improving erasure codes of cold and hot data |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |