Channel interleaving processing method and processing module
By improving the interleaving matrix storage method and dual-cache structure, the problem of low interleaving cache efficiency was solved, storage resources were saved and the number of read operations was reduced, thereby improving the efficiency of interleaving processing.
Patent Information
- Application Number
- CN202110841877.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-26
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-07-26
AI Technical Summary
In existing technologies, interleaved caches are inefficient, require large storage capacity, and involve numerous read operations, leading to resource waste and increased power consumption.
Each row of the interleaving matrix, consisting of 8 bits (information bits and parity bits), occupies one storage unit. Punching is performed during reading to reduce the number of write operations to the interleaving buffer. A double-buffered structure is used for pipelined processing.
It improves the efficiency of interleaved caching, reduces storage requirements and the number of read operations, saves 87.5% of storage resources, and reduces the number of read operations to 1/8 of the conventional solution.
Smart Images

Figure CN113726476B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital communication, and in particular to a channel interleaving processing method used in dual-mode communication of a national power grid. The present invention also relates to a channel interleaving processing module used in a dual-mode communication system of a national power grid. Background Art
[0002] In digital communication systems, no matter the transmission medium is a wireless channel or a wired channel, due to the complexity and variability of channel conditions, sudden errors are likely to occur at the receiving end. Although digital communication systems usually have a powerful channel error correction code protection mechanism, general error correction code decoding algorithms, such as the common Viterbi decoding algorithm for convolutional codes, Turbo code decoding algorithm, and LDPC code decoding algorithm, all have optimal performance under Gaussian white noise channel conditions. When there are sudden errors, that is, many errors occur in a short period of time, or even many errors occur continuously, the decoding error correction performance will be affected, and it is easy to fail to correct errors, resulting in packet loss or packet errors. Reed-Solomon codes are suitable for dealing with sudden errors, but conversely are not suitable for dealing with Gaussian errors (randomly distributed errors that occur under Gaussian white noise conditions are called Gaussian errors). Therefore, some communication systems use a channel error correction code mechanism that combines convolutional codes and Reed-Solomon codes. The convolutional code acts as an inner code to first solve Gaussian errors. Errors that cannot be corrected by the Viterbi decoding algorithm of the convolutional code usually present burst characteristics. These burst errors are then solved by the Reed-Solomon code decoding algorithm that acts as an outer code.
[0003] Before entering the channel error correction code decoder, if the possible burst errors in the received data can be converted into randomly distributed approximate Gaussian errors by some method, it is beneficial to maximize the error correction capability of the channel error correction code decoder. Interleaving is such a technology commonly used in digital communication systems. At the transmitting end, the data output by the error correction code encoder is shuffled and reorganized in a pseudo-random manner according to the bit unit or bit group (or code word or symbol) unit under the premise of keeping its content unchanged. Then, at the input end of the error correction code decoder at the receiving end, a symmetrical process (called deinterleaving or deinterleaving) is performed to restore its original order. The interleaving process at the transmitting end and the deinterleaving process at the receiving end cancel each other out, so there is no effect on the data itself, but the position arrangement of the errors (which can be called error mode) that appear during the channel transmission process is shuffled and reorganized in a pseudo-random manner because it is only affected by the deinterleaving at the receiving end. If the error pattern is originally a Gaussian error pattern, the properties of the Gaussian error pattern will not be changed after it is shuffled and reorganized in a pseudo-random manner. However, if the error pattern is originally a burst error pattern, it will become a Gaussian error pattern after it is shuffled and reorganized in a pseudo-random manner. In this way, under Gaussian white noise channel conditions, the error correction performance of the error correction decoding at the receiving end will not be affected, while under other channel conditions that may cause burst errors, the error correction performance of the error correction decoding at the receiving end can be effectively improved (compared to the case where interleaving is not used).
[0004] State Grid's dual-mode communication interconnection technology (State Grid Corporation of China Enterprise Standard: Dual-mode Communication Interconnection Technical Specification Part 4-1: Physical Layer Communication Protocol) includes two physical layer standards, one is the high-speed carrier physical layer transmitted through power lines, referred to as HPLC; the other is the wireless physical layer transmitted through the air wirelessly, referred to as HRF. The frame structure diagrams of the two physical layers are as follows: Figure 1 and Figure 2 shown.
[0005] In the State Grid dual-mode communication system, the input data of the channel interleaving comes from the Turbo coding output. Turbo coding is performed in units of payload blocks (PB). The State Grid dual-mode communication system defines six payload block sizes, namely PB16, PB40, PB72, PB136, PB264 and PB520. The value following PB represents the size of the payload block calculated in bytes, PB_SIZE. For example, PB16 means that the data block size is 16 bytes. The payload block size calculated in terms of the number of bits is recorded as K=8*PB_SIZE. The Turbo code in the State Grid dual-mode communication system is a dual binary convolutional Turbo code. The Turbo coding of a payload block is performed in K / 2 beats. Each beat inputs two bits of data in parallel and outputs 4 bits of data. The 4 bits of data output in the i-th beat are recorded as {u 2i ,u 2i+1 ,p 2i ,p 2i+1}, where u 2i ,u 2i+1 is the original input information bit, p 2i ,p 2i+1 is the check bit calculated by the encoder. The Turbo coding output needs to be punctured to delete some of the check bits. Different puncturing modes correspond to three different equivalent code rates, as follows: Figure 4 , Figure 5 and Figure 6 shown.
[0006] The channel interleaving process defined in the State Grid Dual-Mode Communication Interconnection Technical Specification is as follows:
[0007] The channel interleaving unit is used to randomize the information bits and check bits output by the turbo encoder and punctured before multiple copies and transmission to the channel. Interleaving of information bits: The information bits are divided into 4 sub-blocks, each of which is K / 4 bits in size. The information bits are written into a matrix of K / 4 rows and 4 columns by column and read out by row. The first round reads (0, StepSize, 2*StepSize…) rows until the end of the matrix; the second round reads (1, 1+StepSize, 1+2*StepSize…) rows until the end of the matrix; after StepSize rounds, all rows are read.
[0008] Interleaving of parity bits: The parity bits are divided into 4 sub-blocks, each of which is T = (NK) / 4 bits. The parity bits are written into a matrix of T rows and 4 columns by column, and read out by row. The first round reads (offset, offset+StepSize, offset+2*StepSize…) mod T rows; the second round reads (offset+1, offset+1+StepSize, offset+1+2*StepSize…) mod T rows, and each round reads T / StepSize rows. After StepSize rounds, all T rows are read.
[0009] The parameters used in channel interleaving are interleaving step size StepSize and interleaving offset value offset. Figure 3 As shown, PHR only has PB16 mode, and PSDU is compatible with all PB modes. Here, PHR refers to the frame control data part of the physical frame in the State Grid dual-mode communication system, and PSDU refers to the payload data part of the physical frame in the State Grid dual-mode communication system. The information code and check code read out from the interleaving buffer are also subject to half-byte shift processing: the half-byte shift is shifted in units of 4 bits, regardless of information bits or check bits, the order is adjusted every two half-bytes, b0 indicates that the bit comes from block 1 of the information or check bit, and so on, b1 indicates that it comes from block 2, b2 indicates that it comes from block 3, and b3 indicates that it comes from block 4. When bits are output serially, the leftmost bit of the 4 bits is output first, from left to right, and the rules are as follows: Figure 7 shown.
[0010] Finally, the information code and the check code must be interleaved: for the 1 / 2 code rate, the first 4 bits of every 2 half-bytes output are the information code, followed by 4 bits of the check code, and so on. For the 4 / 5 code rate, every 5 half-bytes output are first 2 4-bit information bits, then 1 4-bit check bit, and finally 2 4-bit information bits, and so on. For the 16 / 18 code rate, every 9 half-bytes output are first 3 4-bit information bits, then 4-bit check bits, and finally 5 4-bit information bits, and this pattern is repeated. In the conventional implementation, Turbo coding outputs a bit group sequence {u 2i ,u 2i+1 ,p 2i ,p 2i+1}According to the order defined by the standard, puncturing is first performed, and then the information bit interleaving buffer and the check bit interleaving buffer are written bit by bit. The interleaving buffer is implemented in a double buffer structure, which is used alternately for writing and reading so as to facilitate continuous processing in a pipeline manner. On the one hand, the Turbo coding output result of a payload block (PB) is punctured and then written into the first group of information bit interleaving buffer and check bit interleaving buffer respectively. On the other hand, the interleaving controller reads data from the second group of interleaving buffers to perform half-byte exchange and interleaving of information bits and check bits, and then outputs it to the subsequent module after parallel-to-serial conversion. After completing the processing of a payload block, it switches to writing to the second group of interleaving buffers and reading data from the first group of interleaving buffers... and then keeps alternating until all data blocks are processed.
[0011] The channel interleaving in the State Grid dual-mode communication system belongs to bit-level block interleaving, that is, the interleaving is processed in units of bits. First, the data block to be interleaved, that is, the output data of the Turbo encoder, is written bit by bit into a matrix of K / 4 rows and 4 columns (hereinafter referred to as [a, b] to represent the size of the matrix, where a represents the number of rows of the matrix and b represents the number of columns of the matrix) according to the method defined above, and the check bits are written bit by bit into a matrix of [T / 4, 4] by column, where one element of the matrix represents an information bit or a check bit. The matrix here is a logical concept. In the computer system (whether it is an FPGA chip or a dedicated integrated circuit or a computer software implementation), a one-dimensional storage module can be used to implement the storage of matrix data. For example, a 1024-byte memory can be used to store 128 rows and 8 columns of matrix data, where each byte stores a data element of the matrix, the 1st to 8th storage units store the 1st row of the matrix, the 9th to 16th storage units store the 2nd row of the matrix... and so on. In a computer system (whether it is an FPGA chip, a dedicated integrated circuit, or a computer software implementation), the minimum bit width of a storage module is usually 8 bits, that is, a storage unit can store 8 bits or 1 byte of data, and the storage module can usually only be accessed (read or write modified) according to 8-bit storage units.
[0012] Writing to the interleaved buffer requires writing bit by bit, and the storage units in the computer system can only be accessed as 8-bit storage units, so in the conventional implementation, the interleaved buffer uses an 8-bit storage unit to store one bit of data. In this way, the interleaved buffer of the information bit needs to store a matrix of K / 4 rows and 4 columns, so it actually needs to use 4 storage blocks with a depth of K / 4, and each storage block corresponds to a sub-block or a column. Similarly, the interleaved buffer of the check bit needs to store a matrix of T / 4 rows and 4 columns, so it actually needs to use 4 storage blocks with a depth of T / 4, and each storage block corresponds to a sub-block or a column. Further, the interleaved buffer needs to be implemented in a double buffer structure, so the interleaved buffer for the information bit requires 8 storage blocks with a depth of K / 4, and the interleaved buffer for the check bit requires 8 storage blocks with a depth of T / 4. Further, when reading data from the interleaved buffer, it is read by row. Although the data in the same interleaved row belong to different columns and are stored in different storage blocks and have the same corresponding storage addresses and can be read simultaneously, since the interleaved cache is implemented using 8 storage blocks (4 information bits and 4 check bits), 8 read operations are actually required to read the data in the same interleaved row.
[0013] In summary, the conventional State Grid dual-mode communication signal interleaving processing solution has the following defects:
[0014] 1. The interleaving buffer uses an 8-bit storage unit to store 1-bit data, and 7 bits of storage space cannot be used for other purposes and are wasted, with an effective utilization rate of only 12.5%.
[0015] 2. In the read operation, eight read operations are required to read eight bits of data in a row. Compared with theoretically requiring only one read operation, the operation efficiency is only 12.5%, which corresponds to a huge waste of operation power consumption. Summary of the invention
[0016] A series of simplified concepts are introduced in the Summary of the Invention, which are all simplifications of the prior art in the field, and will be further described in detail in the Detailed Description of the Invention. The Summary of the Invention of the present invention does not mean to attempt to define the key features and essential technical features of the claimed technical solution, nor does it mean to attempt to determine the scope of protection of the claimed technical solution.
[0017] The technical problem to be solved by the present invention is to provide a channel interleaving processing method which can improve the use efficiency of the interleaving buffer, reduce the capacity requirement of the interleaving buffer, and reduce the number of operations required for reading the interleaving buffer.
[0018] Correspondingly, the present invention also provides a channel interleaving processing module which can improve the use efficiency of the interleaving buffer, reduce the capacity requirement of the interleaving buffer, and reduce the number of operations required for reading the interleaving buffer.
[0019] In order to solve the above technical problems, the present invention provides a channel interleaving processing method for dual-mode communication of the State Grid, which is used for dual-mode communication of the State Grid, and includes the following steps:
[0020] S1, write the 4-bit data output by the encoder in each K / 2 action beat into the interleaving buffer, where K is the length of the encoder input data block calculated in bits;
[0021] S2, read out 8 bits of data one by one in the interleaving buffer in the order of addresses with a K / 4 action beat, and perform puncturing, half-byte swapping, information bit interleaving and check bit interleaving, and then output after parallel-to-serial conversion;
[0022] Among the 4 data output by the encoder in each beat, 2 bits are information bits and 2 bits are check bits. The width of the interleaving buffer is 8 bits, and the depth is determined by the maximum payload block size.
[0023] In the S2, the upper 4 bits of the 8 bits read from the interleaving buffer in each beat are information bits, and the lower 4 bits are check bits.
[0024] Optionally, the channel interleaving processing method is further improved, step S1 is The data of each beat {u 2i ,u 2i+1 ,p 2i ,p 2i+1}, u represents information bits, p represents check bits, and writing to the interleaving buffer includes the following sub-steps:
[0025] S1.1, determine the first address addr1 of the interleaved buffer to be written in the current beat;
[0026] S1.2, read out 8 bits of data at address addr1 from the interleaving buffer, recorded as rval1;
[0027] S1.3, u 2i , p 2i Replace 2 bits in rval1;
[0028] S1.4, write the updated rval1 back to the address addr1 of the interleaving buffer;
[0029] S1.5, determine the second address addr2 of the interleaved buffer to be written in the current beat;
[0030] S1.6, read 8 bits of data at address addr2 from the interleaving buffer, recorded as rval2;
[0031] S1.7, u2i+1 , p 2i+1 Replace 2 bits in rval2;
[0032] S1.8, write the updated rval2 back to the address addr2 of the interleaving buffer.
[0033] Optionally, the channel interleaving processing method is further improved, step S2 After the puncturing, half-byte exchange, information bit interleaving and check bit interleaving of each beat data, it is output after parallel-to-serial conversion, including the following sub-steps:
[0034] S2.1, read data from interleaving buffer address j to obtain rdat;
[0035] S2.2, determine whether the lower 4 bits of the 8 bits of data currently read should be discarded; count the upper 4 bits and the lower 4 bits respectively, the count of the upper 4 bits is equal to the current read address, and the count of the lower 4 bits only counts the valid data that is not discarded, the count value of the upper 4 bits is recorded as hcnt, and the count value of the lower 4 bits is recorded as lcnt;
[0036] S2.3, based on hcnt and lcnt, half-byte swap processing is performed on the upper 4 bits of data and the lower 4 bits of data that are not discarded, respectively. The half-byte swap processing is to perform a cyclic right shift processing on the original 4 bits of data, and the right shift amount is determined by hcnt and lcnt;
[0037] S2.4, rearrange the order of the high 4 bits of data and the low 4 bits of data after puncturing and half-byte swapping and output them through parallel-to-serial conversion.
[0038] In order to solve the above technical problems, the present invention provides a channel interleaving processing module for a dual-mode communication system of a State Grid Corporation of China, comprising:
[0039] The encoder is adapted to output 4 bits of data per K / 2 action beats and write them into an interleaved buffer, where K is the encoder input data block length;
[0040] The interleaving processing unit is adapted to read out 8 bits of data from the interleaving buffer address by address in K / 4 action beats in address order, and perform puncturing, half-byte exchange, information bit interleaving and check bit interleaving, and then output after parallel-to-serial conversion.
[0041] Among the 4 data output by the encoder in each beat, 2 bits are information bits and 2 bits are check bits. The width of the interleaving buffer is 8 bits, and the depth is determined by the maximum payload block size.
[0042] Among the 8 bits read from the interleaving buffer in each beat, the upper 4 bits are information bits, and the lower 4 bits are check bits.
[0043] Optionally, the channel interleaving processing module is further improved, and the encoder The data of each beat {u 2i ,u 2i+1 ,p 2i ,p 2i+1}, u represents the information bit, p represents the check bit, and the following steps are used to write the interleaving buffer:
[0044] S1.1, determine the first address addr1 of the interleaved buffer to be written in the current beat;
[0045] S1.2, read out 8 bits of data at address addr1 from the interleaving buffer, recorded as rval1;
[0046] S1.3, u 2i , p 2i Replace 2 bits in rval1;
[0047] S1.4, write the updated rval1 back to the address addr1 of the interleaving buffer;
[0048] S1.5, determine the second address addr2 of the interleaved buffer to be written in the current beat;
[0049] S1.6, read 8 bits of data at address addr2 from the interleaving buffer, recorded as rval2;
[0050] S1.7, u 2i+1 , p 2i+1 Replace 2 bits in rval2;
[0051] S1.8, write the updated rval2 back to the address addr2 of the interleaving buffer.
[0052] Optionally, the channel interleaving processing module is further improved, wherein the interleaving processing unit After the puncturing, half-byte exchange, information bit interleaving and check bit interleaving of the beat data, it is output after parallel-to-serial conversion. The following steps are adopted:
[0053] S2.1, read data from interleaving buffer address j to obtain rdat;
[0054] S2.2, determine whether the lower 4 bits of the 8 bits of data currently read should be discarded; count the upper 4 bits and the lower 4 bits respectively, the count of the upper 4 bits is equal to the current read address, and the count of the lower 4 bits only counts the valid data that is not discarded, the count value of the upper 4 bits is recorded as hcnt, and the count value of the lower 4 bits is recorded as lcnt;
[0055] S2.3, based on hcnt and lcnt, half-byte swap processing is performed on the upper 4 bits of data and the lower 4 bits of data that are not discarded, respectively. The half-byte swap processing is to perform a cyclic right shift processing on the original 4 bits of data, and the right shift amount is determined by hcnt and lcnt;
[0056] S2.4, rearrange the order of the high 4 bits of data and the low 4 bits of data after puncturing and half-byte swapping and output them through parallel-to-serial conversion.
[0057] Different from the conventional technical implementation, in the scheme of the present invention, the interleaving buffer does not use one storage unit to store one bit, but each row of the interleaving matrix, including 8 bits of information bits and check bits, occupies one storage unit. Moreover, the puncturing process is not performed before writing the interleaving buffer, but is performed when reading from the interleaving buffer. Therefore, the process of writing the interleaving buffer is common to different code rates. When writing the interleaving buffer, it is still written bit by bit, but the 8-bit data of each row occupying a storage unit in the interleaving matrix is not written at one time, but written in 4 times, each time writing 1 information bit and 1 corresponding check bit. When writing to a storage unit occupied by the same row, it must be ensured that the previously written bits will not be tampered with. The implementation method is that when writing an address, it is first read out, and then the information bit and check bit to be written are updated to the corresponding bit position calculated according to the interleaving rule of the read data, and then written back to the same address of the interleaving buffer. In this way, the new bit is written to the predetermined bit position, and the data of other bit positions in the storage unit is ensured not to be tampered with.
[0058] The cache depth requirement of the present invention remains unchanged, but it is reduced from 8 cache blocks to only one, saving 87.5% of storage resources. Moreover, in the interleaved cache, 8 bits of data in the same row can be read out in one read operation, and the number of read operations required for reading data is also reduced to 1 / 8 of the conventional solution.
[0059] The information bit interleaving and check bit interleaving of the present invention use two 8-bit width storage blocks in total. The two storage blocks form a double buffer structure, which is alternately used for writing and reading, respectively, to ensure pipeline processing when multiple load blocks need to be processed. The depth of the storage block is determined by the size of the original load block. Assuming that PB_SIZE represents the number of bytes of PB, the depth requirement is For example, in the State Grid dual-mode communication standard, the largest PB is PB520, so the depth of the interleaving buffer is required to be 1040. In other words, the interleaving buffer consists of 2 1040-byte storage blocks.
[0060] The upper 4 bits of the interleaving buffer store information bits, and the lower 4 bits store check bits. Under different code rate conditions, the amount of check bit data left after puncturing and deletion is different. Each address in the upper 4-bit area of the interleaving buffer must store information bits. When CR=1 / 2, the amount of check bit data is the same as the information bit, and each address in the lower 4-bit area of the interleaving buffer is used to store valid check bits (i.e., not deleted by the puncturing process); when CR=4 / 5, the amount of check bit data is 1 / 4 of the information bit, and the addresses in the lower 4-bit area that satisfy addr%4==0 (address counting starts from 0) store valid check bits, and the other addresses store check bits that are scheduled to be deleted in the puncturing process; when CR=16 / 18, the amount of check bit data is 1 / 8 of the information bit, and the addresses in the lower 4-bit area that satisfy addr%8==0 store check bits, and the other addresses store check bits that are scheduled to be deleted in the puncturing process. Taking PB16 as an example, the data is stored in the interleaving buffer after being written into the interleaving buffer as follows: Figure 8 , Fig. 9 and Fig.10 As shown, each row represents a storage unit, the leftmost is MSB (bit[7]), which is used to store the earliest bit written in the same interleaved row, and the rightmost is defined as LSB (bit[0]), which is used to store the latest bit written in the same interleaved row. Of course, experienced engineers in this field should know that this bit order definition is not inevitable. For example, defining the leftmost as LSB (bit[7]) to store the latest bit written in the same interleaved row and the rightmost as MSB (bit[0] to store the earliest bit written in the same interleaved row has no effect at all. Subsequent processing methods only need to be adjusted accordingly and keep consistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The drawings of the present invention are intended to illustrate the general characteristics of the methods, structures and / or materials used in specific exemplary embodiments of the present invention, and to supplement the description in the specification. However, the drawings of the present invention are schematic diagrams not drawn to scale, and thus may not accurately reflect the precise structure or performance characteristics of any given embodiment, and the drawings of the present invention should not be interpreted as limiting or restricting the range of values or properties covered by the exemplary embodiments of the present invention. The present invention is further described in detail below in conjunction with the drawings and specific embodiments:
[0062] Figure 1 It is a schematic diagram of the high-speed carrier physical layer frame structure.
[0063] Figure 2 It is a schematic diagram of the wireless physical layer frame structure.
[0064] Figure 3 It is the channel interleaving parameter table.
[0065] Figure 4 This is a schematic diagram of the puncturing process when the bit rate is 1 / 2.
[0066] Figure 5 This is a schematic diagram of the puncturing process when the bit rate is 16 / 18.
[0067] Figure 6 This is a schematic diagram of the puncturing process when the bit rate is 4 / 5.
[0068] Figure 7 is a nibble shift table.
[0069] Figure 8 It is the data after PB16, CR=1 / 2 interleaved cache write processing.
[0070] Fig. 9 It is the data after PB16, CR=4 / 5 interleaved cache write processing.
[0071] Fig.10 It is the data after PB16, CR=16 / 18 interleaved cache write processing. DETAILED DESCRIPTION
[0072] The following describes the implementation methods of the present invention through specific specific embodiments, and those skilled in the art can fully understand other advantages and technical effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through different specific implementation methods, and the details in this specification can also be applied based on different viewpoints, and various modifications or changes can be made without deviating from the overall design concept of the invention. It should be noted that the following embodiments and the features in the embodiments can be combined with each other in the absence of conflict. The following exemplary embodiments of the present invention can be implemented in a variety of different forms and should not be interpreted as being limited to the specific embodiments described herein. It should be understood that these embodiments are provided to make the disclosure of the present invention thorough and complete, and to fully convey the technical solutions of these exemplary specific embodiments to those skilled in the art.
[0073] First embodiment;
[0074] The present invention provides a channel interleaving processing method for dual-mode communication of a national power grid, comprising the following steps:
[0075] S1, the encoder outputs 4 bits of data per beat and writes them into the interleaving buffer at a K / 2 action beat, where K is the encoder input data block length;
[0076] S2, read out 8 bits of data one by one in the interleaving buffer in the order of addresses with a K / 4 action beat, and perform puncturing, half-byte swapping, information bit interleaving and check bit interleaving, and then output after parallel-to-serial conversion;
[0077] Among the 4 data output by the encoder in each beat, 2 bits are information bits and 2 bits are check bits. The width of the interleaving buffer is 8 bits, and the depth is determined by the maximum payload block size.
[0078] Second embodiment;
[0079] Taking PB16 as an example to illustrate the channel interleaving processing method of the present invention, PB16 indicates that the size of the payload block is 16 bytes, i.e., 128 bits of data, so the cache depth is The present invention provides a channel interleaving processing method for dual-mode communication of a national power grid, comprising the following steps:
[0080] S1, the encoder outputs 4 bits of data at a K / 2 action beat and writes them into the interleaving buffer. Among every 4 bits of data, 2 bits are information bits and 2 bits are check bits. The width of the interleaving buffer is 8 bits, and the depth is determined by the maximum payload block size. K is the encoder input data block length;
[0081] The input data of the channel interleaving is the output of the Turbo encoder. Each action beat of the Turbo encoder inputs two bits and outputs 4 bits, which includes the two information bits of the original input and the two check bits calculated by the encoder. Therefore, the channel interleaving module inputs 4 bits in parallel in each action beat, which is recorded as The data of each beat {u 2i ,u 2i+1 ,p 2i ,p 2i+1} as an example, u represents the information bit and p represents the check bit;
[0082] As mentioned above, in the implementation method of the present invention, the puncturing process is moved to the time when the interleaving buffer is read out, so for different code rates, the process of writing into the interleaving buffer is exactly the same.
[0083] S1.1, at the first action beat, that is, i = 0, the interleaved input data is {u0, u1, p0, p1}, refer to Figure 8 , Fig. 9 and Fig.10 As shown, these four bits should be written into bit[7] and bit[3] of the first storage unit (address 0) and the second storage unit (address 1) of the interleaving buffer respectively. The writing includes the following sub-steps:
[0084] S1.2, determine the first address addr1=0 of the interleaving buffer to be written in the current beat;
[0085] The 8 bits of data at address addr1 are read out from the interleaving buffer and stored in the variable rval[7:0]. In fact, for the writing of address 0 and address 1, since there are no bits written earlier, the step of reading out first is redundant. However, the advantage of doing so is that the processing of all beats is completely consistent, that is, the regularity of the processing in all beats is ensured;
[0086] S1.3, reassign rval[7] to u0, and reassign rval[3] to p0;
[0087] S1.4, write rval back to address 0;
[0088] S1.5, determine the second address addr1=1 of the interleaved buffer to be written in the current beat;
[0089] S1.6, read the data at address 1 and store it in variable rval[7:0];
[0090] S1.6, reassign rval[7] to u1, and reassign rval[3] to p1;
[0091] S1.8, write rval back to address 1;
[0092] …
[0093] In the (i+1)th action beat, the interleaved input data is {u 2i ,u 2i+1 ,p 2i ,p 2i+1},refer to Figure 8 , Fig. 9 and Fig.10 As shown, these 4 bits should be written into the storage unit at the address (2i%32) and the storage unit at the address ((2i+1)%32) of the interleaving buffer respectively. and Go here Indicates that x is rounded down. Here, x%y means the operation of x modulo y, which includes the following sub-steps:
[0094] S1.1, determine the first address addr1 of the interleaved buffer to be written in the current beat = (2i%32);
[0095] S1.2, read the data at address addr1 and store it in variable rval[7:0];
[0096] S1.3, Reassign value to u 2i , Reassign the value to p 2i ;
[0097] S1.4, write rval back to address addr1;
[0098] S1.5, determine the second address addr2 of the interleaved buffer to be written in the current beat = ((2i+1)%32);
[0099] S1.6, read the data at address addr2 and store it in variable rval[7:0];
[0100] S1.7, Reassign value to u 2i+1 , Reassign the value to p 2i+1 ;
[0101] S1.8, write rval back to the address ((2i+1)%32);
[0102] …
[0103] The above process continues until So far, the cache writing of the channel interleaving processing of the Turbo coded output data corresponding to one PB data block is completed.
[0104] Because the data in the storage unit at the corresponding address is read out before each writing and rewritten after only updating the data at the corresponding bit position to be written, the previously written bit data at the same address position will not be tampered with. For example, when i=32, the {u 64 ,p 64} need to be written to bit[7] and bit[3] of the address (2i%32)=0. This address has previously been written to bit[7], bit[6], bit[3], and bit[2] respectively. 32 ,p0,p 32}. At this time, the value obtained after reading address 0 is rval={u0,u 32 ,X,X,p0,p 32 ,X,X}, where X represents an uncertain value, or don't-care. (i.e. rval[5]) and (i.e. rval[1]) are updated to u respectively 64 and p 64 Get the updated rval={u0,u 32 ,u 64 ,X,p0,p 32 ,p 64 ,X}, and then write it back to address 0. It can be seen that bit[5] and bit[1] of address 0 are correctly updated, while the data of bit[7], bit[6], bit[1], and bit[0] written previously remain unchanged.
[0105] The interleaved buffer readout process is performed in natural row order, because each row corresponds to exactly one address, so it can be read out in the natural address order of 0, 1, 2, .... For the data read out from the interleaved buffer in natural row order, puncturing, half-byte shifting, and order adjustment of information bits and check bits are performed next.
[0106] Punching processing varies according to the bit rate. The processing rules under different bit rates are as follows: Figure 4 , Figure 5 and Figure 6 See Figure 8 , Fig. 9 and Fig.10 After writing the data into the interleaving buffer in the manner described in step S1, Figure 8 , Fig. 9 and Fig.10p0,p 32 ,p 64 ,p 96 The part corresponds to the check bit data to be deleted in the puncturing process. The interleaving process between the information code and the check code refers to the sorting adjustment between the information code and the check code output through block interleaving in units of half a byte. For the 1 / 2 code rate, in every two half bytes of the valid information code and check code read out from the interleaving buffer, the first 4 bits are the information code, followed by the next 4 bits as the check code, and so on. For the 16 / 18 code rate, first there are 3 4-bit information bits, then 4-bit check bits, and finally 5 4-bit information bits, and this pattern is repeated. For the 4 / 5 code rate, first there are 2 4-bit information bits, then 1 4-bit check bit, and finally 2 4-bit information bits, and so on.
[0107] Half-byte shift means that no matter whether it is information bits or check bits, the order is adjusted every two half-bytes. The exchange rule is as follows: Figure 7 As shown. Among them, block 1 corresponds to Figure 8 , Fig. 9 and Fig.10 From left to right, the first column (information code) and the fourth column (check code) in block 2 correspond to Figure 8 , Fig. 9 and Fig.10 From left to right, the second column (information code) and the fifth column (check code) are listed, and so on.
[0108] S2, read out 8 bits of data one by one in the interleaving buffer in the order of addresses with a K / 4 action beat, the upper 4 bits of the 8 bits read out each time are information bits, and the lower 4 bits are check bits, and perform puncturing, half-byte exchange, information bit interleaving and check bit interleaving, and then output after parallel-to-serial conversion;
[0109] Processing step S2 is completed in K / 4 action beats. The processing step S2 under different bit rates is different due to different puncturing processes. The action beat sequence number of processing step S2 is An action beat describing the processing step S2 under different bit rate conditions is decomposed in the following manner, which is further explained at bit rate 1 / 2, bit rate 4 / 5 and bit rate 16 / 18 respectively;
[0110] Under the condition of bit rate 1 / 2, it is equivalent to no puncturing. Figure 8 The action of one beat of processing step 2 under the bit rate 1 / 2 condition is as follows:
[0111] S2.1, read data from the address K of the interleaving buffer, and store the read data in the variable rdat, where the upper 4 bits are information bits and the lower 4 bits are check bits;
[0112] S2.2, let Shift the upper and lower nibbles of rdat i times respectively. If i is 0, it is equivalent to not performing a circular shift and remains unchanged. That is to say, when Keep rdat unchanged;
[0113] when Shift the high and low nibbles of rdat right once respectively to obtain rdat1[7:0]←{rdat[4],rdat[7],rdat[6],rdat[5],rdat[0],rdat[3],rdat[2],rdat[1]}, where ← means assigning the data on the right to the variables on the left according to the same bit position. The above formula means assigning rdat[4] to rdat1[7], assigning rdat[7] to rdat1[6], and so on.
[0114] when Shift the high and low nibbles of rdat right twice respectively to get rdat1[7:0]←{rdat[5],rdat[4],rdat[7],rdat[6],rdat[1],rdat[0],rdat[3],rdat[2]} Shift the high and low nibbles of rdat three times respectively to get rdat1[7:0]←{rdat[6],rdat[5],rdat[4],rdat[7],rdat[2],rdat[1],rdat[0],rdat[3]
[0115] S2.3, under the condition of code rate 1 / 2, since there is no puncturing process, the 8-bit data rdat1 after the above half-byte shift process is directly output in the order of "from high bit to low bit".
[0116] Under the condition of bit rate 4 / 5, if Fig. 9 As shown, 3 / 4 of the check codes need to be punctured and deleted, and only the check codes stored in the storage units whose addresses satisfy (k%4)=0 need to be retained. The actions of one beat of the processing step S2 under the code rate 4 / 5 condition are as follows:
[0117] S2.1, read data from address k of the interleaving buffer, and store the read data in variable rdat, where the upper 4 bits are information bits and the lower 4 bits are check bits.
[0118] S2.2, let Shift the high nibble of rdat i times, and shift the low nibble of rdat j times. If i or j is equal to 0, it is equivalent to not doing a circular shift and remains unchanged. For example, when k is equal to 36,
[0119] Shift the upper 4 bits of rdat right twice, and keep the lower 4 bits of rdat unchanged, to obtain: rdat1[7:0]←{rdat[5],rdat[4],rdat[7],rdat[6],rdat[3],rdat[2],rdat[1],rdat[0]}.
[0120] When k is equal to 17, Execute 0 circular right shifts on the upper 4 bits of rdat and 2 circular right shifts on the lower 4 bits of rdat to obtain: dat1[7:0]←{rdat[7],rdat[6],rdat[5],rdat[4],rdat[1],rdat[0],rdat[3],rdat[2]}. Fig. 9 As shown, the check code stored at address #17 needs to be punctured and deleted, but it is still subjected to cyclic shift processing here in order to maintain the regularity of the processing, which is more conducive to implementation than deliberately distinguishing it and not processing it.
[0121] S2.3, when (k%4)==0, output the high 4 bits of rdat1 in the order of "from high to low", and temporarily store the low 4 bits in the variable rdat2[3:0];
[0122] When (k%4)==1, the high 4 bits of rdat1 are output in the order of "from high to low", and the low 4 bits are discarded;
[0123] When (k%4)==2, first output rdat2[3:0] in the order of "from high to low", then output the high 4 bits of rdat in the order of "from high to low", and discard the low 4 bits;
[0124] When (k%4)==3, the upper 4 bits of rdat are output in the order of "from high to low", and the lower 4 bits are discarded.
[0125] Under the condition of bit rate 16 / 18, if Fig.10 As shown, 7 / 8 of the check codes need to be punctured and deleted, and only the check codes stored in the storage units whose addresses satisfy (k%8)==0 need to be retained. The actions of one beat of the processing step S2 under the code rate 16 / 18 condition are as follows:
[0126] S2.1 reads data from address k of the interleaving buffer, and the read data is stored in variable rdat, wherein the upper 4 bits are information bits and the lower 4 bits are check bits.
[0127] S2.2 Order Shift the high nibble of rdat i times, and shift the low nibble of rdat j times. If i or j is equal to 0, it is equivalent to not making the corresponding circular shift and remains unchanged. For example, when k is equal to 80, Perform 0 circular right shifts on the upper 4 bits of rdat and 2 circular right shifts on the lower 4 bits of rdat to obtain: rdat1[7:0]←{rdat[7],rdat[6],rdat[5],rdat[4],rdat[1],rdat[0],rdat[3],rdat[2]}.
[0128] When k is equal to 26, Shift the upper 4 bits of rdat right once, and the lower 4 bits of rdat right three times, to obtain: {rdat[0],rdat[7],rdat[6],rdat[5],rdat[2],rdat[1],rdat[0],rdat[3]}. Fig.10 As shown, the check code stored at address #26 needs to be punctured and deleted, but it is still subjected to cyclic shift processing here in order to maintain the regularity of the processing, which is more conducive to implementation than deliberately distinguishing it and not processing it.
[0129] S2.3, when (k%8)==0, output the upper 4 bits of rdat1 in the order of "from high to low", and temporarily store the lower 4 bits in the variable rdat2[3:0].
[0130] When (k%8)==1, the upper 4 bits of rdat1 are output in the order of "from high to low", and the lower 4 bits are discarded.
[0131] When (k%8)==2, the high 4 bits of rdat1 are output in the order of "from high to low", and the low 4 bits are discarded.
[0132] When (k%8)==3, rdat2[3:0] is first output in the order of "from high to low", and then the high 4 bits of rdat1 are output in the order of "from high to low", and the low 4 bits are dropped.
[0133] When (k%8)==4, the upper 4 bits of rdat1 are output in the order of "from high to low", and the lower 4 bits are discarded.
[0134] When (k%8)==5, the upper 4 bits of rdat1 are output in the order of "from high to low", and the lower 4 bits are discarded.
[0135] When (k%8)==6, the upper 4 bits of rdat1 are output in the order of "from high to low", and the lower 4 bits are discarded.
[0136] When (k%8)==7, the upper 4 bits of rdat1 are output in the order of "from high to low", and the lower 4 bits are discarded.
[0137] Third embodiment;
[0138] The present invention provides a channel interleaving processing module for a dual-mode communication system of a national power grid, comprising:
[0139] An encoder adapted to output 4 bits of data per beat and write them into an interleaved buffer at a K / 2 action beat, where K is the encoder input data block length;
[0140] The interleaving processing unit is adapted to read out 8 bits of data one by one in the interleaving buffer in the order of addresses with a K / 4 action beat, and perform puncturing, half-byte exchange, information bit interleaving and check bit interleaving, and then output after parallel-to-serial conversion.
[0141] Fourth embodiment
[0142] The present invention provides a channel interleaving processing module for a dual-mode communication system of a national power grid. The principle of the fourth embodiment of the present invention is the same as that of the third embodiment, including:
[0143] An encoder adapted to output 4 bits of data per beat at a K / 2 action beat and write them into an interleaving buffer, wherein 2 bits of every 4 bits of data are information bits and 2 bits are check bits, the width of the interleaving buffer is 8 bits, the depth is determined by the maximum payload block size, and K is the encoder input data block length;
[0144] First The data of each beat {u 2i ,u 2i+1 ,p 2i ,p 2i+1}, u represents information bits, p represents check bits, and the following steps are used as an example of writing to the interleaving buffer:
[0145] S1.1, determine the first address addr1 of the interleaved buffer to be written in the current beat;
[0146] S1.2, read out 8 bits of data at address addr1 from the interleaving buffer, recorded as rval1;
[0147] S1.3, u 2i , p 2i Replace 2 bits in rval1;
[0148] S1.4, write the updated rval1 back to the address addr1 of the interleaving buffer;
[0149] S1.5, determine the second address addr2 of the interleaved buffer to be written in the current beat;
[0150] S1.6, read 8 bits of data at address addr2 from the interleaving buffer, recorded as rval2;
[0151] S1.7, u 2i+1 , p 2i+1 Replace 2 bits in rval2;
[0152] S1.8, write the updated rval2 back to the address addr2 of the interleaving buffer;
[0153] An interleaving processing unit is adapted to read out 8 bits of data one by one in the interleaving buffer in the order of addresses with a K / 4 action beat, wherein the upper 4 bits of the 8 bits read out each time are information bits and the lower 4 bits are check bits, and the data is punctured, half-byte exchanged, information bit interleaved and check bit interleaved, and then outputted after parallel-to-serial conversion;
[0154] First For example, after the puncturing of the beat data, half-byte exchange, information bit interleaving and check bit interleaving, and then the parallel-to-serial conversion, the output is output. The following steps are adopted:
[0155] S2.1, read data from interleaving buffer address j to obtain rdat;
[0156] S2.2, determine whether the lower 4 bits of the 8 bits of data currently read should be discarded; count the upper 4 bits and the lower 4 bits respectively, the count of the upper 4 bits is equal to the current read address, and the count of the lower 4 bits only counts the valid data that is not discarded, the count value of the upper 4 bits is recorded as hcnt, and the count value of the lower 4 bits is recorded as lcnt;
[0157] S2.3, based on hcnt and lcnt, half-byte swap processing is performed on the upper 4 bits of data and the lower 4 bits of data that are not discarded, respectively. The half-byte swap processing is to perform a cyclic right shift processing on the original 4 bits of data, and the right shift amount is determined by hcnt and lcnt;
[0158] S2.4, rearrange the order of the high 4 bits of data and the low 4 bits of data after puncturing and half-byte swapping and output them through parallel-to-serial conversion.
[0159] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. It will also be understood that, unless expressly defined herein, terms such as those defined in general dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art, and not interpreted in an ideal or overly formal sense.
[0160] The present invention has been described in detail above through specific implementation modes and embodiments, but these do not constitute limitations of the present invention. Without departing from the principles of the present invention, those skilled in the art may also make many variations and improvements, which should also be regarded as the protection scope of the present invention.
Claims
1. A channel interleaving processing method, which is used for dual-mode communication of the State Grid, characterized in that: The following steps are involved: S1, the encoder outputs 4 bits of data per beat in K / 2 action beats and writes them into the interleaving buffer, where K is the encoder input data block length, including: The data of each beat {u 2i ,u 2i+1 ,p 2i ,p 2i+1 }, u represents information bits, p represents check bits, and writing to the interleaving buffer includes the following sub-steps: S1.1, determine the first address addr1 of the interleaved buffer to be written in the current beat; S1.2, read out 8 bits of data at address addr1 from the interleaving buffer, recorded as rval1; S1.3, u 2i , p 2i Replace 2 bits in rval1; S1.4, write the updated rval1 back to the address addr1 of the interleaving buffer; S1.5, determine the second address addr2 of the interleaved buffer to be written in the current beat; S1.6, read 8 bits of data at address addr2 from the interleaving buffer, recorded as rval2; S1.7, u 2i+1 , p 2i+1 Replace 2 bits in rval2; S1.8, write the updated rval2 back to the address addr2 of the interleaving buffer; S2, read out 8 bits of data one by one in the interleaving buffer in the order of addresses with a K / 4 action beat, and perform puncturing, half-byte swapping, information bit interleaving and check bit interleaving, and then output after parallel-to-serial conversion; Among the 4 data output by the encoder in each beat, 2 bits are information bits and 2 bits are check bits. The width of the interleaving buffer is 8 bits, and the depth is determined by the maximum payload block size.
2. The channel interleaving processing method according to claim 1, characterized in that: The upper 4 bits of the 8 bits read out each time are information bits, and the lower 4 bits are check bits.
3. The channel interleaving processing method according to claim 1, wherein: Step S2: After the puncturing, half-byte exchange, information bit interleaving and check bit interleaving of each beat data, it is output after parallel-to-serial conversion, including the following sub-steps: S2.1, read data from interleaving buffer address j to obtain rdat; S2.2, determine whether the lower 4 bits of the 8 bits of data currently read should be discarded; count the upper 4 bits and the lower 4 bits respectively, the count of the upper 4 bits is equal to the current read address, and the count of the lower 4 bits only counts the valid data that is not discarded, the count value of the upper 4 bits is recorded as hcnt, and the count value of the lower 4 bits is recorded as lcnt; S2.3, based on hcnt and lcnt, half-byte swap processing is performed on the upper 4 bits of data and the lower 4 bits of data that are not discarded, wherein the half-byte swap processing is a circular right shift processing of the original 4 bits of data, and the right shift amount is determined by hcnt and lcnt; S2.4, rearrange the order of the high 4 bits of data and the low 4 bits of data after puncturing and half-byte swapping and output them through parallel-to-serial conversion.
4. A channel interleaving processing module, which is used in the State Grid dual-mode communication system, characterized in that: include: An encoder adapted to output 4 bits of data at a K / 2 action beat and write them into an interleaved buffer, where K is the encoder input data block length; The encoder converts the The data of each beat {u 2i ,u 2i+1 ,p 2i ,p 2i+1 }, u represents the information bit, p represents the check bit, and the following steps are used to write the interleaving buffer: S1.1, determine the first address addr1 of the interleaved buffer to be written in the current beat; S1.2, read out 8 bits of data at address addr1 from the interleaving buffer, recorded as rval1; S1.3, u 2i , p 2i Replace 2 bits in rval1; S1.4, write the updated rval1 back to the address addr1 of the interleaving buffer; S1.5, determine the second address addr2 of the interleaved buffer to be written in the current beat; S1.6, read 8 bits of data at address addr2 from the interleaving buffer, recorded as rval2; S1.7, u 2i+1 , p 2i+1 Replace 2 bits in rval2; S1.8, write the updated rval2 back to the address addr2 of the interleaving buffer; An interleaving processing unit adapted to read out 8 bits of data one by one in the interleaving buffer in the order of addresses at a K / 4 action beat, and perform puncturing, half-byte exchange, information bit interleaving and check bit interleaving, and then output after parallel-to-serial conversion; Among the 4 data output by the encoder in each beat, 2 bits are information bits and 2 bits are check bits. The width of the interleaving buffer is 8 bits, and the depth is determined by the maximum payload block size.
5. The channel interleaving processing module according to claim 4, characterized in that: The upper 4 bits of the 8 bits read out each time are information bits, and the lower 4 bits are check bits.
6. The channel interleaving processing module according to claim 4, characterized in that: The interleaving processing unit After the puncturing, half-byte exchange, information bit interleaving and check bit interleaving of the beat data, it is output after parallel-to-serial conversion. The following steps are adopted: S2.1, read data from interleaving buffer address j to obtain rdat; S2.2, determine whether the lower 4 bits of the 8 bits of data currently read should be discarded; count the upper 4 bits and the lower 4 bits respectively, the count of the upper 4 bits is equal to the current read address, and the count of the lower 4 bits only counts the valid data that is not discarded, the count value of the upper 4 bits is recorded as hcnt, and the count value of the lower 4 bits is recorded as lcnt; S2.3, based on hcnt and lcnt, half-byte swap processing is performed on the upper 4 bits of data and the lower 4 bits of data that are not discarded, wherein the half-byte swap processing is a circular right shift processing of the original 4 bits of data, and the right shift amount is determined by hcnt and lcnt; S2.4, rearrange the order of the high 4 bits of data and the low 4 bits of data after puncturing and half-byte swapping and output them through parallel-to-serial conversion.
