CN113297000B - A kind of RAID encoding circuit and encoding method - Google Patents
A kind of RAID encoding circuit and encoding method Download PDFInfo
- Publication number
- CN113297000B CN113297000B CN202110551258.0A CN202110551258A CN113297000B CN 113297000 B CN113297000 B CN 113297000B CN 202110551258 A CN202110551258 A CN 202110551258A CN 113297000 B CN113297000 B CN 113297000B
- Authority
- CN
- China
- Prior art keywords
- data
- check code
- parameter
- raid
- current
- 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
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
- G06F11/1076—Parity data used in redundant arrays of independent storages, e.g. in RAID systems
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M13/00—Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
- H03M13/03—Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words
- H03M13/05—Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words using block codes, i.e. a predetermined number of check bits joined to a predetermined number of information bits
- H03M13/13—Linear codes
- H03M13/15—Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes
- H03M13/151—Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes using error location or error correction polynomials
- H03M13/1515—Reed-Solomon codes
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- Algebra (AREA)
- Pure & Applied Mathematics (AREA)
- Probability & Statistics with Applications (AREA)
- Error Detection And Correction (AREA)
Abstract
Description
技术领域technical field
本申请涉及存储技术领域,特别涉及一种RAID编码电路及编码方法。The present application relates to the field of storage technology, in particular to a RAID encoding circuit and encoding method.
背景技术Background technique
伴随着通讯技术和网络科技的迅速发展,数字化信息呈指数爆炸式增长,数据存储技术也因此迎来了巨大的挑战。存储系统中数据的可靠性问题以及存储系统的能耗问题越来越被人们所关注。现如今面对如此庞大的数据规模,存储系统中数据的可靠性和存储系统中包含的组件数量成反比关系,即存储系统组件数越多,那么存储系统中数据的可靠性就越低。在大规模存储系统中,磁盘故障造成的数据可靠性下降是相当严重的问题,对此人们展开了相关容错技术的研究。RAID(Redundant Arrays of Independent Disks,即独立冗余磁盘阵列)技术应运而生,采用RAID存储技术,可以大大提高存储容量,提高系统输入输出的请求处理能力并且通过数据的分布式存储技术,并行访问手段和信息冗余技术提高数据的可靠性。目前,RAID可以被分为不同的等级:RAID 0,1,5,6,10,在实际电路中一般实现RAID 6都需要在实现RAID 5的前提下进行,因此如何在实现RAID 5的前提下,快速且以较低面积实现RAID6是需要解决的问题。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. In large-scale storage systems, data reliability degradation caused by disk failure is a very serious problem, and people have launched research on related fault-tolerant technologies. RAID (Redundant Arrays of Independent Disks, that is, independent redundant disk array) technology came into being, using RAID storage technology can greatly increase storage capacity, improve system input and output request processing capabilities and through data distributed storage technology, parallel access Means and information redundancy technology improve data reliability. At present, RAID can be divided into different levels:
发明内容Contents of the invention
有鉴于此,本申请的目的在于提供一种RAID编码电路及编码方法,能够在实现RAID 5的前提下,快速且以较低面积实现RAID 6。其具体方案如下:In view of this, the purpose of this application is to provide a RAID encoding circuit and encoding method, which can implement RAID 6 quickly and with a relatively small area on the premise of implementing RAID 5. The specific plan is as follows:
第一方面,本申请公开了一种RAID编码电路,包括:In a first aspect, the application discloses a RAID encoding circuit, comprising:
第一参数模块,用于获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID 6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1;The first parameter module is configured to obtain the first verification parameter corresponding to the current target data stripe of the data to be encoded in the current RAID mode, and use the first verification parameter and the current target data stripe to determine the first parameter after operation Data; wherein, the first check parameter in the RAID 6 mode is the encoding parameter corresponding to the first check code determined based on the Vandermonde RS coding relationship, and the first check parameter in the RAID 5 mode is 1;
第一编码模块,用于对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。The first encoding module is used to encode the current first check code read from the storage location of the first check code and the data after the current first parameter operation to obtain a new first check code, and convert the new first check code The first check code is stored in the first check code storage location until the final first check code corresponding to the data to be encoded is determined based on the last target data strip of the data to be encoded.
可选的,还包括:Optionally, also include:
数据条带分割模块,用于将所述待编码数据分割为预设数量个数据条带;A data strip division module, configured to divide the data to be encoded into a preset number of data strips;
伽罗华域转换模块,用于将每个数据条带转换为伽罗华域数据,得到每个数据条带对应的所述目标数据条带;A Galois field conversion module, configured to convert each data strip into Galois field data, and obtain the target data strip corresponding to each data strip;
相应的,所述第一编码模块,用于对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行异或运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置。Correspondingly, the first encoding module is configured to perform an XOR operation on the current first check code read from the first check code storage location and the current first parameter operation data to obtain a new first check code code, and store a new first check code in the storage location of the first check code.
可选的,还包括:Optionally, also include:
第二参数模块,用于获取RAID 6模式下待编码数据的当前目标数据条带对应的第二校验参数,并利用所述第二校验参数和当前目标数据条带确定第二参数运算后数据;其中,RAID 6对应的第二校验参数为基于范德蒙式RS编码关系确定的第二校验码对应的编码参数;The second parameter module is configured to obtain the second verification parameter corresponding to the current target data stripe of the data to be encoded in RAID 6 mode, and use the second verification parameter and the current target data stripe to determine the second parameter after operation Data; wherein, the second check parameter corresponding to RAID 6 is the encoding parameter corresponding to the second check code determined based on the Vandermonde RS encoding relationship;
第二编码模块,用于对从第二校验码存储位置读取的当前第二校验码以及当前第二参数运算后数据进行编码运算,得到新的第二校验码,并将新的第二校验码存储至所述第二校验码存储位置。The second encoding module is used to encode the current second check code read from the second check code storage location and the current second parameter operation data to obtain a new second check code, and convert the new The second check code is stored in the second check code storage location.
可选的,所述第一参数模块,还用于获取RAID 6下待编码数据的当前目标数据条带对应的第二校验参数,并利用所述第二校验参数和当前目标数据条带确定第二参数运算后数据;其中,RAID 6对应的第二校验参数为基于范德蒙式RS编码关系确定的第二校验码对应的编码参数;Optionally, the first parameter module is further configured to obtain a second verification parameter corresponding to the current target data stripe of the data to be encoded under RAID 6, and use the second verification parameter and the current target data stripe Determine the data after the operation of the second parameter; wherein, the second verification parameter corresponding to RAID 6 is a coding parameter corresponding to the second verification code determined based on the Vandermonde RS coding relationship;
相应的,所述第一编码模块,还用于对从第二校验码存储位置读取的当前第二校验码以及当前第二参数运算后数据进行编码运算,得到新的第二校验码,并将新的第二校验码存储至所述第二校验码存储位置。Correspondingly, the first encoding module is further configured to perform an encoding operation on the current second check code read from the second check code storage location and the current second parameter operation data to obtain a new second check code code, and store a new second check code in the second check code storage location.
可选的,还包括:Optionally, also include:
数据缓存模块,用于将所述待编码数据的目标数据条带存入缓存;A data caching module, configured to store the target data strips of the data to be encoded in the cache;
数据读取模块,用于从所述缓存中读取所述目标数据条带,同时分别传输至所述目标数据条带对应的数据存储位置以及所述第一参数模块。The data reading module is configured to read the target data strip from the cache, and simultaneously transmit it to the data storage location corresponding to the target data strip and the first parameter module.
可选的,所述第一参数模块具体用于:Optionally, the first parameter module is specifically used for:
基于公式确定RAID 6模式下待编码数据的当前目标数据条带对应的第一校验参数;formula based Determine the first check parameter corresponding to the current target data stripe of the data to be encoded in the RAID 6 mode;
其中,αp为基于范德蒙式RS编码关系确定的所述第一校验码对应的编码系数值,αq为基于范德蒙式RS编码关系确定的第二校验码对应的编码系数值,αx为基于范德蒙式RS编码关系确定的当前目标数据条带对应的编码系数值,表示异或运算。Wherein, α p is the coding coefficient value corresponding to the first check code determined based on the Vandermonde RS coding relationship, α q is the coding coefficient value corresponding to the second check code determined based on the Vandermonde RS coding relationship, and α x is the coding coefficient value corresponding to the current target data strip determined based on the Vandermonde RS coding relationship, Indicates an XOR operation.
可选的,所述第二参数模块具体用于:Optionally, the second parameter module is specifically used for:
基于公式确定RAID 6模式下待编码数据的当前目标数据条带对应的第二校验参数;formula based Determine the second check parameter corresponding to the current target data stripe of the data to be encoded in the RAID 6 mode;
其中,αp为基于范德蒙式RS编码关系确定的所述第一校验码对应的编码系数值,αq为基于范德蒙式RS编码关系确定的第二校验码对应的编码系数值,αx为基于范德蒙式RS编码关系确定的当前目标数据条带对应的编码系数值,表示异或运算。Wherein, α p is the coding coefficient value corresponding to the first check code determined based on the Vandermonde RS coding relationship, α q is the coding coefficient value corresponding to the second check code determined based on the Vandermonde RS coding relationship, and α x is the coding coefficient value corresponding to the current target data strip determined based on the Vandermonde RS coding relationship, Indicates an XOR operation.
第二方面,本申请公开了一种RAID编码方法,包括:In a second aspect, the application discloses a RAID encoding method, comprising:
获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID 6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1;Obtain the first verification parameter corresponding to the current target data stripe of the data to be encoded in the current RAID mode, and use the first verification parameter and the current target data stripe to determine the data after the first parameter operation; wherein, the RAID 6 mode The first check parameter below is the encoding parameter corresponding to the first check code determined based on the Vandermonde RS encoding relationship, and the first check parameter in the RAID 5 mode is 1;
对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。Perform encoding operation on the current first check code read from the first check code storage location and the current first parameter operation data to obtain a new first check code, and store the new first check code in The first check code storage location until the final first check code corresponding to the data to be encoded is determined based on the last target data strip of the data to be encoded.
可选的,还包括:Optionally, also include:
将所述待编码数据分割为预设数量个数据条带;dividing the data to be encoded into a preset number of data strips;
将每个数据条带转换为伽罗华域数据,得到每个数据条带对应的目标数据条带。Convert each data stripe to Galois field data to obtain the target data stripe corresponding to each data stripe.
可选的,所述对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,包括:Optionally, the encoding operation of the current first check code read from the first check code storage location and the current first parameter operation data to obtain a new first check code includes:
对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行异或运算,得到新的第一校验码。An XOR operation is performed on the current first check code read from the storage location of the first check code and the current first parameter operation data to obtain a new first check code.
可见,本申请公开的一种RAID编码电路,包括:第一参数模块,用于获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID 6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1;第一编码模块,用于对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。这样,只需要第一参数模块即可实现RAID 5向RAID 6的编码转换,能够在实现RAID 5的前提下,快速且以较低面积实现RAID 6。It can be seen that a RAID encoding circuit disclosed in the present application includes: a first parameter module, configured to obtain a first check parameter corresponding to a current target data stripe of data to be encoded in the current RAID mode, and use the first check parameter to The verification parameters and the current target data strip determine the data after the operation of the first parameter; wherein, the first verification parameter in RAID 6 mode is the encoding parameter corresponding to the first verification code determined based on the Vandermonde RS coding relationship, and the RAID 5 mode The first check parameter below is 1; the first encoding module is used to encode the current first check code read from the first check code storage location and the current first parameter operation data to obtain a new The first check code, and store the new first check code in the first check code storage location, until the last target data strip of the data to be encoded is determined based on the data to be encoded The final first checksum. In this way, only the first parameter module is needed to realize the code conversion from RAID 5 to RAID 6, and RAID 6 can be realized quickly and with a relatively small area under the premise of realizing RAID 5.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application 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 It is an embodiment of the present application, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.
图1为本申请公开的一种RAID编码电路结构示意图;Fig. 1 is a schematic structural diagram of a RAID encoding circuit disclosed in the present application;
图2为本申请公开的一种具体的RAID编码电路编码示意图;Fig. 2 is a kind of specific RAID encoding circuit encoding schematic diagram disclosed in the present application;
图3为本申请公开的一种RAID 5编码电路编码示意图;Fig. 3 is a schematic diagram of encoding of a RAID 5 encoding circuit disclosed by the present application;
图4为本申请公开的一种RAID 6编码电路编码示意图;Fig. 4 is a schematic diagram of encoding of a RAID 6 encoding circuit disclosed in the present application;
图5为本申请公开的一种RAID编码方法流程图。FIG. 5 is a flowchart of a RAID encoding method disclosed in the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
参见图1所示,本申请实施例公开了一种RAID编码电路,包括:Referring to Fig. 1, the embodiment of the present application discloses a RAID encoding circuit, including:
第一参数模块11,用于获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID 6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1。The
在具体的实施方式中,利用所述第一校验参数和当前目标数据条带进行乘法运算,得到第一参数运算后数据。In a specific implementation manner, the multiplication operation is performed by using the first verification parameter and the current target data strip to obtain the data after the operation of the first parameter.
第一编码模块12,用于对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。The
在具体的实施方式中,所述电路还包括:In a specific implementation manner, the circuit also includes:
数据条带分割模块,用于将所述待编码数据分割为预设数量个数据条带。A data strip division module, configured to divide the data to be encoded into a preset number of data strips.
其中,预设数量为RAID的数据条带数量。Wherein, the preset number is the number of data stripes of the RAID.
伽罗华域转换模块,用于将每个数据条带转换为伽罗华域数据,得到每个数据条带对应的所述目标数据条带。The Galois field conversion module is configured to convert each data strip into Galois field data, and obtain the target data strip corresponding to each data strip.
相应的,所述第一编码模块,用于对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行异或运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置。Correspondingly, the first encoding module is configured to perform an XOR operation on the current first check code read from the first check code storage location and the current first parameter operation data to obtain a new first check code code, and store a new first check code in the storage location of the first check code.
也即,本申请实施例可以基于伽罗华域的数据条带进行编码运算,这样可以提高编码效率。That is, in the embodiment of the present application, encoding operations can be performed based on data strips in the Galois field, which can improve encoding efficiency.
需要指出的是,RAID 5只有一个parity stripe(校验条带),也即第一校验码,进行编码时,设待编码数据分为n个数据条带,则数据条带和第一校验码的关系表示为:It should be pointed out that RAID 5 has only one parity stripe (parity stripe), that is, the first parity code. The relationship between code verification is expressed as:
其中,d0,d1...dn表示数据条带,p表示第一校验码,表示异或运算。Among them, d 0 , d 1 ... d n represent data strips, p represents the first check code, Indicates an XOR operation.
实现RAID 6时需要同时支持两个校验条带,即第一校验码和第二校验码。本申请使用RS(即Reed-Solomon Code,里德所罗门码)码来进行第一校验码和第二校验码的编码,RS码有范德蒙、柯西等多种实现方式,考虑到RAID 6的特性和运算的简单性需求,本申请实施例使用的是范德蒙的实现方式,设待编码数据分为n个数据条带,则依照上式,数据条带、第一校验码和第二校验码的关系表示为:When implementing RAID 6, it is necessary to support two parity stripes at the same time, that is, the first parity code and the second parity code. This application uses RS (that is, Reed-Solomon Code, Reed-Solomon Code) code to carry out the encoding of the first check code and the second check code. RS codes have various implementation methods such as Vandermonde and Cauchy. The characteristics of the characteristics and the simple requirements of the operation, the embodiment of the present application uses the implementation method of Vandermonde, assuming that the data to be encoded is divided into n data strips, then according to the above formula, the data strips, the first check code and the second The relationship of the check code is expressed as:
其中,d0,d1...dn表示数据条带,p表示第一校验码,q表示第二校验码,表示异或运算,α表示范德蒙参数。Among them, d 0 , d 1 ... d n represent data strips, p represents the first check code, q represents the second check code, Represents an XOR operation, and α represents a Vandermonde parameter.
为了方便运算和存储,本实施例通过伽罗华域处理为有限域再进行编码存储。此外,由于电路中数据的传输一般以byte为标准,因此,本申请实施例使用的伽罗华域为8比特位的有限域0X11D,即是:In order to facilitate calculation and storage, in this embodiment, the Galois field is processed into a finite field and then coded and stored. In addition, since the transmission of data in the circuit is generally based on byte, the Galois field used in the embodiment of this application is an 8-bit finite field 0X11D, that is:
P(X)=x8+x4+x3+x2+1;P(X)= x8 + x4 + x3 + x2 +1;
有限域0X11D的伽罗华域下,对于数据的定义可以表示为表一所示:Under the Galois field of the finite field 0X11D, the definition of data can be expressed as shown in Table 1:
表一Table I
例如,当生成元素的指数为10时,通过上述伽罗华域本源多项式P(X)转换,表示为二进制01110100。通过这样的转换,所有的数据都会被转换为8比特的二进制数,并进行基于8比特二进制数的四则运算。基于伽罗华域的情况可知,传统的RAID 5和6都可以通过伽罗华域实现普通的数据四则运算,但申请提出的基于范德蒙的RS码做RAID 6的编码需要考虑对应的指数关系,当涉及四则运算,尤其是乘法时,需要考虑数据溢出后是否依然符合范德蒙关系的问题。为验证其适用性,做以下运算推导:For example, when the index of the generating element is 10, it is expressed as binary 01110100 through the above-mentioned Galois field original polynomial P(X) conversion. Through such conversion, all data will be converted into 8-bit binary numbers, and four arithmetic operations based on 8-bit binary numbers will be performed. Based on the situation of the Galois field, it can be seen that both traditional RAID 5 and 6 can realize common data arithmetic operations through the Galois field, but the coding of RAID 6 based on the Vandermonde RS code proposed in the application needs to consider the corresponding exponential relationship. When it comes to four arithmetic operations, especially multiplication, it is necessary to consider whether the data overflow still conforms to the Vandermonde relationship. In order to verify its applicability, the following calculation derivation is done:
假设有两个数据条带d0和d1需要进行乘法运算,按照8比特的伽罗华域进行展开并利用基于范德蒙的RS码做转换后为:Assuming that there are two data strips d 0 and d 1 that need to be multiplied, they are expanded according to the 8-bit Galois field and converted using the Vandermonde-based RS code as follows:
由于最容易产生溢出问题的是乘法,因此做d0和d1的乘法运算可得:Since multiplication is the most prone to overflow problems, the multiplication of d 0 and d 1 can be obtained:
d0*d1=A7B7α14 d 0 *d 1 = A 7 B 7 α 14
+(A7B6+A6B7)α13 +(A 7 B 6 +A 6 B 7 )α 13
+...++...+
+A0B0α0 +A 0 B 0 α 0
将上式的A7B7,(A7B6+A6B7)直到A0B0用参数P14,P13,...,P0来表示,则上式可以表示为:Express A 7 B 7 , (A 7 B 6 +A 6 B 7 ) to A 0 B 0 in the above formula with parameters P 14 , P 13 ,...,P 0 , then the above formula can be expressed as:
d0*d1=P14α14+P13α13+...+P2α2+P1α1+P0α0 d 0 *d 1 =P 14 α 14 +P 13 α 13 +...+P 2 α 2 +P 1 α 1 +P 0 α 0
基于表一查询溢出项α14,α13,...,α8的8比特二进制表示方式,例如,α8=29表示为α8=α4+α3+α2+α0然后重新带入上式,则可得到:Query the 8-bit binary representation of overflow items α 14 , α 13 , ..., α 8 based on Table 1. For example, α 8 =29 is expressed as α 8 =α 4 +α 3 +α 2 +α 0 and then re-enclosed Into the above formula, you can get:
d0*d1=C7α7+C6α6+...+C2α2+C1α1+C0α0;d 0 *d 1 =C 7 α 7 +C 6 α 6 +...+C 2 α 2 +C 1 α 1 +C 0 α 0 ;
其中,C0,C1...C6,C7为通过查询表一进行拆分运算后,利用P(X)=x8+x4+x3+x2+1表示的针对α7,α6,...,α0的新的参数。可知完美适配基于范德蒙的RS码需求,可完成RAID 6的四则运算,即是说本申请提出的基于范德蒙的RS码可用于RAID 6的编解码,实现RAID 6的运算。Among them, C 0 , C 1 ... C 6 , C 7 are the data for α 7 represented by P(X)=x 8 +x 4 +x 3 +x 2 +1 after the split operation is performed through the lookup table 1. , α 6 ,..., the new parameters of α 0 . It can be seen that the perfect adaptation to the requirements of the RS code based on Vandermonde can complete the four arithmetic operations of RAID 6, that is to say, the RS code based on Vandermonde proposed in this application can be used for the encoding and decoding of RAID 6 to realize the operation of RAID 6.
在一种具体的实施方式中,RAID编码电路还包括:In a specific implementation manner, the RAID encoding circuit also includes:
第二参数模块,用于获取RAID 6模式下待编码数据的当前目标数据条带对应的第二校验参数,并利用所述第二校验参数和当前目标数据条带确定第二参数运算后数据;其中,RAID 6对应的第二校验参数为基于范德蒙式RS编码关系确定的第二校验码对应的编码参数;The second parameter module is configured to obtain the second verification parameter corresponding to the current target data stripe of the data to be encoded in RAID 6 mode, and use the second verification parameter and the current target data stripe to determine the second parameter after operation Data; wherein, the second check parameter corresponding to RAID 6 is the encoding parameter corresponding to the second check code determined based on the Vandermonde RS encoding relationship;
第二编码模块,用于对从第二校验码存储位置读取的当前第二校验码以及当前第二参数运算后数据进行编码运算,得到新的第二校验码,并将新的第二校验码存储至所述第二校验码存储位置。The second encoding module is used to encode the current second check code read from the second check code storage location and the current second parameter operation data to obtain a new second check code, and convert the new The second check code is stored in the second check code storage location.
在另一种具体的实施方式中,所述第一参数模块,还用于获取RAID 6下待编码数据的当前目标数据条带对应的第二校验参数,并利用所述第二校验参数和当前目标数据条带确定第二参数运算后数据;其中,RAID 6对应的第二校验参数为基于范德蒙式RS编码关系确定的第二校验码对应的编码参数;In another specific implementation manner, the first parameter module is further configured to obtain the second verification parameter corresponding to the current target data stripe of the data to be encoded under RAID 6, and use the second verification parameter Determine the data after the second parameter operation with the current target data strip; wherein, the second verification parameter corresponding to RAID 6 is the encoding parameter corresponding to the second verification code determined based on the Vandermonde RS encoding relationship;
相应的,所述第一编码模块,还用于对从第二校验码存储位置读取的当前第二校验码以及当前第二参数运算后数据进行编码运算,得到新的第二校验码,并将新的第二校验码存储至所述第二校验码存储位置。Correspondingly, the first encoding module is further configured to perform an encoding operation on the current second check code read from the second check code storage location and the current second parameter operation data to obtain a new second check code code, and store a new second check code in the second check code storage location.
也即,在具体的实施方式中,可以利用同一参数模块、编码模块串行确定第一校验码和第二校验码,以降低电路面积。为了提升编码速度,可以并行的利用不同的参数模块、编码模块分别确定第一校验码和第二校验码。That is, in a specific implementation manner, the first check code and the second check code can be serially determined by using the same parameter module and encoding module, so as to reduce the circuit area. In order to increase the encoding speed, different parameter modules and encoding modules can be used in parallel to determine the first check code and the second check code respectively.
并且,在具体的实施方式中,RAID编码电路还包括:And, in a specific embodiment, the RAID coding circuit also includes:
数据缓存模块,用于将所述待编码数据的目标数据条带存入缓存。The data caching module is configured to store the target data strips of the data to be encoded into the cache.
在具体的实施方式中,缓存方式可以为buffer(缓冲器)或FIFO(即First InputFirst Output,先进先出)。In a specific implementation manner, the buffer mode may be buffer (buffer) or FIFO (namely First Input First Output, first in first out).
数据读取模块,用于从所述缓存中读取所述目标数据条带,同时分别传输至所述目标数据条带对应的数据存储位置以及所述第一参数模块。The data reading module is configured to read the target data strip from the cache, and simultaneously transmit it to the data storage location corresponding to the target data strip and the first parameter module.
例如,参见图2所示,图2为本申请公开的一种具体的RAID编码电路编码示意图。For example, refer to FIG. 2 , which is a schematic diagram of encoding of a specific RAID encoding circuit disclosed in the present application.
1、待编码数据进入RAID编码电路,RAID编码电路先将待编码数据分割为预设数量个数据条带,然后将每个数据条带转换为伽罗华域数据,得到每个数据条带对应的目标数据条带,通过buffer或FIFO等方式暂存,等待数据读取模块空闲时,数据读取模块将目标数据条带分别同时送往当前数据条带对应的数据存储位置以及的第一参数模块、第二参数模块,第一参数模块获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用第一校验参数和当前目标数据条带进行乘法运算,得到第一参数运算后数据,将第一参数运算后数据传输至第一编码模块,第二参数模块获取当前RAID模式下待编码数据的当前目标数据条带对应的第二校验参数,并利用第二校验参数和当前目标数据条带进行乘法运算,得到第二参数运算后数据,将第二参数运算后数据传输至第二编码模块。比如,当前的目标数据条带为d0,将数据传输至d0对应的存储位置以及第一参数模块、第二参数模块。同一时间,从第一校验码p和第二校验码q的存储位置读取现在所存的数据,即当前第一校验码和当前第二校验码传输至第一编码模块、第二编码模块。1. The data to be encoded enters the RAID encoding circuit. The RAID encoding circuit first divides the data to be encoded into a preset number of data strips, and then converts each data strip into Galois field data to obtain the data corresponding to each data strip. The target data strips are temporarily stored in buffer or FIFO, and when the data reading module is idle, the data reading module sends the target data strips to the data storage location corresponding to the current data strip and the first parameter module, the second parameter module, and the first parameter module obtains the first verification parameter corresponding to the current target data stripe of the data to be encoded under the current RAID mode, and uses the first verification parameter and the current target data stripe to perform multiplication, Obtain the calculated data of the first parameter, transmit the calculated data of the first parameter to the first encoding module, and obtain the second verification parameter corresponding to the current target data strip of the data to be encoded in the current RAID mode by the second parameter module, and use The second verification parameter is multiplied by the current target data strip to obtain the data after the operation of the second parameter, and the data after the operation of the second parameter is transmitted to the second encoding module. For example, the current target data strip is d 0 , and the data is transmitted to the storage location corresponding to d 0 and the first parameter module and the second parameter module. At the same time, read the stored data from the storage locations of the first check code p and the second check code q, that is, the current first check code and the current second check code are transmitted to the first encoding module, the second encoding module.
2、第一参数运算后数据、第二参数运算后数据分别与从第一校验码存储位置读取的当前第一校验码和从第二校验码存储位置读取的当前第二校验码中所存的数据在第一编码模块、第二编码模块中进行异或运算后,产生的新的第一校验码和新的第二校验码,然后更新第一校验码存储位置和第二校验码存储位置的数据。2. The data after the operation of the first parameter and the data after the operation of the second parameter are respectively compared with the current first check code read from the storage location of the first check code and the current second check code read from the storage location of the second check code. After the data stored in the check code is XORed in the first encoding module and the second encoding module, a new first check code and a new second check code are generated, and then the storage location of the first check code is updated and the data in the second check code storage location.
其中,第一校验码存储位置和第二校验码存储位置的初始值均为0,这样,利用待编码数据的最后一个目标数据条带确定出的校验码即为待编码数据对应的最终的校验码,完成对待编码数据的编码。Wherein, the initial values of the first check code storage location and the second check code storage location are both 0, so that the check code determined by using the last target data strip of the data to be encoded is the corresponding value of the data to be encoded. The final check code completes the encoding of the data to be encoded.
需要指出的是,RAID 5模式下的第一校验参数为1,通过第一参数模块和第一编码模块即可完成编码,得到对应的第一校验码。It should be pointed out that the first check parameter in the RAID 5 mode is 1, and the encoding can be completed through the first parameter module and the first encoding module to obtain the corresponding first check code.
在具体的实施方式中,所述第一参数模块具体用于:In a specific implementation manner, the first parameter module is specifically used for:
基于公式确定RAID 6模式下待编码数据的当前目标数据条带对应的第一校验参数;formula based Determine the first check parameter corresponding to the current target data stripe of the data to be encoded in the RAID 6 mode;
其中,αp为基于范德蒙式RS编码关系确定的所述第一校验码对应的编码系数值,αq为基于范德蒙式RS编码关系确定的第二校验码对应的编码系数值,αx为基于范德蒙式RS编码关系确定的当前目标数据条带对应的编码系数值,表示异或运算。Wherein, α p is the coding coefficient value corresponding to the first check code determined based on the Vandermonde RS coding relationship, α q is the coding coefficient value corresponding to the second check code determined based on the Vandermonde RS coding relationship, and α x is the coding coefficient value corresponding to the current target data strip determined based on the Vandermonde RS coding relationship, Indicates an XOR operation.
所述第二参数模块具体用于:The second parameter module is specifically used for:
基于公式确定RAID 6模式下待编码数据的当前目标数据条带对应的第二校验参数;formula based Determine the second check parameter corresponding to the current target data stripe of the data to be encoded in the RAID 6 mode;
其中,αp为基于范德蒙式RS编码关系确定的所述第一校验码对应的编码系数值,αq为基于范德蒙式RS编码关系确定的第二校验码对应的编码系数值,αx为基于范德蒙式RS编码关系确定的当前目标数据条带对应的编码系数值,表示异或运算。Wherein, α p is the coding coefficient value corresponding to the first check code determined based on the Vandermonde RS coding relationship, α q is the coding coefficient value corresponding to the second check code determined based on the Vandermonde RS coding relationship, and α x is the coding coefficient value corresponding to the current target data strip determined based on the Vandermonde RS coding relationship, Indicates an XOR operation.
下面介绍本申请提供的RAID编码电路的实现过程:Introduce the realization process of the RAID coding circuit that this application provides below:
需要指出的是,RAID 5的实现为:当需要实现RAID5的编码时,操作方式如图3所示,图3为本申请实施例公开的一种RAID 5编码电路编码示意图。1、待编码数据进入RAID5编码电路,RAID编码电路先将待编码数据分割为预设数量个数据条带,通过buffer或FIFO等方式暂存等待等待数据读取模块空闲时,数据读取模块将数据条带分别同时送往当前数据条带对应的数据存储位置以及编码模块。同一时间,从存储校验码p的位置读取现在所存的数据进入编码模块。2、数据条带与从存储校验码p的位置读取到的当前校验码进行在编码模块进行异或运算后,产生的新的校验码写入存储校验码p的位置,更新该位置的数据。It should be pointed out that the implementation of RAID 5 is: When the encoding of RAID5 needs to be implemented, the operation mode is shown in FIG. 3 . FIG. 3 is a schematic diagram of encoding of a RAID 5 encoding circuit disclosed in the embodiment of the present application. 1. The data to be encoded enters the RAID5 encoding circuit. The RAID encoding circuit first divides the data to be encoded into a preset number of data strips, and temporarily stores them through buffer or FIFO. When the data reading module is idle, the data reading module will The data stripes are respectively sent to the data storage location corresponding to the current data stripe and the encoding module at the same time. At the same time, read the currently stored data from the location where the check code p is stored and enter the encoding module. 2. The data strip and the current check code read from the location where the check code p is stored are performed after the encoding module performs an XOR operation, and the new check code generated is written into the location where the check code p is stored, and updated data for this location.
实现对硬件电路的复用,达到最小面积,最大的复用优化,因此对于RAID6时,需要设定同样的方式进行编码。Realize the multiplexing of hardware circuits, achieve the minimum area, and maximize multiplexing optimization. Therefore, for RAID6, it is necessary to set the same method for encoding.
RAID 6的关系可以表示为:The relationship of RAID 6 can be expressed as:
其中,公式(1)可以简单的通过对RAID 5的表达式扩充出第二个校验条带q即可。因此实现RAID 6的公式(1)的编码时,套用RAID 5的模块即可。可以使用两个编码模块并行操作,也可以和RAID 5一样只使用一个编码模块,分两拍分别运算p和q的值然后分别更新。因为RS RAID 6编码的公式(1)和RAID 5非常类似,可以将q考虑为和p相同的方式进行更新,因此套用同一个电路即可并行或串行实现p和q的计算及更新。例如,参见图4所示,图4为本申请实施例公开的一种RAID 6编码电路编码示意图,用于实现实现RAID 6的公式(1)的编码。1、待编码数据进入RAID6编码电路,RAID6编码电路先将待编码数据分割为预设数量个数据条带,通过buffer或FIFO等方式暂存等待等待数据读取模块空闲时,数据读取模块将数据条带分别同时送往当前数据条带对应的数据存储位置以及两个不同的编码模块。同一时间,从存储校验码p和q的位置读取现在所存的数据分别送入两个编码模块。2、数据条带与从存储校验码p的位置读取到的当前校验码p在相应的编码模块进行异或运算后,产生的新的校验码写入存储校验码p的位置,更新该位置的数据。数据条带与从存储校验码q的位置读取到的当前校验码q在相应的编码模块进行异或运算后,产生的新的校验码写入存储校验码q的位置,更新该位置的数据。Wherein, the formula (1) can simply expand the expression of RAID 5 to obtain the second parity strip q. Therefore, when implementing the coding of formula (1) of RAID 6, the module of RAID 5 can be applied. You can use two encoding modules to operate in parallel, or you can use only one encoding module like RAID 5, and calculate the values of p and q in two steps and then update them separately. Because the formula (1) of RS RAID 6 encoding is very similar to RAID 5, q can be considered to be updated in the same way as p, so the calculation and update of p and q can be realized in parallel or in series by applying the same circuit. For example, referring to FIG. 4 , FIG. 4 is a schematic diagram of encoding of a RAID 6 encoding circuit disclosed in an embodiment of the present application, and is used to implement encoding of Formula (1) for implementing RAID 6. 1. The data to be encoded enters the RAID6 encoding circuit. The RAID6 encoding circuit first divides the data to be encoded into a preset number of data strips, and temporarily stores them in buffer or FIFO. When the data reading module is idle, the data reading module will The data stripes are sent to the data storage location corresponding to the current data stripe and to two different encoding modules at the same time. At the same time, the currently stored data is read from the location where the check codes p and q are stored and sent to the two encoding modules respectively. 2. After the data strip and the current check code p read from the location where the check code p is stored are XORed in the corresponding encoding module, the new check code generated is written into the location where the check code p is stored , to update the data for that location. After the data strip and the current check code q read from the location where the check code q is stored are XORed in the corresponding encoding module, the new check code generated is written into the location where the check code q is stored, and updated data for this location.
而RS RAID 6的公式(2)和的RAID 5区别较大,因其相比RAID 5的异或运算,增加了不同的参数以及对应的乘法。为了设定同样的方式进行编码,实现电路复用,本实施例添加了参数模块,通过参数模块在进行异或运算前,使数据条带乘以参数,该参数能够同时满足RAID 6的公式(1)和(2)。使公式(2)可以基于更新的数据条带通过额外乘法运算以及异或运算完成p及q的计算更新。The formula (2) of RS RAID 6 is quite different from that of RAID 5, because compared with the XOR operation of RAID 5, different parameters and corresponding multiplications are added. In order to set the encoding in the same way and realize circuit multiplexing, a parameter module is added in this embodiment, and the data strip is multiplied by the parameter before performing the XOR operation through the parameter module, and the parameter can satisfy the formula of RAID 6 at the same time ( 1) and (2). The calculation and updating of p and q can be completed by formula (2) based on the updated data strips through additional multiplication operations and XOR operations.
设任一储存数据为dx,其对应的校验码为p和q。更新后的存储数据为dx',其对应的校验码为p'和q'。x为数据条带对应的编号。Let any stored data be d x , and its corresponding check codes be p and q. The updated stored data is d x ', and its corresponding check codes are p' and q'. x is the serial number corresponding to the data stripe.
通过RAID 6的公式(1)的编码关系可知,满足以下关系:According to the coding relationship of formula (1) of RAID 6, it can be seen that the following relationship is satisfied:
设dx-dx'=Δ,则可更新上式为: Let d x -d x '=Δ, then the above formula can be updated as:
设p和q对应的RS RAID 6的参数分别为αp,αq,则对上式分别乘以αp,αq可得到关系为:Assuming that the parameters of RS RAID 6 corresponding to p and q are α p , α q respectively, then multiply the above formula by α p , α q to obtain the relationship:
以及,基于αp,αq对应的RS RAID 6编码关系可得:And, based on the RS RAID 6 encoding relationship corresponding to α p , α q can be obtained:
(5)式中的αx指的是存储数据Δ对应的编码系数。α x in formula (5) refers to the encoding coefficient corresponding to the stored data Δ.
以求q'为例,使式(3)和(5)相加,此处的加指的就是伽罗华域中的加法,及时异或运算,可得:Take the calculation of q' as an example, add the formulas (3) and (5), the addition here refers to the addition in the Galois field, and perform XOR operation in time, we can get:
同理(3)和(4)相加可得p'的关系公式。Similarly, the relational formula of p' can be obtained by adding (3) and (4).
上式中如上面定义可知,p和q是原本存存储的检验码,Δ为对应的待存数据的增量,可以表示数据的变化,也可以表示新增数据。αp,αq和αx如上所述表示的是对应的编码系数,在RAID 6的公式(2)中αp,αq分别为αn+1,αn+2,αx为相应条带数据的系数值,比如α0,都是和数据具体值无关的确定参数,可以直接运算。In the above formula, as defined above, p and q are the original stored check codes, and Δ is the increment of the corresponding data to be stored, which can represent data changes or new data. α p , α q and α x represent the corresponding coding coefficients as mentioned above. In the formula (2) of RAID 6, α p , α q are α n+1 and α n+2 respectively, and α x is the corresponding The coefficient value with data, such as α 0 , is a definite parameter that has nothing to do with the specific value of the data, and can be directly calculated.
在具体的实施方式中,待编码数据的数据条带可视为Δ,αx为基于范德蒙式RS编码关系确定的当前目标数据条带对应的编码系数值。In a specific implementation manner, the data strip of the data to be encoded can be regarded as Δ, and α x is the coding coefficient value corresponding to the current target data strip determined based on the Vandermonde RS coding relationship.
由于和为确定参数,则通过以上运算转换,可知RS RAID 6的p和q的数据更新可以通过添加可参数计算然后利用图4中的电路实现。添加参数模块即可得到如图2的电路。because and In order to determine the parameters, through the above calculation conversion, it can be seen that the data update of p and q of RS RAID 6 can be realized by adding parameter calculations and then using the circuit in Figure 4. The circuit shown in Figure 2 can be obtained by adding the parameter module.
可见,本申请实施例公开的RAID编码电路,包括:第一参数模块,用于获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID 6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1;第一编码模块,用于对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。这样,只需要第一参数模块即可实现RAID 5向RAID 6的编码转换,能够在实现RAID 5的前提下,快速且以较低面积实现RAID 6。It can be seen that the RAID encoding circuit disclosed in the embodiment of the present application includes: a first parameter module, configured to obtain the first verification parameter corresponding to the current target data stripe of the data to be encoded in the current RAID mode, and use the first verification parameter The verification parameters and the current target data strip determine the data after the operation of the first parameter; wherein, the first verification parameter in RAID 6 mode is the encoding parameter corresponding to the first verification code determined based on the Vandermonde RS coding relationship, and the RAID 5 mode The first check parameter below is 1; the first encoding module is used to encode the current first check code read from the first check code storage location and the current first parameter operation data to obtain a new The first check code, and store the new first check code in the first check code storage location, until the last target data strip of the data to be encoded is determined based on the data to be encoded The final first checksum. In this way, only the first parameter module is needed to realize the code conversion from RAID 5 to RAID 6, and RAID 6 can be realized quickly and with a relatively small area under the premise of realizing RAID 5.
参见图5所示,本申请实施例公开了一种RAID编码方法,包括:Referring to Fig. 5, the embodiment of the present application discloses a RAID encoding method, including:
步骤S11:获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1;Step S11: Obtain the first verification parameter corresponding to the current target data stripe of the data to be encoded in the current RAID mode, and use the first verification parameter and the current target data stripe to determine the data after the first parameter operation; wherein, The first check parameter under the RAID6 mode is the encoding parameter corresponding to the first check code determined based on the Vandermonde RS encoding relationship, and the first check parameter under the RAID 5 mode is 1;
步骤S12:对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。Step S12: Perform encoding operation on the current first check code read from the first check code storage location and the current first parameter operation data to obtain a new first check code, and convert the new first check code The code is stored in the first check code storage location until the final first check code corresponding to the data to be encoded is determined based on the last target data strip of the data to be encoded.
在具体的实施方式中,可以将所述待编码数据分割为预设数量个数据条带;将每个数据条带转换为伽罗华域数据,得到每个数据条带对应的目标数据条带。In a specific implementation, the data to be encoded can be divided into a preset number of data strips; each data strip is converted into Galois field data, and the target data strip corresponding to each data strip is obtained .
相应的,所述对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,包括:Correspondingly, the encoding operation of the current first check code read from the first check code storage location and the current first parameter operation data to obtain a new first check code includes:
对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行异或运算,得到新的第一校验码。An XOR operation is performed on the current first check code read from the storage location of the first check code and the current first parameter operation data to obtain a new first check code.
在一种具体的实施方式中,可以:In a specific implementation mode, it is possible to:
通过第一参数模块获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID 6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1;Obtaining the first verification parameter corresponding to the current target data strip of the data to be encoded in the current RAID mode through the first parameter module, and using the first verification parameter and the current target data strip to determine the data after the first parameter operation; Wherein, the first check parameter in the RAID 6 mode is the encoding parameter corresponding to the first check code determined based on the Vandermonde RS encoding relationship, and the first check parameter in the RAID 5 mode is 1;
通过第一编码模块对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。Through the first encoding module, the current first check code read from the first check code storage location and the current first parameter operation data are encoded to obtain a new first check code, and the new first check code The check code is stored in the first check code storage location until the final first check code corresponding to the data to be encoded is determined based on the last target data strip of the data to be encoded.
通过第二参数模块获取RAID 6模式下待编码数据的当前目标数据条带对应的第二校验参数,并利用所述第二校验参数和当前目标数据条带确定第二参数运算后数据;其中,RAID 6对应的第二校验参数为基于范德蒙式RS编码关系确定的第二校验码对应的编码参数;Obtaining the second verification parameter corresponding to the current target data strip of the data to be encoded in RAID 6 mode through the second parameter module, and using the second verification parameter and the current target data strip to determine the second parameter operation data; Wherein, the second check parameter corresponding to RAID 6 is the encoding parameter corresponding to the second check code determined based on the Vandermonde RS encoding relationship;
通过第二编码模块对从第二校验码存储位置读取的当前第二校验码以及当前第二参数运算后数据进行编码运算,得到新的第二校验码,并将新的第二校验码存储至所述第二校验码存储位置。Through the second encoding module, the current second check code read from the second check code storage location and the current second parameter operation data are encoded to obtain a new second check code, and the new second check code The check code is stored in the second check code storage location.
在另一种具体的实施方式中,可以In another specific embodiment, it can be
通过第一参数模块获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID 6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1;Obtaining the first verification parameter corresponding to the current target data strip of the data to be encoded in the current RAID mode through the first parameter module, and using the first verification parameter and the current target data strip to determine the data after the first parameter operation; Wherein, the first check parameter in the RAID 6 mode is the encoding parameter corresponding to the first check code determined based on the Vandermonde RS encoding relationship, and the first check parameter in the RAID 5 mode is 1;
通过第一编码模块对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。Through the first encoding module, the current first check code read from the first check code storage location and the current first parameter operation data are encoded to obtain a new first check code, and the new first check code The check code is stored in the first check code storage location until the final first check code corresponding to the data to be encoded is determined based on the last target data strip of the data to be encoded.
通过第一参数模块获取RAID 6下待编码数据的当前目标数据条带对应的第二校验参数,并利用所述第二校验参数和当前目标数据条带确定第二参数运算后数据;其中,RAID 6对应的第二校验参数为基于范德蒙式RS编码关系确定的第二校验码对应的编码参数;Obtain the second verification parameter corresponding to the current target data stripe of the data to be encoded under RAID 6 through the first parameter module, and use the second verification parameter and the current target data stripe to determine the second parameter operation data; wherein , the second check parameter corresponding to RAID 6 is the encoding parameter corresponding to the second check code determined based on the Vandermonde RS encoding relationship;
相应的,通过第一编码模块对从第二校验码存储位置读取的当前第二校验码以及当前第二参数运算后数据进行编码运算,得到新的第二校验码,并将新的第二校验码存储至所述第二校验码存储位置。Correspondingly, the current second check code read from the second check code storage location and the current second parameter operation data are encoded and operated by the first encoding module to obtain a new second check code, and the new The second check code is stored in the second check code storage location.
并且,在具体的实施方式中,可以将所述待编码数据的目标数据条带存入缓存;从所述缓存中读取所述目标数据条带,同时分别传输至所述目标数据条带对应的数据存储位置以及所述第一参数模块。Moreover, in a specific implementation manner, the target data strips of the data to be encoded may be stored in a cache; the target data strips are read from the cache, and simultaneously transmitted to the corresponding The data storage location and the first parameter module.
并且,在具体的实施方式中,可以基于公式确定RAID 6模式下待编码数据的当前目标数据条带对应的第一校验参数;And, in a specific embodiment, it can be based on the formula Determine the first check parameter corresponding to the current target data stripe of the data to be encoded in the RAID 6 mode;
其中,αp为基于范德蒙式RS编码关系确定的所述第一校验码对应的编码系数值,αq为基于范德蒙式RS编码关系确定的第二校验码对应的编码系数值,αx为基于范德蒙式RS编码关系确定的当前目标数据条带对应的编码系数值,表示异或运算。Wherein, α p is the coding coefficient value corresponding to the first check code determined based on the Vandermonde RS coding relationship, α q is the coding coefficient value corresponding to the second check code determined based on the Vandermonde RS coding relationship, and α x is the coding coefficient value corresponding to the current target data strip determined based on the Vandermonde RS coding relationship, Indicates an XOR operation.
基于公式确定RAID 6模式下待编码数据的当前目标数据条带对应的第二校验参数;formula based Determine the second check parameter corresponding to the current target data stripe of the data to be encoded in the RAID 6 mode;
其中,αp为基于范德蒙式RS编码关系确定的所述第一校验码对应的编码系数值,αq为基于范德蒙式RS编码关系确定的第二校验码对应的编码系数值,αx为基于范德蒙式RS编码关系确定的当前目标数据条带对应的编码系数值,表示异或运算。Wherein, α p is the coding coefficient value corresponding to the first check code determined based on the Vandermonde RS coding relationship, α q is the coding coefficient value corresponding to the second check code determined based on the Vandermonde RS coding relationship, and α x is the coding coefficient value corresponding to the current target data strip determined based on the Vandermonde RS coding relationship, Indicates an XOR operation.
可见,本申请获取当前RAID模式下待编码数据的当前目标数据条带对应的第一校验参数,并利用所述第一校验参数和当前目标数据条带确定第一参数运算后数据;其中,RAID 6模式下的第一校验参数为基于范德蒙式RS编码关系确定的第一校验码对应的编码参数,RAID 5模式下的第一校验参数为1;对从第一校验码存储位置读取的当前第一校验码以及当前第一参数运算后数据进行编码运算,得到新的第一校验码,并将新的第一校验码存储至所述第一校验码存储位置,直到基于所述待编码数据的最后一个目标数据条带确定出所述待编码数据对应的最终的第一校验码。这样,只需要更换第一校验码参数即可实现RAID 5向RAID 6的编码转换,能够在实现RAID 5的前提下,快速且以较低面积实现RAID 6。It can be seen that the present application obtains the first verification parameter corresponding to the current target data stripe of the data to be encoded in the current RAID mode, and uses the first verification parameter and the current target data stripe to determine the data after the first parameter operation; wherein , the first check parameter in RAID 6 mode is the encoding parameter corresponding to the first check code determined based on the Vandermonde RS coding relationship, and the first check parameter in RAID 5 mode is 1; The current first check code read from the storage location and the data after the current first parameter operation are encoded and operated to obtain a new first check code, and the new first check code is stored in the first check code The location is stored until the final first check code corresponding to the data to be encoded is determined based on the last target data strip of the data to be encoded. In this way, the code conversion from RAID 5 to RAID 6 can be realized only by changing the first check code parameter, and RAID 6 can be realized quickly and with a relatively small area under the premise of realizing RAID 5.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的方法而言,由于其与实施例公开的电路相对应,所以描述的比较简单,相关之处参见电路部分说明即可。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 method disclosed in the embodiment, since it corresponds to the circuit disclosed in the embodiment, the description is relatively simple, and for related parts, please refer to the description of the circuit part.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
以上对本申请所提供的一种RAID编码电路及编码方法进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A kind of RAID encoding circuit and encoding method provided by the application has been introduced in detail above, and specific examples have been used in this paper to illustrate the principle and implementation of the application. The description of the above embodiments is only used to help understand the application. method and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation and application scope. Application Restrictions.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110551258.0A CN113297000B (en) | 2021-05-20 | 2021-05-20 | A kind of RAID encoding circuit and encoding method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110551258.0A CN113297000B (en) | 2021-05-20 | 2021-05-20 | A kind of RAID encoding circuit and encoding method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113297000A CN113297000A (en) | 2021-08-24 |
CN113297000B true CN113297000B (en) | 2022-12-23 |
Family
ID=77323110
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110551258.0A Active CN113297000B (en) | 2021-05-20 | 2021-05-20 | A kind of RAID encoding circuit and encoding method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113297000B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114138543A (en) * | 2021-11-30 | 2022-03-04 | 深信服科技股份有限公司 | Data strip coding method, system, device and medium |
CN113986147A (en) * | 2021-12-24 | 2022-01-28 | 苏州浪潮智能科技有限公司 | RAID6 hardware acceleration circuit structure and RAID6 hardware acceleration implementation method |
CN114442950B (en) * | 2022-01-21 | 2024-01-23 | 山东云海国创云计算装备产业创新中心有限公司 | Data recovery method, system, device and computer readable storage medium |
CN114895842B (en) * | 2022-03-29 | 2025-07-22 | 山东云海国创云计算装备产业创新中心有限公司 | TP-RAID encoding and decoding method, system, equipment and storage medium |
CN114416424B (en) * | 2022-03-30 | 2022-06-17 | 苏州浪潮智能科技有限公司 | A RAID encoding and decoding method, device, device and readable storage medium |
CN114415982B (en) * | 2022-03-30 | 2022-06-07 | 苏州浪潮智能科技有限公司 | Data storage method, device and equipment and readable storage medium |
CN115167787B (en) * | 2022-09-06 | 2023-01-24 | 苏州浪潮智能科技有限公司 | A data transfer method, system, device and computer-readable storage medium |
CN116028260B (en) * | 2023-01-09 | 2024-02-27 | 海光信息技术股份有限公司 | Data processing method, processing device and storage system |
CN116312726B (en) * | 2023-05-16 | 2023-08-15 | 苏州浪潮智能科技有限公司 | Data storage method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103577274A (en) * | 2012-07-31 | 2014-02-12 | 国际商业机器公司 | Management method and device of memory array |
CN106227463A (en) * | 2016-07-11 | 2016-12-14 | 苏州科达科技股份有限公司 | RAID model, reading and writing data and method for reconstructing thereof |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101848055A (en) * | 2009-03-23 | 2010-09-29 | 华为技术有限公司 | Method and device for correcting data |
CN102023820B (en) * | 2010-12-01 | 2012-08-22 | 北京同有飞骥科技股份有限公司 | Method for constructing double-disk fault-tolerant vertical packet parallel access disk array |
CN105335150B (en) * | 2014-08-13 | 2019-03-19 | 苏宁易购集团股份有限公司 | The quick decoding method and system of correcting and eleting codes data |
CN107391046B (en) * | 2017-08-02 | 2021-04-20 | 郑州云海信息技术有限公司 | Method and device for writing data in a RAID system |
US11132258B2 (en) * | 2019-01-31 | 2021-09-28 | EMC IP Holding Company, LLC | In-place RAID conversion system and method |
-
2021
- 2021-05-20 CN CN202110551258.0A patent/CN113297000B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103577274A (en) * | 2012-07-31 | 2014-02-12 | 国际商业机器公司 | Management method and device of memory array |
CN106227463A (en) * | 2016-07-11 | 2016-12-14 | 苏州科达科技股份有限公司 | RAID model, reading and writing data and method for reconstructing thereof |
Also Published As
Publication number | Publication date |
---|---|
CN113297000A (en) | 2021-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113297000B (en) | A kind of RAID encoding circuit and encoding method | |
CN113296999B (en) | A RAID6 encoding method and encoding circuit | |
CN113297001B (en) | RAID (redundant array of independent disks) coding and decoding method and coding and decoding circuit | |
CN103688514B (en) | A kind of minimum memory regenerates the coding and memory node restorative procedure of code | |
CN107086870B (en) | MDS array code encoding and decoding method for repairing multi-node failure | |
KR20190008335A (en) | Method and apparatus for encoding and decoding structured LDPC | |
CN105518996B (en) | A kind of data decoding method based on binary field reed-solomon code | |
CN113687975B (en) | Data processing method, device, equipment and storage medium | |
CN114465627B (en) | A data storage method, system, device and storage medium | |
CN103746774A (en) | Error resilient coding method for high-efficiency data reading | |
CN110401489B (en) | Optical fiber signal generation method, device and system | |
CN114895842A (en) | A TP-RAID encoding and decoding method, system, device and storage medium | |
CN112468161B (en) | RS high-speed coding circuit | |
CN107153661A (en) | A kind of storage, read method and its device of the data based on HDFS systems | |
CN113986147A (en) | RAID6 hardware acceleration circuit structure and RAID6 hardware acceleration implementation method | |
WO2017041232A1 (en) | Encoding and decoding framework for binary cyclic code | |
CN116312726B (en) | Data storage method and device, electronic equipment and storage medium | |
CN100417031C (en) | Method of realizing Reed Solomen convolution code in broadband radio insertion system | |
CN112364985A (en) | Convolution optimization method based on distributed coding | |
CN115811318B (en) | Polar code encoding method, device, communication equipment and storage medium | |
CN109245775B (en) | Decoder and method for realizing decoding | |
US10171109B2 (en) | Fast encoding method and device for Reed-Solomon codes with a small number of redundancies | |
CN108347250B (en) | Fast coding method and apparatus suitable for small amount of redundant Reed-Solomon codes | |
CN115793984A (en) | Data storage method and device, computer equipment and storage medium | |
CN108566210A (en) | The LDPC coded systems and method, LDPC encoder of compatible IEEE802.11n standards |
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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240703 Address after: 2324, Building 1, Aosheng Building, No. 1166 Xinluo Street, High tech Zone, Jinan City, Shandong Province, 250000 Patentee after: Inspur Computer Technology Co.,Ltd. Country or region after: China Address before: 35th floor, S01 building, Inspur science and Technology Park, 1036 Inspur Road, Jinan area, Jinan pilot Free Trade Zone, Jinan City, Shandong Province Patentee before: Shandong Yunhai guochuang cloud computing equipment industry innovation center Co.,Ltd. Country or region before: China |