WO2019214265A1 - Method and apparatus for calculating cyclic redundancy check (crc) code - Google Patents

Method and apparatus for calculating cyclic redundancy check (crc) code Download PDF

Info

Publication number
WO2019214265A1
WO2019214265A1 PCT/CN2018/125871 CN2018125871W WO2019214265A1 WO 2019214265 A1 WO2019214265 A1 WO 2019214265A1 CN 2018125871 W CN2018125871 W CN 2018125871W WO 2019214265 A1 WO2019214265 A1 WO 2019214265A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data segment
bit
segment
highest
Prior art date
Application number
PCT/CN2018/125871
Other languages
French (fr)
Chinese (zh)
Inventor
林宪正
张进毅
王工艺
沈建强
Original Assignee
华为技术有限公司
中国科学技术大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司, 中国科学技术大学 filed Critical 华为技术有限公司
Publication of WO2019214265A1 publication Critical patent/WO2019214265A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, 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/03Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words
    • H03M13/05Error 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/09Error detection only, e.g. using cyclic redundancy check [CRC] codes or single parity bit

Definitions

  • C(x) a L-1 x ⁇ (L-1)+a L-2 x ⁇ (L-2)+a L-3 x ⁇ (L-3)+...+a 0 .
  • a l-1 is the Most Significant Bit (MSB) of the information sequence
  • a 0 is the Least Significant Bit (LSB) of the information sequence
  • x ⁇ (L-1) is the L-1 of X.
  • the first source polynomial is the least number of valid items in the multiple of the second native polynomial
  • the shift operation and the exclusive-OR operation can be further reduced by using a multiple of the number of valid items.
  • the processing the second data based on the one or more first source polynomials Three data including:
  • Step 4 replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  • This implementation can reduce the number of data segments for shifting and XOR operations, thereby improving the efficiency and performance of computational data CRC encoding.
  • the fourth data is processed based on Q2(x) to obtain the third data, including:
  • Step 22 Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
  • Step 24 Perform a shift operation on the high (M-K) bit of the fifth data segment based on the Q (2x) to obtain a seventh data segment;
  • the method further includes reading the first data and the N-bit CRC code, calculating an N-bit CRC code of the first data, and comparing whether the calculated N-bit CRC code and the read N are compared.
  • the bit CRC code is consistent to determine whether the first data has an error during the storage process.
  • a third aspect of the embodiments of the present invention provides an apparatus for calculating a cyclic redundancy check CRC code, including an interface and a processor, where the interface is in communication with a processor, and the processor is configured to perform various possible aspects of the first aspect of the embodiments of the present invention. Method to realize.
  • FIG. 9 is a schematic flowchart of CRC coding according to an embodiment of the present invention.
  • the storage system in the embodiment of the present invention may be a storage array (such as of series, series).
  • the storage array includes a storage controller 201 and a plurality of hard disks, wherein the hard disks include solid state disks (SSDs), disks, or hybrid hard disks.
  • the controller 201 includes a central processing unit (CPU) 301, a memory 302 and an interface 303.
  • the memory 302 stores computer instructions, and the CPU 301 executes computer instructions in the memory 302 to manage and store the storage system. Access operation.
  • a Field Programmable Gate Array or other hardware may perform the above-mentioned corresponding operations instead of the CPU 501, or the FPGA or other hardware may perform the above-mentioned corresponding operations together with the CPU 501.
  • the embodiment of the present invention collectively refers to the combination of CPU 501 and memory 502, FPGA and other hardware or FPGA replacing CPU 501 and other hardware replacing CPU 501 and CPU 501 as a processor.
  • the interface 303 can be a Network Interface Card (NIC), a Host Bus Adaptor (HBA), an antenna, or the like.
  • the embodiment of the present invention can also be applied to a data transmission scenario.
  • a computer network or various communication networks use data according to an embodiment of the present invention.
  • a method of calculating the CRC encoding of the data provided.
  • a computer acquires data, such as data generated by an application on a computer, and calculates a CRC code of the data.
  • the embodiment of the present invention is based on obtaining a check code by using C(x)*X ⁇ N and a generator polynomial G(x), that is, a remainder obtained by dividing C(x)*X ⁇ N by G(x) as an N-bit CRC code.
  • G(x) generator polynomial
  • any one of the data consisting of binary bit strings can be in one-to-one correspondence with a polynomial whose coefficients are only '0' and '1'.
  • the item with a coefficient of 1 is called a valid item.
  • the third step setting the value of the i-th bit and the j-th bit of the information sequence C(x) to 1.
  • Step 602 Divide the new information sequence from the highest bit of the new information sequence into a data segment of length 369 bits.
  • the first data segment starts shifting to the left according to the next highest index of the octave.
  • the new sequence of information generated in step 605 is executed in steps 602-605, and is cycled until the final length of the new information sequence obtained according to step 605 is 394 bits, that is, the length of the new information sequence is less than 2*369.
  • step 605 when the length of the new information sequence is greater than 2*369, step 602 is performed; when the length of the new information sequence is less than 2*369, step 606 is performed.
  • Step 804 The lower 369 bits of the XOR result of the 1st data segment shifted to the left by 31 bits and the left shift of 0 bits are XORed with the 2nd data segment.
  • the XOR of the first data segment of the left shift of 31 bits and the left shift of 0 bits has a total of 400 bits, and the left side of the XOR of the first data segment of the left shift of 31 bits and the left shift of 0 bits is defined as a high bit (conversely defined as Low), for example, the first 31 bits from the left are called the high 31 bits, and the 369 bits from the right are called the lower 369 bits.
  • Step 903 XOR the first data segment and the second data segment.
  • the above embodiments are applied to a storage system, which stores CRC codes of data, stores CRC codes of data and data, and ensures accuracy and consistency of data storage.
  • the storage system reads the data
  • the CRC code of the data is simultaneously read
  • the storage system calculates the CRC code of the read data, and compares whether the CRC code of the read data is the same as the CRC code calculated by the read data. If they are the same, it means that the data did not have an error during the storage process; if it is not the same, it indicates that the data has an error during the storage process.
  • Step 5 XOR the fourth data segment and the fifth data segment to obtain a sixth data segment
  • processing unit 113 is specifically configured to perform the following steps:
  • Step 24 Perform a shift operation on the high (M-K) bit of the fifth data segment based on the Q (2x) to obtain a seventh data segment;
  • Dividing the third data by the second source polynomial yields an N-bit remainder as the N-bit CRC encoding of the first data.
  • the storage unit is further configured to store the source polynomial and the multiple.
  • the above-mentioned units are respectively used to implement the corresponding implementations of the embodiments of the embodiments of the present invention.
  • the specific implementations of the various units may be the device structure of the embodiment of the present invention, or may be a software module, which may be run on a server, thereby enabling the device to complete the present invention.
  • the various units may also be hardware devices, for example each unit may be implemented as a processor or interface. For the implementation of the foregoing device, including the various unit implementations, reference may be made to the foregoing method embodiments, and details are not described herein.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.

Landscapes

  • Physics & Mathematics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Error Detection And Correction (AREA)
  • Detection And Correction Of Errors (AREA)

Abstract

A solution for calculating a cyclic redundancy check (CRC) code. In the solution, an information sequence is processed based on multiples of a source polynomial, and a CRC code is calculated from the processed information sequence based on the source polynomial.

Description

计算循环冗余校验CRC编码的方法及装置Method and device for calculating cyclic redundancy check CRC coding 技术领域Technical field
本发明涉及信息技术领域,更具体地,涉及一种计算循环冗余校验CRC编码的方法及装置。The present invention relates to the field of information technology, and in particular, to a method and apparatus for calculating a cyclic redundancy check CRC coding.
背景技术Background technique
在存储系统中,循环冗余校验(Cyclic Redundancy Check,CRC)编码是一种循环码,在存储系统中的CRC编码通常使用基于伽罗华域GF(2)的本源多项式设计CRC编码方案。CRC编码原理:假设一个L比特的信息序列(信息取值为0或1),aL-1,aL-2,…,a0,其中信息序列可以为待处理的数据,比如待存储或发送的数据,L-比特的信息序列表示成一个多项式:In the storage system, Cyclic Redundancy Check (CRC) coding is a cyclic code. The CRC coding in the storage system usually uses a native polynomial based on the Galois field GF(2) to design a CRC coding scheme. CRC coding principle: Assume an L-bit information sequence (information value is 0 or 1), aL-1, aL-2, ..., a0, where the information sequence can be data to be processed, such as data to be stored or transmitted. The L-bit information sequence is represented as a polynomial:
C(x)=a L-1x^(L-1)+a L-2x^(L-2)+a L-3x^(L-3)+…+a 0。其中a l-1是信息序列的最高有效位(Most Significant Bit,MSB),a 0是信息序列的最低有效位(Least Significant Bit,LSB),x^(L-1)表示X的L-1次幂或X的L-1次方。 C(x)=a L-1 x^(L-1)+a L-2 x^(L-2)+a L-3 x^(L-3)+...+a 0 . Where a l-1 is the Most Significant Bit (MSB) of the information sequence, a 0 is the Least Significant Bit (LSB) of the information sequence, and x^(L-1) is the L-1 of X. The power or the L-1 power of X.
另外,m阶本原多项式G(m)为:In addition, the m-th order primitive polynomial G(m) is:
G(x)=g mx^m+g m-1x^(m-1)+g m-2x^(m-2)+…+g 0 G(x)=g m x^m+g m-1 x^(m-1)+g m-2 x^(m-2)+...+g 0
则,then,
计算C(x)的编码可以表示为:CRC(C(x))=C(x)*x^m mod G(x)The code for calculating C(x) can be expressed as: CRC(C(x))=C(x)*x^m mod G(x)
从上面的式子可以看出,CRC编码表示的是C(x)*x^m除以另一个固定的数G(x)之后的余数,其中“*”表示数学运算符号中的“乘”。As can be seen from the above equation, the CRC code represents the remainder after C(x)*x^m divided by another fixed number G(x), where "*" represents the "multiplication" in the mathematical operation symbol. .
在存储系统中,为了对有效数据进行检错,存储系统会对数据进行CRC编码,从而数据在存储或传输过程中发生错误后,存储系统能快速的进行数据一致性校验,因此CRC编码是存储系统中的常用特性。In the storage system, in order to perform error detection on valid data, the storage system CRC-encodes the data, so that after the data is stored or transmitted, the storage system can quickly perform data consistency check, so the CRC code is Common features in storage systems.
现有技术中采用流水线(pipeline)的方式结合查表法对数据进行CRC编码,如图1所示:In the prior art, a pipeline is used in combination with a table lookup method to CRC code data, as shown in FIG. 1:
a)把数据分成若干个段(segment),如segment0至SegmentN,其中N为不小于1的自然数。a) Divide the data into segments, such as segment0 to SegmentN, where N is a natural number not less than one.
b)对每个段单独进行CRC编码,分别得到crc0至crcN。b) Perform CRC encoding on each segment separately, and get crc0 to crcN respectively.
c)将每个段编码得到的crc和特定的常量系数(Constant)进行无进位乘法(Carry-lessMultiplication,CLMUL)。如将crc0与Constant0进行CLMUL,将crc1与Constant1进行CLMUL,……,将crcN与ConstantN进行CLMUL。c) Perform the carry-less multiplication (CLMUL) of the crc obtained by encoding each segment and the specific constant coefficient (Constant). For example, CrcUL is performed by crc0 and Constant0, CLMUL is performed by crc1 and Constant1, and CLMUL is performed by crcN and ConstantN.
d)将每个段的CLMUL结果进行CRC编码,分别得到C0,C1,C2,……,CN。d) CRC coding the CLMUL results of each segment to obtain C0, C1, C2, ..., CN, respectively.
e)将C0,C1,C2,……,CN进行异或(Exclusive OR,XOR),得到最终的CRC编码CRCF。e) Exclusive OR (XOR) of C0, C1, C2, ..., CN to obtain the final CRC coded CRCF.
然而,现有技术CRC编码方式的步骤b和d中的CRC编码操作需要大量的移位和异或运 行,增加了计算的复杂度,需要消耗大量的计算资源,从而影响了CRC编码的效率与性能。However, the CRC encoding operation in steps b and d of the prior art CRC encoding method requires a large amount of shift and XOR operation, which increases the computational complexity and consumes a large amount of computing resources, thereby affecting the efficiency of CRC encoding. performance.
发明内容Summary of the invention
本发明实施例第一方面,提供了计算循环冗余校验CRC编码的方案,包括:获取第一数据;将第一数据左移N位得到第二数据,其中N为循环冗余校验CRC编码位数;基于一个或多个第一本源多项式处理第二数据得到第三数据;其中所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X与有效的次最高项的指数Y之差大于1;第三数据的长度小于所述第二数据的长度;X与Y为正整数,X大于Y;基于第二本源多项式处理第三数据得到第一数据的N位CRC编码;其中,所述一个或多个第一本源多项式中的每一个是所述第二本源多项式的倍式,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X大于所述第二本源多项式的有效的最高项的指数R。具体实现,可以由存储阵列的控制器、服务器等设备执行上述方案,设备中存储第一本源多项式和第二本源多项式。该方案减少移位和异或运算操作,提高了计算CRC编码的效率和性能。A first aspect of the embodiments of the present invention provides a solution for calculating a cyclic redundancy check CRC coding, including: acquiring first data; shifting the first data to the left by N bits to obtain second data, where N is a cyclic redundancy check CRC. a number of coded bits; processing the second data based on the one or more first source polynomials to obtain third data; wherein an exponent X of the highest term of each of the one or more first source polynomials valid for the first source polynomial is valid The difference between the index Y of the next highest item is greater than 1; the length of the third data is less than the length of the second data; X and Y are positive integers, and X is greater than Y; processing the third data based on the second source polynomial to obtain the first data N-bit CRC code; wherein each of the one or more first source polynomials is a multiple of the second source polynomial, each of the one or more first source polynomials The exponent X of the highest term of the polynomial effective is greater than the exponent R of the highest highest term of the second native polynomial. Specifically, the foregoing solution may be implemented by a controller, a server, or the like of the storage array, where the first source polynomial and the second source polynomial are stored. This scheme reduces the shift and XOR operation and improves the efficiency and performance of calculating CRC coding.
结合第一方面,在第一种可能的实现方式中,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的项数小于所述第二本源多项式有效的项数,从而减少了移位操作和异或操作。With reference to the first aspect, in a first possible implementation, the number of items that are valid for each of the one or more first source polynomials is less than the number of items that are valid by the second source polynomial, thereby Reduced shift operations and XOR operations.
结合第一方面或第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述第一本源多项式为所述第二本源多项式的倍式中有效的项数最少的倍式,使用有效项数最少的倍式,可以进一步减少移位操作和异或操作。With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation, the first source polynomial is the least number of valid items in the multiple of the second native polynomial In the doubling mode, the shift operation and the exclusive-OR operation can be further reduced by using a multiple of the number of valid items.
结合第一方面或第一方面的第一种或第二种可能的实现方式,在第三种可能的实现方式中,所述基于一个或多个第一本源多项式处理所述第二数据得到第三数据,包括:With reference to the first aspect or the first or second possible implementation of the first aspect, in a third possible implementation, the processing the second data based on the one or more first source polynomials Three data, including:
步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the second one obtained by dividing the X-bit size from the highest bit in step 1. Data segment
步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于2*X位,其中“*”表示乘。该实现方式可以减少进行移位和异或操作的数据段的数量,从而提高计算数据CRC编码的效率与性能。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2*X bits, where "*" indicates multiplication. This implementation can reduce the number of data segments for shifting and XOR operations, thereby improving the efficiency and performance of computational data CRC encoding.
结合第一方面或第一方面的第一种或第二种可能的实现方式,在第四种可能的实现方式中,所述基于一个或多个第一本源多项式处理所述第二数据得到第三数据,包括:With reference to the first aspect or the first or second possible implementation of the first aspect, in a fourth possible implementation, the processing the second data based on the one or more first source polynomials Three data, including:
步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;其中,所述第三数据段的长度为M位;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is a first data segment obtained from the highest bit of the second data in the step 1; wherein the length of the third data segment is M bits;
步骤3:将所述第三数据段的低X位与第二数据段进行异或操作得到第四数据段;所 述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XORing the lower X bits of the third data segment with the second data segment to obtain a fourth data segment; the second data segment is divided into X bits according to the highest bit in step 1. The second data segment obtained;
步骤4:将所述第三数据段的高(M-X)位基于所述Q(x)进行移位操作得到第五数据段;Step 4: Perform a shift operation on the high (M-X) bit of the third data segment based on the Q(x) to obtain a fifth data segment;
步骤5:将所述第四数据段与所述第五数据段进行异或得到第六数据段;Step 5: XOR the fourth data segment and the fifth data segment to obtain a sixth data segment;
步骤6:将所述第六数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至6,直到所述第二数据的长度小于2*X位,其中“*”表示乘。该实现方式可以减少进行移位和异或操作的数据段的数量,从而提高计算数据CRC编码的效率与性能。Step 6: replacing the first data segment and the second data segment of the second data in step 1 with the sixth data segment to form the second data, and performing steps 1 to 6 until The length of the second data is less than 2*X bits, where "*" indicates multiplication. This implementation can reduce the number of data segments for shifting and XOR operations, thereby improving the efficiency and performance of computational data CRC encoding.
结合第一方面或第一方面的第一种或第二种可能的实现方式,在第五种可能的实现方式中,所述一个或多个第一本源多项式包括第一本源多项式Q1(x)和Q2(x),其中,Q1(x)有效的最高项的指数大于Q2(x)有效的最高项的指数;所述基于一个或多个第一本源多项式处理所述第二数据得到第三数据,包括:In conjunction with the first aspect or the first or second possible implementation of the first aspect, in a fifth possible implementation, the one or more first source polynomials comprise a first native polynomial Q1(x) And Q2(x), wherein an index of a highest item valid for Q1(x) is greater than an index of a highest item valid for Q2(x); said processing the second data based on one or more first source polynomials to obtain a third Data, including:
将所述第二数据基于Q1(x)进行处理得到第四数据;Processing the second data based on Q1(x) to obtain fourth data;
将所述第四数据基于Q2(x)进行处理得到所述第三数据。该实现方式可以进一步减少进行移位和异或操作的数据段的数量,从而提高计算数据CRC编码的效率与性能。The fourth data is processed based on Q2(x) to obtain the third data. This implementation can further reduce the number of data segments for shifting and XOR operations, thereby improving the efficiency and performance of computational data CRC encoding.
结合第一方面的第五种可能的实现方式,在第六种可能的实现方式中,将所述第二数据基于Q1(x)进行处理得到第四数据,包括:With reference to the fifth possible implementation manner of the first aspect, in a sixth possible implementation, the processing, by using the second data, to obtain the fourth data, based on Q1(x), includes:
步骤1:将所述第二数据从最高位开始以Q1(x)有效的最高项的指数位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the exponent bit size of the highest item valid by Q1(x);
步骤2:将所述第二数据的第一数据段基于所述Q1(x)进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the Q1 (x), and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以Q1(x)有效的最高项的指数位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the highest item in the step 1 that is valid from the highest bit and is valid with Q1(x) The second data segment obtained by dividing the index bit size;
步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于Q1(x)有效的最高项的指数位2倍的长度。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2 times the exponent bit of the highest term in which Q1(x) is valid.
结合第一方面的第五种或第六种可能的实现方式,在第七种可能的实现方式中,将所述第四数据基于Q2(x)进行处理得到所述第三数据,包括:With reference to the fifth or sixth possible implementation of the first aspect, in a seventh possible implementation, the fourth data is processed based on Q2(x) to obtain the third data, including:
步骤21:将所述第四数据从最高位开始以Q2(x)有效的最高项的指数位大小划分数据段;Step 21: Divide the fourth data from the highest bit to divide the data segment by the exponent bit size of the highest item valid by Q2(x);
步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
步骤23:将所述第五数据段与所述第四数据的第二数据段进行异或操作得到第六数据段;所述第四数据的所述第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;Step 23: XORing the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is from the The second data segment obtained by dividing the highest bit of the fourth data;
步骤24:将所述第六数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤21至24,直到所述第四数据的长度小于Q2(x)有效 的最高项的指数位2倍的长度。Step 24: replacing the first data segment and the second data segment of the fourth data in step 21 with the sixth data segment to form the fourth data, and performing steps 21 to 24 until the fourth data The length is less than 2 times the length of the exponent bit of the highest term valid for Q2(x).
结合第一方面的第五种或第六种可能的实现方式,在第八种可能的实现方式中,将所述第四数据基于Q2(x)进行处理得到所述第三数据,包括:With reference to the fifth or the sixth possible implementation of the first aspect, in an eighth possible implementation, the fourth data is processed based on Q2(x) to obtain the third data, including:
步骤21:将所述第四数据从最高位开始以K位大小划分数据段;其中K表示Q2(x)有效的最高项的指数;Step 21: Divide the fourth data from the highest bit to divide the data segment by the K bit size; wherein K represents an index of the highest item valid for Q2(x);
步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
步骤23:将所述第五数据段的低R位与所述第四数据的第二数据段进行异或得到第六数据段;所述第四数据的第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;所述第五数据段的长度为M位;Step 23: XOR the lower R bit of the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is the a second data segment obtained by dividing a highest bit of the fourth data; the length of the fifth data segment is M bits;
步骤24:将所述第五数据段的高(M-K)位基于所述Q(2x)进行移位操作得到第七数据段;Step 24: Perform a shift operation on the high (M-K) bit of the fifth data segment based on the Q (2x) to obtain a seventh data segment;
步骤25:将所述第六数据段与所述第七数据段进行异或得到第八数据段;Step 25: XOR the sixth data segment and the seventh data segment to obtain an eighth data segment;
步骤26:将所述第八数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤22至26,直到所述第四数据段的长度小于2*K,其中“*”表示乘。Step 26: replacing the first data segment and the second data segment of the fourth data in step 21 with the eighth data segment to form the fourth data, and performing steps 22 to 26 until the fourth data The length of the segment is less than 2*K, where "*" indicates multiplication.
结合第一方面或第一方面的第一种至第八种任一可能的实现方式,在第九种可能的实现方式中,所述基于第二本源多项式处理所述第三数据得到所述第一数据的N位CRC编码,包括:With reference to the first aspect, or any one of the first to the eighth possible implementations of the first aspect, in the ninth possible implementation, the processing the third data based on the second source polynomial to obtain the An N-bit CRC encoding of a data, including:
将所述第三数据除以所述第二本源多项式得到N位余数作为所述第一数据的N位CRC编码。Dividing the third data by the second source polynomial yields an N-bit remainder as the N-bit CRC encoding of the first data.
结合第一方面或第一方面的第一种至第九种任一可能的实现方式,在第十种可能的实现方式中,所述方法还包括:With reference to the first aspect, or any one of the first to the ninth possible implementation manners of the first aspect, in the tenth possible implementation, the method further includes:
存储所述第一数据和所述N位CRC编码。本该案可以提高数据存储的可靠性,防止存储的数据发生错误。进一步的,该该案还包括读取所述第一数据和所述N位CRC编码,计算所述第一数据的N位CRC编码,比较计算出来的N位CRC编码是否与读取出来的N位CRC编码一致,从而判断第一数据在存储过程中是否发生错误。And storing the first data and the N-bit CRC code. This case can improve the reliability of data storage and prevent errors in stored data. Further, the method further includes reading the first data and the N-bit CRC code, calculating an N-bit CRC code of the first data, and comparing whether the calculated N-bit CRC code and the read N are compared. The bit CRC code is consistent to determine whether the first data has an error during the storage process.
结合第一方面或第一方面的第一种至第十种任一可能的实现方式,在第十一种可能的实现方式中,所述方法还包括:With reference to the first aspect, or any one of the first to the tenth possible implementation manners of the first aspect, in an eleventh possible implementation manner, the method further includes:
发送所述第一数据和所述N位CRC编码。Transmitting the first data and the N-bit CRC code.
本发明实施例第二方面,提供了一种计算循环冗余校验CRC编码的装置,包括各种单元,分别用于实现本发明实施例第一方面各种可能的实现方式。A second aspect of the embodiments of the present invention provides an apparatus for calculating a cyclic redundancy check CRC code, which includes various units for implementing various possible implementation manners of the first aspect of the embodiments of the present invention.
本发明实施例第三方面提供了一种计算循环冗余校验CRC编码的装置,包括接口和处理器,接口和处理器通信,处理器用于执行本发明实施例第一方面的各种可能的实现方式。A third aspect of the embodiments of the present invention provides an apparatus for calculating a cyclic redundancy check CRC code, including an interface and a processor, where the interface is in communication with a processor, and the processor is configured to perform various possible aspects of the first aspect of the embodiments of the present invention. Method to realize.
本发明实施例第四方面提供了一种计算循环冗余校验CRC编码的装置,包括接口和处理器,接口和处理器通信,接口用于执行本发明实施例第一方面的各种可能的实现方式。A fourth aspect of the embodiments of the present invention provides an apparatus for calculating a cyclic redundancy check CRC code, including an interface and a processor, where the interface communicates with a processor, and the interface is used to perform various possible aspects of the first aspect of the embodiments of the present invention. Method to realize.
相应地,本发明实施例第五方面还提供了计算机可读存储介质和计算机程序产品,计 算机可读存储介质和计算机程序产品中包含计算机指令用于实现本发明实施例第一方面各种可能的实现方式。Correspondingly, the fifth aspect of the embodiments of the present invention further provides a computer readable storage medium and a computer program product, where the computer readable storage medium and the computer program product comprise computer instructions for implementing various possibilities of the first aspect of the embodiments of the present invention. Method to realize.
本发明实施还第六方面提供了一种芯片,包括各种单元,分别用于执行本发明实施例第一方面的各种可能的实现方式。A sixth aspect of the present invention provides a chip, including various units, for performing various possible implementations of the first aspect of the embodiments of the present invention.
附图说明DRAWINGS
图1是现有技术CRC编码示意图。1 is a schematic diagram of a prior art CRC coding.
图2是本发明实施例存储阵列架构示意图。2 is a schematic diagram of a memory array architecture in accordance with an embodiment of the present invention.
图3是本发明实施例存储阵列的控制器的示意图。3 is a schematic diagram of a controller of a memory array in accordance with an embodiment of the present invention.
图4是本发明实施例分布式块存储系统的示意图。4 is a schematic diagram of a distributed block storage system in accordance with an embodiment of the present invention.
图5是分布式块存储系统的服务器的示意性结构框图。FIG. 5 is a schematic structural block diagram of a server of a distributed block storage system.
图6是本发明实施例CRC编码示意性流程图。FIG. 6 is a schematic flowchart of CRC coding according to an embodiment of the present invention.
图7是本发明实施例划分信息序列示意图。FIG. 7 is a schematic diagram of a sequence of divided information according to an embodiment of the present invention.
图8是本发明实施例CRC编码示意性流程图。FIG. 8 is a schematic flowchart of CRC coding according to an embodiment of the present invention.
图9是本发明实施例CRC编码示意性流程图。FIG. 9 is a schematic flowchart of CRC coding according to an embodiment of the present invention.
图10是本发明实施例划分信息序列示意图。FIG. 10 is a schematic diagram of a sequence of divided information according to an embodiment of the present invention.
图11是本发明实施例芯片结构示意图。11 is a schematic view showing the structure of a chip according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合附图,对本发明实施例中的技术方案进行描述。The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings.
如图2所示,本发明实施例中的存储系统,可以为存储阵列(如
Figure PCTCN2018125871-appb-000001
Figure PCTCN2018125871-appb-000002
Figure PCTCN2018125871-appb-000003
系列,
Figure PCTCN2018125871-appb-000004
系列)。存储阵列包括存储控制器201和多块硬盘,其中,硬盘包含固态硬盘(Solid State Disk,SSD)、磁盘或者混合硬盘等。如图3所示,控制器201包含中央处理单元(Central Processing Unit,CPU)301、存储器302和接口303,存储器302中存储计算机指令,CPU301执行存储器302中的计算机指令对存储系统进行管理及数据访问操作。另外,为节省CPU301的计算资源,现场可编程门阵列(Field Programmable Gate Array,FPGA)或其他硬件也可以用于执行本发明实施例中CPU301全部操作;或者,FPGA或其他硬件与CPU301分别用于执行本发明实施例CPU301的部分操作。为方便描述,本发明实施例统一用处理器来指CPU301和存储器302的组合,以及上述各种实现,处理器与接口303通信。接口303可以为网络接口卡(Networking Interface Card,NIC)、主机总线适配器(Host Bus Adaptor,HBA),天线等。
As shown in FIG. 2, the storage system in the embodiment of the present invention may be a storage array (such as
Figure PCTCN2018125871-appb-000001
of
Figure PCTCN2018125871-appb-000002
Figure PCTCN2018125871-appb-000003
series,
Figure PCTCN2018125871-appb-000004
series). The storage array includes a storage controller 201 and a plurality of hard disks, wherein the hard disks include solid state disks (SSDs), disks, or hybrid hard disks. As shown in FIG. 3, the controller 201 includes a central processing unit (CPU) 301, a memory 302 and an interface 303. The memory 302 stores computer instructions, and the CPU 301 executes computer instructions in the memory 302 to manage and store the storage system. Access operation. In addition, in order to save the computing resources of the CPU 301, a Field Programmable Gate Array (FPGA) or other hardware may also be used to perform all operations of the CPU 301 in the embodiment of the present invention; or, an FPGA or other hardware and the CPU 301 are used respectively. Part of the operation of the CPU 301 of the embodiment of the present invention is performed. For convenience of description, the embodiment of the present invention uniformly refers to a combination of a CPU 301 and a memory 302, and various implementations described above, and the processor communicates with the interface 303. The interface 303 can be a Network Interface Card (NIC), a Host Bus Adaptor (HBA), an antenna, or the like.
如图2和图3所描述的存储阵列,控制器201用于获取数据,如接收主机或客户端发送的数据,使用本发明实施例提供的计算CRC编码的方法计算数据的CRC编码。As shown in FIG. 2 and FIG. 3, the controller 201 is configured to acquire data, such as receiving data sent by the host or the client, and calculate a CRC code of the data by using a method for calculating CRC encoding provided by the embodiment of the present invention.
进一步的,本发明实施例的存储系统还可以为分布式文件存储系统(如
Figure PCTCN2018125871-appb-000005
Figure PCTCN2018125871-appb-000006
系列),分布式块存储系统(如
Figure PCTCN2018125871-appb-000007
Figure PCTCN2018125871-appb-000008
系列)等。以
Figure PCTCN2018125871-appb-000009
Figure PCTCN2018125871-appb-000010
Figure PCTCN2018125871-appb-000011
系列。示例性的如图4所示,分布式块存储系统包括多台服务器,如服务器1、服务器2、服务器3,……,服务器6,服务器间通过InfiniBand或以太网络等互相通信。在实际应用当中,分布式块存储系统中服务器的数量可以根据实际需求增加或减少,本发明实施例对此不作限定。
Further, the storage system of the embodiment of the present invention may also be a distributed file storage system (such as
Figure PCTCN2018125871-appb-000005
of
Figure PCTCN2018125871-appb-000006
Series), distributed block storage systems (eg
Figure PCTCN2018125871-appb-000007
of
Figure PCTCN2018125871-appb-000008
Series) and so on. Take
Figure PCTCN2018125871-appb-000009
Figure PCTCN2018125871-appb-000010
of
Figure PCTCN2018125871-appb-000011
series. Illustratively, as shown in FIG. 4, the distributed block storage system includes a plurality of servers, such as server 1, server 2, server 3, ..., server 6, and the servers communicate with each other through InfiniBand or Ethernet. In an actual application, the number of servers in the distributed block storage system may be increased or decreased according to actual requirements, which is not limited by the embodiment of the present invention.
分布式块存储系统的服务器中包含如图5所示的结构。如图5所示,分布式块存储系统中的每台服务器包含中央处理单元(Central Processing Unit,CPU)501、内存502、接口503、硬盘1、硬盘2和硬盘3,内存502中存储计算机指令,CPU501执行内存502中的程序指令执行相应的操作。接口503可以为硬件接口,如网络接口卡(Network Interface Card,NIC)或主机总线适配器(Host Bus Adaptor,HBA)等,也可以为程序接口模块等。硬盘包含固态硬盘(Solid State Disk,SSD)、磁盘或者混合硬盘。。另外,为节省CPU401的计算资源,现场可编程门阵列(Field Programmable Gate Array,FPGA)或其他硬件也可以代替CPU501执行上述相应的操作,或者,FPGA或其他硬件与CPU501共同执行上述相应的操作。为方便描述,本发明实施例将CPU501与内存502、FPGA及其他替代CPU501的硬件或FPGA及其他替代CPU501的硬件与CPU501的组合统称为处理器。接口303可以为网络接口卡(Networking Interface Card,NIC)、主机总线适配器(Host Bus Adaptor,HBA),天线等。The server of the distributed block storage system includes the structure as shown in FIG. As shown in FIG. 5, each server in the distributed block storage system includes a central processing unit (CPU) 501, a memory 502, an interface 503, a hard disk 1, a hard disk 2, and a hard disk 3. The computer 502 stores computer instructions. The CPU 501 executes the program instructions in the memory 502 to perform the corresponding operations. The interface 503 can be a hardware interface, such as a network interface card (NIC) or a host bus adapter (HBA), or a program interface module. The hard disk contains a Solid State Disk (SSD), a disk, or a hybrid hard disk. . In addition, in order to save the computing resources of the CPU 401, a Field Programmable Gate Array (FPGA) or other hardware may perform the above-mentioned corresponding operations instead of the CPU 501, or the FPGA or other hardware may perform the above-mentioned corresponding operations together with the CPU 501. For convenience of description, the embodiment of the present invention collectively refers to the combination of CPU 501 and memory 502, FPGA and other hardware or FPGA replacing CPU 501 and other hardware replacing CPU 501 and CPU 501 as a processor. The interface 303 can be a Network Interface Card (NIC), a Host Bus Adaptor (HBA), an antenna, or the like.
如图4和图5所描述的分布式块存储系统,服务器的处理器用于获取数据,如接收主机或客户端发送的数据,使用本发明实施例提供的计算CRC编码的方法计算数据的CRC编码。As shown in FIG. 4 and FIG. 5, the processor of the server is configured to acquire data, such as receiving data sent by the host or the client, and calculate the CRC code of the data by using the method for calculating CRC encoding provided by the embodiment of the present invention. .
除图2-图5所示的场景外,本发明实施例还可以应用到数据传输场景,为了保证数据传输的可靠性,如计算机网络、各种通信网络中传输数据时使用本发明实施例所提供的计算数据CRC编码方法。如计算机获取数据,如计算机上应用程序产生的数据,计算数据的CRC编码。In addition to the scenarios shown in FIG. 2 to FIG. 5, the embodiment of the present invention can also be applied to a data transmission scenario. In order to ensure the reliability of data transmission, for example, a computer network or various communication networks use data according to an embodiment of the present invention. A method of calculating the CRC encoding of the data provided. For example, a computer acquires data, such as data generated by an application on a computer, and calculates a CRC code of the data.
为更好的理解本发明实施例,首先本发明实施例结合图2所示的存储系统介绍CRC编码的基本原理是:控制器201接收数据后(下面以接收K位数据进行举例说明),将K位数据作为信息序列,在K位信息序列之后再拼接N位的校验码,整个编码长度为K+N=R位。因此,这种编码也叫(R,K)码。对于一个给定的(R,K)码,可以证明存在一个最高次幂为R-K=N的多项式G(x),根据G(x)可以生成K位序列的CRC编码,而G(x)叫做这个CRC编码的生成多项式。N位校验码的具体生成过程为:假设要存储的数据称为信息序列,一个信息序列可以用多项式C(X)表示,将C(x)左移N位(可表示成C(x)*X^N),这样C(x)的右边就会空出N位,这N位就是放置CRC编码的位置。本发明实施例基于用C(x)*X^N和生成多项式G(x)得到校验码,即用C(x)*X^N除以G(x)得到的余数作为N位CRC编码。其中,任意一个由二进制位串组成的数据都可以和一个系数仅为‘0’和‘1’取值的多项式一一对应。其中,系数为1的项称为有效的项。例如:数据为1010111对应的多项式为X^6+X^4+X^2+X+1,其中,X^6表示X的6次幂或x的6次方,x为伪变量,幂指数(也称为指数)用于指示各位间的排列位置,幂指数为非负整数,“+”表示异或。多项式为X^5+X^3+X^2+X+1对应的数据为101111。在INCITS(InterNational Committee on Information Technology Standards)的T10技术委员会制定的CRC16的本源多项式为0x18BB7,写成二进制为0001 1000 1011 1011 0111,对应的多项式为X^16+X^15+X^11+X^9+X^8+X^7+X^5+X^4+X^2+X^1+1。按照现有的CRC16编码方法,需要将信息序列划分为大小为16位的数据段,信息序列划分出来的数据段从最高位(从左到右)分别为第1数据段、第2数据段、……、第N数据段。其中,N为不小于2的自然数。首先,第1数据段要分别左移15位(bit),左移11位,左移9位,左移8位,左 移7位,左移5位,左移4位,左移2位,左移1位,左移0位,将第1数据段进行上述移位后的得到的数据段进行异或,将异或结果与第2数据段进行异或得到的异或结果,再与第3数据段及第N数据段重新构成数据序列,如果重新构成的新数据序列的长度大于16位,那么对新的数据序列重复执行上述操作(也就是将新的数据序列按照16位划分得到新的数据段,对新的数据段再次执行上述移位及异或操作,以再次构成更新的数据序列),重复的次数可以是一次或者多次,直到最后信息序列长度等于16位为止。For a better understanding of the embodiments of the present invention, firstly, the basic principle of the CRC coding is introduced in the embodiment of the present invention in conjunction with the storage system shown in FIG. 2: after the controller 201 receives the data (the following is an example of receiving K-bit data), The K-bit data is used as the information sequence, and the N-bit check code is spliced after the K-bit information sequence, and the entire code length is K+N=R bits. Therefore, this encoding is also called the (R, K) code. For a given (R, K) code, it can be proved that there is a polynomial G(x) with the highest power RK=N. According to G(x), the CRC encoding of the K-bit sequence can be generated, and G(x) is called The generator polynomial of this CRC code. The specific generation process of the N-bit check code is as follows: assuming that the data to be stored is called an information sequence, an information sequence can be represented by a polynomial C(X), and C(x) is shifted to the left by N bits (which can be expressed as C(x) *X^N), so that the right side of C(x) will be N bits, which is the position where the CRC code is placed. The embodiment of the present invention is based on obtaining a check code by using C(x)*X^N and a generator polynomial G(x), that is, a remainder obtained by dividing C(x)*X^N by G(x) as an N-bit CRC code. . Among them, any one of the data consisting of binary bit strings can be in one-to-one correspondence with a polynomial whose coefficients are only '0' and '1'. Among them, the item with a coefficient of 1 is called a valid item. For example, the polynomial corresponding to the data 1010111 is X^6+X^4+X^2+X+1, where X^6 represents the 6th power of X or the 6th power of x, x is a pseudo variable, and the power index (also called index) is used to indicate the position of the arrangement between the powers, the power exponent is a non-negative integer, and "+" means an exclusive OR. The data corresponding to the polynomial X^5+X^3+X^2+X+1 is 101111. The original polynomial of CRC16 developed by the T10 Technical Committee of INCITS (InterNational Committee on Information Technology Standards) is 0x18BB7, written as binary 0001 1000 1011 1011 0111, and the corresponding polynomial is X^16+X^15+X^11+X^ 9+X^8+X^7+X^5+X^4+X^2+X^1+1. According to the existing CRC16 coding method, the information sequence needs to be divided into data segments of size 16 bits, and the data segments divided by the information sequence are the first data segment and the second data segment from the highest bit (from left to right). ..., the Nth data segment. Where N is a natural number not less than 2. First, the first data segment should be shifted to the left by 15 bits, left to 11 bits, left to 9 bits, left to 8 bits, left to 7 bits, left to 5 bits, left to 4 bits, and left to 2 bits. , shifting 1 bit to the left and 0 bit to the left, XORing the data segment obtained by shifting the first data segment, and XORing the XOR result with the second data segment, and then The third data segment and the Nth data segment are reconstructed into a data sequence. If the length of the reconstructed new data sequence is greater than 16 bits, the above operation is repeated for the new data sequence (that is, the new data sequence is divided into 16 bits. The new data segment performs the above shift and XOR operation on the new data segment again to form the updated data sequence. The number of repetitions may be one or more times until the last information sequence length is equal to 16 bits.
因此,得到如下公式(1)CRC(C(x))=(x deg(G(x))C(x))(mod(G(x));其中,CRC(C(x))表示信息序列C(x)的CRC编码,G(x)表示本源多项式,如T10的CRC16的本源多项式为X^16+X^15+X^11+X^9+X^8+X^7+X^5+X^4+X^2+X^1+1;deg(G(x))表示本源多项式的最高项的指数,如T10的CRC16的本源多项式的最高项的指数为16,即最高位的指数;x deg(G(x))C(x)表示将信息序列C(x)左移本源多项式的最高项的指数位,mod表示取模。 Therefore, the following formula (1) is obtained: CRC(C(x))=(x deg(G(x)) C(x))(mod(G(x)); where CRC(C(x)) represents information The CRC code of the sequence C(x), G(x) represents the source polynomial, such as the original polynomial of CRC16 of T10 is X^16+X^15+X^11+X^9+X^8+X^7+X ^5+X^4+X^2+X^1+1; deg(G(x)) represents the index of the highest term of the source polynomial, such as the index of the highest term of the original polynomial of CRC16 of T10 is 16, that is, the highest The exponent of the bit; x deg(G(x)) C(x) denotes the exponent bit that shifts the information sequence C(x) to the left of the highest term of the source polynomial, and mod denotes the modulo.
结合公式(1),令Q(x)=G(x)T(x),则CRC(C(x))=R(x)(mod(G(x)));其中,R(x)=(x deg(G(x))C(x))(mod(Q(x)),Q(x)表示G(x)的倍式,T(x)表示某一个多项式,用于表示Q(x)是G(x)的倍式,R(x)表示信息序列C(x)左移16bit得到的多项式除以Q(x)的余数。其中Q(x)所含的有效的最高项的指数和有效的次最高项的指数之差大于1,从而相对G(x)可以减少循环移位操作次数,进一步的,可以选择含有效的项数的个数少的Q(x)进一步减少异或运算的次数,从而大幅降低了CRC编码复杂度,例如选择有效的项数最少的倍式。本发明实施例中,多项式的有效项是指系数为1的项,例如,T10的CRC16的本源多项式中X^16、X^15、X^11、X^9、X^8、X^7、X^5、X^4、X^2、X^1、1的系数均为1,为有效的项。 Combining equation (1), let Q(x)=G(x)T(x), then CRC(C(x))=R(x)(mod(G(x))); where R(x) =(x deg(G(x)) C(x))(mod(Q(x)), Q(x) represents a multiple of G(x), and T(x) represents a polynomial used to represent Q (x) is a multiple of G(x), and R(x) represents the remainder of the polynomial obtained by shifting the information sequence C(x) by 16 bits to the left by Q(x), where the valid highest term contained in Q(x) The difference between the index of the index and the effective second highest term is greater than 1, so that the number of cyclic shift operations can be reduced relative to G(x). Further, Q(x) with a small number of valid terms can be selected to be further reduced. The number of exclusive OR operations, thereby greatly reducing the complexity of the CRC encoding, for example, selecting the least efficient multiple of the number of terms. In the embodiment of the present invention, the effective term of the polynomial refers to the term of the coefficient 1, for example, the CRC16 of T10 The coefficients of X^16, X^15, X^11, X^9, X^8, X^7, X^5, X^4, X^2, X^1, and 1 in the source polynomial are all 1, As an effective item.
本发明实施例以G(X)=X^16+X^15+X^11+X^9+X^8+X^7+X^5+X^4+X^2+X^1+1为例,可以利用计算机计算G(x)的倍式,例如使用如下程序查找G(x)的倍式,通常为限定查找范围,可以限定倍式的最高项的指数,例如524287。G(x)的倍式Q(x)表示为x^i+x^j。本发明实施例计算倍式可以由独立的计算机计算,也可以由本发明实施例提供的设备计算,如存储系统等,在此不作限定。以独立的计算机计算为例,计算机执行如下操作:In the embodiment of the present invention, G(X)=X^16+X^15+X^11+X^9+X^8+X^7+X^5+X^4+X^2+X^1+ 1 For example, a computer can calculate a multiplier of G(x), for example, using the following procedure to find a ploid of G(x), usually defining a search range, and defining an index of the highest term of the multiplier, for example, 524287. The multiplet Q(x) of G(x) is expressed as x^i+x^j. The calculation of the doubling method in the embodiment of the present invention may be calculated by an independent computer, or may be calculated by the device provided by the embodiment of the present invention, such as a storage system, and is not limited herein. Taking an independent computer calculation as an example, the computer performs the following operations:
第一步:遍历i和j,其中,对i和j进行赋值,并且0<=j<i<=524287。The first step: traversing i and j, where i and j are assigned, and 0 <= j < i <= 524287.
第二步:初始化长度为524288位的信息序列C(x)为全0。因为如果倍式的最高项的指数为524287,则信息序列C(x)有524288位。Step 2: Initialize the information sequence C(x) with a length of 524288 bits to all zeros. Because if the index of the highest term of the octave is 524287, the information sequence C(x) has 524288 bits.
第三步:设置信息序列C(x)的第i位和第j位的值为1。The third step: setting the value of the i-th bit and the j-th bit of the information sequence C(x) to 1.
第四步:对长度为524288的信息序列C(x)进行CRC16编码方法进行计算得到CRC编码,如果CRC编码为0,则表示找到1个G(x)倍式。The fourth step: the CRC16 encoding method is performed on the information sequence C(x) of length 524288 to obtain the CRC encoding. If the CRC encoding is 0, it means that one G(x) multiple is found.
重复执行第一步至第四步,直到遍历完所有的i与j。Repeat steps 1 through 4 until you have traversed all i and j.
本发明实施例以G(x)的倍式Q(x)=X^369+X^31+1为例,从此倍式可以看出,除去最高项的指数369以外,多项式只有2项的系数是1,即除去最高项外,只有两位有效的项,因此循环移位操作和异或运算次数只需2次。In the embodiment of the present invention, a multiple of Q(x)=X^369+X^31+1 of G(x) is taken as an example. From this doubling, it can be seen that, except for the index 369 of the highest term, the polynomial has only two coefficients. It is 1, that is, except for the highest item, there are only two valid items, so the number of cyclic shift operations and XOR operations is only 2 times.
本发明实施例以G(x)=X^16+X^15+X^11+X^9+X^8+X^7+X^5+X^4+X^2+X^1+1,Q(x)=X^369+X^31+1,C(x)为4096位的信息序列为例,计算信息序列的CRC16编码。本发明实施例中,控制器201需要存储Q(x)和G(x),以用于计算数据的CRC编码。本发明实施例如图6所示,包括:In the embodiment of the present invention, G(x)=X^16+X^15+X^11+X^9+X^8+X^7+X^5+X^4+X^2+X^1+ 1,Q(x)=X^369+X^31+1, and C(x) is an information sequence of 4096 bits as an example, and the CRC16 encoding of the information sequence is calculated. In the embodiment of the present invention, the controller 201 needs to store Q(x) and G(x) for calculating the CRC encoding of the data. The embodiment of the present invention is as shown in FIG. 6, and includes:
步骤601:将C(x)左移16位。Step 601: Shift C(x) to the left by 16 bits.
即在4096位后面补16个0,移位后的信息序列作为新的信息序列,长度为4096+16=4112位。That is, 16 zeros are added after 4096 bits, and the shifted information sequence is used as a new information sequence with a length of 4096+16=4112 bits.
步骤602:将新的信息序列从新的信息序列的最高位开始划分为长度为369位的数据段。Step 602: Divide the new information sequence from the highest bit of the new information sequence into a data segment of length 369 bits.
新的信息序列从最高位划分表示从新的信息信息的左边开始划分,其中左边第1位为最高位。步骤602将移位后的信息序列划分为11个长度为369位的数据段和1个长度为53的数据段。如图7所示,长度为369位的数据段分别表示为第1数据段、第2数据段、第3数据段、……、第11数据段,长度为53位的数据段记为第12数据段。其中,第1数据段的信息序列表示为A,第2数据段的信息序列表示为B。将新的信息序列从新的信息序列的最高位开始划分为长度为369位的数据段也称为将新的信息序列从新的信息序列的最高位以369位大小划分数据段,即以Q(x)有效的最高项的指数位大小划分数据段。The new information sequence is divided from the highest bit to the left of the new information, and the first bit on the left is the highest bit. Step 602 divides the shifted information sequence into 11 data segments of length 369 bits and a data segment of length 53. As shown in FIG. 7, the data segments having a length of 369 bits are represented as the first data segment, the second data segment, the third data segment, ..., the 11th data segment, and the data segment having the length of 53 bits is recorded as the 12th segment. Data segment. The information sequence of the first data segment is represented as A, and the information sequence of the second data segment is represented as B. Dividing a new sequence of information from the highest bit of the new information sequence into a data segment of length 369 bits is also referred to as dividing the new information sequence from the highest bit of the new information sequence by 369 bits, ie Q (x) ) The exponent bit size of the highest valid item divides the data segment.
步骤603:将第1数据段分别左移31位和0位(换句话说:对第1数据段左移31位生成一个数据段,以及对第1数据段左移0位生成第二个数据段),将左移31位和左移0位的第1数据段异或。Step 603: Move the first data segment to the left by 31 bits and 0 bits respectively (in other words: generate a data segment by shifting the first data segment by 31 bits to the left, and shifting the first data segment by 0 bits to generate the second data. Segment), XORed by 31 bits left and 0 bits shifted left by 0.
根据前面计算CRC16编码的操作,第1数据段根据倍式的次最高指数开始向左移位。According to the previous operation of calculating the CRC16 encoding, the first data segment starts shifting to the left according to the next highest index of the octave.
步骤604:将左移31位和左移0位的第1数据段异或结果再与第2数据段异或。Step 604: The XOR result of shifting the left data by 31 bits and shifting the left bit by 0 bits is further XORed with the second data segment.
步骤605:将步骤604的结果作为第1数据段与剩余的数据段组成新的信息序列。Step 605: The result of step 604 is formed into a new information sequence as the first data segment and the remaining data segments.
将步骤605生成的新的信息序列执行步骤602-605,如此循环,直到最后根据步骤605得到的新的信息序列长度为394位,即新的信息序列的长度小于2*369。The new sequence of information generated in step 605 is executed in steps 602-605, and is cycled until the final length of the new information sequence obtained according to step 605 is 394 bits, that is, the length of the new information sequence is less than 2*369.
本发明实施例,步骤605后,当新的信息序列的长度大于2*369,则执行步骤602;当新的信息序列的长度小于2*369,则执行步骤606。In the embodiment of the present invention, after step 605, when the length of the new information sequence is greater than 2*369, step 602 is performed; when the length of the new information sequence is less than 2*369, step 606 is performed.
上述实施例中,数据段根据Q(x)每次需要向左移31位,但是每一次经过步骤602-605操作,会减少一个数据段,因此即使数据段向左移31位,但仍然减少了(369-31)位的长度,即减少了338位长度。因此相对于现有技术,减少了移位操作数量。步骤601中新的信息序列的长度为4112位,即(12*338+56)位,所以当步骤605得到的新的信息序列长度为394位时,则不能再进行步骤2-4的操作。步骤605得到的新的信息序列长度为394位时,执行606。In the above embodiment, the data segment needs to be shifted to the left by 31 bits according to Q(x), but each time the steps 602-605 are performed, one data segment is reduced, so even if the data segment is shifted to the left by 31 bits, it is still reduced. The length of the (369-31) bit is reduced by 338 bits. Therefore, the number of shift operations is reduced relative to the prior art. The length of the new information sequence in step 601 is 4112 bits, that is, (12*338+56) bits. Therefore, when the length of the new information sequence obtained in step 605 is 394 bits, the operations of steps 2-4 cannot be performed. When the new information sequence length obtained in step 605 is 394 bits, 606 is performed.
步骤606:将新的信息序列基于G(x)计算CRC16编码。即基于G(x)处理新的信息序列得到CRC16编码,实际实现中将新的信息序列除得G(x)的余数作为CRC16编码。Step 606: Calculate the CRC16 encoding based on G(x) with the new information sequence. That is, the CRC16 coding is obtained by processing a new information sequence based on G(x). In the actual implementation, the new information sequence is divided by the remainder of G(x) as the CRC16 coding.
在图6所示的实施例中,相对现有技术,减少了移位操作数量和异或操作的数量,因此节省了计算资源,提高了计算CRC编码的效率和性能。In the embodiment shown in FIG. 6, the number of shift operations and the number of XOR operations are reduced relative to the prior art, thereby saving computational resources and improving the efficiency and performance of calculating CRC coding.
本发明另一实施例中,如图8所示,在本发明实施例中,步骤801-803分别参考图6所示步骤601-603。In another embodiment of the present invention, as shown in FIG. 8, in the embodiment of the present invention, steps 801-803 refer to steps 601-603 shown in FIG. 6, respectively.
步骤804:将左移31位和左移0位的第1数据段异或结果的低369位与第2数据段异或。Step 804: The lower 369 bits of the XOR result of the 1st data segment shifted to the left by 31 bits and the left shift of 0 bits are XORed with the 2nd data segment.
其中,左移31位和左移0位的第1数据段异或结果共400位,将左移31位和左移0位的第1数据段异或结果的左边定义为高位(反之定义为低位),例如从左边开始的前31位称为高31位,从右边开始的369位称为低369位。The XOR of the first data segment of the left shift of 31 bits and the left shift of 0 bits has a total of 400 bits, and the left side of the XOR of the first data segment of the left shift of 31 bits and the left shift of 0 bits is defined as a high bit (conversely defined as Low), for example, the first 31 bits from the left are called the high 31 bits, and the 369 bits from the right are called the lower 369 bits.
步骤805:将左移31位和左移0位的第1数据段异或结果的高31位分别左移31位和0位后,对二者进行异或。Step 805: After shifting the upper 31 bits of the XOR data of the 1st data segment shifted left 31 bits and the left shift 0 bit to the left by 31 bits and 0 bits respectively, the two are XORed.
步骤806:将步骤804和步骤805的结果进行异或得到新的数据段,将新的数据段与剩余的数据段组成新的信息序列。Step 806: XOR the results of step 804 and step 805 to obtain a new data segment, and form a new information sequence with the new data segment and the remaining data segments.
对新的信息序列重复执行步骤802-806,直到最后根据步骤805得到的新的信息序列长度为(369+53)位,即422位。Steps 802-806 are repeated for the new information sequence until the new information sequence length obtained according to step 805 is (369+53) bits, ie 422 bits.
本发明实施例,步骤806后,当新的信息序列的长度大于2*369,则执行步骤802;当新的信息序列的长度小于2*369,则执行步骤807。In the embodiment of the present invention, after step 806, when the length of the new information sequence is greater than 2*369, step 802 is performed; when the length of the new information sequence is less than 2*369, step 807 is performed.
上述实施例中,数据段根据Q(x)每次需要向左移31位,但是每一次经过步骤802-804操作,即使数据段向左移31位,但仍然减少了369位的长度。因此相对于现有技术,大大减少了移位操作数据。步骤1中新的信息序列的长度为4112位,即(11*369+56)位,所以当步骤806得到的新的信息序列长度为422位时,则不能再进行步骤802-805的操作,即新的信息序列长度小于2*369。步骤806得到的新的信息序列长度为422位时,执行步骤807。In the above embodiment, the data segment needs to be shifted to the left by 31 bits according to Q(x) each time, but each time through the steps 802-804, even if the data segment is shifted to the left by 31 bits, the length of 369 bits is reduced. Therefore, the shift operation data is greatly reduced as compared with the prior art. The length of the new information sequence in step 1 is 4112 bits, that is, (11*369+56) bits. Therefore, when the length of the new information sequence obtained in step 806 is 422 bits, the operations of steps 802-805 cannot be performed. That is, the new information sequence length is less than 2*369. When the new information sequence length obtained in step 806 is 422 bits, step 807 is performed.
步骤807:将新的信息序列基于G(x)计算CRC16编码。即基于G(x)处理新的信息序列得到CRC16编码,实际实现中将新的信息序列除以G(x)的余数作为CRC16编码。Step 807: Calculate the CRC16 encoding based on G(x) with the new information sequence. That is, the CRC16 coding is obtained by processing a new information sequence based on G(x). In the actual implementation, the new information sequence is divided by the remainder of G(x) as the CRC16 code.
在图8所示的实施例中,相对现有技术,减少了移位操作数量和异或操作的数量,因此节省了计算资源,提高了计算CRC编码的效率和性能。In the embodiment shown in FIG. 8, the number of shift operations and the number of exclusive OR operations are reduced relative to the prior art, thereby saving computational resources and improving the efficiency and performance of calculating CRC coding.
本发明另一实施例中,以In another embodiment of the present invention,
G(x)=X^16+X^15+X^11+X^9+X^8+X^7+X^5+X^4+X^2+X^1+1,Q(x)=X^369+X^31+1,C(x)为512KB的信息序列为例,其中512KB的信息序列的位数为512*1024*8=4194304位,本发明实施例中可以使用多个倍式进行CRC16计算,如倍式Q1(x)=x^65535+1,倍式Q2(x)=x^369+x^31+1。本发明实施如图9所示,包括:G(x)=X^16+X^15+X^11+X^9+X^8+X^7+X^5+X^4+X^2+X^1+1,Q(x For example, the information sequence of 512 KB is 512 KB, and the number of bits of the information sequence of 512 KB is 512*1024*8=4194304 bits, which can be used in the embodiment of the present invention. The doubling formula performs CRC16 calculation, such as the multiple equation Q1(x)=x^65535+1, and the multiple equation Q2(x)=x^369+x^31+1. The implementation of the present invention is as shown in FIG. 9, and includes:
步骤901:将C(x)左移16位。Step 901: Shift C(x) to the left by 16 bits.
即在4194304位后面补16个0,移位后的信息序列作为新的信息序列,长度为4194304+16=4194320位。That is, 16 zeros are added after the 4194304 bits, and the shifted information sequence is used as a new information sequence with a length of 4194304+16=4194320 bits.
步骤902:将新的信息序列从最高位开始划分为长度为65535位的数据段。Step 902: The new information sequence is divided from the highest bit into a data segment having a length of 65535 bits.
新的信息序列从最高位划分表示从新的信息信息的左边开始划分。步骤902将移位后的信息序列划分为64个长度为65535位的数据段和1个长度为80位的数据段。如图10所示,长度为65535位的数据段分别表示为第1数据段、第2数据段、第3数据段,……,第64数据段,长度为80位的数据段记为第65数据段。其中,第1数据段的信息序列表示为A,第2数据段的信息序列表示为B。The new information sequence is divided from the highest bit to indicate the division from the left of the new information. Step 902 divides the shifted information sequence into 64 data segments of length 65535 bits and a data segment of length 80 bits. As shown in FIG. 10, the data segments having a length of 65535 bits are respectively represented as the first data segment, the second data segment, the third data segment, ..., the 64th data segment, and the data segment having the length of 80 bits is recorded as the 65th. Data segment. The information sequence of the first data segment is represented as A, and the information sequence of the second data segment is represented as B.
步骤903:将第1数据段和第2数据段异或。Step 903: XOR the first data segment and the second data segment.
根据前面计算CRC16校验数据的操作,第1数据段根据倍式的次最高指数开始向左移位。在本发明实施例中,Q1(x)=x^65535+1的次最高指数为0,向左移0位。According to the previous operation of calculating the CRC16 check data, the first data segment starts shifting to the left according to the next highest index of the multiple. In the embodiment of the present invention, the next highest index of Q1(x)=x^65535+1 is 0, and 0 bit is shifted to the left.
步骤904:将步骤903异或的结果作为第1数据段与剩余的数据段组成新的信息序列。Step 904: The result of the exclusive OR of step 903 is formed into a new information sequence as the first data segment and the remaining data segments.
将新的信息序列执行步骤902-904,直到最后根据步骤904得到的新的信息序列长度为(65536+80)位,即新的信息序列长度小于2*65535。The new information sequence is executed in steps 902-904 until the new information sequence length obtained according to step 904 is (65536+80) bits, that is, the new information sequence length is less than 2*65535.
本发明实施例,步骤904后,当新的信息序列的长度大于2*65535,则执行步骤902,直到新的信息序列长度小于2*65535。In the embodiment of the present invention, after the step 904, when the length of the new information sequence is greater than 2*65535, step 902 is performed until the length of the new information sequence is less than 2*65535.
上述实施例中,数据段根据Q1(x)每次需要向左移0位,但是每一次经过步骤902-904操作,数据序列减少了65535位的长度。因此相对于现有技术,大大减少了移位操作数据。所以当步骤904得到的新的信息序列长度为65615位时,则不能再进行步骤902-904的操作。当步骤904得到的新的信息序列长度为65615位时,根据Q2(x)执行图6所示实施例的步骤602-606或图8所示实施例的步骤802-807。In the above embodiment, the data segment needs to be shifted to the left by 0 bits each time according to Q1(x), but each time through steps 902-904, the data sequence is reduced by 65535 bits. Therefore, the shift operation data is greatly reduced as compared with the prior art. Therefore, when the new information sequence length obtained in step 904 is 65,615 bits, the operations of steps 902-904 can no longer be performed. When the new information sequence length obtained in step 904 is 65615 bits, steps 602-606 of the embodiment shown in FIG. 6 or steps 802-807 of the embodiment shown in FIG. 8 are performed according to Q2(x).
在图9所示的实施例中,使用了多个倍式,可以有效减少较长的信息序列在计算CRC编码时移位操作次数和异或计算量,因此节省了计算资源,提高了计算CRC编码的效率和性能。In the embodiment shown in FIG. 9, multiple multiples are used, which can effectively reduce the number of shift operations and XOR calculations when calculating a CRC code for a long information sequence, thereby saving computational resources and improving computational CRC. The efficiency and performance of the coding.
本发明实施例,为减少数据处理时延,可以使用中央处理器(Central Processing Unit,CPU)计算CRC校验码,例如使用
Figure PCTCN2018125871-appb-000012
Figure PCTCN2018125871-appb-000013
不同规格的CPU的寄存器大小不同,例如有64位寄存器,128位寄存器、256位寄存器、512位寄存器。在确定Q(x)时可以考虑CPU的寄存器的大小,以充分利用CPU的硬件资源。例如,在
Figure PCTCN2018125871-appb-000014
支持流式单指令多数据扩展指令集(Streaming Single Instruction Single Instruction Multiple Data Extensions,SSE)的CPU中,寄存器大小为128位,因此,可以使用Q(x)=x^384+x^46+x^15,这样可以将信息序列按照384位大小划分成数据段,那么需要3个128位寄存器,可以充分利用CPU硬件资源。
In the embodiment of the present invention, in order to reduce data processing delay, a central processing unit (CPU) may be used to calculate a CRC check code, for example,
Figure PCTCN2018125871-appb-000012
of
Figure PCTCN2018125871-appb-000013
Different sizes of CPUs have different register sizes, such as 64-bit registers, 128-bit registers, 256-bit registers, and 512-bit registers. The size of the CPU's registers can be considered when determining Q(x) to take full advantage of the hardware resources of the CPU. For example, in
Figure PCTCN2018125871-appb-000014
In a CPU that supports Streaming Single Instruction Single Instruction Multiple Data Extensions (SSE), the register size is 128 bits. Therefore, Q(x)=x^384+x^46+x can be used. ^15, this can divide the information sequence into data segments according to 384-bit size, then three 128-bit registers are needed, which can make full use of CPU hardware resources.
上述各实施例应用于存储系统,存储系统计算数据的CRC编码,存储数据和数据的CRC编码,保证数据存储的准确性和一致性。存储系统在读取数据时,同时读取数据的CRC编码,存储系统计算读取到的数据的CRC编码,比较读取的数据的CRC编码与读取的数据计算得到的CRC编码是否相同。如果相同,则表明数据在存储过程中没有发生错误;如果不相同,则表明数据在存储过程中发生错误。The above embodiments are applied to a storage system, which stores CRC codes of data, stores CRC codes of data and data, and ensures accuracy and consistency of data storage. When the storage system reads the data, the CRC code of the data is simultaneously read, and the storage system calculates the CRC code of the read data, and compares whether the CRC code of the read data is the same as the CRC code calculated by the read data. If they are the same, it means that the data did not have an error during the storage process; if it is not the same, it indicates that the data has an error during the storage process.
本发明实施例提供的技术方案,还可以用于数据链接层的CRC校验。在通信系统中,网络层协议的数据单元是互联网协议(Internet Protocol,IP)数据包,而数据链路层的工作就是把网络层交下来的IP数据包封装为帧(frame)发送到链路上,以及把接收到的帧中的数据包取出并上交给网络层。为达到这一目的,数据链路必须具备一系列相应的功能,主要有:The technical solution provided by the embodiment of the present invention can also be used for the CRC check of the data link layer. In the communication system, the data unit of the network layer protocol is an Internet Protocol (IP) data packet, and the work of the data link layer is to encapsulate the IP data packet delivered by the network layer into a frame and send it to the link. And, the data packet in the received frame is taken out and handed over to the network layer. To achieve this, the data link must have a series of corresponding functions, mainly:
将数据包封装为帧,帧是数据链路层的传送单位;Encapsulating a data packet into a frame, which is a transmission unit of the data link layer;
控制帧的传输,包括处理传输差错,调节发送速率与接收方相匹配;Controlling the transmission of the frame, including processing the transmission error, adjusting the transmission rate to match the receiver;
在两个网络实体之间提供数据链路通路的建立、维持和释放的管理。Management of the establishment, maintenance, and release of data link pathways between two network entities.
数据链接层在控制帧的传输需要具有如下功能:The data link layer needs to have the following functions in the transmission of control frames:
差错控制:Error control:
通信系统必须具备发现差错的能力,并采取措施纠正之,使差错控制在所能允许的尽可能小的范围内,这就是差错控制过程,也是数据链路层的主要功能之一。The communication system must have the ability to detect errors and take measures to correct it so that the error is within the smallest possible range. This is the error control process and one of the main functions of the data link layer.
反馈重发:Feedback resend:
接收方通过对CRC编码的检查,可以判定一帧在传输过程中是否发生了差错。一旦发现差错,一般可以采用反馈重发的方法来纠正。这就要求接受方收完一帧后,向发送方反馈一个接收是否正确的信息,使发送方据此做出是否需要重新发送的决定。发送方仅当 收到接收方已正确接收的反馈信号后才能认为该帧已经正确发送完毕,否则需要重发直至正确为止。其中,接收方,即接收设备接收帧,获取帧中的数据和CRC编码,接收设备使用与发送设备相同的方式计算数据的CRC编码,比较接收设备计算得到的CRC编码与帧中的CRC编码是否相同,如果相同,则证明帧在传输过程中没有发生差错,否则则发生了差错。By checking the CRC code, the receiver can determine whether a frame has an error during transmission. Once an error is found, it can generally be corrected by feedback retransmission. This requires the recipient to feed back to the sender a message that the reception is correct, so that the sender can make a decision on whether to resend accordingly. The sender can only consider that the frame has been correctly transmitted after receiving the feedback signal that the receiver has correctly received. Otherwise, it needs to be resent until it is correct. The receiving party, that is, the receiving device receives the frame, acquires the data in the frame and the CRC code, and the receiving device calculates the CRC code of the data in the same manner as the sending device, and compares whether the CRC code calculated by the receiving device and the CRC code in the frame are The same, if the same, proves that the frame did not make an error during the transmission, otherwise an error occurred.
因此,本发明实施例还可以应用于交换机、物理网卡中执行的CRC编码的操作。本发明实施例还可以应用于FPGA芯片、
Figure PCTCN2018125871-appb-000015
处理器或者专用集成电路(Application-specific integrated circuit,ASIC)等计算CRC编码。物理网卡、FPGA芯片、ARM或者ASIC等可以应用于服务器、用户终端、车载设备、无线基站、路由器、交换机、网关等设备。具体实现中,可以根据CRC编码的长度,如16位的CRC编码,生成本源多项式G(x)和一个或多个本源多项式的倍式Q(x),为方便计算CRC编码,G(x)和Q(x)可以预置在芯片或设备中,在本发明实施例的各种设备计算CRC编码时查询或调用G(x)和Q(x)。G(x)和Q(x)可以以二进制、十六进制等形式呈现,本发明实施对此不作限定。
Therefore, the embodiment of the present invention can also be applied to the operation of CRC encoding performed in a switch and a physical network card. The embodiment of the invention can also be applied to an FPGA chip,
Figure PCTCN2018125871-appb-000015
The processor or an application-specific integrated circuit (ASIC) or the like calculates the CRC code. Physical network cards, FPGA chips, ARM or ASICs can be applied to servers, user terminals, in-vehicle devices, wireless base stations, routers, switches, gateways, and the like. In a specific implementation, the source polynomial G(x) and one or more primitive polynomials Q(x) may be generated according to the length of the CRC encoding, such as 16-bit CRC encoding, for convenient calculation of CRC encoding, G(x) And Q(x) may be preset in the chip or device to query or invoke G(x) and Q(x) when the various devices of the embodiments of the present invention calculate the CRC code. G(x) and Q(x) may be presented in binary, hexadecimal, etc., which is not limited by the implementation of the present invention.
本发明实施例提供存储设备、服务器、用户终端、车载设备、无线基站、路由器、交换机、网关等设备包括接口和处理器,处理器用于执行本发明实施例各方案,或者由上述设备的接口卡执行本发明实施例各方案。另一种实现方式,上述设备包括各种单元,如图11所示,包括获取单元111、移位单元112和处理单元113。其中,获取单元111,用于获取第一数据;移位单元112,用于将所述第一数据左移N位得到第二数据,其中N为循环冗余校验CRC编码位数;处理单元113,用于基于一个或多个第一本源多项式处理所述第二数据得到第三数据,基于第二本源多项式处理所述第三数据得到所述第一数据的N位CRC编码;其中,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X与有效的次最高项的指数Y之差大于1;所述第三数据的长度小于所述第二数据的长度;X与Y为正整数,X大于Y;所述一个或多个第一本源多项式中的每一个是所述第二本源多项式的倍式,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X大于所述第二本源多项式的有效的最高项的指数R。进一步的,处理单元113,具体用于执行如下步骤:The embodiments of the present invention provide a storage device, a server, a user terminal, an in-vehicle device, a wireless base station, a router, a switch, a gateway, and the like, including an interface and a processor, where the processor is used to execute various embodiments of the embodiments of the present invention, or an interface card of the foregoing device. The various embodiments of the embodiments of the present invention are implemented. In another implementation, the above device includes various units, as shown in FIG. 11, including an obtaining unit 111, a shifting unit 112, and a processing unit 113. The obtaining unit 111 is configured to acquire first data, and the shifting unit 112 is configured to shift the first data to the left by N bits to obtain second data, where N is a cyclic redundancy check CRC coded number of bits; 113. The method is configured to process the second data based on one or more first source polynomials to obtain third data, and process the third data based on the second native polynomial to obtain an N-bit CRC encoding of the first data. a difference between an index X of a highest item in which the first source polynomial is valid for each of the first source polynomial and an index Y of the effective second highest item is greater than 1; a length of the third data is less than the second The length of the data; X and Y are positive integers, X is greater than Y; each of the one or more first source polynomials is a multiple of the second source polynomial, the one or more first source polynomials An index X of the highest item valid for each of the first source polynomials is greater than an index R of the highest highest item of the second source polynomial. Further, the processing unit 113 is specifically configured to perform the following steps:
步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the second one obtained by dividing the X-bit size from the highest bit in step 1. Data segment
步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于2*X位,其中“*”表示乘。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
进一步的,处理单元113,具体用于执行如下步骤:Further, the processing unit 113 is specifically configured to perform the following steps:
步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述 第二数据最高位开始得到的第一个数据段;其中,所述第三数据段的长度为M位;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is a first data segment obtained from the highest bit of the second data in the step 1; wherein the length of the third data segment is M bits;
步骤3:将所述第三数据段的低X位与第二数据段进行异或操作得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XORing the lower X bits of the third data segment with the second data segment to obtain a fourth data segment; the second data segment is divided into X bits according to the highest bit in step 1. The second data segment obtained;
步骤4:将所述第三数据段的高(M-X)位基于所述Q(x)进行移位操作得到第五数据段;Step 4: Perform a shift operation on the high (M-X) bit of the third data segment based on the Q(x) to obtain a fifth data segment;
步骤5:将所述第四数据段与所述第五数据段进行异或得到第六数据段;Step 5: XOR the fourth data segment and the fifth data segment to obtain a sixth data segment;
步骤6:将所述第六数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至6,直到的所述第二数据的长度小于2*X位,其中“*”表示乘。Step 6: replacing the first data segment and the second data segment of the second data in step 1 with the sixth data segment to form the second data, and performing steps 1 to 6 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
进一步的,所述一个或多个第一本源多项式包括第一本源多项式Q1(x)和Q2(x),其中,Q1(x)有效的最高项的指数大于Q2(x)有效的最高项的指数,处理单元113,具体用于执行如下步骤:Further, the one or more first source polynomials comprise first source polynomials Q1(x) and Q2(x), wherein the index of the highest item valid for Q1(x) is greater than the highest item of Q2(x) effective The index, processing unit 113 is specifically configured to perform the following steps:
将所述第二数据基于Q1(x)进行处理得到第四数据;Processing the second data based on Q1(x) to obtain fourth data;
将所述第四数据基于Q2(x)进行处理得到所述第三数据。The fourth data is processed based on Q2(x) to obtain the third data.
进一步的,处理单元113,具体用于执行以下步骤:Further, the processing unit 113 is specifically configured to perform the following steps:
步骤1:将所述第二数据从最高位开始以Q1(x)有效的最高项的指数位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the exponent bit size of the highest item valid by Q1(x);
步骤2:将所述第二数据的第一数据段基于所述Q1(x)进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the Q1 (x), and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以Q1(x)有效的最高项的指数位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the highest item in the step 1 that is valid from the highest bit and is valid with Q1(x) The second data segment obtained by dividing the index bit size;
步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于Q1(x)有效的最高项的指数位2倍的长度。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2 times the exponent bit of the highest term in which Q1(x) is valid.
进一步的,所述处理单元113,具体用于执行以下步骤:Further, the processing unit 113 is specifically configured to perform the following steps:
步骤21:将所述第四数据从最高位开始以Q2(x)有效的最高项的指数位大小划分数据段;Step 21: Divide the fourth data from the highest bit to divide the data segment by the exponent bit size of the highest item valid by Q2(x);
步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
步骤23:将所述第五数据段与所述第四数据的第二数据段进行异或操作得到第六数据段;所述第四数据的所述第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;Step 23: XORing the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is from the The second data segment obtained by dividing the highest bit of the fourth data;
步骤24:将所述第六数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤21至24,直到所述第四数据的长度小于Q2(x)有效的最高项的指数位2倍的长度。Step 24: replacing the first data segment and the second data segment of the fourth data in step 21 with the sixth data segment to form the fourth data, and performing steps 21 to 24 until the fourth data The length is less than 2 times the length of the exponent bit of the highest term valid for Q2(x).
进一步的,处理单元113具体用于执行以下步骤:Further, the processing unit 113 is specifically configured to perform the following steps:
步骤21:将所述第四数据从最高位开始以K位大小划分数据段;其中K表示Q2(x) 有效的最高项的指数;Step 21: Divide the fourth data from the highest bit to divide the data segment by the K bit size; wherein K represents an index of the highest item valid for Q2(x);
步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
步骤23:将所述第五数据段的低K位与所述第四数据的第二数据段进行异或得到第六数据段;所述第四数据的第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;所述第五数据段的长度为M位;Step 23: XOR the lower K bit of the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is the a second data segment obtained by dividing a highest bit of the fourth data; the length of the fifth data segment is M bits;
步骤24:将所述第五数据段的高(M-K)位基于所述Q(2x)进行移位操作得到第七数据段;Step 24: Perform a shift operation on the high (M-K) bit of the fifth data segment based on the Q (2x) to obtain a seventh data segment;
步骤25:将所述第六数据段与所述第七数据段进行异或得到第八数据段;Step 25: XOR the sixth data segment and the seventh data segment to obtain an eighth data segment;
步骤26:将所述第八数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤22至26,直到所述第四数据段的长度小于2*K,其中“*”表示乘。Step 26: replacing the first data segment and the second data segment of the fourth data in step 21 with the eighth data segment to form the fourth data, and performing steps 22 to 26 until the fourth data The length of the segment is less than 2*K, where "*" indicates multiplication.
进一步的,处理单元113,具体用于:Further, the processing unit 113 is specifically configured to:
将所述第三数据除以所述第二本源多项式得到N位余数作为所述第一数据的N位CRC编码。Dividing the third data by the second source polynomial yields an N-bit remainder as the N-bit CRC encoding of the first data.
进一步的,还包括存储单元,用于存储所述第一数据和所述N位CRC编码。Further, a storage unit is further included, configured to store the first data and the N-bit CRC code.
进一步的,还包括发送单元,用于发送所述第一数据和所述N位CRC编码。Further, the method further includes a sending unit, configured to send the first data and the N-bit CRC code.
进一步的,存储单元,还用于存储本源多项式和倍式。上述各单元分别用于执行本发明实施例各方案对应的实现,各种单元具体实现可以是本发明实施例的设备结构,也可以为软件模块,可以运行在服务器上,从而使设备完成本发明实施例中描述的各种实现。各种单元也可以为硬件设备,例如各单元可以处理器或接口实现。上述设备包括各种单元实现可以参考前面方法实施例描述,在此不再赘述。Further, the storage unit is further configured to store the source polynomial and the multiple. The above-mentioned units are respectively used to implement the corresponding implementations of the embodiments of the embodiments of the present invention. The specific implementations of the various units may be the device structure of the embodiment of the present invention, or may be a software module, which may be run on a server, thereby enabling the device to complete the present invention. Various implementations described in the embodiments. The various units may also be hardware devices, for example each unit may be implemented as a processor or interface. For the implementation of the foregoing device, including the various unit implementations, reference may be made to the foregoing method embodiments, and details are not described herein.
本发明实施例还提供了一种芯片,如图11所示,包含:获取单元111、移位单元112和处理单元113。进一步的,上述芯片还可以包含存储单元114,用于存储本源多项式和倍式。上述各单元分别用于执行本发明实施例各方案对应的实现,图11所示的各单元可以为芯片的硬件逻辑模块、ASCI或网卡等。The embodiment of the present invention further provides a chip, as shown in FIG. 11, comprising: an obtaining unit 111, a shifting unit 112, and a processing unit 113. Further, the above chip may further include a storage unit 114 for storing the original polynomial and the multiple. Each of the above units is used to implement the corresponding implementation of each solution in the embodiment of the present invention. Each unit shown in FIG. 11 may be a hardware logic module of the chip, an ASCI, a network card, or the like.
本申请的又一方面提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得计算机执行上述各实施例。Yet another aspect of the present application provides a computer readable storage medium having instructions stored therein that, when executed on a computer, cause the computer to perform the various embodiments described above.
本申请的又一方面提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述各实施例。Yet another aspect of the present application provides a computer program product comprising instructions that, when executed on a computer, cause the computer to perform the various embodiments described above.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通 过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的计算机可读取存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including The instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing computer readable storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. The medium of the program code.

Claims (48)

  1. 一种计算循环冗余校验CRC编码的方法,其特征在于,所述方法包括:A method for calculating a cyclic redundancy check CRC coding, the method comprising:
    获取第一数据;Obtain the first data;
    将所述第一数据左移N位得到第二数据,其中N为循环冗余校验CRC编码位数;Transmitting the first data to the left by N bits to obtain second data, where N is a cyclic redundancy check CRC coded number of bits;
    基于一个或多个第一本源多项式处理所述第二数据得到第三数据;其中所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X与有效的次最高项的指数Y之差大于1;所述第三数据的长度小于所述第二数据的长度;X与Y为正整数,X大于Y;Processing the second data based on the one or more first native polynomials to obtain third data; wherein an exponent X of the highest term of each of the one or more first native polynomials is valid and a valid number of times The difference between the highest index Y is greater than 1; the length of the third data is less than the length of the second data; X and Y are positive integers, and X is greater than Y;
    基于第二本源多项式处理所述第三数据得到所述第一数据的N位CRC编码;其中,所述一个或多个第一本源多项式中的每一个是所述第二本源多项式的倍式,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X大于所述第二本源多项式的有效的最高项的指数R。Processing the third data based on the second native polynomial to obtain an N-bit CRC encoding of the first data; wherein each of the one or more first source polynomials is a multiple of the second native polynomial, An index X of the highest item valid for each of the one or more first source polynomials is greater than an index R of the highest highest item of the second source polynomial.
  2. 根据权利要求1所述的方法,其特征在于,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的项数小于所述第二本源多项式有效的项数。The method of claim 1 wherein the number of items valid for each of the one or more first source polynomials is less than the number of items valid for the second source polynomial.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一本源多项式为所述第二本源多项式的倍式中有效的项数最少的倍式。The method according to claim 1 or 2, wherein the first source polynomial is a finite formula having the least number of terms valid in a multiple of the second native polynomial.
  4. 根据权利要求1-3任一所述的方法,其特征在于,所述基于一个或多个第一本源多项式处理所述第二数据得到第三数据,包括:The method according to any one of claims 1-3, wherein the processing the second data based on the one or more first source polynomials to obtain the third data comprises:
    步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
    步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
    步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the second one obtained by dividing the X-bit size from the highest bit in step 1. Data segment
    步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于2*X位,其中“*”表示乘。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  5. 根据权利要求1-3任一所述的方法,其特征在于,所述基于一个或多个第一本源多项式处理所述第二数据得到第三数据,包括:The method according to any one of claims 1-3, wherein the processing the second data based on the one or more first source polynomials to obtain the third data comprises:
    步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
    步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;其中,所述第三数据段的长度为M位;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is a first data segment obtained from the highest bit of the second data in the step 1; wherein the length of the third data segment is M bits;
    步骤3:将所述第三数据段的低X位与第二数据段进行异或操作得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XORing the lower X bits of the third data segment with the second data segment to obtain a fourth data segment; the second data segment is divided into X bits according to the highest bit in step 1. The second data segment obtained;
    步骤4:将所述第三数据段的高(M-X)位基于所述Q(x)进行移位操作得到第五数据段;Step 4: Perform a shift operation on the high (M-X) bit of the third data segment based on the Q(x) to obtain a fifth data segment;
    步骤5:将所述第四数据段与所述第五数据段进行异或得到第六数据段;Step 5: XOR the fourth data segment and the fifth data segment to obtain a sixth data segment;
    步骤6:将所述第六数据段取代步骤1中的所述第二数据的所述第一数据段和所述第 二数据段从而构成所述第二数据,执行步骤1至6,直到所述第二数据的长度小于2*X位,其中“*”表示乘。Step 6: replacing the first data segment and the second data segment of the second data in step 1 with the sixth data segment to form the second data, and performing steps 1 to 6 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  6. 根据权利要求1-3任一所述的方法,其特征在于,所述一个或多个第一本源多项式包括第一本源多项式Q1(x)和Q2(x),其中,Q1(x)有效的最高项的指数大于Q2(x)有效的最高项的指数;所述基于一个或多个第一本源多项式处理所述第二数据得到第三数据,包括:A method according to any of claims 1-3, wherein said one or more first source polynomials comprise first source polynomials Q1(x) and Q2(x), wherein Q1(x) is valid The index of the highest item is greater than the index of the highest item valid for Q2(x); the processing the second data based on the one or more first source polynomials to obtain the third data, including:
    将所述第二数据基于Q1(x)进行处理得到第四数据;Processing the second data based on Q1(x) to obtain fourth data;
    将所述第四数据基于Q2(x)进行处理得到所述第三数据。The fourth data is processed based on Q2(x) to obtain the third data.
  7. 根据权利要求6所述的方法,其特征在于,将所述第二数据基于Q1(x)进行处理得到第四数据,包括:The method according to claim 6, wherein the processing the second data based on Q1(x) to obtain fourth data comprises:
    步骤1:将所述第二数据从最高位开始以Q1(x)有效的最高项的指数位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the exponent bit size of the highest item valid by Q1(x);
    步骤2:将所述第二数据的第一数据段基于所述Q1(x)进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the Q1 (x), and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
    步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以Q1(x)有效的最高项的指数位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the highest item in the step 1 that is valid from the highest bit and is valid with Q1(x) The second data segment obtained by dividing the index bit size;
    步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于Q1(x)有效的最高项的指数位2倍的长度。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2 times the exponent bit of the highest term in which Q1(x) is valid.
  8. 根据权利要求7所述的方法,其特征在于,将所述第四数据基于Q2(x)进行处理得到所述第三数据,包括:The method according to claim 7, wherein the processing the fourth data based on Q2(x) to obtain the third data comprises:
    步骤21:将所述第四数据从最高位开始以Q2(x)有效的最高项的指数位大小划分数据段;Step 21: Divide the fourth data from the highest bit to divide the data segment by the exponent bit size of the highest item valid by Q2(x);
    步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
    步骤23:将所述第五数据段与所述第四数据的第二数据段进行异或操作得到第六数据段;所述第四数据的所述第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;Step 23: XORing the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is from the The second data segment obtained by dividing the highest bit of the fourth data;
    步骤24:将所述第六数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤21至24,直到所述第四数据的长度小于Q2(x)有效的最高项的指数位2倍的长度。Step 24: replacing the first data segment and the second data segment of the fourth data in step 21 with the sixth data segment to form the fourth data, and performing steps 21 to 24 until the fourth data The length is less than 2 times the length of the exponent bit of the highest term valid for Q2(x).
  9. 根据权利要求7所述的方法,其特征在于,将所述第四数据基于Q2(x)进行处理得到所述第三数据,包括:The method according to claim 7, wherein the processing the fourth data based on Q2(x) to obtain the third data comprises:
    步骤21:将所述第四数据从最高位开始以K位大小划分数据段;其中K表示Q2(x)有效的最高项的指数;Step 21: Divide the fourth data from the highest bit to divide the data segment by the K bit size; wherein K represents an index of the highest item valid for Q2(x);
    步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得 到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
    步骤23:将所述第五数据段的低K位与所述第四数据的第二数据段进行异或得到第六数据段;所述第四数据的第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;所述第五数据段的长度为M位;Step 23: XOR the lower K bit of the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is the a second data segment obtained by dividing a highest bit of the fourth data; the length of the fifth data segment is M bits;
    步骤24:将所述第五数据段的高(M-K)位基于所述Q(2x)进行移位操作得到第七数据段;Step 24: Perform a shift operation on the high (M-K) bit of the fifth data segment based on the Q (2x) to obtain a seventh data segment;
    步骤25:将所述第六数据段与所述第七数据段进行异或得到第八数据段;Step 25: XOR the sixth data segment and the seventh data segment to obtain an eighth data segment;
    步骤26:将所述第八数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤22至26,直到所述第四数据段的长度小于2*K,其中“*”表示乘。Step 26: replacing the first data segment and the second data segment of the fourth data in step 21 with the eighth data segment to form the fourth data, and performing steps 22 to 26 until the fourth data The length of the segment is less than 2*K, where "*" indicates multiplication.
  10. 根据权利要求1-9任一所述的方法,其特征在于,所述基于第二本源多项式处理所述第三数据得到所述第一数据的N位CRC编码,包括:The method according to any one of claims 1-9, wherein the processing the third data based on the second native polynomial to obtain the N-bit CRC encoding of the first data comprises:
    将所述第三数据除以所述第二本源多项式得到N位余数作为所述第一数据的N位CRC编码。Dividing the third data by the second source polynomial yields an N-bit remainder as the N-bit CRC encoding of the first data.
  11. 根据权利要求1-10任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 10, wherein the method further comprises:
    存储所述第一数据和所述N位CRC编码。And storing the first data and the N-bit CRC code.
  12. 根据权利要求1-10任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 10, wherein the method further comprises:
    发送所述第一数据和所述N位CRC编码。Transmitting the first data and the N-bit CRC code.
  13. 一种计算循环冗余校验CRC编码的装置,其特征在于,包括:An apparatus for calculating a cyclic redundancy check CRC code, comprising:
    获取单元,用于获取第一数据;An obtaining unit, configured to acquire first data;
    移位单元,用于将所述第一数据左移N位得到第二数据,其中N为循环冗余校验CRC编码位数;a shifting unit, configured to shift the first data to the left by N bits to obtain second data, where N is a cyclic redundancy check CRC coded number of bits;
    处理单元,用于基于一个或多个第一本源多项式处理所述第二数据得到第三数据,基于第二本源多项式处理所述第三数据得到所述第一数据的N位CRC编码;其中,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X与有效的次最高项的指数Y之差大于1;所述第三数据的长度小于所述第二数据的长度;X与Y为正整数,X大于Y;所述一个或多个第一本源多项式中的每一个是所述第二本源多项式的倍式,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X大于所述第二本源多项式的有效的最高项的指数R。a processing unit, configured to process the second data based on the one or more first native polynomials to obtain third data, and process the third data based on the second native polynomial to obtain an N-bit CRC encoding of the first data; a difference between an index X of a highest item in which the first source polynomial is valid of each of the one or more first source polynomials and an index Y of a valid second highest item is greater than 1; a length of the third data is less than the number The length of the two data; X and Y are positive integers, X is greater than Y; each of the one or more first source polynomials is a multiple of the second native polynomial, the one or more first sources An exponent X of the highest item valid for each of the first original polynomial of the polynomial is greater than an exponent R of the highest highest item of the second native polynomial.
  14. 根据权利要求13所述的装置,其特征在于,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的项数小于所述第二本源多项式有效的项数。The apparatus of claim 13 wherein the number of terms for which each of the one or more first source polynomials is valid for the first source polynomial is less than the number of terms for which the second source polynomial is valid.
  15. 根据权利要求13或14所述的装置,其特征在于,所述第一本源多项式为所述第二本源多项式的倍式中有效的项数最少的倍式。The apparatus according to claim 13 or 14, wherein said first source polynomial is a multiple of a number of terms valid in a multiple of said second native polynomial.
  16. 根据权利要求11-15任一所述的装置,其特征在于,所述处理单元,具体用于执行如下步骤:The device according to any one of claims 11-15, wherein the processing unit is specifically configured to perform the following steps:
    步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
    步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述 第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
    步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the second one obtained by dividing the X-bit size from the highest bit in step 1. Data segment
    步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于2*X位,其中“*”表示乘。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  17. 根据权利要求11-15任一所述的装置,其特征在于,所述处理单元,具体用于执行以下步骤:The device according to any one of claims 11-15, wherein the processing unit is specifically configured to perform the following steps:
    步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
    步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;其中,所述第三数据段的长度为M位;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is a first data segment obtained from the highest bit of the second data in the step 1; wherein the length of the third data segment is M bits;
    步骤3:将所述第三数据段的低X位与第二数据段进行异或操作得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XORing the lower X bits of the third data segment with the second data segment to obtain a fourth data segment; the second data segment is divided into X bits according to the highest bit in step 1. The second data segment obtained;
    步骤4:将所述第三数据段的高(M-X)位基于所述Q(x)进行移位操作得到第五数据段;Step 4: Perform a shift operation on the high (M-X) bit of the third data segment based on the Q(x) to obtain a fifth data segment;
    步骤5:将所述第四数据段与所述第五数据段进行异或得到第六数据段;Step 5: XOR the fourth data segment and the fifth data segment to obtain a sixth data segment;
    步骤6:将所述第六数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至6,直到的所述第二数据的长度小于2*X位,其中“*”表示乘。Step 6: replacing the first data segment and the second data segment of the second data in step 1 with the sixth data segment to form the second data, and performing steps 1 to 6 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  18. 根据权利要求11-15任一所述的装置,其特征在于,所述一个或多个第一本源多项式包括第一本源多项式Q1(x)和Q2(x),其中,Q1(x)有效的最高项的指数大于Q2(x)有效的最高项的指数;所述处理单元,具体用于执行以下步骤:The apparatus according to any one of claims 11-15, wherein said one or more first source polynomials comprise first source polynomials Q1(x) and Q2(x), wherein Q1(x) is valid The index of the highest item is greater than the index of the highest item that is valid for Q2(x); the processing unit is specifically configured to perform the following steps:
    将所述第二数据基于Q1(x)进行处理得到第四数据;Processing the second data based on Q1(x) to obtain fourth data;
    将所述第四数据基于Q2(x)进行处理得到所述第三数据。The fourth data is processed based on Q2(x) to obtain the third data.
  19. 根据权利要求18所述的装置,其特征在于,所述处理装置具体用于执行以下步骤:The device according to claim 18, wherein the processing device is specifically configured to perform the following steps:
    步骤1:将所述第二数据从最高位开始以Q1(x)有效的最高项的指数位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the exponent bit size of the highest item valid by Q1(x);
    步骤2:将所述第二数据的第一数据段基于所述Q1(x)进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the Q1 (x), and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
    步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以Q1(x)有效的最高项的指数位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the highest item in the step 1 that is valid from the highest bit and is valid with Q1(x) The second data segment obtained by dividing the index bit size;
    步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于Q1(x)有效的最高项的指数位2倍的长度。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2 times the exponent bit of the highest term in which Q1(x) is valid.
  20. 根据权利要求18所述的装置,其特征在于,所述处理单元,具体用于执行以下步骤:The device according to claim 18, wherein the processing unit is specifically configured to perform the following steps:
    步骤21:将所述第四数据从最高位开始以Q2(x)有效的最高项的指数位大小划分数据段;Step 21: Divide the fourth data from the highest bit to divide the data segment by the exponent bit size of the highest item valid by Q2(x);
    步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
    步骤23:将所述第五数据段与所述第四数据的第二数据段进行异或操作得到第六数据段;所述第四数据的所述第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;Step 23: XORing the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is from the The second data segment obtained by dividing the highest bit of the fourth data;
    步骤24:将所述第六数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤21至24,直到所述第四数据的长度小于Q2(x)有效的最高项的指数位2倍的长度。Step 24: replacing the first data segment and the second data segment of the fourth data in step 21 with the sixth data segment to form the fourth data, and performing steps 21 to 24 until the fourth data The length is less than 2 times the length of the exponent bit of the highest term valid for Q2(x).
  21. 根据权利要求18所述的装置,其特征在于,所述处理单元具体用于执行以下步骤:The device according to claim 18, wherein the processing unit is specifically configured to perform the following steps:
    步骤21:将所述第四数据从最高位开始以K位大小划分数据段;其中K表示Q2(x)有效的最高项的指数;Step 21: Divide the fourth data from the highest bit to divide the data segment by the K bit size; wherein K represents an index of the highest item valid for Q2(x);
    步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
    步骤23:将所述第五数据段的低K位与所述第四数据的第二数据段进行异或得到第六数据段;所述第四数据的第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;所述第五数据段的长度为M位;Step 23: XOR the lower K bit of the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is the a second data segment obtained by dividing a highest bit of the fourth data; the length of the fifth data segment is M bits;
    步骤24:将所述第五数据段的高(M-K)位基于所述Q(2x)进行移位操作得到第七数据段;Step 24: Perform a shift operation on the high (M-K) bit of the fifth data segment based on the Q (2x) to obtain a seventh data segment;
    步骤25:将所述第六数据段与所述第七数据段进行异或得到第八数据段;Step 25: XOR the sixth data segment and the seventh data segment to obtain an eighth data segment;
    步骤26:将所述第八数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤22至26,直到所述第四数据段的长度小于2*K,其中“*”表示乘。Step 26: replacing the first data segment and the second data segment of the fourth data in step 21 with the eighth data segment to form the fourth data, and performing steps 22 to 26 until the fourth data The length of the segment is less than 2*K, where "*" indicates multiplication.
  22. 根据权利要求13-21任一所述的装置,其特征在于,所述处理单元,具体用于:The device according to any one of claims 13 to 21, wherein the processing unit is specifically configured to:
    将所述第三数据除以所述第二本源多项式得到N位余数作为所述第一数据的N位CRC编码。Dividing the third data by the second source polynomial yields an N-bit remainder as the N-bit CRC encoding of the first data.
  23. 根据权利要求13-22任一所述的装置,其特征在于,还包括存储单元,用于存储所述第一数据和所述N位CRC编码。The apparatus according to any one of claims 13-22, further comprising a storage unit for storing said first data and said N-bit CRC code.
  24. 根据权利要求13-22任一所述的装置,其特征在于,还包括发送单元,用于发送所述第一数据和所述N位CRC编码。The apparatus according to any one of claims 13-22, further comprising a transmitting unit configured to transmit the first data and the N-bit CRC code.
  25. 一种计算循环冗余校验CRC编码的装置,其特征在于,所述装置包括接口和处理器,所述处理器用于:An apparatus for calculating a cyclic redundancy check CRC code, the apparatus comprising an interface and a processor, the processor is configured to:
    获取第一数据;Obtain the first data;
    将所述第一数据左移N位得到第二数据,其中N为循环冗余校验CRC编码位数;Transmitting the first data to the left by N bits to obtain second data, where N is a cyclic redundancy check CRC coded number of bits;
    基于一个或多个第一本源多项式处理所述第二数据得到第三数据;Processing the second data based on one or more first source polynomials to obtain third data;
    基于第二本源多项式处理所述第三数据得到所述第一数据的N位CRC编码;其中,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X与有效的次最高项的指数Y之差大于1;所述第三数据的长度小于所述第二数据的长度;X与Y为正整数,X大于Y;所述一个或多个第一本源多项式中的每一个是所述第二本源多项式的倍式,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X大于所述第二本源多项式的有效的最高项的指数R。Processing the third data based on the second native polynomial to obtain an N-bit CRC encoding of the first data; wherein an index X of a highest term of each of the one or more first native polynomials valid for the first native polynomial The difference from the index Y of the effective next highest item is greater than 1; the length of the third data is less than the length of the second data; X and Y are positive integers, and X is greater than Y; the one or more first sources Each of the polynomials is a multiple of the second native polynomial, an exponent X of the highest term of each of the one or more first native polynomials valid for the first native polynomial being greater than the validity of the second native polynomial The highest index of the index R.
  26. 根据权利要求25所述的装置,其特征在于,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的项数小于所述第二本源多项式有效的项数。The apparatus of claim 25 wherein the number of terms for which each of the one or more first source polynomials is valid for the first source polynomial is less than the number of terms for which the second source polynomial is valid.
  27. 根据权利要求25或26所述的装置,其特征在于,所述第一本源多项式为所述第二本源多项式的倍式中有效的项数最少的倍式。The apparatus according to claim 25 or 26, wherein said first source polynomial is a finite formula having the least number of terms valid in a multiple of said second native polynomial.
  28. 根据权利要求25-27任一所述的装置,其特征在于,所述处理器具体用于:The device according to any one of claims 25-27, wherein the processor is specifically configured to:
    步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
    步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
    步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the second one obtained by dividing the X-bit size from the highest bit in step 1. Data segment
    步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于2*X位,其中“*”表示乘。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  29. 根据权利要求25-27任一所述的装置,其特征在于,所述处理器具体用于:The device according to any one of claims 25-27, wherein the processor is specifically configured to:
    步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
    步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;其中,所述第三数据段的长度为M位;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is a first data segment obtained from the highest bit of the second data in the step 1; wherein the length of the third data segment is M bits;
    步骤3:将所述第三数据段的低X位与第二数据段进行异或操作得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XORing the lower X bits of the third data segment with the second data segment to obtain a fourth data segment; the second data segment is divided into X bits according to the highest bit in step 1. The second data segment obtained;
    步骤4:将所述第三数据段的高(M-X)位基于所述Q(x)进行移位操作得到第五数据段;Step 4: Perform a shift operation on the high (M-X) bit of the third data segment based on the Q(x) to obtain a fifth data segment;
    步骤5:将所述第四数据段与所述第五数据段进行异或得到第六数据段;Step 5: XOR the fourth data segment and the fifth data segment to obtain a sixth data segment;
    步骤6:将所述第六数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至6,直到所述第二数据的长度小于2*X位,其中“*”表示乘。Step 6: replacing the first data segment and the second data segment of the second data in step 1 with the sixth data segment to form the second data, and performing steps 1 to 6 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  30. 根据权利要求25-27任一所述的装置,其特征在于,所述一个或多个第一本源多项式包括第一本源多项式Q1(x)和Q2(x),其中,Q1(x)有效的最高项的指数大于Q2(x)有效的最高项的指数;所述处理器具体用于:The apparatus according to any one of claims 25-27, wherein said one or more first source polynomials comprise first source polynomials Q1(x) and Q2(x), wherein Q1(x) is valid The index of the highest item is greater than the index of the highest item valid for Q2(x); the processor is specifically used to:
    将所述第二数据基于Q1(x)进行处理得到第四数据;Processing the second data based on Q1(x) to obtain fourth data;
    将所述第四数据基于Q2(x)进行处理得到所述第三数据。The fourth data is processed based on Q2(x) to obtain the third data.
  31. 根据权利要求30所述的装置,其特征在于,所述处理器具体用于:The device according to claim 30, wherein the processor is specifically configured to:
    步骤1:将所述第二数据从最高位开始以Q1(x)有效的最高项的指数位大小划分数据 段;Step 1: dividing the second data from the highest bit and dividing the data segment by the exponent bit size of the highest item valid by Q1(x);
    步骤2:将所述第二数据的第一数据段基于所述Q1(x)进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the Q1 (x), and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
    步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以Q1(x)有效的最高项的指数位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the highest item in the step 1 that is valid from the highest bit and is valid with Q1(x) The second data segment obtained by dividing the index bit size;
    步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于Q1(x)有效的最高项的指数位2倍的长度。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2 times the exponent bit of the highest term in which Q1(x) is valid.
  32. 根据权利要求30所述的装置,其特征在于,所述处理器具体用于:The device according to claim 30, wherein the processor is specifically configured to:
    步骤21:将所述第四数据从最高位开始以Q2(x)有效的最高项的指数位大小划分数据段;Step 21: Divide the fourth data from the highest bit to divide the data segment by the exponent bit size of the highest item valid by Q2(x);
    步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
    步骤23:将所述第五数据段与所述第四数据的第二数据段进行异或操作得到第六数据段;所述第四数据的所述第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;Step 23: XORing the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is from the The second data segment obtained by dividing the highest bit of the fourth data;
    步骤24:将所述第六数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤21至24,直到所述第四数据的长度小于Q2(x)有效的最高项的指数位2倍的长度。Step 24: replacing the first data segment and the second data segment of the fourth data in step 21 with the sixth data segment to form the fourth data, and performing steps 21 to 24 until the fourth data The length is less than 2 times the length of the exponent bit of the highest term valid for Q2(x).
  33. 根据权利要求30所述的装置,其特征在于,所述处理器具体用于:步骤21:将所述第四数据从最高位开始以K位大小划分数据段;其中K表示Q2(x)有效的最高项的指数;The apparatus according to claim 30, wherein said processor is specifically configured to: step 21: divide said fourth data from a highest bit by a K bit size; wherein K indicates that Q2(x) is valid The highest index of the item;
    步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
    步骤23:将所述第五数据段的低K位与所述第四数据的第二数据段进行异或得到第六数据段;所述第四数据的第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;所述第五数据段的长度为M位;Step 23: XOR the lower K bit of the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is the a second data segment obtained by dividing a highest bit of the fourth data; the length of the fifth data segment is M bits;
    步骤24:将所述第五数据段的高(M-K)位基于所述Q(2x)进行移位操作得到第七数据段;Step 24: Perform a shift operation on the high (M-K) bit of the fifth data segment based on the Q (2x) to obtain a seventh data segment;
    步骤25:将所述第六数据段与所述第七数据段进行异或得到第八数据段;Step 25: XOR the sixth data segment and the seventh data segment to obtain an eighth data segment;
    步骤26:将所述第八数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤22至26,直到所述第四数据段的长度小于2*K,其中“*”表示乘。Step 26: replacing the first data segment and the second data segment of the fourth data in step 21 with the eighth data segment to form the fourth data, and performing steps 22 to 26 until the fourth data The length of the segment is less than 2*K, where "*" indicates multiplication.
  34. 根据权利要求25-33任一所述的装置,其特征在于,所述处理器具体用于:The device according to any one of claims 25-33, wherein the processor is specifically configured to:
    将所述第三数据除以所述第二本源多项式得到N位余数作为所述第一数据的N位 CRC编码。Dividing the third data by the second source polynomial yields an N-bit remainder as the N-bit CRC encoding of the first data.
  35. 根据权利要求25-34任一所述的装置,其特征在于,所述处理器还用于:The device according to any one of claims 25-34, wherein the processor is further configured to:
    存储所述第一数据和所述N位CRC编码。And storing the first data and the N-bit CRC code.
  36. 根据权利要求25-34任一所述的装置,其特征在于,所述处理器还用于:The device according to any one of claims 25-34, wherein the processor is further configured to:
    发送所述第一数据和所述N位CRC编码。Transmitting the first data and the N-bit CRC code.
  37. 一种计算机程序产品,其特征在于,所述计算机程序产品包含计算机指令,处理器执行所述计算机指令用于:A computer program product, comprising: computer program product, the processor executing the computer instruction for:
    获取第一数据;Obtain the first data;
    将所述第一数据左移N位得到第二数据,其中N为循环冗余校验CRC编码位数;Transmitting the first data to the left by N bits to obtain second data, where N is a cyclic redundancy check CRC coded number of bits;
    基于一个或多个第一本源多项式处理所述第二数据得到第三数据;Processing the second data based on one or more first source polynomials to obtain third data;
    基于第二本源多项式处理所述第三数据得到所述第一数据的N位CRC编码;其中,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X与有效的次最高项的指数Y之差大于1;所述第三数据的长度小于所述第二数据的长度;X与Y为正整数,X大于Y;所述一个或多个第一本源多项式中的每一个是所述第二本源多项式的倍式,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的最高项的指数X大于所述第二本源多项式的有效的最高项的指数R。Processing the third data based on the second native polynomial to obtain an N-bit CRC encoding of the first data; wherein an index X of a highest term of each of the one or more first native polynomials valid for the first native polynomial The difference from the index Y of the effective next highest item is greater than 1; the length of the third data is less than the length of the second data; X and Y are positive integers, and X is greater than Y; the one or more first sources Each of the polynomials is a multiple of the second native polynomial, an exponent X of the highest term of each of the one or more first native polynomials valid for the first native polynomial being greater than the validity of the second native polynomial The highest index of the index R.
  38. 根据权利要求37所述的计算机程序产品,其特征在于,所述一个或多个第一本源多项式中的每一个第一本源多项式有效的项数小于所述第二本源多项式有效的项数。The computer program product of claim 37, wherein the number of items valid for each of the one or more first source polynomials is less than the number of items valid for the second source polynomial.
  39. 根据权利要求37或38所述的计算机程序产品,其特征在于,所述第一本源多项式为所述第二本源多项式的倍式中有效的项数最少的倍式。A computer program product according to claim 37 or claim 38, wherein said first source polynomial is a least significant multiple of the number of terms in the multiple of said second native polynomial.
  40. 根据权利要求37-39任一所述的计算机程序产品,其特征在于,所述处理器执行所述计算机程序产品具体用于:A computer program product according to any of claims 37-39, wherein said processor executes said computer program product specifically for:
    步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
    步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
    步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the second one obtained by dividing the X-bit size from the highest bit in step 1. Data segment
    步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于2*X位,其中“*”表示乘。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  41. 根据权利要求37-39任一所述的计算机程序产品,其特征在于,所述处理器执行所述计算机程序产品具体用于:A computer program product according to any of claims 37-39, wherein said processor executes said computer program product specifically for:
    步骤1:将所述第二数据从最高位开始以X位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the X bit size;
    步骤2:将所述第二数据的第一数据段基于所述第一本源多项式进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;其中,所述第三数据段的长度为M位;Step 2: Perform a shift operation on the first data segment of the second data based on the first source polynomial, and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is a first data segment obtained from the highest bit of the second data in the step 1; wherein the length of the third data segment is M bits;
    步骤3:将所述第三数据段的低X位与第二数据段进行异或操作得到第四数据段;所 述第二数据段为步骤1中从所述最高位开始以X位大小划分得到的第二个数据段;Step 3: XORing the lower X bits of the third data segment with the second data segment to obtain a fourth data segment; the second data segment is divided into X bits according to the highest bit in step 1. The second data segment obtained;
    步骤4:将所述第三数据段的高(M-X)位基于所述Q(x)进行移位操作得到第五数据段;Step 4: Perform a shift operation on the high (M-X) bit of the third data segment based on the Q(x) to obtain a fifth data segment;
    步骤5:将所述第四数据段与所述第五数据段进行异或得到第六数据段;Step 5: XOR the fourth data segment and the fifth data segment to obtain a sixth data segment;
    步骤6:将所述第六数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至6,直到所述第二数据的长度小于2*X位,其中“*”表示乘。Step 6: replacing the first data segment and the second data segment of the second data in step 1 with the sixth data segment to form the second data, and performing steps 1 to 6 until The length of the second data is less than 2*X bits, where "*" indicates multiplication.
  42. 根据权利要求37-39任一所述的计算机程序产品,其特征在于,所述一个或多个第一本源多项式包括第一本源多项式Q1(x)和Q2(x),其中,Q1(x)有效的最高项的指数大于Q2(x)有效的最高项的指数;所述处理器执行所述计算机程序产品具体用于:A computer program product according to any of claims 37-39, wherein said one or more first source polynomials comprise first source polynomials Q1(x) and Q2(x), wherein Q1(x) The index of the valid highest item is greater than the index of the highest item valid for Q2(x); the processor executes the computer program product specifically for:
    将所述第二数据基于Q1(x)进行处理得到第四数据;Processing the second data based on Q1(x) to obtain fourth data;
    将所述第四数据基于Q2(x)进行处理得到所述第三数据。The fourth data is processed based on Q2(x) to obtain the third data.
  43. 根据权利要求42所述的计算机程序产品,其特征在于,所述处理器执行所述计算机程序产品具体用于:The computer program product of claim 42, wherein the processor executes the computer program product specifically for:
    步骤1:将所述第二数据从最高位开始以Q1(x)有效的最高项的指数位大小划分数据段;Step 1: dividing the second data from the highest bit and dividing the data segment by the exponent bit size of the highest item valid by Q1(x);
    步骤2:将所述第二数据的第一数据段基于所述Q1(x)进行移位操作,将移位操作得到的数据段进行异或得到第三数据段;所述第一数据段为所述步骤1中的从所述第二数据最高位开始得到的第一个数据段;Step 2: Perform a shift operation on the first data segment of the second data based on the Q1 (x), and XOR the data segment obtained by the shift operation to obtain a third data segment; the first data segment is The first data segment obtained from the highest bit of the second data in the step 1;
    步骤3:将所述第三数据段与第二数据段进行异或得到第四数据段;所述第二数据段为步骤1中从所述最高位开始以Q1(x)有效的最高项的指数位大小划分得到的第二个数据段;Step 3: XOR the third data segment and the second data segment to obtain a fourth data segment; the second data segment is the highest item in the step 1 that is valid from the highest bit and is valid with Q1(x) The second data segment obtained by dividing the index bit size;
    步骤4:将所述第四数据段取代步骤1中的所述第二数据的所述第一数据段和所述第二数据段从而构成所述第二数据,执行步骤1至4,直到所述第二数据的长度小于Q1(x)有效的最高项的指数位2倍的长度。Step 4: replacing the first data segment and the second data segment of the second data in step 1 with the fourth data segment to form the second data, and performing steps 1 to 4 until The length of the second data is less than 2 times the exponent bit of the highest term in which Q1(x) is valid.
  44. 根据权利要求42所述的计算机程序产品,其特征在于,所述处理器执行所述计算机程序产品具体用于:The computer program product of claim 42, wherein the processor executes the computer program product specifically for:
    步骤21:将所述第四数据从最高位开始以Q2(x)有效的最高项的指数位大小划分数据段;Step 21: Divide the fourth data from the highest bit to divide the data segment by the exponent bit size of the highest item valid by Q2(x);
    步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
    步骤23:将所述第五数据段与所述第四数据的第二数据段进行异或操作得到第六数据段;所述第四数据的所述第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;Step 23: XORing the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is from the The second data segment obtained by dividing the highest bit of the fourth data;
    步骤24:将所述第六数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤21至24,直到所述第四数据的长度小于Q2(x)有效的最高项的指数位2倍的长度。Step 24: replacing the first data segment and the second data segment of the fourth data in step 21 with the sixth data segment to form the fourth data, and performing steps 21 to 24 until the fourth data The length is less than 2 times the length of the exponent bit of the highest term valid for Q2(x).
  45. 根据权利要求42所述的计算机程序产品,其特征在于,所述处理器执行所述计算机程序产品具体用于:The computer program product of claim 42, wherein the processor executes the computer program product specifically for:
    步骤21:将所述第四数据从最高位开始以K位大小划分数据段;其中K表示Q2(x)有效的最高项的指数;Step 21: Divide the fourth data from the highest bit to divide the data segment by the K bit size; wherein K represents an index of the highest item valid for Q2(x);
    步骤22:将所述第四数据的第一数据段基于所述Q2(x)进行移位操作,将移位操作得到的数据段进行异或得到第五数据段;所述第四数据的第一数据段为所述步骤21中的从所述第四数据最高位开始得到的第一个数据段;Step 22: Perform a shift operation on the first data segment of the fourth data based on the Q2 (x), and XOR the data segment obtained by the shift operation to obtain a fifth data segment; a data segment is the first data segment obtained from the highest bit of the fourth data in the step 21;
    步骤23:将所述第五数据段的低R位与所述第四数据的第二数据段进行异或得到第六数据段;所述第四数据的第二数据段为步骤21中从所述第四数据的最高位开始划分得到的第二个数据段;所述第五数据段的长度为M位;Step 23: XOR the lower R bit of the fifth data segment and the second data segment of the fourth data to obtain a sixth data segment; the second data segment of the fourth data is the a second data segment obtained by dividing a highest bit of the fourth data; the length of the fifth data segment is M bits;
    步骤24:将所述第五数据段的高(M-K)位基于所述Q(2x)进行移位操作得到第七数据段;Step 24: Perform a shift operation on the high (M-K) bit of the fifth data segment based on the Q (2x) to obtain a seventh data segment;
    步骤25:将所述第六数据段与所述第七数据段进行异或得到第八数据段;Step 25: XOR the sixth data segment and the seventh data segment to obtain an eighth data segment;
    步骤26:将所述第八数据段取代步骤21中的所述第四数据的第一数据段和第二数据段从而构成所述第四数据,执行步骤22至26,直到所述第四数据段的长度小于2*K,其中“*”表示乘。Step 26: replacing the first data segment and the second data segment of the fourth data in step 21 with the eighth data segment to form the fourth data, and performing steps 22 to 26 until the fourth data The length of the segment is less than 2*K, where "*" indicates multiplication.
  46. 根据权利要求37-45任一所述的计算机程序产品,其特征在于,所述处理器执行所述计算机程序产品具体用于:A computer program product according to any of claims 37-45, wherein said processor executes said computer program product specifically for:
    将所述第三数据除以所述第二本源多项式得到N位余数作为所述第一数据的N位CRC编码。Dividing the third data by the second source polynomial yields an N-bit remainder as the N-bit CRC encoding of the first data.
  47. 根据权利要求37-46任一所述的计算机程序产品,其特征在于,所述处理器执行所述计算机指令还用于:A computer program product according to any of claims 37-46, wherein said processor executing said computer instructions is further for:
    存储所述第一数据和所述N位CRC编码。And storing the first data and the N-bit CRC code.
  48. 根据权利要求37-46任一所述的计算机程序产品,其特征在于,所述处理器执行所述计算机指令还用于:A computer program product according to any of claims 37-46, wherein said processor executing said computer instructions is further for:
    发送所述第一数据和所述N位CRC编码。Transmitting the first data and the N-bit CRC code.
PCT/CN2018/125871 2018-05-08 2018-12-29 Method and apparatus for calculating cyclic redundancy check (crc) code WO2019214265A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810433230.5 2018-05-08
CN201810433230.5A CN108574490B (en) 2018-05-08 2018-05-08 Method and device for calculating Cyclic Redundancy Check (CRC) code

Publications (1)

Publication Number Publication Date
WO2019214265A1 true WO2019214265A1 (en) 2019-11-14

Family

ID=63571968

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/125871 WO2019214265A1 (en) 2018-05-08 2018-12-29 Method and apparatus for calculating cyclic redundancy check (crc) code

Country Status (2)

Country Link
CN (1) CN108574490B (en)
WO (1) WO2019214265A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086684A (en) * 2022-08-22 2022-09-20 中科金勃信(山东)科技有限公司 Image compression method, system and medium based on CRC

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108574490B (en) * 2018-05-08 2022-05-10 华为技术有限公司 Method and device for calculating Cyclic Redundancy Check (CRC) code

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8020069B1 (en) * 2003-01-27 2011-09-13 Marvell International Ltd. Methods of supporting host CRC in data storage systems without RLL coding
CN102739258A (en) * 2011-04-14 2012-10-17 普天信息技术研究院有限公司 Method and apparatus for calculating cyclic redundancy check code
CN105095012A (en) * 2014-05-21 2015-11-25 株式会社东芝 Controller, storage device, and control method
CN107239362A (en) * 2017-02-20 2017-10-10 中国科学院微电子研究所 A kind of computational methods and system of CRC parallel computing code
CN107659381A (en) * 2017-09-08 2018-02-02 华为技术有限公司 Coding method and device
CN108574490A (en) * 2018-05-08 2018-09-25 华为技术有限公司 Calculate the method and device of cyclic redundancy check (CRC) coding

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5384786A (en) * 1991-04-02 1995-01-24 Cirrus Logic, Inc. Fast and efficient circuit for identifying errors introduced in Reed-Solomon codewords
EP0840462B1 (en) * 1996-10-29 2004-12-15 International Business Machines Corporation A method and apparatus for a two-step calculation of CRC-32
CN100388629C (en) * 2003-12-22 2008-05-14 普天信息技术研究院 A rapid calculation method for cyclic redundant check
CN101902228B (en) * 2009-05-25 2012-11-28 中兴通讯股份有限公司 Rapid cyclic redundancy check encoding method and device
US20160142073A1 (en) * 2013-06-20 2016-05-19 Telefonaktiebolaget L M Ericsson (Publ) Access Control in a Network
CN105790773A (en) * 2016-04-08 2016-07-20 暨南大学 Novel 10 gigabit Ethernet parallel CRC encoding and decoding method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8020069B1 (en) * 2003-01-27 2011-09-13 Marvell International Ltd. Methods of supporting host CRC in data storage systems without RLL coding
CN102739258A (en) * 2011-04-14 2012-10-17 普天信息技术研究院有限公司 Method and apparatus for calculating cyclic redundancy check code
CN105095012A (en) * 2014-05-21 2015-11-25 株式会社东芝 Controller, storage device, and control method
CN107239362A (en) * 2017-02-20 2017-10-10 中国科学院微电子研究所 A kind of computational methods and system of CRC parallel computing code
CN107659381A (en) * 2017-09-08 2018-02-02 华为技术有限公司 Coding method and device
CN108574490A (en) * 2018-05-08 2018-09-25 华为技术有限公司 Calculate the method and device of cyclic redundancy check (CRC) coding

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086684A (en) * 2022-08-22 2022-09-20 中科金勃信(山东)科技有限公司 Image compression method, system and medium based on CRC
CN115086684B (en) * 2022-08-22 2022-11-18 中科金勃信(山东)科技有限公司 Image compression method, system and medium based on CRC

Also Published As

Publication number Publication date
CN108574490B (en) 2022-05-10
CN108574490A (en) 2018-09-25

Similar Documents

Publication Publication Date Title
JP5329239B2 (en) Multi-body code generator and decoder for communication systems
JP5863200B2 (en) Encoding and decoding using elastic codes with flexible source block mapping
US10248498B2 (en) Cyclic redundancy check calculation for multiple blocks of a message
JP2019533345A (en) Method and apparatus for encoding data using polar codes
WO2021209037A1 (en) Data recovery method and apparatus
WO2005101875A2 (en) Protecting sub-packets in a wireless network
US11184028B2 (en) Coding method, decoding method, apparatus, and device
TWI392267B (en) Methods and apparatus for providing linear erasure codes
WO2011103741A1 (en) Method and device for data check processing
WO2019214265A1 (en) Method and apparatus for calculating cyclic redundancy check (crc) code
US7434150B1 (en) Methods, circuits, architectures, software and systems for determining a data transmission error and/or checking or confirming such error determinations
EP3345323A1 (en) Retransmission technique
US11075715B2 (en) Encoding method and apparatus
CN108270508B (en) Cyclic redundancy check CRC implementation method, device and network equipment
WO2012109872A1 (en) Method, apparatus and lte terminals for cyclic redundancy checking in communication system
US11804855B2 (en) Pipelined forward error correction for vector signaling code channel
WO2019214266A1 (en) Method and device for calculating crc code
KR101436973B1 (en) Supercharged codes
WO2019096124A1 (en) Cyclic redundancy check (crc) calculation method and device
Ruckmani et al. High Speed cyclic Redundancy Check for USB
CN109217982A (en) Transmit method, apparatus, sending device and the receiving device of data
CN110603759B (en) Unified error correction and detection code generator
Atrawalkar et al. Design and Simulation of Parallel CRC Generation Architecture for High Speed Application
CN111600613A (en) Checking method, device, decoder, receiver and computer storage medium
Bennet et al. Computation of Field Programmable Cyclic Redundancy Checks Circuit Architecture

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18917821

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18917821

Country of ref document: EP

Kind code of ref document: A1