This application relates to the field of channel coding technologies, and in particular, to a channel coding method, a channel coding apparatus, a chip system, and a storage medium.
In a communications system, a coding technology is usually used to increase a peak value of the communications system and improve reliability of data transmission, and linear precoding needs to be used on a transmit end to adjust amplitude and a phase of a transmit channel. Both a transmit device and a receive device store a precoding matrix codebook. The transmit device may obtain a precoding matrix by factorizing a channel transmission matrix, then encode each piece of data, and send encoded data to corresponding parallel channels for transmission. However, in a precoding method, a specific channel state (including a capacity) of each parallel channel usually needs to be known, and when a capacity of each parallel channel is not known, usually, only diversity (Diversity) technologies can be used. However, all general diversity technologies are used for different modulation symbols in a same encoding block; therefore, no coding gain can be obtained by using the coding technology, and obtained channel capacities of the parallel channels cannot be maximized, in other words, a combined capacity cannot reach 1.
This application provides a channel coding method, a channel coding apparatus, a chip system, and a storage medium, so that characteristics of polar (Polar) code can be fully utilized to resolve a prior-art problem that a combined capacity of channels is relatively low when data is sent based on parallel channels. The parallel channels herein are two or more time-domain-based or frequency-domain-based channels, and data is sent on the parallel channels after same or different processing (which includes but is not limited to processing such as encoding, modulation, scrambling, and conjugation).
A first aspect provides a channel coding method. Each encoder includes at least N idle encoding blocks that are contiguous in time-domain positions or frequency-domain positions, and encoding blocks in different encoders include a same quantity of encoding sub-blocks. Each encoding block includes P encoding sub-blocks, reliabilities of the P encoding sub-blocks are sorted in ascending order based on a time-domain position ascending order or frequency-domain position ascending order, P is a positive integer, and P≥N. The method includes:
first preprocessing N bit sequences, where a manner of the preprocessing mainly includes positive sequencing, reverse sequencing, or linear transformation, or may include another preprocessing manner;
then inputting, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, N bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of M encoders, where N and M are positive integers, and M≥2;
obtaining M corresponding encoded sequences after encoding, in the encoders, the N preprocessed bit sequences that are input;
and respectively sending the M obtained encoded sequences on M parallel channels through resource mapping, where resource mapping means that for each channel used to transmit an encoded sequence, a to-be-sent encoded sequence is mapped onto a virtual resource block, then the encoded sequence that is mapped onto the virtual resource block is mapped onto a physical resource block, and finally the encoded sequence is sent by using a channel corresponding to the physical resource block.
Compared with that in an existing mechanism, in this application, there is no need to know a capacity of a single parallel channel, before repeated data is input into an encoder, the repeated data is preprocessed first, and then repeated data preprocessed each time is input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, into encoding sub-blocks of encoding blocks in one of the M encoders. In this way, it can be ensured that all bit sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, the N bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode the N bit sequences.
In some possible designs, different preprocessing may be performed on different bit sequences based on times required for repeated encoding. Inputting the N bit sequences preprocessed each time into the encoding sub-blocks and encoding the input bit sequences mainly includes the following.
a: The N bit sequences are sequentially input, according to a bit order of the bit sequences and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a first encoder, and the N bit sequences input into the first encoder are encoded, to obtain a first encoded sequence.
An ith bit sequence of the N bit sequences is input, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into an ith encoding sub-block of an ith encoding block in the first encoder, where i is a positive integer, and 1≤i≤P.
In addition, at least one of the two following two is further included.
b: The N bit sequences are sequentially input, according to the bit order of the bit sequences and a time-domain position descending order or a frequency-domain position descending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a second encoder, and the N bit sequences input into the second encoder are encoded, to obtain a second encoded sequence.
A jth bit sequence of the N bit sequences is input, according to the bit order of the bit sequences and the time-domain position descending order or the frequency-domain position descending order of encoding blocks in an encoder, into a jth encoding sub-block of a jth encoding block in the second encoder, where j is a positive integer, and 1≤j≤P.
Alternatively, c: The N bit sequences obtained after linear transformation are input, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a third encoder, and the N bit sequences input into the third encoder after linear transformation are encoded, to obtain a third encoded sequence.
In case c, linear transformation needs to be performed on the N bit sequences, where linear transformation is performed for (M−2) times, and there is at least one third encoder. A specific linear transformation process and a specific process of inputting the N bit sequences into the encoding sub-blocks are as follows:
first performing linear transformation on N bit sequences that are to be input into a kth third encoder, to obtain N new bit sequences, where k is a positive integer, and 1≤k≤M; and then inputting an mth new bit sequence of the N new bit sequences into an mth encoding sub-block of an mth encoding block in the kth third encoder, where m is a positive integer, and 1≤m≤P.
The first encoder, the second encoder, and the third encoder are all polar encoders.
In some possible designs, before the N bit sequences obtained after linear transformation are input into the third encoder, the N new bit sequences may be further mapped onto an X Galois field, where X=2p, and p is a positive integer. That the N bit sequences are mapped onto the X Galois field includes one of the following:
when M≤3, the N bit sequences are mapped onto a binary field; or
when M>3, the N bit sequences are mapped onto a q-nary Galois field 2q, where q is a positive integer greater than or equal to 2.
After the N bit sequences obtained after linear transformation are input into the third encoder, and before the N bit sequences input into the third encoder after linear transformation are encoded, the N new bit sequences that are mapped onto the X Galois field and that are input into the kth third encoder are mapped onto binary sequences.
In some possible designs, a matrix for linear transformation satisfies:
[bj,1, bj,2 . . . bj,N]=[a1, a2 . . . a N]×F j, where bj,1 bj,2 . . . bj,N represent the N new bit sequences obtained after linear transformation is performed on N bit sequences to be input into a jth third encoder, a1 a2 . . . aN represent the N bit sequences to be input into the jth third encoder, and Fj represents the matrix for linear transformation.
In some possible designs, after the N bit sequences are preprocessed, and before the N bit sequences preprocessed each time are input, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, into encoding sub-blocks of encoding blocks in one of the M encoders, an encoding sub-block in the first encoder other than an ith encoding sub-block, an encoding sub-block in the second encoder other than a jth encoding sub-block, and an encoding sub-block in the kth third encoder other than an mth encoding sub-block may be further set to zero. An encoding operation process can be simplified in a manner of setting zero.
In this application, the N bit sequences have a same length or different lengths, a length of a first encoding sub-block is the same as that of a second encoding sub-block, the first encoding sub-block is an encoding sub-block in one encoder into which a first bit sequence of the N bit sequences is input after the first bit sequence is preprocessed once, and the second encoding sub-block is an encoding sub-block of another encoder into which the first bit sequence is input after the first bit sequence is preprocessed for another time.
In some possible designs, during encoding of the bit sequences, a coding matrix corresponding to a processing type of preprocessing in an encoder may be invoked based on the processing type, and the N preprocessed bit sequences and the coding matrix are multiplied, to obtain a corresponding encoded sequence. A proper coding matrix is selected, so that an encoded sequence that satisfies a service requirement can be obtained, and an encoded sequence that has a characteristic, for example, an encoded sequence having strong interference resistance or being capable of improving a bit sequence spectrum characteristic or reducing an error, can also be obtained. A specific type of the coding matrix and a quantity of coding matrices are not limited in this application.
A second aspect provides a channel coding method. The method includes: first preprocessing a first data stream and a second data stream separately, where the first data stream includes N1 bit sequences, the second data stream includes N2 bit sequences, and N1 and N2 are positive integers;
then separately inputting, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences of a first data stream preprocessed each time and bit sequences of a second data stream preprocessed each time into encoding sub-blocks of different encoding blocks in one of M encoders, where M≥2, in each encoder, a (k+1)th bit sequence of the first data stream and a kth bit sequence of the second data stream are located in a same encoding block, and k is a positive integer;
in each encoder, encoding a bit sequence that is in an encoding block in which a kth bit sequence of the first data stream is located, so as to obtain a corresponding encoded sequence, where the kth bit sequence of the first data stream is located in an encoding sub-block that has highest reliability in one encoding block; and
finally, respectively sending obtained encoded sequences on M parallel channels through resource mapping, where resource mapping means that for each channel used to transmit an encoded sequence, a to-be-sent encoded sequence is mapped onto a virtual resource block, then the encoded sequence that is mapped onto the virtual resource block is mapped onto a physical resource block, and finally the encoded sequence is sent by using a channel corresponding to the physical resource block.
Encoding blocks in different encoders include a same quantity of encoding sub-blocks. Each encoder includes at least N idle encoding blocks that are contiguous in time-domain positions or frequency-domain positions, where N=N1 or N=N2; and each encoding block includes P encoding sub-blocks, reliabilities of the P encoding sub-blocks are sorted in ascending order based on a time-domain position ascending order or a frequency-domain position ascending order, where P is a positive integer, and P≥N.
Compared with that in an existing mechanism, in this application, there is no need to know a capacity of a single parallel channel, before data streams are input into an encoder, bit sequences of the data streams are preprocessed first, and then bit sequences preprocessed each time are input, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, into encoding sub-blocks of encoding blocks in one of the M encoders. In this way, it can be ensured that all bit sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, the bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode the bit sequences.
In some possible designs, different preprocessing may be performed on different bit sequences based on times required for repeated encoding. Inputting the N bit sequences preprocessed each time into the encoding sub-blocks and encoding the input bit sequences mainly includes the following.
a: The N bit sequences are sequentially input, according to a bit order of the bit sequences and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a first encoder, and the N bit sequences input into the first encoder are encoded, to obtain a first encoded sequence.
An ith bit sequence of the N bit sequences is input, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into an ith encoding sub-block of an ith encoding block in the first encoder, where i is a positive integer, and 1≤i≤P.
In addition, at least one of the two following two is further included.
b: The N bit sequences are sequentially input, according to the bit order of the bit sequences and a time-domain position descending order or a frequency-domain position descending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a second encoder, and the N bit sequences input into the second encoder are encoded, to obtain a second encoded sequence.
A jth bit sequence of the N bit sequences is input, according to the bit order of the bit sequences and the time-domain position descending order or the frequency-domain position descending order of encoding blocks in an encoder, into a jth encoding sub-block of a jth encoding block in the second encoder, where j is a positive integer, and 1≤j≤P.
Alternatively, c: The N bit sequences obtained after linear transformation are input, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a third encoder, and the N bit sequences input into the third encoder after linear transformation are encoded, to obtain a third encoded sequence.
Linear transformation is performed on the N bit sequences, where linear transformation may be performed for (M−2) times, and there is at least one third encoder. First, linear transformation is performed on the N bit sequences that are to be input into a kth third encoder, to obtain N new bit sequences, where k is a positive integer, and 1≤k≤M.
Then an mth new bit sequence of the N new bit sequences is input into an mth encoding sub-block of an mth encoding block in the kth third encoder, where m is a positive integer, and 1≤m≤P.
In some possible designs, before the N bit sequences obtained after linear transformation are input into the encoding sub-blocks of the encoding blocks in the third encoder, the N new bit sequences may be further mapped onto an X Galois field, where X=2p, and p is a positive integer. That the N bit sequences are mapped onto the X Galois field includes one of the following:
when M≤4, the N bit sequences are mapped onto a binary field; or
when M>4, the N bit sequences are mapped onto a q-nary Galois field 2q, where q is a positive integer greater than or equal to 2.
Then, after the N bit sequences obtained after linear transformation are input into the encoding sub-blocks of the encoding blocks in the third encoder, and before the N bit sequences input into the third encoder after linear transformation are encoded, the N new bit sequences that are mapped onto the X Galois field and that are input into the kth third encoder are mapped onto binary sequences.
In some possible designs, a matrix for linear transformation satisfies:
[bj,1 bj,2 . . . bj,N]=[a1 a2 . . . a N]×Fj, where bj,1 bj,2 . . . bj,N represent the N new bit sequences obtained after linear transformation is performed on N bit sequences to be input into a jth third encoder, a1 a2 . . . aN represent the N bit sequences to be input into the jth third encoder, and Fj represents the matrix for linear transformation.
In some possible designs, after the first data stream and the second data stream are preprocessed separately, and before the ith bit sequence of the N bit sequences is input, according to the bit order of the bit sequence and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into the ith encoding sub-block of the ith encoding block in the first encoder, an encoding sub-block in the first encoder other than the ith encoding sub-block, an encoding sub-block in the second encoder other than the jth encoding sub-block, and an encoding sub-block in the kth third encoder other than the mth encoding sub-block may be further set to zero. An encoding operation process can be simplified in a manner of setting zero.
In some possible designs, the N bit sequences have a same length or different lengths, a length of a first encoding sub-block is the same as that of a second encoding sub-block, the first encoding sub-block is an encoding sub-block in one encoder into which a first bit sequence of the N bit sequences is input after the first bit sequence is preprocessed once, and the second encoding sub-block is an encoding sub-block of another encoder into which the first bit sequence is input after the first bit sequence is preprocessed for another time.
In some possible designs, a coding matrix corresponding to a processing type of preprocessing in an encoder may be invoked based on the processing type, and the N preprocessed bit sequences and the coding matrix are multiplied, to obtain a corresponding encoded sequence. A proper coding matrix is selected, so that an encoded sequence that satisfies a service requirement can be obtained, and an encoded sequence that has a characteristic, for example, an encoded sequence having strong interference resistance or being capable of improving a bit sequence spectrum characteristic or reducing an error, can also be obtained. A specific type of the coding matrix and a quantity of coding matrices are not limited in this application.
A third aspect of this application provides a channel coding method. In this method, each encoder includes encoding blocks that are contiguous in time-domain positions or frequency-domain positions, and encoding blocks in different encoders include a same quantity of encoding sub-blocks. Each encoding block includes a plurality of encoding sub-blocks, the encoding sub-blocks in the encoding block are corresponding to reliability, and in each encoding block, reliabilities of encoding sub-blocks are sorted in ascending order based on a time-domain position ascending order or frequency-domain position ascending order. The method includes:
first preprocessing each bit sequence in a bit sequence set in one of at least two preprocessing manners, where the bit sequence set includes at least two bit sequences, each bit sequence includes N sub-sequences, and N is a positive integer; and optionally, different bit sequences are preprocessed in different manners;
then inputting, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, each of N preprocessed sub-sequences into an encoding sub-block of an encoding block in one of M encoders, where a position of an ith encoding sub-block that is of a (j+i)th encoding block and that is corresponding to an ith sub-sequence of a jth bit sequence in the bit sequence set is represented by Qi,(j+i), i<N, i is a nonnegative integer, j and M are positive integers, and bit sequences in at least two encoders are preprocessed in different manners;
encoding a bit sequence that is in the encoding block in which Qi,(j+i) is located, to obtain a corresponding encoded sequence; and finally, respectively sending, on M parallel channels through resource mapping, encoded sequences obtained after each time of encoding.
Compared with that in an existing mechanism, in this application, there is no need to know a capacity of a single parallel channel, before bit sequences are input into an encoder, the bit sequences are preprocessed first, and then bit sequences preprocessed each time are input, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, into encoding sub-blocks of encoding blocks in one of the M encoders. In this way, it can be ensured that all sub-sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, each of the bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode each bit sequence.
In some possible designs, the encoding a bit sequence that is in the encoding block in which Qi,(j+i) is located includes:
in each encoder, sequentially encoding a bit sequence that is in an encoding block in which an ith sub-sequence of a ith bit sequence is located, a bit sequence that is in an encoding block in which an ith sub-sequence of a (j+1)th bit sequence is located, and a bit sequence that is in an encoding block in which an ith sub-sequence of a (j+2)th bit sequence is located.
In some possible designs, different preprocessing may be performed on different bit sequences based on times required for repeated encoding. Therefore, the inputting, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, each of N preprocessed sub-sequences into an encoding sub-block of an encoding block in one of M encoders includes:
sequentially inputting, according to a bit order of bits and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, all sub-sequences of a same bit sequence into encoding sub-blocks of encoding blocks in a first encoder; and
further includes at least one of the following two items:
sequentially inputting, according to the bit order of the bits and a time-domain position descending order or a frequency-domain position descending order of encoding blocks in an encoder, all sub-sequences of the same bit sequence into encoding sub-blocks of encoding blocks in a second encoder; or
inputting, according to the bit order of the bits and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, each sub-sequence of a same bit sequence obtained after linear transformation into an encoding sub-block of an encoding block in a third encoder.
In some possible designs, when M≥3, linear transformation is performed for at least once, and there is at least one third encoder.
After linear transformation is performed on at least one bit sequence in the bit sequence set, and before the sub-sequences of the same bit sequence obtained after linear transformation are input into the encoding sub-blocks of the encoding blocks in the third encoder, bit sequences obtained after linear transformation may be further mapped onto an X Galois field, where X=2p, and p is a positive integer.
After the sub-sequences of the same bit sequence obtained after linear transformation are input into the encoding blocks in the third encoder, and before the sub-sequences that are of the same bit sequence input into the third encoder after linear transformation are encoded, the bit sequences obtained after linear transformation that are mapped onto the X Galois field and that are input into the third encoder are mapped onto binary sequences.
That the bit sequences obtained after linear transformation are mapped onto the X Galois field includes one of the following:
when M≤4, the bit sequences obtained after linear transformation are mapped onto a binary field; or
when M>4, the bit sequences obtained after linear transformation are mapped onto a q-nary Galois field 2q, where q is a positive integer greater than or equal to 2.
In some possible designs, a matrix for linear transformation satisfies:
[bk1 bk 2 . . . bk,N]=[a1 a2 . . . aN]×Fk, where bk1 bk2 . . . bk,N represent sub-sequences of a same bit sequence input into a kth third encoder after linear transformation, a1 a2 . . . aN separately represent sub-sequences of the same bit sequence that are to be input into the kth third encoder, Fk represents the matrix for linear transformation, N is a quantity of encoding blocks in the encoder, k and N are positive integers, and 1≤k≤M.
In some possible designs, after a first preprocessed bit sequence is input into encoding sub-blocks of encoding blocks in one of the M encoders, and before the bit sequence that is in the encoding block in which Qi,(j+i) is located is encoded, an encoding sub-block, other than the position Qi,(j+i), in the encoder into which the first preprocessed bit sequence is input may be further set to zero.
In some possible designs, sub-sequences of a same bit sequence have a same length or different lengths, a length of a first encoding sub-block is the same as that of a second encoding sub-block, the first encoding sub-block is an encoding sub-block in one encoder into which a first sub-sequence of the bit sequence set is input after the first sub-sequence is preprocessed once, and the second encoding sub-block is an encoding sub-block of another encoder into which the first sub-sequence is input after the first sub-sequence is preprocessed for another time.
In some possible designs, during encoding of the bit sequences, a coding matrix corresponding to a processing type of preprocessing in an encoder may be invoked based on the processing type, and a preprocessed bit sequence set and the coding matrix are multiplied, to obtain a corresponding encoded sequence. A proper coding matrix is selected, so that an encoded sequence that satisfies a service requirement can be obtained, and an encoded sequence that has a characteristic, for example, an encoded sequence having strong interference resistance or being capable of improving a bit sequence spectrum characteristic or reducing an error, can also be obtained. A specific type of the coding matrix and a quantity of coding matrices are not limited in this application.
A fourth aspect of this application provides a channel coding apparatus, implementing a function corresponding to the channel coding method provided in the first aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the foregoing function. The modules may be hardware and/or software.
In a possible design, the apparatus includes:
a processing module, configured to preprocess N bit sequences, and input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, N bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of M encoders, where N and M are positive integers, and M≥2;
encoders, configured to encode the N preprocessed bit sequences input into the encoders, to obtain M corresponding encoded sequences; and
a transceiver module, configured to respectively send, on M parallel channels, the M encoded sequences obtained through encoding.
In a possible design, the channel coding apparatus includes:
at least one processor, a memory, an encoder, and a transceiver, where
the memory is configured to store program code, and the processor is configured to invoke the program code stored in the memory, to perform the following operations:
preprocessing N bit sequences, and inputting, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, N bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of M encoders, where N and M are positive integers, and M≥2;
encoding the N preprocessed bit sequences input into the encoders, to obtain M corresponding encoded sequences; and
respectively sending, on M parallel channels by using the transceiver, the M encoded sequences obtained through encoding.
The transceiver may alternatively be replaced with a receiver and a transmitter, and the receiver and the transmitter may be a same physical entity or different physical entities. When being the same physical entity, the receiver and the transmitter may be collectively referred to as a transceiver. The memory may be integrated into the processor, or may be separate from the processor.
A fifth aspect of this application provides a channel coding apparatus, implementing a function corresponding to the channel coding method provided in the second aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the foregoing function. The modules may be hardware and/or software.
In a possible design, the apparatus includes:
a processing module, configured to: preprocess a first data stream and a second data stream separately, where the first data stream includes N1 bit sequences, the second data stream includes N2 bit sequences, and N1 and N2 are positive integers; and separately input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences of a first data stream preprocessed each time and bit sequences of a second data stream preprocessed each time into encoding sub-blocks of different encoding blocks in one of M encoders, where M≥2, a (k+1)th bit sequence of the first data stream and a kth bit sequence of the second data stream are located in a same encoding block, and k is a positive integer;
an encoder, configured to encode a bit sequence that is in an encoding block in which a kth bit sequence of the first data stream input into the encoder is located, so as to obtain a corresponding encoded sequence, where the kth bit sequence of the first data stream is located in an encoding sub-block that has highest reliability in one encoding block; and
a transceiver module, configured to respectively send, on M parallel channels, encoded sequences obtained through encoding.
In a possible design, the apparatus includes:
at least one processor, a memory, and a transceiver, where
the memory is configured to store program code, and the processor is configured to invoke the program code stored in the memory, to perform the following operations:
preprocessing a first data stream and a second data stream separately, where the first data stream includes N1 bit sequences, the second data stream includes N2 bit sequences, and N1 and N2 are positive integers; and separately inputting, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences of a first data stream preprocessed each time and bit sequences of a second data stream preprocessed each time into encoding sub-blocks of different encoding blocks in one of M encoders, where M≥2, a (k+1)th bit sequence of the first data stream and a kth bit sequence of the second data stream are located in a same encoding block, and k is a positive integer;
encoding a bit sequence that is in an encoding block in which a kth bit sequence of the first data stream input into the encoder is located, so as to obtain a corresponding encoded sequence, where the kth bit sequence of the first data stream is located in an encoding sub-block that has highest reliability in one encoding block; and
respectively sending, on M parallel channels by using the transceiver, the encoded sequences obtained through encoding.
The transceiver may alternatively be replaced with a receiver and a transmitter, and the receiver and the transmitter may be a same physical entity or different physical entities. When being the same physical entity, the receiver and the transmitter may be collectively referred to as a transceiver. The memory may be integrated into the processor, or may be separate from the processor.
A sixth aspect of this application provides a channel coding apparatus, implementing a function corresponding to the channel coding method provided in the third aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the foregoing function. The modules may be hardware and/or software.
In a possible design, the apparatus includes:
a processing module, configured to: preprocess each bit sequence in a bit sequence set in one of at least two preprocessing manners, where the bit sequence set includes at least two bit sequences, each bit sequence includes N sub-sequences, and N is a positive integer; and input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, each of N preprocessed sub-sequences into an encoding sub-block of an encoding block in one of M encoders, where a position of an ith encoding sub-block that is of a (j+i)th encoding block and that is corresponding to an ith sub-sequence of a jth bit sequence in the bit sequence set is represented by Qi,(j+i), i<N, is a nonnegative integer, j and M are positive integers, and bit sequences in at least two encoders are preprocessed in different manners;
an encoder, configured to encode a bit sequence that is in the encoding block in which Qi,(j+i) is located, to obtain a corresponding encoded sequence; and
a transceiver module, configured to respectively send, on M parallel channels, encoded sequences obtained after each time of encoding.
In a possible design, the apparatus includes at least one processor, a memory, and a transceiver.
the memory is configured to store program code, and the processor is configured to invoke the program code stored in the memory, to perform the following operations:
preprocessing each bit sequence in a bit sequence set in one of at least two preprocessing manners, where the bit sequence set includes at least two bit sequences, each bit sequence includes N sub-sequences, and N is a positive integer; and inputting, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, each of N preprocessed sub-sequences into an encoding sub-block of an encoding block in one of M encoders, where a position of an ith encoding sub-block that is of a (j+i)th encoding block and that is corresponding to an ith sub-sequence of a jth bit sequence in the bit sequence set is represented by Qi,(j+i), i is a nonnegative integer, j and M are positive integers, and bit sequences in at least two encoders are preprocessed in different manners;
encoding a bit sequence that is in the encoding block in which Qi,(j+i) is located, to obtain a corresponding encoded sequence; and
respectively sending, on M parallel channels by using the transceiver, the encoded sequences obtained after each time of encoding.
In a possible design, the channel coding apparatus may include one or more processors, one or more encoders, and a communications unit. The one or more processors are configured to support a communications device in executing corresponding functions in the foregoing method. The communications unit is configured to support communication between the channel coding apparatus and another device, to implement a transmit/receive function.
Optionally, the communications device may further include one or more memories. The memory is configured to be coupled with the processor and stores a program instruction and data that are necessary for the channel coding apparatus. The one or more memories may be integrated with the processor, or may be separate from the processor. This is not limited in this application.
The channel coding apparatus may be further a communications chip, may be disposed in a terminal device or a communications device on a network side. The communications unit may be an input/output circuit or interface of the communications chip.
Another aspect of this application provides a computer readable storage medium including an instruction, where when the instruction runs on a computer, the computer is caused to perform the methods in the foregoing aspects.
Compared with that in the prior art, in the solution provided in embodiments of this application, a transmit device does not need to know a capacity of a single parallel channel, and before inputting bit sequences into an encoder, the transmit device first preprocesses the bit sequences, and then inputs, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of the M encoders. In this way, it can be ensured that all bit sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, the bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode the bit sequences.
In the specification, claims, and accompanying drawings of this application, terms “first”, “second”, and so on are intended to distinguish between similar objects but d0 not necessarily indicate a specific order or sequence. It should be understood that data termed in such a way is interchangeable in proper circumstances so that the embodiments described herein can be implemented in other orders than the order illustrated or described herein. In addition, terms “include”, “have”, or any other variant thereof are intended to cover a non-exclusive inclusion. For example, a process, a method, a system, a product, or a device that includes a series of steps or modules is not necessarily limited to the steps or modules that are expressly listed, but may include another step or module not expressly listed or inherent to the process, the method, the product, or the device. The module division in the embodiments of this application is merely logical division, and there may be another division during implementation in actual application. For example, a plurality of modules may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the modules may be implemented in electrical or another form, and this is not limited in the embodiments of this application. In addition, modules or sub-modules described as separate components may be or may not be physically separated, or may be or may not be physical modules, or may be distributed in a plurality of circuit modules. Objectives of the solutions of the embodiments of this application may be achieved by selecting some or all of the modules according to actual requirements.
A channel coding method, a channel coding apparatus, a chip system, and a storage medium are provided in the embodiments of this application and are applied to a Global System for Mobile Communications (GSM) system, a general packet radio service (GPRS) system, a Code Division Multiple Access (CDMA) system, a Wideband Code Division Multiple Access (WCDMA) system, a Long Term Evolution (LTE) system, and various types of subsequently evolved wireless communications systems that include but are not limited to a communications system such as a fifth generation (5G) mobile communications system.
A transmit device may be a network device or a terminal device, and a receive device may be a terminal device or a network device. The network device includes but is not limited to an evolved NodeB (eNB), a radio network controller (RNC), a NodeB (NB), a base station controller (BSC), a base transceiver station (BTS), a home evolved NodeB or home NodeB (for example, a Home evolved NodeB or Home NodeB, HNB), and a baseband unit (BBU).
The terminal device in the embodiments of this application may be a device that provides voice and/or data connectivity for a user, a handheld device with a wireless connection function, or another processing device connected to a wireless modem. The terminal device may communicate with one or more core networks through a radio access network (RAN). The terminal device may be a mobile terminal, such as a mobile phone (or referred to as a “cellular” phone) or a computer with a mobile terminal, for example, may be a portable, a pocket-sized, a handheld, a computer built-in, or an in-vehicle mobile apparatus, which exchanges voice and/or data with the radio access network. For example, the terminal device is a device, such as a personal communication service (PCS) phone, a cordless phone, a Session Initiation Protocol (SIP) phone set, a wireless local loop (WLL) station, or a personal digital assistant (PDA). A wireless terminal may also be referred to as a system, a subscriber unit, a subscriber station, a mobile station, a remote station, an access point, a remote terminal, an access terminal, a user terminal, a terminal device, a user agent, a user device, or user equipment.
The channel coding apparatus in this application includes a plurality of encoders, and each encoder is corresponding to one parallel channel. The parallel channels herein are two or more time-domain-based or frequency-domain-based channels, and data is repeatedly sent on the parallel channels after same or different processing (which includes but is not limited to processing such as encoding, modulation, scrambling, and conjugation). Each encoder includes a plurality of encoding blocks, the encoding blocks may be sequenced in time-domain position ascending order or frequency-domain position ascending order, and encoding blocks of different encoders include a same quantity of encoding sub-blocks. Each encoding block includes a plurality of encoding sub-blocks. In each encoding block, an encoding sub-block, a length of the encoding sub-block, and reliabilit of the encoding sub-block are in one-to-one correspondence, and a position of an encoding sub-block in an encoding block represents reliability of the encoding sub-block. In an encoding block, encoding sub-blocks are sequenced in ascending order according to reliability. The encoder used in this application may be a polar encoder or may be another type of encoder. A specific type is not limited in this application.
In actual application, a channel can be ultimately polarized through polarization by using a polar encoder, to obtain an almost noiseless channel and a pure noise channel. Then, even if a channel state is not known in advance, in other words, even if which channel is a noiseless channel and which channel is a pure noise channel are not known, it can be ensured that data is correctly transmitted through the almost noiseless channel. It can be learned that a characteristic that bit positions in the polar encoder are sequenced according to reliability can be fully utilized by using the polar encoder, so as to transform all input bit sequences into low bit rate encoded sequences, and therefore a combined capacity of the parallel channels reaches 1. Data transmitted through the almost noiseless channel includes but is not limited to payload (payload), a packet, and control data.
Reliability of an encoding sub-block is reliability of encoding, for example, may be a sequence number of a channel with highest reliability. A length of an encoding sub-block is a maximum quantity of bits that can be accommodated in the encoding sub-block, or may be referred to as a bit capacity.
Before a bit sequence is sent to a defined channel for transmission, the to-be-encoded bit sequence needs to be input into the channel coding apparatus, and the input bit sequence is encoded. Then, an encoded bit sequence is sent to the channel for transmission. In this application, encoding performed on the bit sequence is repeated encoding, and sending the encoded bit sequence to the channel for transmission is transmission based on parallel channels. The parallel channels in this application may be polar channels, reliabilities of channels that participate in transmitting repeated bit sequences may be the same, or may be in descending order. This is not specifically limited in this application. Each bit sequence sent to the channel may be referred to as one piece of repeated data, or referred to as repeated information bits, or the like.
To resolve the foregoing technical problem, the embodiments of this application mainly provide the following technical solutions:
On a transmit device side, to-be-coded bit sequences are preprocessed first, and then bit sequences preprocessed each time are input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, into encoding blocks of the encoder. Therefore, preprocessed bit sequences are placed, according to this order, into corresponding encoding blocks each time preprocessing is performed. In this way, after bit sequences of a same data stream are transmitted by using parallel channels, a receive device receives the repeated bit sequences sent from a transmit device, decodes a bit sequence from each channel, and then can calculate, based on decoding results, a correct order of bits in the bit sequences. The receive device may use a manner such as successive cancellation (SC) decoding, belief propagation (BP) decoding, or list decoding. A specific decoding manner is not limited in this application.
It can be learned that, according to this solution, even if the transmit device does not know exact capacities of the parallel channels, a correct encoding scheme for the transmit device and a correct decoding scheme for the receive device can be designed, and it can be ensured that a combined capacity of the parallel channels can reach 1.
In
Encoding blocks in different encoders have a same quantity of encoding sub-blocks, the N bit sequences have a same length or different lengths, a length of a first encoding sub-block is the same as that of a second encoding sub-block, the first encoding sub-block is an encoding sub-block in one encoder into which a first bit sequence of the N bit sequences is input after the first bit sequence is preprocessed once, and the second encoding sub-block is an encoding sub-block of another encoder into which the first bit sequence is input after the first bit sequence is preprocessed for another time. The following describes an embodiment of this application, and this embodiment of this application includes the following steps.
101. Preprocess N bit sequences.
N bit sequences preprocessed each time may be used as one piece of repeated data. The following three sequence transformation preprocessing manners are mainly used for the N bit sequences: positive sequencing, reverse sequencing, and linear transformation. Certainly, another preprocessing manner may also be used, such as reversible non-linear transformation or bit-reverse sequencing. A specific preprocessing manner is not limited in this application.
Positive sequencing means that N to-be-preprocessed bit sequences are sequenced according to a bit order of the bit sequences. For example, when one data stream is divided into bit sequences a0, a1, and a2 (that is, when N=3), a0, a1, and a2 may include a same quantity of bits or different quantities of bits, and a further detailed example is that a specific quantity of bits may depend on a bit capacity of an encoding sub-block into which a bit sequence actually needs to be input. A bit order of a0, a1, and a2 is a descending order. When being input into encoding blocks, a0, a1, and a2 may be input into corresponding encoding blocks according to the bit order of a0, a1, and a2.
Reverse sequencing means that N to-be-preprocessed bit sequences are sequenced according to a reverse bit order of the bit sequences.
It should be noted that if another input rule is set for positive sequencing and reverse sequencing, to some extent, it can also be regarded that the N original bit sequences are not preprocessed. For example, one data stream is divided into bit sequences a0, a1, and a2 , a0, a1, and a2 may include a same quantity of bits or different quantities of bits, and a further detailed example is that a specific quantity of bits may depend on a bit capacity of an encoding sub-block into which a bit sequence actually needs to be input. A bit order of a0, a1, and a2 is a descending order. When being input into encoding blocks, a0, a1, and a2 may be input into corresponding encoding blocks according to the bit order of a0, a1, and a2 ; or a0, a1, and a2 may be input into corresponding encoding blocks according to a bit order of a2, a1, and a0. Note that bits included in each of a2, al, and a0 may be in reverse order or may not be in reverse order in this reverse sequencing. Herein, a bit order is represented by a bit order of a2, a1, and a0, without specific division. Same processing is applied to the following description. Therefore, actually, it can also be regarded that the three bit sequences a0, a1, and a2 are not preprocessed. Reverse processing is used as an example in all the following content in this application. In addition, reverse sequencing does not necessarily indicate that original bit order is reversed, and it only needs to ensure that an order of a plurality of bit sequences in N transformed bit sequences is different from that before transformation.
Linear transformation means mapping from one linear space onto another linear space in a same domain. In this application, original bit sequences may be transformed to bit sequences in another linear space by performing linear transformation on the bit sequences. During linear transformation, vectors of the transformed bit sequences may be obtained by multiplying vectors of the original bit sequences and a coding matrix. A matrix for linear transformation may satisfy:
[bj,1 bj,2 . . . bj,N]=[a1 a2 . . . aN]×Fj, where bj,1 bj,2 . . . bj,N represent the N new bit sequences obtained after linear transformation is performed on N bit sequences to be input into a jth third encoder, a1 a2 . . . aN represent the N bit sequences to be input into the jth third encoder, and Fj represents the matrix for linear transformation.
Transformation may be further performed based on the formula used in this application, to obtain another formula of linear transformation. A specific formula of linear transformation is not limited in this application.
102. Input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, N bit sequences preprocessed each time into encoding blocks in one of M encoders.
N and M are positive integers, M≥2, and after each time of preprocessing, the N bit sequences are input into a different encoder.
103. Obtain M corresponding encoded sequences after encoding, in the encoders, N preprocessed bit sequences that are input.
During encoding, a coding matrix corresponding to a processing type of preprocessing in an encoder may be invoked based on the processing type, and the N preprocessed bit sequences and the coding matrix are multiplied, to obtain a corresponding encoded sequence.
It is assumed that three parallel channels are required in total, and correspondingly, three coding matrices in the encoders are A, B, and C. The following sequences may be obtained by multiplying each of the three coding matrices and N input bit sequences (a0, a1, a2, . . . , aN−1):
(x0, x1, x2, . . . , xN−1)=(a0, a1, a2, . . . , aN−1)×A; (1)
(y0, y1, y2, . . . , yN−1)=(a0, a1, a2, . . . , aN−1)×B; (2)
(z0, z1, z2, . . . zN−1)=(a0, a1, a2, . . . , aN−1)×C; (3)
For any k1≥0, k2≥0, and k3≥0, k1, k2, and k3 are all integers, and k1+k2+k3=N.
On a receive device end, received bit sequences are decoded by using a general decoding matrix based on a predefined encoding/decoding codebook. If first k1 x are known, (x0, x1, x2, . . . , xk1−1) is known, if first k2 y are obtained through decoding, (y0, y1, y2, . . . yk2−1) can be calculated, if first k3 z are obtained through decoding, (z0, z1, z2, . . . , zk3−1) can be calculated, and so on. Finally, the receive end can obtain (a0, a1, a2, . . . , aN−1) through decoding.
In addition, a coding matrix affects a channel capacity size, and therefore affects system performance of a communications system. Therefore, weight parameters of coding matrices may be further designed to select an appropriate coding matrix to encode the bit sequences.
Repeated data in this application is transmitted based on repeated encoding and parallel channels; therefore, for different channels, preprocessing may be the same or different. In steps 102 and 103, that the N bit sequences preprocessed in step 101 are input into corresponding encoding blocks and are encoded may occur in the two following scenarios:
1. M=2 scenario
Two times of different preprocessing need to be performed on the N bit sequences. The N bit sequences preprocessed each time are input into one encoder. After each time of preprocessing, the N bit sequences are input into a different encoder. The two following cases are mainly included:
a. After one time of positive sequencing, the N bit sequences are input into one encoder; and after one time of linear transformation, the N bit sequences are input into another encoder.
b. After one time of positive sequencing, the N bit sequences are input into one encoder; and after one time of reverse sequencing, the N bit sequences are input into another encoder.
2. M>3 scenario
Preprocessing including one time of positive sequencing, one time of reverse sequencing, and (M−2) times of linear transformation needs to be performed on the N bit sequences. A same formula or different formulas may be used in preprocessing of the (M−2) times of linear transformation. A specific formula used in the (M−2) times of linear transformation is not limited in this application.
The following describes a process of performing positive sequencing, reverse sequencing, or linear transformation on the N bit sequences, inputting the N bit sequences into M encoders, and encoding the N bit sequences.
(1) Encoding After Positive Sequencing:
During encoding, the N bit sequences obtained after positive sequencing may be sequentially input, according to a bit order of the bit sequences and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a first encoder, and then the N bit sequences input into the first encoder are encoded, so as to obtain a first encoded sequence encoded.
A process of inputting the N bit sequences into the first encoder is as follows:
An ith bit sequence of the N bit sequences is input, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into an ith encoding sub-block of an ith encoding block in the first encoder, where i is a positive integer, and 1≤i≤P.
(2) Encoding After Reverse Sequencing:
The N preprocessed bit sequences are sequentially input, according to the bit order of the bit sequences and a time-domain position descending order or a frequency-domain position descending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a second encoder, and the N bit sequences input into the second encoder are encoded, to obtain a second encoded sequence. Optionally, reverse sequencing may alternatively be performed on all of the N bit sequences first, and then each of the N bit sequences obtained after reverse sequencing is input, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into an encoding sub-block of an encoding block in a second encoder. Any preprocessing that can achieve the same obj ective can be used. Specific preprocessing performed on all of the N bit sequences is not limited in this application.
A process of inputting the N bit sequences into the second encoder is as follows:
A jth bit sequence of the N bit sequences is input, according to the bit order of the bit sequences and the time-domain position descending order or the frequency-domain position descending order of encoding blocks in an encoder, into a jth encoding sub-block of a jth encoding block in the second encoder, where j is a positive integer, and 1≤j≤P.
(3) Encoding After Linear Transformation:
The N bit sequences obtained after linear transformation are input, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into encoding sub-blocks of encoding blocks in a third encoder, and the N bit sequences input into the third encoder after linear transformation are encoded, to obtain a third encoded sequence.
Linear transformation is performed for (M−2) times, and there is at least one third encoder. Correspondingly, a process of performing linear transformation on the N bit sequences is as follows:
First, linear transformation is performed on the N bit sequences that are to be input into a kth third encoder, to obtain N new bit sequences, where k is a positive integer, and 1≤k≤M.
Then, an mth new bit sequence of the N new bit sequences is input into an mth encoding sub-block of an mth encoding block in the kth third encoder, where m is a positive integer, and 1≤m≤P.
A matrix for linear transformation may satisfy the following formula:
[bj,1 bj,2 . . . bj,N]=[a1 a2 . . . aN ]×Fj, where bj,1 bj,2 . . . bj,N represent the N new bit sequences obtained after linear transformation is performed on N bit sequences to be input into a jth third encoder, a1 a2 . . . aN represent the N bit sequences to be input into the jth third encoder, and Fj represents the matrix for linear transformation. Transformation may be further performed based on the formula used in this application, to obtain another formula of linear transformation. A specific formula of linear transformation is not limited in this application.
Optionally, to simplify an encoding operation process for currently input bit sequences and to improve encoding efficiency, bit sequences in some encoding sub-blocks may be further frozen, so that the bit sequences become known bit sequences. Alternatively, the encoding sub-blocks may be initialized, so as to help input subsequent bit sequences. After the N bit sequences are preprocessed, and before the N bit sequences preprocessed each time are input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, into encoding blocks of one of the M encoders, an encoding sub-block in the first encoder other than an ith encoding sub-block, an encoding sub-block in the second encoder other than a jth encoding sub-block, and an encoding sub-block in the kth third encoder other than an mth encoding sub-block may be set to zero. The encoding operation process can be simplified and the encoding efficiency can be improved in a manner of setting zero. It should be noted that, setting zero mentioned herein and in the following description may be further setting one, or setting any known value. For ease of description, setting zero is used as an example for description herein and in the following description. Details are not described again in the following description.
104. Respectively send the M obtained encoded sequences on M parallel channels through resource mapping.
Compared with that in an existing mechanism, in this embodiment of this application, a transmit device does not need to know a capacity of a single parallel channel. Before inputting repeated data into an encoder, the transmit device may first preprocess the repeated data, and then input, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, repeated data preprocessed each time into encoding sub-blocks of encoding blocks in one of the M encoders. In this way, it can be ensured that all bit sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, the N bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode the N bit sequences.
In some embodiments of the present invention, before the N bit sequences obtained after linear transformation are input into the third encoder, the N new bit sequences may be further mapped onto an X Galois field, where X=2p, and p is a positive integer.
After the N bit sequences obtained after linear transformation are input into the third encoder, and before the N bit sequences input into the third encoder after linear transformation are encoded, the N new bit sequences that are mapped onto the X Galois field and that are input into the kth third encoder may be further mapped onto binary sequences.
That the N bit sequences are mapped onto the X Galois field includes one of the following:
when M≤4, the N bit sequences are mapped onto a binary field; or
when M>4, the N bit sequences are mapped onto a q-nary Galois field 2q, where q is a positive integer greater than or equal to 2.
For repeated data obtained through positive sequencing: The N bit sequences (including bit sequences a0, a1, a2, . . . , aN−2, and aN−1) are separately placed on input ends of N contiguous encoding blocks of a first encoder. a0 is placed in an encoding sub-block whose index is 0 in a first encoding block, ai is placed in an encoding sub-block whose index is 1 in a second encoding block, a2 is placed in an encoding sub-block whose index is 2 in a third encoding block, and so on, aN−1 is placed in an encoding sub-block whose index is N−1 in an Nth encoding block. Then, a0, a1, a2, . . . , aN−2, and aN−1 input into the first encoder are encoded, or encoding may be performed after bit sequences are placed in all encoding sub-blocks of all encoding blocks in the first encoder. An encoding time sequence is not limited in this application.
For repeated data obtained through reverse sequencing: Reverse sequencing is performed to change the N bit sequences (including bit sequences a0, a1, a2, . . . , aN−2, and aN−1) to (aN−1, aN−2, . . . , a1, a0), and then (aN−1, aN−2, a1, a0) are separately placed on input ends of N contiguous encoding blocks of a second encoder. aN−1 is placed in an encoding sub-block whose index is 0 in a first encoding block, aN−2 is placed in an encoding sub-block whose index is 1 in a second encoding block, and so on, a1 is placed in an encoding sub-block whose index is N−2 in an (N−1)th encoding block, and a0 is placed in an encoding sub-block whose index is N−1 in an Nth encoding block. Similarly, a0, a1, a2, . . . , aN−2, and aN−1 input into the second encoder are encoded, or encoding may be performed after bit sequences are placed in all encoding sub-blocks of all encoding blocks in the first encoder.
Characteristics, such as the encoder, the encoding block, the encoding sub-block, the arrangement order of positions of encoding sub-blocks in an encoding block, the preprocessing manner, the rule of inputting a bit sequence into an encoding sub-block, the encoding rule, the matrix for linear transformation, the lengths of bit sequences input into encoding sub-blocks, the X Galois field, and the coding matrix, are also applicable to all embodiments (including an embodiment corresponding to any one of
In some other application scenarios, considering that encoders need to simultaneously encode at least two data streams, the at least two data streams may still be separately input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, into M encoders, and then bit sequences in a same encoder are encoded. An order of inputting data streams into encoders and an encoding rule of encoding the data streams input into the encoders may be further set to improve encoding efficiency and encoder utilization. The at least two data streams are input into a same encoder according to a uniform rule, and the at least two data streams are encoded according to the encoding rule, so that encoding efficiency can be improved, a coding gain can be ensured, and a combined capacity can reach 1 based only on a combined capacity of M channels without a need to know a capacity of every channel.
In
In
In
For encoding in
In actual application, when the at least two data streams are separately input into the encoders, a time sequence of inputting the data streams may be specified. Assuming that a data stream 1, a data stream 2, and a data steam 3 need to be simultaneously encoded, the data steam 1, the data stream 2, and the data stream 3 may be sequentially input into corresponding encoders in a time sequence according to an encoding rule, and then the data streams are encoded. Alternatively, after some bit sequences of the data stream 1 and some bit sequences of the data steam 2 are input into the encoders, the bit sequences of the data stream 1 input into the encoders may be encoded; after some bit sequences of the data steam 3 are input into the encoders, the bit sequences that are of the data streams 1 and 2 and that are input into the encoders are encoded; and so on, until encoding of all bit sequences are completed. Referring to
201. Preprocess a first data stream and a second data stream separately.
The first data stream includes N1 bit sequences, the second data stream includes N2 bit sequences, N1 and N2 are positive integers, and N1 and N2 may be equal or may not be equal. The data streams may be divided based on a bit capacity of an idle encoding sub-block in a current encoder, for example, when some current idle encoding sub-blocks have a relatively large bit capacity, bit sequences with a relatively large quantity of bits may be obtained through division, so that the bit sequences are placed in the encoding sub-blocks with a relatively large bit capacity; or data streams may be divided based on importance of bit sequences in the data streams, or bit order of a bit sequence having high importance may be changed with reference to a preprocessing manner, so that the bit sequence having high importance is input into an encoding sub-block having high reliability as far as possible. Values of N1 and N2 are variable, and a specific division rule is not limited in this application.
202. Separately input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences of a first data stream preprocessed each time and bit sequences of a second data stream preprocessed each time into encoding sub-blocks of different encoding blocks in one of M encoders.
M≥2, and in each encoder, a (k+1)th bit sequence of the first data stream and a kth bit sequence of the second data stream are located in a same encoding block, where k is a positive integer.
203. In each encoder, encode a bit sequence that is in an encoding block in which a kth bit sequence of the first data stream is located, to obtain an encoded sequence.
The kth bit sequence of the first data stream is located in an encoding sub-block that has highest reliability in an encoding block.
204. Respectively send obtained encoded sequences on M parallel channels through resource mapping,
Compared with that in an existing mechanism, in this application, a transmit device does not need to know a capacity of a single parallel channel, and before inputting data streams into an encoder, the transmit device first preprocesses bit sequences of the data streams, and then inputs, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of the M encoders. In this way, it can be ensured that all bit sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, the bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode the bit sequences.
It should be noted that, because of factors such as a difference in sizes of a plurality of data streams input into a same encoder and a difference in quantities of bits that have high importance and that are in the data streams, quantities of bit sequences obtained by dividing the plurality of data streams may be different. There may be the two following cases: In one case, a data stream input later may finally occupy less encoding blocks while a data stream input earlier may occupy more encoding blocks; in the other case, after a last data stream is input into encoding blocks, no new data streams are input into the encoder, and bit sequences have not been placed in all encoding sub-blocks of all encoding blocks in the first encoder yet. In the two cases, some bit sequences that are previously input cannot be encoded according to the encoding rule described in step 203; therefore, in both cases, rest bit sequences may be directly encoded without waiting. In this way, encoding efficiency can be improved, and unnecessary waiting can be avoided.
In the following description, encoding a data stream a, a data stream b, a data stream c, a data stream d, and a data stream e is used as an example.
As shown in
As shown in
Referring to
301. Preprocess each bit sequence in the bit sequence set in one of at least two preprocessing manners.
The bit sequence set includes at least two bit sequences, each bit sequence includes N sub-sequences, and N is a positive integer.
In a process of preprocessing different bit sequences, different bit sequences may be preprocessed in different manners or in a same manner, and a quantity of preprocessing times of different bit sequences may be the same or different. This is not specifically limited in this application.
302. Input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, each of N preprocessed sub-sequences into an encoding sub-block of an encoding block in one of the M encoders.
A position of an ith encoding sub-block that is of a (j+i)th encoding block and that is corresponding to an ith sub-sequence of a jth bit sequence in the bit sequence set is represented by Qi,(j+i), i<N is a nonnegative integer, and j and M are positive integers. It should be noted that, in this application, j of the jth bit sequence is an index of the jth bit sequence in the bit sequence set. Similarly, i of the ith encoding sub-block is an index of the ith encoding sub-block in an encoding block to which the encoding sub-block belongs. For example, the bit sequence set includes four bit sequences, a first bit sequence of the bit sequence set includes 20 sub-sequences, and a first sub-sequence of the 20 sub-sequences may be referred to as a 0th sub-sequence. Therefore, a 0th encoding sub-block indicates that an index of the encoding sub-block in an encoding block to which the encoding sub-block belongs is 0, and a position, of the 0th encoding sub-block in a first encoding block, corresponding to the 0th sub-sequence in the first bit sequence is Q0,1. The others are similar.
Optionally, bit sequences in at least two encoders are preprocessed in different manners.
Sub-sequences of a same bit sequence need to be preprocessed for at least two times. In a bit sequence obtained after each time of preprocessing, sub-sequences need to be separately input into encoding sub-blocks of different encoding blocks in a same encoder. The following three cases are included based on different preprocessing manners and a quantity of encoders required for repeated data.
1. All sub-sequences of a same bit sequence are sequentially input, according to a bit order of bits and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, into an encoding sub-block of an encoding block in a first encoder.
2. All sub-sequences of a same bit sequence are sequentially input, according to a bit order of bits and a time-domain position descending order or a frequency-domain position descending order of encoding blocks in an encoder, into an encoding sub-block of an encoding block in a second encoder. Alternatively, reverse sequencing may be first performed on each sub-sequence of the same bit sequence, and then all sub-sequences of the same bit sequence obtained after reverse sequencing are sequentially input, according to a bit order of bits and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, in to an encoding sub-block of an encoding block in a second encoder. Any preprocessing that can achieve the same objective can be used. Specific preprocessing performed on each sub-sequence of the bit sequence is not limited in this application.
3. Each sub-sequence of a same bit sequence obtained after linear transformation is input, according to a bit order of bits and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, into an encoding sub-block of an encoding block in a third encoder.
When M=2, after one time of positive sequencing, to-be-encoded bit sequences may be input into one encoder; and after one time of linear transformation, bit sequences obtained are input into another encoder. Alternatively, after one time of positive sequencing, to-be-encoded bit sequences are input into one encoder; and after one time of reverse sequencing, bit sequences obtained are then input into another encoder.
When M≥3, preprocessing including one time of positive sequencing, one time of reverse sequencing, and (M−2) times of linear transformation needs to be performed on to-be-encoded bit sequences. A same formula or different formulas may be used in preprocessing of the (M−2) times of linear transformation. A specific formula used in the (M−2) times of linear transformation is not limited in this application. In addition, when M≥3, linear transformation is performed for at least once, and there is at least one third encoder.
Optionally, to simplify an encoding operation process for currently input bit sequences and to improve encoding efficiency, bit sequences in some encoding sub-blocks may be further frozen, so that the bit sequences become known bit sequences. Alternatively, the encoding sub-blocks may be initialized, so as to help input subsequent bit sequences. After a first preprocessed bit sequence is input into encoding sub-blocks of encoding blocks in one of the M encoders, an encoding sub-block, other than the position Qi,(i+1), in the encoder into which the first preprocessed bit sequence is currently input may be set to zero.
303. Encode a bit sequence that is in an encoding block in which Qi,(j+i) is located, to obtain a corresponding encoded sequence.
In each encoder, a bit sequence that is in an encoding block in which an ith sub-sequence of a jth bit sequence is located, a bit sequence that is in an encoding block in which an ith sub-sequence of a (j+1)th bit sequence is located, and a bit sequence that is in an encoding block in which an ith sub-sequence of a (j+2)th bit sequence is located may be encoded sequentially.
During encoding, a coding matrix corresponding to a processing type of preprocessing in an encoder may be invoked based on the processing type, and a preprocessed bit sequence set and the coding matrix are multiplied, to obtain a corresponding encoded sequence. In the embodiment corresponding to
[bk1 bk2 . . . bk,N]=[a1 a2 . . . aN]×Fk where bk1 bk2 . . .bk,N represent sub-sequences of a same bit sequence input into a kth third encoder after linear transformation, a1 a2 . . . aN separately represent sub-sequences of the same bit sequence that are to be input into the kth third encoder, Fk represents the matrix for linear transformation, N is a quantity of encoding blocks in the encoder, k and N are positive integers, and 1≤k≤M.
304. Respectively send, on M parallel channels through resource mapping, encoded sequences obtained after each time of encoding.
Compared with that in an existing mechanism, in this application, a transmit device does not need to know a capacity of a single parallel channel, and before inputting bit sequences into an encoder, the transmit device first preprocesses the bit sequences, and then inputs, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of the M encoders. In this way, it can be ensured that all sub-sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, each of the bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode each bit sequence.
For ease of understanding, refer to
Q0,1 represents a position, corresponding to an encoding sub-block whose index is #0 in encoding sub-blocks of a first encoding block, of a0 of the bit sequence a, the encoding sub-block whose index is #0 is referred to as encoding sub-block #0 for short, and the following is the same;
Q1,2 represents a position, corresponding to an encoding sub-block #1 of a second encoding block, of a1 of the bit sequence a;
Q2,3 represents a position, corresponding to an encoding sub-block #2 of a third encoding block, of a2 of the bit sequence a;
Q0,2 represents a position, corresponding to an encoding sub-block #0 of the second encoding block, of b0 of the bit sequence b;
Q1,3 represents a position, corresponding to an encoding sub-block #1 of the third encoding block, of b1 of the bit sequence b;
Q2,4 represents a position, corresponding to an encoding sub-block #2 of a fourth encoding block, of b2 of the bit sequence b;
Qo,3 represents a position, corresponding to an encoding sub-block #0 of the third encoding block, of c0 of the bit sequence c;
Q1,4 represents a position, corresponding to an encoding sub-block #1 of the fourth encoding block, of c1 of the bit sequence c;
Q2,5 represents a position, corresponding to an encoding sub-block #2 of a fifth encoding block, of c2 of the bit sequence c;
Qo,4 represents a position, corresponding to an encoding sub-block #0 of the fourth encoding block, of d0 of the bit sequence d;
Q1,5 represents a position, corresponding to an encoding sub-block #1 of the fifth encoding block, of d1 of the bit sequence d;
Q2,6 represents a position, corresponding to an encoding sub-block #2 of a sixth encoding block, of d2 of the bit sequence d;
Q0,5 represents a position, corresponding to an encoding sub-block #0 of the fifth encoding block, of e0 of the bit sequence e;
Q1,6 represents a position, corresponding to an encoding sub-block #1 of the sixth encoding block, of e1 of the bit sequence e; and
Q0,6 represents a position, corresponding to an encoding sub-block #0 of the sixth encoding block, of f0 of the bit sequence f;
For the channel #1, after a0 to a2 are input, bit sequences in the encoding block in which Q0,1 is located are encoded; after b0 to b2 are input, bit sequences in the encoding block in which Q0,2 is located are encoded; after c0 to c2 are input, bit sequences in the encoding block in which Q0,3 is located are encoded; and after d0 to d2 are input, bit sequences in the encoding block in which Q0,4 is located are encoded. Then, bit sequences in an encoder in which encoding sub-blocks shown by shade blocks are located are encoded. This is similar for the channel #2.
Optionally, sub-sequences of a same bit sequence may be of a same length or different lengths. Lengths of the sub-sequences may be determined based on factors such as a length of an actual idle encoding sub-block and importance of the sub-sequences. This is not specifically limited in this application. In addition, sub-sequences of each piece of repeated data are preprocessed for a plurality of times; however, it needs to ensure that a length of a first encoding sub-block is the same as that of a second encoding sub-block. The first encoding sub-block is an encoding sub-block in one encoder into which a first sub-sequence of the bit sequence set is input after the first sub-sequence is preprocessed once, and the second encoding sub-block is an encoding sub-block of another encoder into which the first sub-sequence is input after the first sub-sequence is preprocessed for another time.
The channel coding method in this application is described above, and the following describes a channel coding apparatus that performs the channel coding method. The channel coding apparatus includes a processing module, an encoder, and a transceiver module. Each encoder includes at least N idle encoding blocks that are contiguous in time-domain positions or frequency-domain positions, each encoding block includes P encoding sub-blocks, reliabilities of the P encoding sub-blocks are sorted in ascending order based on a time-domain position ascending order or frequency-domain position ascending order, P is a positive integer, and P≥N.
1. Referring to
a processing module, configured to preprocess N bit sequences, and input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, N bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of M encoders, where N and M are positive integers, and M≥2;
encoders, configured to encode the N preprocessed bit sequences input into the encoders, to obtain M corresponding encoded sequences; and
a transceiver module, configured to respectively send, on M parallel channels, the M encoded sequences obtained through encoding.
In this embodiment of this application, the processing module does not need to know a capacity of a single parallel channel, and before inputting repeated data into an encoder, the processing module may first preprocess the repeated data, and then input, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, repeated data preprocessed each time into encoding sub-blocks of encoding blocks in one of M encoders. In this way, it can be ensured that all bit sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, the N bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode the N bit sequences.
Optionally, in some embodiments of the present invention, the processing module is configured to:
sequentially input, according to a bit order of the bit sequences and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, the N bit sequences into encoding sub-blocks of encoding blocks in a first encoder, and encode, by using the first encoder, the N bit sequences input into the first encoder, to obtain a first encoded sequence; and
the processing module is further configured to perform at least one of the following two operations:
sequentially inputting, according to the bit order of the bit sequences and a time-domain position descending order or a frequency-domain position descending order of encoding blocks in an encoder, the N bit sequences into encoding sub-blocks of encoding blocks in a second encoder, and encoding, by using the second encoder, the N bit sequences input into the second encoder, to obtain a second encoded sequence; or
inputting, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, N bit sequences obtained after linear transformation into encoding sub-blocks of encoding blocks in a third encoder, and encoding, by using the third encoder, the N bit sequences input into the third encoder after linear transformation, to obtain a third encoded sequence.
In some embodiments of the present invention, the processing module is configured to:
input, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, an ith bit sequence of the N bit sequences into an ith encoding sub-block of an ith encoding block in the first encoder, where i is a positive integer, and 1≤i≤P.
Optionally, in some embodiments of the present invention, the processing module is configured to:
input, according to the bit order of the bit sequences and the time-domain position descending order or the frequency-domain position descending order of encoding blocks in an encoder, a jth bit sequence of the N bit sequences into a jth encoding sub-block of a jth encoding block in the second encoder, where j is a positive integer, and 1≤j≤P.
Optionally, in some embodiments of the present invention, the processing module is configured to:
first perform linear transformation on the N bit sequences, which is performing linear transformation on N bit sequences that are to be input into a kth third encoder, to obtain N new bit sequences, where k is a positive integer, and 1≤k≤M; and linear transformation is performed for (M−2) times, and there is at least one third encoder; and
then input an mth new bit sequence of the N new bit sequences into an mth encoding sub-block of an mth encoding block in the kth third encoder, where m is a positive integer, and 1≤m≤P.
Optionally, a matrix for linear transformation in this embodiment of this application satisfies:
[bj,1, bj,2 . . . bj,N]=[a1 a2 . . . aN]×F j, where bj,1, bj,2 . . . bj,N represent the N new bit sequences obtained after linear transformation is performed on N bit sequences to be input into a jth third encoder, a1 a2 . . . aN represent the N bit sequences to be input into the jth third encoder, and Fj represents the matrix for linear transformation.
Optionally, in some embodiments of the present invention, after the processing module preprocesses the N bit sequences and before the processing module inputs, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, the N bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of the M encoders, the encoders may further perform the following step:
the first encoder sets an encoding sub-block in the first encoder other than the ith encoding sub-block to zero, the second encoder sets an encoding sub-block in the second encoder other than the jth encoding sub-block to zero, and the third encoder sets an encoding sub-block in the kth third encoder other than the mth encoding sub-block to zero.
Optionally, in some embodiments of the present invention, the N bit sequences have a same length or different lengths, a length of a first encoding sub-block is the same as that of a second encoding sub-block, the first encoding sub-block is an encoding sub-block in one encoder into which a first bit sequence of the N bit sequences is input after the first bit sequence is preprocessed once, and the second encoding sub-block is an encoding sub-block of another encoder into which the first bit sequence is input after the first bit sequence is preprocessed for another time.
Optionally, in some embodiments of the present invention, during actual encoding, the encoder may invoke, based on a processing type of preprocessing, a coding matrix corresponding to the processing type in the encoder, and multiply the N preprocessed bit sequences and the coding matrix, to obtain a corresponding encoded sequence.
2. Referring to
a processing module, configured to: preprocess a first data stream and a second data stream separately, where the first data stream includes N1 bit sequences, the second data stream includes N2 bit sequences, and N1 and N2 are positive integers; and separately input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences of a first data stream preprocessed each time and bit sequences of a second data stream preprocessed each time into encoding sub-blocks of different encoding blocks in one of M encoders, where M≥2, a (k+1)th bit sequence of the first data stream and a kth bit sequence of the second data stream are located in a same encoding block, and k is a positive integer;
an encoder, configured to encode a bit sequence that is in an encoding block in which a kth bit sequence of the first data stream input into the encoder is located, so as to obtain a corresponding encoded sequence, where the kth bit sequence of the first data stream is located in an encoding sub-block that has highest reliability in one encoding block; and
a transceiver module, configured to respectively send, on M parallel channels, encoded sequences obtained through encoding.
In this embodiment of this application, the processing module does not need to know a capacity of a single parallel channel, and before inputting data streams into an encoder, the processing module may first preprocess bit sequences of the data streams, and then input, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, bit sequences preprocessed each time into encoding sub-blocks of encoding blocks in one of the M encoders. In this way, it can be ensured that all bit sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, the bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode the bit sequences.
Optionally, in some embodiments of the present invention, each encoder includes at least N idle encoding blocks that are contiguous in time-domain positions or frequency-domain positions, where N=N1 or N=N2; and the processing module is configured to:
sequentially input, according to a bit order of the bit sequences and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, the N bit sequences into encoding blocks in a first encoder, and encode, by using the first encoder, the N bit sequences input into the first encoder, to obtain a first encoded sequence; and
the processing module is further configured to perform at least one of the following two operations:
sequentially inputting, according to the bit order of the bit sequences and a time-domain position descending order or a frequency-domain position descending order of encoding blocks in an encoder, the N bit sequences into encoding blocks in a second encoder, and encoding, by using the second encoder, the N bit sequences input into the second encoder, to obtain a second encoded sequence; or
inputting, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, the N bit sequences obtained after linear transformation into encoding blocks in a third encoder, and encoding, by using the third encoder, the N bit sequences input into the third encoder after linear transformation, to obtain a third encoded sequence.
Optionally, in some embodiments of the present invention, each encoding block includes P encoding sub-blocks, reliabilities of the P encoding sub-blocks are in descending order based on a time-domain position ascending order, where P is a positive integer, and P≥N; and details about inputting the bit sequences into the first encoder, the second encoder, and the third encoder are as follows:
For inputting the bit sequences into the first encoder: The processing module inputs, according to the bit order of the bit sequences and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, an ith bit sequence of the N bit sequences into an ith encoding sub-block of an ith encoding block in the first encoder, where i is a positive integer, and 1≤i≤P.
For inputting the bit sequences into the second encoder: The processing module inputs, according to the bit order of the bit sequences and the time-domain position descending order or the frequency-domain position descending order of encoding blocks in an encoder, a jth bit sequence of the N bit sequences into a jth encoding sub-block of a jth encoding block in the second encoder where j is a positive integer, and 1≤j≤P.
For inputting the bit sequences into the third encoder: The processing module first performs linear transformation on the N bit sequences. A specific process of linear transformation is: performing linear transformation on N bit sequences that are to be input into a kth third encoder, to obtain N new bit sequences, where k is a positive integer, and 1≤k≤M; and linear transformation may be performed for (M−2) times, there is at least one third encoder. The processing module then inputs an mth new bit sequence of the N new bit sequences into an mth encoding sub-block of an mth encoding block in the kth third encoder, where m is a positive integer, and 1≤m≤P.
Optionally, in some embodiments of the present invention, before inputting the N bit sequences obtained after linear transformation into the third encoder, the processing module may be further configured to map the N new bit sequences onto an X Galois field, where X=2p, and p is a positive integer.
In addition, after imputing the N bit sequences obtained after linear transformation into the third encoder, and before encoding the N bit sequences input into the third encoder after linear transformation, the processing module may further map, onto binary sequences, the N new bit sequences that are mapped onto the X Galois field and that are input into the kth third encoder.
That the N bit sequences are mapped onto the X Galois field may include one of the following:
when M≤4, the N bit sequences are mapped onto a binary field; or
when M>4, the N bit sequences are mapped onto a q-nary Galois field 2q, where q is a positive integer greater than or equal to 2.
Optionally, a matrix for linear transformation satisfies:
[bj,1 bj,2 . . . bj,N]=[a1 a2 . . . aN]×Fj, where bj,1 bj,2 . . . bj,N represent the N new bit sequences obtained after linear transformation is performed on N bit sequences to be input into a jth third encoder, a1 a2 . . . aN represent the N bit sequences to be input into the jth third encoder, and Fj represents the matrix for linear transformation.
Optionally, in some embodiments of the present invention, after preprocessing the first data stream and the second data stream separately, and before inputting, according to the bit order of the bit sequence and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, the ith bit sequence of the N bit sequences into the ith encoding sub-block of the ith encoding block in the first encoder, the processing module is further configured to:
set an encoding sub-block in the first encoder other than the ith encoding sub-block to zero, set an encoding sub-block in the second encoder other than the jth encoding sub-block to zero, and set an encoding sub-block in the kth third encoder other than the mth encoding sub-block to zero.
Optionally, in some embodiments of the present invention, the N bit sequences have a same length or different lengths, a length of a first encoding sub-block is the same as that of a second encoding sub-block, the first encoding sub-block is an encoding sub-block in one encoder into which a first bit sequence of the N bit sequences is input after the first bit sequence is preprocessed once, and the second encoding sub-block is an encoding sub-block of another encoder into which the first bit sequence is input after the first bit sequence is preprocessed for another time.
Optionally, in some embodiments of the present invention, during encoding, the encoder may invoke, based on a processing type of preprocessing, a coding matrix corresponding to the processing type in the encoder, and multiply the N preprocessed bit sequences and the coding matrix, to obtain a corresponding encoded sequence.
3. Referring to
a processing module, configured to: preprocess each bit sequence in a bit sequence set in one of at least two preprocessing manners, where the bit sequence set includes at least two bit sequences, each bit sequence includes N sub-sequences, and N is a positive integer; and input, according to a position arrangement order of encoding sub-blocks of an encoding block in an encoder, each of N preprocessed sub-sequences into an encoding sub-block of an encoding block in one of M encoders, where a position of an ith encoding sub-block that is of a (j+i)th encoding block and that is corresponding to an ith sub-sequence of a jth bit sequence in the bit sequence set is represented by Qi,(j+i), i<N, i is a nonnegative integer, j and M are positive integers, and bit sequences in at least two encoders are preprocessed in different manners;
an encoder, configured to encode a bit sequence that is in the encoding block in which Qi,(j+i) is located, to obtain a corresponding encoded sequence; and
a transceiver module, configured to respectively send, on M parallel channels, encoded sequences obtained after each time of encoding.
Each encoder may include encoding blocks that are contiguous in time-domain positions or frequency-domain positions, each encoding block includes a plurality of encoding sub-blocks, the encoding sub-blocks in the encoding block are corresponding to reliabilities, and in each encoding block, reliabilities of encoding sub-blocks are sorted in ascending order based on a time-domain position ascending order or frequency-domain position ascending order.
In this embodiment of this application, the processing module does not need to know a capacity of a single parallel channel, and before inputting a bit sequence into an encoder, the processing module may first preprocess the bit sequence, and then input, according to the position arrangement order of encoding sub-blocks of an encoding block in an encoder, a bit sequence preprocessed each time into an encoding sub-block of an encoding block in one of the M encoders. In this way, it can be ensured that all sub-sequences input into the encoder are input into corresponding encoding sub-blocks according to a rule. Therefore, each of the bit sequences can be correctly sent, a preset channel capacity can be reached through a coding gain, and a receive device can correctly decode each bit sequence.
Optionally, in some embodiments of the present invention, different bit sequences may be preprocessed in different manners.
Optionally, in some embodiments of the present invention, each encoder is configured to:
for bit sequences in the encoder, sequentially encode a bit sequence that is in an encoding block in which an ith sub-sequence of a ith bit sequence is located, a bit sequence that is in an encoding block in which an ith sub-sequence of a (j+1)th bit sequence is located, and a bit sequence that is in an encoding block in which an ith sub-sequence of a (j+2)th bit sequence is located.
Optionally, in some embodiments of the present invention, the processing module is configured to:
sequentially input, according to a bit order of bits and a time-domain position ascending order or a frequency-domain position ascending order of encoding blocks in an encoder, all sub-sequences of a same bit sequence into encoding sub-blocks of encoding blocks in a first encoder; and
the processing module is further configured to perform at least one of the following two operations:
sequentially inputting, according to the bit order of the bits and a time-domain position descending order or a frequency-domain position descending order of encoding blocks in an encoder, all sub-sequences of the same bit sequence into encoding sub-blocks of encoding blocks in a second encoder; or
inputting, according to the bit order of the bits and the time-domain position ascending order or the frequency-domain position ascending order of encoding blocks in an encoder, each sub-sequence of a same bit sequence obtained after linear transformation into an encoding sub-block of an encoding block in a third encoder.
Optionally, in some embodiments of the present invention, the preprocessing manners include linear transformation, and when M≥3, linear transformation is performed for at least once, and there is at least one third encoder.
A matrix for linear transformation may satisfy:
[bk,1 bk2 . . . bk,N]=[a1 a2 . . . aN]×Fk, where bk1 bk2 . . . bk,N represent sub-sequences of a same bit sequence input into a kth third encoder after linear transformation, a1 a2 . . . aN separately represent sub-sequences of the same bit sequence that are to be input into the kth third encoder, Fk represents the matrix for linear transformation, N is a quantity of encoding blocks in the encoder, k and N are positive integers, and 1≤k≤M.
Optionally, in some embodiments of the present invention, after the processing module inputs a first preprocessed bit sequence into an encoding sub-block of an encoding block in one of the M encoders, and before the processing module encodes the bit sequence that is in the encoding block in which Qi,(j+i) is located, the encoder may be further configured to:
set an encoding sub-block, other than the position Qi,(i+i), in the encoder into which the first preprocessed bit sequence is currently input to zero.
Optionally, in some embodiments of the present invention, sub-sequences of a same bit sequence have a same length or different lengths, a length of a first encoding sub-block is the same as that of a second encoding sub-block, the first encoding sub-block is an encoding sub-block in one encoder into which a first sub-sequence of the bit sequence set is input after the first sub-sequence is preprocessed once, and the second encoding sub-block is an encoding sub-block of another encoder into which the first sub-sequence is input after the first sub-sequence is preprocessed for another time.
Optionally, in some embodiments of the present invention, for each encoder, during actual encoding, the encoder may invoke, based on a processing type of preprocessing, a coding matrix corresponding to the processing type in the encoder, and multiply a preprocessed bit sequence set and the coding matrix, to obtain a corresponding encoded sequence.
It should be noted that the encoder in this application may be an independent circuit module or may be a logic circuit implemented by software. The encoder may be implemented by software or hardware, and the encoder may be implemented by a processor by using software or may be implemented by a chip separate from a processor. This is not specifically limited in this application. For example, in the embodiments corresponding to
Memories in
This application further provides a computer storage medium. The medium stores a program, and when the program is executed, some or all of the steps performed by the foregoing channel coding apparatuses in the foregoing channel coding methods are performed.
In the foregoing embodiments, the description of each embodiment has respective focuses. For a part that is not described in detail in an embodiment, reference may be made to related descriptions in other embodiments.
It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the system, apparatus, and module described above, reference may be made to a corresponding process in the foregoing method embodiments, and details are not described herein again.
In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely used as an example. For example, the module division is merely logical function division and may be other division in actual implementation. For example, a plurality of modules or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or modules may be implemented in electrical, mechanical, or other forms.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one position, or may be distributed on a plurality of network modules. Some or all the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
In addition, functional modules in the embodiments of this application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules may be integrated into one module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module.
When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, the integrated module may be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the prior art, or all or some of the technical solutions may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the methods described in the embodiments of this application. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.
The technical solutions provided in this application are described in detail above. The principle and implementation of this application are described through specific examples in the embodiments of this application. The description about the embodiments is merely provided to help understand the method and core ideas of this application. In addition, persons of ordinary skill in the art can make variations and modifications in terms of the specific implementations and application scopes according to the ideas of this application. Therefore, the content of the specification shall not be construed as a limit to this application.
Number | Date | Country | Kind |
---|---|---|---|
201611204798.7 | Dec 2016 | CN | national |
This application is a continuation of International Application No. PCT/CN2017/115569, filed in Dec. 12, 2017, which claims priority to Chinese Patent Application No. 201611204798.7, filed on Dec. 23, 2016. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2017/115569 | Dec 2017 | US |
Child | 16450125 | US |