A real-time recursive CRC check method, device, computer storage medium and program

Through the real-time recursive CRC verification method, ultra-high-speed real-time data flow is processed, and the problems of slow computing speed and poor flexibility in the prior art are solved, and logarithmic-order computing time complexity and efficient CRC verification are realized.

CN119070829BActive Publication Date: 2025-02-25CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411545944.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-25
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

The existing CRC verification method is slow in processing ultra-high-speed real-time data streams, which cannot meet the real-time computing requirements, and has poor flexibility when processing binary sequence lengths are not fixed.

Method used

Using real-time recursive CRC check method, the real-time bit stream is intercepted into binary sequences with non-fixed lengths, and the left and right bisectors and step by step merge calculations are performed to calculate the CRC check value and verification matrix of each final subsequence to achieve the Computation time complexity of numerical orders.

Benefits of technology

It realizes efficient CRC verification of ultra-high-speed real-time data streams, meets the real-time computing needs, and has the advantages of good flexibility and efficient computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119070829B_ABST
    Figure CN119070829B_ABST
Patent Text Reader

Abstract

The present invention discloses a real-time recursive CRC verification method, which sequentially intercepts a binary sequence S1S2...S from a real-time bit stream a1a2a3... with a non-fixed length. i ...; For each binary sequence S i The subsequence is obtained by bisecting the subsequences on the left and right, and the bisecting of the subsequences on the left and right is repeated until the length of the subsequence finally obtained is less than a preset value; the CRC check value and check matrix of each final subsequence are calculated, and the left and right subsequences are merged upward step by step to obtain the final check value of the entire real-time bit stream. The present invention also discloses a corresponding CRC check device, a computer storage medium and a program for implementing the CRC check method. The present invention adopts a method combining iteration and recursion to calculate the check value of a variable-length binary sequence stream in real time, achieving a logarithmic calculation time complexity, and meeting the CRC operation requirements of real-time ultra-high-speed data streams.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital information transmission error detection, and in particular to a real-time recursive CRC verification method, device, computer storage medium and program. Background Art

[0002] CRC coding is a commonly used error checking code, which is used to ensure the correctness of information transmission under various protocol formats. According to the general principle of CRC coding, the generation of CRC check bits and the verification of the received sequence are both achieved by dividing the received sequence modulo an intermediate polynomial. The division circuit is usually implemented using a feedback shift register, which is a traditional serial calculation method and has the problem of slow processing speed.

[0003] The Chinese patent with publication number CN103199873A adopts a structure mixed with multi-channel and parallel bit width to realize CRC fast calculation. The data is segmented and input into multiple channels, and multiple operation units are used for parallel calculation. The serial calculation of parallel bit width is adopted inside the channel. The above method needs to know the length of the binary information sequence in advance before multi-channel block division of the binary sequence can be performed, and the binary data stream cannot be processed in real time; at the same time, the bit width of the parallel bit is fixed, which reduces the flexibility and facilitates the unified calculation and storage of the check matrix. However, when the binary sequence is long, the parallel bit width setting is longer and requires a larger check matrix storage space, and the parallel bit width setting is shorter and requires a longer serial calculation time. The calculation time complexity of the check value is still sublinear, which cannot meet the requirements of ultra-high-speed real-time calculation. Summary of the invention

[0004] In view of the above defects of the prior art, the present invention provides a real-time recursive CRC check method and device, the purpose of which is to meet the requirements of ultra-high-speed real-time computing. The present invention also provides a corresponding computer storage medium and program.

[0005] The technical solution of the present invention is as follows:

[0006] A real-time recursive CRC verification method comprises the following steps:

[0007] Real-time bitstream Sequentially truncate binary sequences with non-fixed length ;

[0008] For each binary sequence Perform left-right bisection to obtain a subsequence, and repeat left-right bisection on the subsequence until the length of the final subsequence is less than a preset value;

[0009] The CRC check value and check matrix of each final subsequence are calculated, and the left and right subsequences are merged upward step by step to obtain the final check value of the entire real-time bit stream.

[0010] Furthermore, in the CRC value verification mode, it is determined whether the final verification value is all zeros. If it is all zeros, it indicates that the verification is correct, otherwise it is an error.

[0011] Furthermore, in the binary sequence When the length is an odd number, in the binary sequence Add "0" to the beginning of the string and then divide it equally on the left and right sides.

[0012] Furthermore, the CRC checksum of each final subsequence is Sum check matrix The calculation method is:

[0013] , represents modulo 2 multiplication, represents modulo 2 addition, B represents the final subsequence, N represents the length of the final subsequence, and P represents the coefficients of the generating polynomial. Order vector, F represents m Order square array, represents the modulo 2 operation of F n Power;

[0014] The method of combining the left and right subsequences step by step to obtain the final check value of the entire real-time bit stream is as follows: first, combine the left and right subsequences step by step to obtain the binary sequence The checksum value Sum check matrix ; Then all binary sequences The check value and check matrix are iteratively calculated to obtain the final check value R;

[0015] When the left and right subsequences are merged and calculated step by step upward, the left subsequence is set and right subsequence Merge calculation to obtain the parent sequence segment The checksum value Sum check matrix ,

[0016] ,

[0017] like The length of is odd, ,

[0018] like The length of is even, ;

[0019] All binary sequences When the final check value R is obtained by iterative calculation of the check value and the check matrix, for the binary sequence , its CRC check value , and thus iterate backwards in sequence until the end of the real-time bit stream to obtain the final check value R.

[0020] Another technical solution of the present invention is:

[0021] A real-time recursive CRC check device, comprising:

[0022] Interception module, used to convert real-time bit stream Sequentially truncate binary sequences with non-fixed length ;

[0023] Bisection module, for each binary sequence Perform left-right bisection to obtain a subsequence, and repeat left-right bisection on the subsequence until the length of the final subsequence is less than a preset value;

[0024] And, a calculation module is used to calculate the CRC check value and check matrix of each final subsequence, and merge the left and right subsequences step by step upward to obtain the final check value of the entire real-time bit stream.

[0025] Furthermore, it includes a verification module for determining whether the final verification value is all zero in the CRC value verification mode, and if it is all zero, it indicates that the verification is correct, otherwise it is an error.

[0026] Another technical solution of the present invention is:

[0027] A computer storage medium stores a computer program, and when the computer program is executed by a processor, the real-time recursive CRC verification method is implemented.

[0028] Another technical solution of the present invention is:

[0029] A computer program product, when executed by a processor, implements the real-time recursive CRC checking method.

[0030] Compared with the prior art, the present invention has the following advantages:

[0031] The real-time bit stream of unknown length is truncated into sequence segments of unfixed length, which has the advantages of good flexibility and convenience for parallel computing.

[0032] A recursive method is used to simultaneously solve the check value and the check matrix for each sequence segment. The sequence segment is decomposed layer by layer into the minimum segment length and then calculated. The check value and the check matrix are then backtracked layer by layer to achieve logarithmic computational time complexity.

[0033] Each segment of the binary sequence is calculated independently, and parallel processing units can be used to further improve efficiency.

[0034] The present invention makes full use of the characteristics of CRC, adopts a method combining iteration and recursion, and calculates the check value of a variable-length binary sequence stream in real time, achieving a logarithmic level of calculation time complexity, and meeting the CRC operation requirements of real-time ultra-high-speed data streams. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flow chart of the real-time recursive CRC verification method.

[0036] Figure 2 Schematic diagram of recursive calculation of check value and check matrix for binary sequence segments.

[0037] Figure 3 Schematic diagram of iterative segmented calculation of the final checksum value for a binary sequence stream.

[0038] Figure 4 The figure is a comparison chart of the computational time of the traditional serial method, the method of the present invention and the multi-channel parallel method. DETAILED DESCRIPTION

[0039] The present invention will be further described below in conjunction with the embodiments, but are not intended to be limiting of the present invention.

[0040] The real-time recursive CRC check device of this embodiment includes:

[0041] Interception module, used to convert real-time bit stream Sequentially truncate binary sequences with non-fixed length ;

[0042] Bisection module, for each binary sequence Perform left-right bisection to obtain a subsequence, and repeat left-right bisection on the subsequence until the length of the final subsequence is less than a preset value;

[0043] A calculation module is used to calculate the CRC check value and check matrix of each final subsequence, and merge the left and right subsequences step by step upward to obtain the final check value of the entire real-time bit stream;

[0044] And a verification module is used to determine whether the final verification value is all zero in the CRC value verification mode. If it is all zero, it indicates that the verification is correct, otherwise it is an error.

[0045] The real-time recursive CRC verification method implemented by the real-time recursive CRC verification device is as follows:

[0046] First, for real-time bit stream The corresponding generating polynomial The coefficient of Order vector P, m The order square matrix F, that is .

[0047] Then as Figure 1 As shown, the following steps are included:

[0048] Step 1: Download from live bitstream Sequentially extract binary sequences of variable length .

[0049] Step 2: Calculate each binary sequence segment by recursive method The checksum value Sum check matrix , .

[0050] Step 3: The check value and check matrix of each segment are iteratively calculated to obtain the final check value R.

[0051] Step 4: Determine the verification result according to the working mode and the final verification value R.

[0052] Please combine Figure 2 As shown, the binary sequence segment in step 2 The checksum value Sum check matrix , Obtained through recursive synchronous calculation, the details are as follows:

[0053] Step 2.1: If the binary sequence segment Length L is an odd number, Add a zero to the first part of The length of is even and is directly divided into two halves. The left and right subsequences of the two halves are and .

[0054] Step 2.2: As in step 2.1, continue to divide the left and right subsequences into equal parts until the length of the subsequence is N Less than the set minimum value, that is, the minimum segment length for CRC value calculation.

[0055] Step 2.3: Calculate the length N The binary sequence segment The checksum value Sum check matrix , .

[0056] Note: Symbol Represents modulo 2 multiplication, symbol Represents modulo 2 addition.

[0057] Step 2.4: Left subsequence of minimum segment length and right subsequence Merge calculation to obtain the parent sequence segment The checksum value Sum check matrix ,

[0058] ,

[0059] like The length of is odd, ,

[0060] like The length of is even, .

[0061] Step 2.5: As described in step 2.4, obtain the sequence segment The check value and check matrix of the parent sequence are traced back layer by layer to finally obtain the sequence segment The checksum value Sum check matrix .

[0062] Please combine Figure 3 As shown, in step 3, the final check value R is obtained by iterative calculation based on the check value of each segment and the check matrix. The specific details are as follows:

[0063] Step 3.1: From the binary sequence segment The checksum value Sum check matrix , we can get the binary sequence The checksum value ;

[0064] Step 3.2: From the binary sequence segment The checksum value Sum check matrix , we can get the binary sequence The checksum value ;

[0065] Step 3.3: Iterate and calculate to get the binary sequence The CRC check value is ;

[0066] Step 3.4: From the binary sequence segment The checksum value Sum check matrix , we can get the binary sequence CRC check value ;

[0067] Step 3.5: With the next sequence segment The checksum value Sum check matrix Calculate, find , until the real-time bit stream ends, and the final check value R is obtained.

[0068] Step 4 determines the verification result according to the working mode and the final verification value R. The details are as follows:

[0069] If it is the mode of generating CRC check value, the R value is the generated CRC check value; if it is the mode of verifying CRC value, the R value is all zeros, the check is correct, otherwise it is an error.

[0070] The following is a specific real-time bit stream The sequence is used as an example to illustrate the difference in computational time consumption among the traditional serial method, the method of the present invention and the multi-channel parallel method (CN103199873A). The encoding length is m =8, generating polynomial , the transmission sequence is a bit string 1010…1010 of length 40000, where 10 appears alternately. The upper limit of the minimum segment length in the method of the present invention is set to 5, that is, ,The number of channels in the multi-channel parallel method is set to 4.

[0071] When generating CRC check values, the parallel bit width of multi-channel parallel operation is set to 10000. When checking CRC check values, the processing sequence The length of is 40008 and the parallel width is set to 10002.

[0072] According to the generating polynomial , can be obtained .

[0073] In step 1, the processed binary sequence is divided into four equal parts. When the CRC check value is generated, The length is 10000. When checking the CRC check value, The length is 10002.

[0074] When the CRC check value is generated, the final check value R is 11010111, that is, the check value of the bit string 1010...1010 of length 40000, and the binary bit string and the check value are concatenated as 1010...101011010111 to generate the transmission sequence. When the CRC value is checked, the final check value R is 00000000, indicating that the transmission sequence is received without error.

[0075] Depend on Figure 4The results show that the time consumption of the three operation methods is of different orders of magnitude. The traditional serial method is the most time-consuming, the multi-channel parallel method reduces the time consumption by one order of magnitude, and the method of the present invention reduces the time consumption by another order of magnitude. The reduction in time consumption is mainly determined by their linear, sublinear and logarithmic computational complexity.

[0076] Finally, it should be pointed out that the specific methods of the above embodiments can form a computer program product. Therefore, the computer program product implemented in this application can be stored on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.).

Claims

1. A real-time recursive CRC verification method, characterized in that: The following steps are involved: Real-time bitstream Sequentially truncate binary sequences with non-fixed length ; For each binary sequence Perform left-right bisection to obtain a subsequence, and repeat left-right bisection on the subsequence until the length of the final subsequence is less than a preset value; Calculate the CRC check value and check matrix of each final subsequence, and combine the left and right subsequences step by step to obtain the final check value of the entire real-time bit stream; CRC checksum for each final subsequence Sum check matrix The calculation method is: , represents modulo 2 multiplication, represents modulo 2 addition, B represents the final subsequence, N represents the length of the final subsequence, and P represents the coefficients of the generating polynomial. Order vector, F represents m Order square array, represents the modulo 2 operation of F n Power; The method of merging the left and right subsequences step by step upward to obtain the final check value of the entire real-time bit stream is as follows: first, merge the left and right subsequences step by step upward to obtain a binary sequence The checksum value Sum check matrix ; Then all binary sequences The check value and check matrix are iteratively calculated to obtain the final check value R; When the left and right subsequences are merged and calculated step by step upward, the left subsequence is set and right subsequence Merge calculation to obtain the parent sequence segment The checksum value Sum check matrix , , like The length of is an odd number, , like The length of is even, ; All binary sequences When the final check value R is obtained by iterative calculation of the check value and the check matrix, for the binary sequence , its CRC check value , and thus iterate backwards in sequence until the end of the real-time bit stream to obtain the final check value R.

2. The real-time recursive CRC verification method according to claim 1, characterized in that: In the CRC value verification mode, it is determined whether the final verification value is all zeros. If it is all zeros, it indicates that the verification is correct, otherwise it is an error.

3. The real-time recursive CRC verification method according to claim 1, characterized in that: In binary sequence When the length is an odd number, in the binary sequence Add "0" to the beginning of the string and then divide it equally on the left and right sides.

4. A real-time recursive CRC check device, characterized in that: include: Interception module, used to convert real-time bit stream Sequentially truncate binary sequences with non-fixed length ; Bisection module, for each binary sequence Perform left-right bisection to obtain a subsequence, and repeat left-right bisection on the subsequence until the length of the final subsequence is less than a preset value; and, a calculation module, for calculating the CRC check value and check matrix of each final subsequence, and merging the left and right subsequences step by step upward to obtain the final check value of the entire real-time bit stream; CRC checksum for each final subsequence Sum check matrix The calculation method is: , represents modulo 2 multiplication, represents modulo 2 addition, B represents the final subsequence, N represents the length of the final subsequence, and P represents the coefficients of the generating polynomial. Order vector, F represents m Order square array, represents the modulo 2 operation of F n Power; The method of merging the left and right subsequences step by step upward to obtain the final check value of the entire real-time bit stream is as follows: first, merge the left and right subsequences step by step upward to obtain a binary sequence The checksum value Sum check matrix ; Then all binary sequences The check value and check matrix are iteratively calculated to obtain the final check value R; When the left and right subsequences are merged and calculated step by step upward, the left subsequence is set and right subsequence Merge calculation to obtain the parent sequence segment The checksum value Sum check matrix , , like The length of is an odd number, , like The length of is even, ; All binary sequences When the final check value R is obtained by iterative calculation of the check value and the check matrix, for the binary sequence , its CRC check value , and thus iterate backwards in sequence until the end of the real-time bit stream to obtain the final check value R.

5. The real-time recursive CRC check device according to claim 4, characterized in that: It includes a verification module, which is used to determine whether the final verification value is all zero in the CRC value verification mode. If it is all zero, it indicates that the verification is correct, otherwise it is an error.

6. The real-time recursive CRC check device according to claim 4, characterized in that: Bisection modules in binary sequence When the length is an odd number, in the binary sequence Add "0" to the beginning of the string and then divide it equally on the left and right sides.

7. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the real-time recursive CRC checking method described in any one of claims 1 to 3 is implemented.

8. A computer program product, characterized in that When the computer program product is executed by a processor, the real-time recursive CRC checking method described in any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Rapid configuration method for two-stage CRC (Cyclic Redundancy Check) operation

    CN103199873A

  • Rapid cyclic redundancy check encoding method and device

    CN101902228A

  • Cyclic redundancy check method and equipment, and storage medium

    CN108233944A