Disclosure of Invention
In view of the above, an object of the present invention is to provide a method for encoding and decoding feedback information for data transmission, a transmitting end and a receiving end, which can improve the compression gain of a bitmap in the feedback information, simplify the decoding process, and improve the data transmission efficiency of a synchronous satellite mobile communication system.
The invention is realized by the following steps:
in a first aspect, an embodiment of the present invention provides a method for encoding feedback information for data transmission, where the method is applied to a data transmission device, where the data transmission device includes a sending end and a receiving end, and the feedback information includes a bitmap; the data packet sent by the sending end comprises the serial number of the data packet, and the method comprises the following steps:
the receiving end receives the data packet sent by the sending end, and generates an original bitmap according to the number and the receiving state of the data packet, wherein the length of the original bitmap is LS which is less than or equal to 511;
the receiving end encodes the original bitmap to generate a first compressed bitmap, wherein the length of the first compressed bitmap is LC 1; the first compressed bitmap comprises a plurality of fixed-length first code words, and each fixed-length first code word represents the number of bits of the same and continuous binary number in the original bitmap;
the receiving end sends feedback information comprising the bitmap to the sending end; if the LS is less than or equal to the LC1, selecting the original bitmap as a bitmap included in the feedback information, and if the LC1 is less than the LS, selecting the first compressed bitmap as a bitmap included in the feedback information; the feedback information also comprises compression mode description information which describes the bitmap as the original bitmap or the first compressed bitmap; if the bitmap is the first compressed bitmap, the feedback information further includes an initial state flag describing a receiving state of a data packet represented by a first segment of identical and consecutive binary numbers in an original bitmap corresponding to a first codeword in the first compressed bitmap.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where each fixed-length first codeword represents a number of bits of a same and consecutive binary number in the original bitmap, and the method includes:
if the number of bits of the same and continuous binary number does not exceed 63 bits, the number of bits of the binary number not exceeding 63 bits is represented by a 6-bit binary code, and the 6-bit binary code is a result code; if the number of bits of the same and continuous binary number exceeds 63 bits, the number of bits of the binary number exceeding 63 bits is represented by a 9-bit binary code, wherein 3 bits of the 9-bit binary code are forming codes, and 6 bits of the 9-bit binary code are result codes; the first codeword comprises the result code or the form code and the result code, a first bit of the first codeword is a type code describing whether the first codeword comprises or does not comprise the form code.
The first code word with the fixed length is 7 bits or 10 bits, when decoding, the first code word with the fixed length is known to be 7 bits or 10 bits by reading the type code, and then the first code word with the fixed length can be decoded by reading the 6 bits or 9 bits behind the type code, so that the decoding process is simple and quick, the decoding efficiency is improved, and the data transmission efficiency is further improved.
With reference to the first aspect or with reference to the first possible implementation manner of the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the first compressed bitmap includes a plurality of first codewords with fixed lengths, and the method includes:
the first compressed bitmap includes the first codewords combined in an order of the same and consecutive binary numbers corresponding to the first codewords in the original bitmap.
The first code words are combined into a first compressed bitmap according to the sequence, and the decoded original bitmap can correctly reflect the receiving state of the data packet.
With reference to the second possible implementation manner of the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where the generating an original bitmap according to a reception state of the data packet includes:
the original bitmap is generated according to the receiving state of the data packet corresponding to the next number of the first lost data packet.
And when the data packet is lost, generating an original bitmap, and defaulting the data packet before the lost data packet as successfully received by a sending end. The first bit of the original bitmap indicates the reception status of the next data packet of the first missing data packet. The transmitting end first retransmits a packet corresponding to a bit preceding the first bit of the original bitmap.
With reference to the third possible implementation manner of the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where the method further includes:
the receiving end encodes the digits of the same and continuous binary numbers included in the original bitmap according to a compression method of ITU-T-TRecommunications T.4, and generates a second code word after encoding the digits of each section of the same and continuous binary numbers;
the second code word is combined according to the sequence of the same and continuous binary number of each segment in the original bitmap to generate a second compressed bitmap, and the length of the second compressed bitmap is LC 2;
comparing the sizes of LS, LC1 and LC2, if LS is less than or equal to LC1 and is less than or equal to LC2, selecting the original bitmap as the bitmap included in the feedback information, if LC1 is less than or equal to LC2 and LC1 is less than LS, selecting the first bitmap as the bitmap included in the feedback information, and if LC2 is less than LS and LC2 is less than LC1, selecting the second bitmap as the bitmap included in the feedback information; the feedback information further includes compression mode description information describing that the bitmap is the original bitmap, the first compressed bitmap, or the second compressed bitmap.
After the receiving end generates the original bitmap, the original bitmap is coded in two modes, then the length of the compressed bitmap generated by the two coding modes is compared with the length of the original bitmap, the bitmap with shorter length is sent, and if the bitmap is as long as the bitmap, the original bitmap which does not need to be decoded is sent.
With reference to the first aspect, the first possible implementation manner of the first aspect, the third possible implementation manner of the first aspect, or the fourth possible implementation manner of the first aspect, an embodiment of the present invention provides a fifth possible implementation manner of the first aspect, where a binary number 0 in the original bitmap indicates a missing data packet included in the reception status of the data packet, and a binary number 1 indicates a received data packet included in the reception status of the data packet; the initial state flag of the receiving state of the data packet represented by the same and consecutive binary number in the first segment of the original bitmap corresponding to the first code word in the first compressed bitmap includes binary numbers 0 and 1, where the binary number 0 included in the initial state flag indicates that the same and consecutive binary number in the first segment is 0, and the binary number 1 included in the initial state flag indicates that the same and consecutive binary number in the first segment is 1.
Since the same and consecutive binary numbers 0 or 1 in the first compressed bitmap have the same first code word when the length is the same, the feedback information needs to include the start state of the reception state of the packet represented by the first segment of the same and consecutive binary numbers in the original bitmap corresponding to the first code word in the first compressed bitmap. Two adjacent first code words represent two identical and consecutive binary numbers 0 and 1 or two identical and consecutive binary numbers 1 and 0.
In a second aspect, an embodiment of the present invention further provides a method for decoding feedback information of data transmission, where the method is applied to a device for data transmission, where the device for data transmission includes a sending end and a receiving end, the feedback information includes a bitmap, and the method includes:
the sending end receives the feedback information sent by the receiving end, and the feedback information also comprises compression mode description information which describes that the bitmap is the original bitmap, the first compression bitmap or the second compression bitmap;
if the bitmap included in the feedback information is the first compressed bitmap or the second compressed bitmap, the sending end decodes the bitmap included in the feedback information according to the compression mode description information to generate an original bitmap;
and the sending end resends the data packet lost by the receiving end according to the receiving state of the data packet represented by the original bitmap included by the feedback information or the original bitmap obtained after decoding.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where if a bitmap included in the feedback information is the first compressed bitmap, the feedback information further includes a start state flag describing a reception state of a packet represented by a first segment of identical and consecutive binary numbers in an original bitmap corresponding to a first codeword in the first compressed bitmap; the sending end decodes the bitmap included in the feedback information according to the compression mode description information to generate an original bitmap, and the method comprises the following steps:
the sending end judges that the bitmap included in the feedback information is the first compressed bitmap or the second compressed bitmap according to the compression mode description information;
the first compressed bitmap comprises a plurality of first code words with fixed length, each first code word comprises a result code or a forming code and a result code, the result code is a 6-bit binary code, and the forming code is a 3-bit binary code; a first bit of the first codeword is a type code describing whether the first codeword includes or does not include the forming code; if the bitmap included in the feedback information is the first compressed bitmap, the sending end determines the length of each first code word according to the type code, and then decodes the first compressed bitmap according to the length of each first code word and the initial state mark to generate an original bitmap;
if the bitmap included in the feedback information is the second compressed bitmap, the sending end encodes the second compressed bitmap according to a decoding method of ITU-T-TRecommunications T.4, and generates an original bitmap according to the initial state mark.
And if the sending end judges that the bitmap included in the feedback information is the first compressed bitmap or the second compressed bitmap according to the compression mode description information, the sending end decodes the bitmap according to different decoding methods to generate the original bitmap.
In a third aspect, an embodiment of the present invention provides a receiving end for data transmission, where the receiving end is applied to a device for data transmission, where the device for data transmission includes a sending end and a receiving end, the sending end sends a data packet to the receiving end, the receiving end sends feedback information describing a receiving state of the data packet to the sending end, and the feedback information includes a bitmap; the data packet sent by the sending end includes the serial number of the data packet, and the receiving end includes:
a data packet receiving unit, configured to receive a data packet sent by the sending end;
an original bitmap generation unit, configured to generate an original bitmap according to the number and the receiving state of the data packet, where the length of the original bitmap is LS, and LS is less than or equal to 511;
an original bitmap encoding unit, configured to encode the original bitmap to generate a compressed bitmap, where the length of the compressed bitmap is LC; the compressed bitmap comprises a plurality of fixed-length code words, and each fixed-length code word represents the number of bits of the same and continuous binary number in the original bitmap;
a feedback information sending unit, configured to send feedback information including the bitmap to a sending end; if the LS is less than or equal to the LC, selecting the original bitmap as a bitmap included in the feedback information, and if the LC is less than the LS, selecting the compressed bitmap as a bitmap included in the feedback information; the feedback information also comprises compressed mode description information which describes the bitmap as the original bitmap or the compressed bitmap; if the bitmap is the compressed bitmap, the feedback information further includes an initial state flag describing a receiving state of a data packet represented by a first segment of the same and consecutive binary number in the compressed bitmap.
In a fourth aspect, an embodiment of the present invention provides a sending end for data transmission, where the sending end is applied to a data transmission device, where the data transmission device includes a sending end and a receiving end, the sending end sends a data packet to the receiving end, and the receiving end sends feedback information describing a receiving state of the data packet to the sending end, where the feedback information includes a bitmap; the data packet sent by the sending end includes the serial number of the data packet, and the sending end includes:
a feedback information receiving unit, configured to receive the feedback information sent by the receiving end, where the feedback information further includes compression mode description information describing that the bitmap is an original bitmap or a compressed bitmap;
a compressed bitmap decoding unit, configured to decode the bitmap included in the feedback information according to the compression mode description information to generate an original bitmap, if the bitmap included in the feedback information is the compressed bitmap;
and the data packet sending unit is used for resending the data packet lost by the receiving end according to the receiving state of the data packet represented by the original bitmap included in the feedback information or the original bitmap obtained after decoding.
The invention realizes the technical effects that: the invention provides a coding and decoding method of feedback information of data transmission, a sending end and a receiving end, which are characterized in that an original bitmap generated by the receiving state of a data packet is coded, and then the original bitmap or a compressed bitmap with shorter length is sent, so that the feedback information of the data transmission occupies channel resources as little as possible. The coding method of the feedback information of the data transmission comprises a method for coding an original bitmap by using a code word with a fixed length, the method has large compression gain, occupies less channel resources during transmission, has a simple decoding method, and improves the efficiency of data transmission.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In a geostationary satellite mobile communication system, long delays and high error rates lead to a considerable increase in the unreliability of data transmission. In order to increase the reliability of data transmission, data is transmitted in an AM (acknowledged mode) mode at a radio link control layer of a protocol stack. The operation mode is as follows: the sending end numbers the data packets to be sent, and the numbers are contained in the data header during sending; the receiving end sequentially receives the data packets and records the serial numbers of the received data packets; the receiving end sends ACK/NACK (acknowledgement/non-acknowledgement) information to the sending end to inform the sending end which data packets are received and which data packets are not received; and the transmitting end retransmits the data which is not received by the receiving end according to the content of the ACK/NACK.
The ACK/NACK message typically contains an acknowledgement for a number of data packets. Its representation method is a bitmap. Each bit of the bitmap represents the state of a packet. The bitmap of an ACK/NACK message can confirm the status of up to 511 packets, i.e., a bitmap of an ACK/NACK may be represented using 511 bits (1 bit is a 1-bit binary number). But not all burst lengths can meet this requirement and one ACK/NACK message cannot be sent in segments in multiple bursts. A compression is therefore typically used to reduce the length occupied by the bitmap in the ACK/NACK message. The compression method uses the coding method used by the fax described in ITU-T.4. This method represents a plurality of consecutive 1's and a plurality of consecutive 0's with a specific codeword, and the reason why the compression gain can be achieved by doing so is: the facsimile pattern is represented by pixels, each having only two values, "black" and "white", corresponding to "0" and "1". Since the granularity of the pixel is fine, the pattern is basically composed of consecutive 0 s and consecutive 1 s. When a specific codeword is used to represent consecutive 1's and 0's, the length of the bit occupied by the codeword is less than the length of the expressed consecutive 1's and 0's.
However, the code word generated by this encoding method is still long, and the corresponding decoding process is complicated. Since the code word is not of a fixed length, when each code word is identified in a stream of bits, it is necessary to perform bit-by-bit parsing from beginning to end to determine a complete code word.
The embodiment of the invention provides a method for coding feedback information of data transmission, and the method has the advantages of shorter code word generated by coding and improved compression gain.
Referring to fig. 1, a method for encoding feedback information of data transmission is applied to a data transmission apparatus, the data transmission apparatus includes a transmitting end and a receiving end, the feedback information includes a bitmap; the data packet sent by the sending end comprises the serial number of the data packet, and the method comprises the following steps:
s101: and the receiving end receives the data packet sent by the sending end.
S102: and the receiving end generates an original bitmap according to the number and the receiving state of the data packet, wherein the length of the original bitmap is LS which is less than or equal to 511.
S103: the receiving end encodes the original bitmap to generate a first compressed bitmap, and the length of the first compressed bitmap is LC 1; the first compressed bitmap includes a plurality of fixed-length first codewords, each fixed-length first codeword representing a number of bits of a same and consecutive binary number in the original bitmap.
S104: the receiving end compares the lengths of the LS and LC 1.
S105: the receiving end sends feedback information comprising the bitmap to the sending end;
if the LS is less than or equal to LC1, selecting the original bitmap as the bitmap included in the feedback information, and if the LC1 is less than the LS, selecting the first compressed bitmap as the bitmap included in the feedback information; the feedback information also comprises compression mode description information which describes that the bitmap is an original bitmap or a first compression bitmap; if the bitmap is a first compressed bitmap, the feedback information further includes an initial state flag describing a receiving state of a data packet represented by a first section of the same and consecutive binary numbers in an original bitmap corresponding to a first codeword in the first compressed bitmap.
The coding method of the feedback information of the data transmission adopts the first code word with fixed length for coding, only the first code word with fixed length needs to be read during decoding, and the code words do not need to be analyzed one by one bit from beginning to end, so that the decoding is simple, and the transmission efficiency of the data is improved.
Referring to fig. 2, a method for encoding feedback information of data transmission is applied to a data transmission apparatus, the data transmission apparatus includes a transmitting end and a receiving end, the feedback information includes a bitmap; the data packet sent by the sending end comprises the serial number of the data packet, and the method comprises the following steps:
s201: and the receiving end receives the data packet sent by the sending end.
S202: and the receiving end generates an original bitmap according to the number and the receiving state of the data packet, wherein the length of the original bitmap is LS which is less than or equal to 511.
S203: the receiving end encodes the original bitmap to generate a first compressed bitmap and a second compressed bitmap, wherein the length of the first compressed bitmap is LC1, and the length of the second compressed bitmap is LC 2;
the step of generating the first compressed bitmap is as follows:
the first compressed bitmap comprises a plurality of fixed-length first code words, the fixed-length first code words are combined in sequence, the combination sequence is the sequence of the same and continuous binary numbers corresponding to the first code words in the original bitmap, and each fixed-length first code word represents the number of bits of the same and continuous binary numbers in the original bitmap. If the number of bits of the same and consecutive binary number does not exceed 63 bits, as shown in fig. 7, the number of bits of the binary number not exceeding 63 bits is represented by a 6-bit binary code, and the 6-bit binary code is a result code; if the number of bits of the same and consecutive binary number exceeds 63 bits, as shown in fig. 8, the number of bits of the binary number exceeding 63 bits is represented by a 9-bit binary code, the 3-bit high bits of the 9-bit binary code are forming codes, and the 6-bit low bits are result codes; the first code word comprises a result code or a forming code and the result code, the first bit of the first code word is a type code, and the type code describes that the first code word comprises or does not comprise the forming code;
the step of generating the second compressed bitmap is as follows:
the receiving end encodes the digits of the same and continuous binary numbers in the original bitmap according to a compression method of ITU-T-TRecommunications T.4, and generates a second code word after encoding the digits of each section of the same and continuous binary numbers; the second code word is combined in the order of each segment of the same and consecutive binary number in the original bitmap to generate a second compressed bitmap.
S204: the receiving end compares the sizes of the LS, the LC1 and the LC 2;
if LS is less than or equal to LC1 and less than or equal to LC2, selecting the original bitmap as a bitmap included in the feedback information, if LC1 is less than or equal to LC2 and LC1 is less than LS, selecting the first bitmap as a bitmap included in the feedback information, and if LC2 is less than LS and LC2 is less than LC1, selecting the second bitmap as a bitmap included in the feedback information; the feedback information also comprises compression mode description information which describes that the bitmap is an original bitmap, a first compression bitmap or a second compression bitmap; if the bitmap is a first compressed bitmap, the feedback information further includes an initial state flag describing a receiving state of a data packet represented by a first section of the same and consecutive binary numbers in an original bitmap corresponding to a first codeword in the first compressed bitmap.
S205: the receiving end sends feedback information including a bitmap to the sending end, and the bitmap included in the sent feedback information can be an original bitmap, a first compressed bitmap or a second compressed bitmap.
In order to improve the efficiency of data transmission, when the original bitmap is generated, the bitmap is generated according to the receiving state of the data packet corresponding to the next number of the first lost data packet. For example, the data packet with the number x is lost, the first bit of the original bitmap indicates the receiving state of the data packet with the number x +1, and the second bit indicates the receiving state of the data packet with the number x + 2. The data packets numbered x-1 and previously numbered are by default already received successfully.
In the embodiment of the invention, the binary number 0 in the original bitmap represents that the data packet is lost, and the binary number 1 represents that the data packet is received. The start state flag of the receiving state of the data packet represented by the first segment of the same and consecutive binary numbers in the original bitmap corresponding to the first code word in the first compressed bitmap includes binary numbers 0 and 1, where the binary number 0 included in the start state flag indicates that the first segment of the same and consecutive binary numbers is 0, and the binary number 1 included in the start state flag indicates that the first segment of the same and consecutive binary numbers is 1. The binary numbers 0 and 1 in the original bitmap and the binary numbers 0 and 1 included in the start state flag may be given the opposite contents to the above representation contents according to the actual requirement.
Corresponding to the above coding method, referring to fig. 3, an embodiment of the present invention provides a method for decoding feedback information of data transmission, where the method is applied to a device for data transmission, the device for data transmission includes a sending end and a receiving end, the feedback information includes a bitmap, and the method includes:
s301: the sending end receives feedback information sent by the receiving end;
the feedback information further includes compression mode description information describing whether the bitmap is an original bitmap, a first compressed bitmap, or a second compressed bitmap.
S302: if the bitmap included in the feedback information is a first compressed bitmap or a second compressed bitmap, the sending end judges that the bitmap included in the feedback information is the first compressed bitmap or the second compressed bitmap according to the compression mode description information, and then decodes the bitmap included in the feedback information to generate an original bitmap;
the method comprises the following specific steps: if the bitmap included in the feedback information is a first compressed bitmap, the feedback information further includes a starting state mark describing a receiving state of a data packet represented by a first section of same and continuous binary numbers in an original bitmap corresponding to a first code word in the first compressed bitmap, a sending end reads the starting state mark first, determines that the data packet described by the first code word is described by the first bit of the original bitmap is lost or received, then reads the first bit, namely a type code, of the first code word, determines that the length of the first code word is 7 bits or 10 bits, then decodes the first code word, and then decodes the second first code word until the original bitmap is generated;
and if the bitmap included in the feedback information is a second compressed bitmap, the sending end decodes according to a decoding method corresponding to the compression method of ITU-T Recommendations T.4 to generate an original bitmap.
S303: and the sending end resends the data packet lost by the receiving end according to the receiving state of the data packet represented by the original bitmap included in the feedback information or the original bitmap obtained after decoding.
When the coding and decoding method is used, the receiving end firstly receives the data packet sent by the sending end, and the data packet comprises the serial number of the data packet. And the receiving end generates an original bitmap according to the receiving state and the number of the data packet, wherein the original bitmap is composed of binary numbers 0 and 1, 0 represents that the data packet is lost, 1 represents that the data packet is successfully received, and the bit number of the binary number in the original bitmap is the length LS of the original bitmap. After generating the original bitmap, the receiving end encodes and compresses the original bitmap in two ways, namely, generating a first compressed bitmap and a second compressed bitmap, wherein the lengths of the first compressed bitmap and the second compressed bitmap are LC1 and LC2 respectively. The first compression bitmap is generated as follows:
for example, if there is such a segment of binary number … … 111111111100000 … … in the original bitmap, then according to the code table of the first code word shown in fig. 5a and 5b and fig. 7 and 8, the generated first compressed bitmap is … … 00010100000100 … …, since the segment of consecutive and identical binary numbers 0 and 1 in the original bitmap does not exceed 63 bits, no forming code is used, and the generated two segments of first code words are both 7 bits.
The second compression bitmap is generated as follows:
if such a binary number … … 111111111100000 … … is still present in the original bitmap, then the second compressed bitmap generated according to the code table of the second codeword shown in fig. 6a and 6b is … … 001110011 … ….
As can be seen from the table, when the length of the same and consecutive binary numbers in the original bitmap is less than 18 bits, the gain of the second compressed bitmap is higher than that of the first compressed bitmap, but when the length of the same and consecutive binary numbers in the original bitmap is greater than or equal to 18 bits, in particular greater than 63 bits, each first codeword remains at 10 bits, while the length of the second codeword representing consecutive binary numbers 0 is almost all above 20 bits. In the synchronous satellite mobile communication, the data transmission is interfered much, so that a binary number 0 with multiple continuous bits in an original bitmap can appear frequently, and the coding mode for generating the first compressed bitmap in the synchronous satellite mobile communication is better than the existing coding mode for generating the second compressed bitmap. In order to cope with various situations which may occur, the feedback information of data transmission provided by the embodiment of the present invention is encoded by using the above two methods, the lengths of the generated compressed bitmaps are compared, and the compressed bitmap with a shorter length is sent.
In the above example, if 111111111100000 is used as the original bitmap, the length LC2 of the second compressed bitmap 001110011 is shorter than the length LC1 of the first compressed bitmap 00010100000100 and the length of the original bitmap LS, that is, the bitmap sent by the feedback information is the second compressed bitmap. The second compressed bitmap at this time occupies less channel resources.
The receiving end sends feedback information to the sending end, and the feedback information also comprises compression mode description information and initial state marks. After receiving the feedback information, the sending end judges whether a bitmap included in the feedback information is an original bitmap, a first compressed bitmap or a second compressed bitmap according to the compression mode description information; the first codeword of the compressed bitmap is known to represent a 1 from the start status flag. Continuing with the above example, the bitmap is a second compressed bitmap, which the transmitting end decodes according to fig. 6a and 6 b. The decoding process is as follows:
since it is impossible to judge whether the result code or the formation code, it needs to be determined step by step.
When the first and second code words are parsed,
(1) reading the first bit, since the value is 0, then it can be concluded that:
if the result code is: the first and second codewords may take values in the set [1, 2, 10, 11, 12, 13, 18.. 63 ];
if the code is formed: the first and second code words may be [192, 256, 320, 384, 448 ].
(2) Reading the second bit, since the value is 0, then it can be concluded that:
if the result code is: the first second codeword may take values in the set [1, 10, 12, 13, 19.. 23, 26, 28.. 48, 53, 54, 61, 62, 63 ];
if the code is formed: the first second codeword may be [320, 384 ].
(3) Reading the third bit, since the value is 1, then it can be concluded that:
if the result code is: the first codeword may take values in the set [10, 12, 21, 26, 28, 39.. 44, 53, 54, 61, 62, 63 ];
if the code is formed: the first codeword may be [320, 384 ].
(4) Reading the fourth bit, since the value is 1, it can be concluded that:
if the result code is: the first codeword may take values in the set [10, 28, 61, 62, 63 ];
if the code is formed: the first codeword may be [320, 384 ].
(5) Reading the fifth bit, since the value is 1, then it can be concluded that:
the first codeword represents 10 consecutive binary numbers 1.
When the second codeword is parsed, the first second codeword represents a consecutive and identical binary number 1, and the second codeword represents a consecutive and identical binary number 0.
(6) Reading the sixth bit, since the value is 0, then it can be concluded that:
the second codeword is the result code: values may be taken from this set [3.. 63 ].
(7) Reading the seventh bit, since the value is 0, then it can be concluded that:
the second codeword is the result code: values may be taken from the set [5.. 63 ].
(8) Reading the eighth bit, since the value is 1, it can be concluded that:
the second codeword is the result code: values may be taken in this set of [5, 6 ].
(9) Reading the ninth bit, since the value is 1, then it can be concluded that:
the second codeword represents 5 consecutive binary numbers 0.
It can be seen from the decoding process that the decoding process of the second compressed bitmap is complicated. In general, because the data transmission amount is large and the number of data packets is large, the original bitmap is long, the gain of the first compressed bitmap is larger than that of the second compressed bitmap, the decoding method is simple, and the bitmap included in the feedback information is generally the first compressed bitmap.
If the bitmap included in the feedback information is the first compressed bitmap, and the bitmap is decoded 00010100000100, the sender decodes according to fig. 5a and 5 b. The transmitting end knows that the first code word of the segment represents a continuous binary number 1 according to the previous code word.
When the first code word is parsed,
(1) reading the first bit, since the value is 0, then it can be concluded that: the first codeword is the result code.
(2) The values of the 2 nd to 7 th bits are read, and the table lookup reveals that the first code word represents 10 consecutive binary numbers 1.
When the second first codeword is parsed, since the first codeword represents consecutive binary numbers 1, the second first codeword represents consecutive binary numbers 0.
(3) Reading the value of bit 8, since this value is 0, then it can be concluded that: the second codeword is the result code.
(4) The values of the 9 th to 14 th bits are read, and the table lookup reveals that the second first code word represents 5 consecutive binary numbers 0.
It can be seen from the above-described decoding process of the first compressed bitmap that the decoding method of the first compressed bitmap is due to the decoding method of the second compressed bitmap.
When the original bitmap is decompressed or the bitmap included in the received feedback information is the original bitmap, the sending end resends the data packet lost by the receiving end according to the receiving state of the data packet represented by the original bitmap.
Referring to fig. 4, a receiving end 401 of data transmission is applied to a device of data transmission, the device of data transmission includes a transmitting end 501 and the receiving end 401, the transmitting end 501 transmits a data packet to the receiving end 401, the receiving end 401 transmits feedback information describing a receiving state of the data packet to the transmitting end, the feedback information includes a bitmap; the data packet transmitted by the transmitting end 501 includes the number of the data packet. The receiving end 401 includes a packet receiving unit 402, an original bitmap generating unit 403, an original bitmap encoding unit 404, and a feedback information transmitting unit 405. Wherein,
the packet receiving unit 402 is configured to receive a packet sent by the sending end 501.
The original bitmap generation unit 403 is configured to generate an original bitmap according to the number and the receiving status of the data packet, where the length of the original bitmap is LS, and LS is less than or equal to 511.
The original bitmap encoding unit 404 is configured to encode an original bitmap to generate a compressed bitmap, where the length of the compressed bitmap is LC; the compressed bitmap comprises a plurality of fixed-length code words, and each fixed-length code word represents the number of bits of the same and continuous binary number in the original bitmap;
the feedback information sending unit 405 is configured to send feedback information including a bitmap to the sending end 501; if the LS is less than or equal to the LC, selecting the original bitmap as a bitmap included in the feedback information, and if the LC is less than the LS, selecting the compressed bitmap as a bitmap included in the feedback information; the feedback information also comprises compressed mode description information which describes that the bitmap is an original bitmap or a compressed bitmap; if the bitmap is a compressed bitmap, the feedback information further includes a start state flag describing a reception state of a packet represented by a first segment of the same and consecutive binary numbers in the compressed bitmap.
Referring to fig. 4, the transmitting end 501 includes a feedback information receiving unit 504, a compressed bitmap decoding unit 503, and a packet transmitting unit 502, corresponding to the function of the receiving end 401. Wherein,
the feedback information receiving unit 504 is configured to receive the feedback information sent by the feedback information sending unit 405, where the feedback information further includes compression mode description information that describes that the bitmap is an original bitmap or a compressed bitmap.
The compressed bitmap decoding unit 503 is configured to decode the bitmap included in the feedback information according to the compression mode description information if the bitmap included in the feedback information is a compressed bitmap, and generate an original bitmap.
The data packet sending unit 502 is configured to resend the data packet lost by the receiving end 401 according to the receiving state of the data packet indicated by the original bitmap included in the feedback information or the original bitmap obtained after decoding.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.