WO2022021098A1 - Encoding and decoding method and apparatus - Google Patents

Encoding and decoding method and apparatus Download PDF

Info

Publication number
WO2022021098A1
WO2022021098A1 PCT/CN2020/105310 CN2020105310W WO2022021098A1 WO 2022021098 A1 WO2022021098 A1 WO 2022021098A1 CN 2020105310 W CN2020105310 W CN 2020105310W WO 2022021098 A1 WO2022021098 A1 WO 2022021098A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
inverse
packets
elements
encoding
Prior art date
Application number
PCT/CN2020/105310
Other languages
French (fr)
Chinese (zh)
Inventor
史强
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202080102961.7A priority Critical patent/CN115812305A/en
Priority to PCT/CN2020/105310 priority patent/WO2022021098A1/en
Publication of WO2022021098A1 publication Critical patent/WO2022021098A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0045Arrangements at the receiver end
    • H04L1/0052Realisations of complexity reduction techniques, e.g. pipelining or use of look-up tables
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
    • H03M13/37Decoding methods or techniques, not specific to the particular type of coding provided for in groups H03M13/03 - H03M13/35
    • H03M13/373Decoding methods or techniques, not specific to the particular type of coding provided for in groups H03M13/03 - H03M13/35 with erasure correction and erasure determination, e.g. for packet loss recovery or setting of erasures for the decoding of Reed-Solomon codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0041Arrangements at the transmitter end
    • H04L1/0043Realisations of complexity reduction techniques, e.g. use of look-up tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0057Block codes
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
    • H03M13/03Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words
    • H03M13/05Error detection or forward error correction by redundancy in data representation, i.e. code words containing more digits than the source words using block codes, i.e. a predetermined number of check bits joined to a predetermined number of information bits
    • H03M13/13Linear codes
    • H03M13/15Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes
    • H03M13/151Cyclic codes, i.e. cyclic shifts of codewords produce other codewords, e.g. codes defined by a generator polynomial, Bose-Chaudhuri-Hocquenghem [BCH] codes using error location or error correction polynomials
    • H03M13/154Error and erasure correction, e.g. by using the error and erasure locator or Forney polynomial

Definitions

  • the embodiments of the present application relate to the field of communications, and in particular, to an encoding and decoding method and apparatus.
  • the video conference system is a network-based multimedia communication system, which can support multi-person video conference, video communication, multi-person voice, screen sharing, dynamic manuscript speech, text exchange, text message, electronic whiteboard, multi-person desktop sharing, file transfer and other functions to provide convenient communication channels for enterprises.
  • network quality (such as network packet loss) is the main factor affecting the video conference experience.
  • network packet loss will directly lead to screen blur, freeze, freeze and other phenomena, seriously affecting user experience and conference quality.
  • Anti-packet loss optimization technology in the video transmission encoding and decoding process is a necessary measure for video conference systems.
  • the traditional forward error correction (FEC) technology only identifies and modifies the bits of data errors, and has limited recovery capability for sudden long-term continuous packet loss.
  • the new FEC technology provides an end-to-end chip solution for the whole packet loss recovery, specifically: the sender constructs an encoding matrix based on the original packet (the original data packet to be sent, also known as the original packet) according to the encoding and decoding algorithm Generate redundant packets, send both original packets and redundant packets; the receiving end decodes and recovers the lost original packets based on the codec algorithm according to the actual received data packets.
  • the new FEC technology has the following defects: the encoding matrix constructed by the current sender is complex, which increases the burden of the encoding and decoding scheme; the receiver can only select the decoding matrix after sorting the original packets and redundant packets out of sequence, and the resource overhead and The calculation delay is very large.
  • the embodiments of the present application provide an encoding and decoding method and apparatus, which can reduce resource overhead and calculation delay on the premise of effectively recovering lost packets of the entire packet.
  • a decoding method can be applied to a decoding device, and the method can include: acquiring a code stream, the code stream including X original packets and Q redundant packets; The number M, the number R of redundant packets and the packet length L, analyze the code stream to obtain X original packets and Q redundant packets, and determine the number N of lost original packets, where N equals M minus X; Q is less than or Equal to R; eliminate the P redundant packets in the Q redundant packets to obtain the elimination result; wherein, the P redundant packets are redundant packets that satisfy the conditions; P is the smaller value of N and Q; According to the packet receiving order and packet identification in the code stream, construct a standard Cauchy matrix with R rows and M columns; select the columns corresponding to the P lost original packets and the rows corresponding to the P redundant packets in the standard Cauchy matrix. The elements corresponding to the overlapping positions are obtained to obtain the P-order decoding matrix; the inverse matrix of the P-order decoding matrix is
  • the decoding end can directly determine the elements to construct the decoding matrix according to the receiving order of the data packets in the code stream and the packet identification. resource overhead and computational delay.
  • the P lost original packets are part or all of the N lost original packets.
  • the maximum error correction capability of the codec system is Q
  • P is equal to Q.
  • the P lost original packets are any P of the N lost original packets.
  • the above-mentioned elimination results include elimination results of P redundant packets.
  • the elimination result of a redundant packet includes the elimination result of the elements contained in the redundant packet, and the elimination result of an element is the part calculated by subtracting the element encoding from the P original packets to be restored.
  • the P original packets are part or all of the successfully received original packets in the code stream received by the decoding end.
  • the number M of original packets, the number R of redundant packets, and the packet length L are encoding parameters, and the encoding parameters can be configured in the encoding end device and/or the decoding end device according to actual requirements.
  • the encoding parameters may also be input by the user to the encoding end device and/or the decoding end device in the encoding and decoding system in real time.
  • the encoding parameters may also be input by the user into the encoding end device, and sent by the encoding end device to the decoding end device.
  • a standard Cauchy matrix with R rows and M columns is constructed according to the packet receiving order and packet identifiers in the code stream, which may specifically include:
  • the packet identifier indxf of the f-th received original packet in the received packet sequence of the received code stream determines the element in the fth row and the gth column of the standard Cauchy matrix Among them, X includes x i , Y includes y j , i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1, and less than or equal to M; x i and y j are independent elements; f is greater than or equal to is equal to 1 and less than or equal to R, and g is greater than or equal to 1 and less than or equal to M.
  • x i and y j in the standard Cauchy matrix elements of R row and M column are strongly related to the order of the original packet and the redundant packet during encoding, and the encoding sequence can be reflected by the packet identifier. Therefore, according to The packet identifier determines the value of the elements in the decoding matrix. According to the receiving order of the packets of the received code stream, the position of the elements in the decoding matrix can be determined. Therefore, the R used to select the decoding matrix can be determined without rearranging out of order.
  • a standard Cauchy matrix with rows and columns can greatly reduce resource overhead.
  • the above standard Cauchy matrix may be the Cauchy matrix of Galois Field.
  • the above-mentioned standard Cauchy matrix may be a Cauchy matrix in the Galois field
  • the decoding method provided by the present application may further include: performing an upper triangular matrix, a diagonal matrix and a lower triangular matrix on the P-order decoding matrix.
  • Triangular matrix (lower triangular matrix, diagonal matrix, upper triangular matrix, LDU) is decomposed to obtain upper triangular matrix, diagonal matrix and lower triangular matrix; respectively obtain the inverse matrix of the upper triangular matrix, the inverse matrix of the diagonal matrix and the lower triangular matrix
  • the inverse matrix of the product of the inverse matrix of the upper triangular matrix, the inverse matrix of the diagonal matrix and the inverse matrix of the lower triangular matrix is used as the inverse matrix of the P-order decoding matrix.
  • acquiring the inverse matrix of the lower triangular matrix may specifically include: determining the inverse element of each element in the lower triangular matrix, and calculating the inverse element of each element in the lower triangular matrix according to the element in the lower triangular matrix.
  • the positions in the triangular matrix are arranged to form the inverse of the lower triangular matrix.
  • the inverse element of the diagonal element in the lower triangular matrix and the first element below the diagonal element is itself; for the other elements in the lower triangular matrix except the diagonal element and the first element below the diagonal element
  • the inverse element is obtained according to the following formula:
  • L o,s -1 is the inverse element of the element L o,s in the o-th row and the s-th column in the lower triangular matrix
  • L o,s i is the diagonal element in the lower triangular matrix where L o,s is located.
  • the inverse element of i elements, L o,s i′ is the inverse element of the i-th element on the right side of L o,s in the lower triangular matrix
  • A is the distance between L o,s and the diagonal elements in the column direction or row direction. number of elements.
  • obtaining the inverse matrix of the upper triangular matrix may specifically include: determining the inverse element of each element in the upper triangular matrix; The positions in the triangular matrix are arranged to form the inverse of the upper triangular matrix.
  • L p,q -1 is the inverse element of the element L p,q in the p-th row and the q-th column in the upper triangular matrix
  • L p, q i is the upper triangular matrix where L p, q is located in the diagonal element of the column.
  • the inverse element of i elements, L p, q i' is the inverse element of the i-th element on the left side of L p, q in the upper triangular matrix
  • B is the distance between L p, q and the diagonal elements in the column direction or row direction. number of elements.
  • X and Y do not have an intersection.
  • X and Y are used as a set of elements to construct the above standard Cauchy matrix, and they are independent of each other and have no intersection, which improves the independence of each element in the above standard Cauchy matrix, and makes the encoding and decoding performance better.
  • Y is ⁇ 0, 1, ..., M-2, M-1 ⁇
  • X is ⁇ M, M+ 1, ..., M+R-2, M+R-1 ⁇ .
  • an encoding method is provided.
  • the method is applied to an encoding device.
  • the method may include: acquiring the number M of original packets, the number R of redundant packets, and the packet length L; acquiring M original packets;
  • the standard Cauchy matrix of columns, as an encoding matrix, the elements in the i-th row and the j-th column of the encoding matrix are x i and y j are independent elements, x i belongs to the set X including R elements, y j belongs to the set Y including M elements, i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1 , and less than or equal to M.
  • the above encoding matrix is a Galois Field Cauchy matrix, and x i +y j is less than 2 8 (that is, less than 256, or equivalently: less than or equal to 255). It has been verified that after decomposing the matrix LDU in the Galois field, inverting the matrix and then calculating the product, the results are consistent with the results of the mathematical inversion algorithm. By decomposing the LDU and then inverting, the complexity of the inversion process can be reduced to improve decoding. efficient.
  • X and Y do not intersect.
  • X and Y are used as a set of elements to construct the above standard Cauchy matrix, and they are independent of each other and have no intersection, which improves the independence of each element in the above standard Cauchy matrix, and makes the encoding and decoding performance better.
  • Y is ⁇ 0, 1, ..., M-2, M-1 ⁇
  • X is ⁇ M, M+1, ..., M+R-2, M+R -1 ⁇ .
  • a decoding apparatus may include: an acquisition unit, a determination unit, a cancellation unit, a construction unit, and a processing unit. in:
  • an acquisition unit configured to acquire a code stream, where the code stream includes X original packets and Q redundant packets.
  • the determining unit is used to analyze the code stream to obtain X original packets and Q redundant packets according to the original packet number M, the redundant packet number R and the packet length L during encoding of the code stream obtained by the acquisition unit, and determine The number N of lost original packets, N is equal to M minus the X; Q is less than or equal to R.
  • the elimination unit is used to eliminate the P redundant packets in the Q redundant packets to obtain the elimination result.
  • the P redundant packets are redundant packets satisfying the condition; P is the smaller value of N and Q.
  • the construction unit is used to construct a standard Cauchy matrix with R rows and M columns according to the packet receiving sequence and packet identifiers in the code stream.
  • the packet identifier is used to indicate the packet sequence when the data packet is encoded.
  • the selection unit is used to select the columns corresponding to the P lost original packets and the elements corresponding to the overlapping positions of the rows corresponding to the P redundant packets in the standard Cauchy matrix to obtain a P-order decoding matrix.
  • the processing unit is used for left-multiplying the original elimination result by the inverse matrix of the P-order decoding matrix to obtain P lost original packets.
  • the decoding apparatus provided in the third aspect is used to execute the decoding method provided in the first aspect or any possible implementation manner of the first aspect, and for the specific implementation, refer to the foregoing first aspect or the first aspect. any possible implementation.
  • an encoding apparatus may include: an acquisition unit, a construction unit, an encoding unit, and a sending unit. in:
  • the acquiring unit is used to acquire the number M of original packets, the number R of redundant packets and the packet length L; and acquire M original packets.
  • the element in the i-th row and the j-th column of the encoding matrix is x i and y j are independent elements, x i belongs to the set X including R elements, y j belongs to the set Y including M elements, i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1 , and less than or equal to M.
  • the coding unit is used to left-multiply the M original packets by the coding matrix to obtain R redundant packets.
  • the sending unit is used for sending M original packets and R redundant packets.
  • the encoding device provided in the fourth aspect is used to execute the encoding method provided by the second aspect or any possible implementation manner of the second aspect, and for specific implementation, refer to the second aspect or the second aspect. any possible implementation.
  • the present application provides a decoding apparatus, which can implement the functions in the method examples described in the first aspect above, and the functions can be implemented by hardware or by executing corresponding software in hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the decoding device may exist in the form of a chip product.
  • the decoding apparatus may include a processor and a transmission interface.
  • the transmission interface is used to receive and send data.
  • the processor is configured to invoke software instructions stored in the memory to cause the decoding apparatus to perform the functions in the method examples described in the first aspect above.
  • the present application provides an encoding device, which can implement the functions in the method examples described in the second aspect above, and the functions can be implemented by hardware or by executing corresponding software in hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the encoding device may exist in the form of a chip product.
  • the encoding apparatus may include a processor and a transmission interface.
  • the transmission interface is used to receive and send data.
  • the processor is configured to invoke software instructions stored in the memory to cause the encoding apparatus to perform the functions of the method examples described in the second aspect above.
  • a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer or a processor, the computer or the processor is made to execute the above-mentioned first aspect or second.
  • the decoding method or the encoding method provided by the aspect or any of its possible implementation manners.
  • a computer program product comprising instructions that, when executed on a computer or processor, cause the computer or processor to perform the above-mentioned first aspect or the second aspect or any possibility thereof.
  • a chip system in a ninth aspect, includes a processor, and may also include a memory, for implementing the corresponding functions in the above method.
  • the chip system can be composed of chips, and can also include chips and other discrete devices.
  • an encoding and decoding system includes the decoding device of the fifth aspect and the encoding device of the sixth aspect, respectively having the functions of the above aspects and any possible implementation manner.
  • FIG. 1 is a schematic structural diagram of a communication system according to an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a communication device according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of an encoding and decoding method provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a curve of performance data varying with the number R of redundant packets according to an embodiment of the present application
  • FIG. 5 is a schematic diagram of a curve of performance data varying with the number of original packets M provided by an embodiment of the present application
  • FIG. 6 is a schematic diagram of a curve of performance data varying with packet length L according to an embodiment of the present application
  • FIG. 7 is a schematic structural diagram of a decoding apparatus provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a decoding device provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an encoding device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an encoding device according to an embodiment of the present application.
  • words such as “exemplary” or “for example” are used to represent examples, illustrations or illustrations. Any embodiments or designs described in the embodiments of the present application as “exemplary” or “such as” should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplary” or “such as” is intended to present the related concepts in a specific manner to facilitate understanding.
  • At least one may also be described as one or more, and the multiple may be two, three, four or more, which is not limited in this application.
  • the original packet (also referred to as the original packet) refers to the data packet to be transmitted in the codec system.
  • the packet length L of the original packet is defined in the encoding parameter, and the data to be transmitted is constructed into multiple data packets of length L, which are the original packets.
  • a redundant packet refers to a reference data packet related to the original packet that is sent together with the original packet during encoding, and is used for reference decoding at the decoding end.
  • the redundant packet can be obtained by multiplying the original packet with the encoding matrix corresponding to the encoding and decoding algorithm.
  • the discarded original packet can be obtained by multiplying the redundant packet with the inverse matrix of the decoding matrix corresponding to the encoding and decoding algorithm.
  • the selected coding matrix is a non-standard matrix, which increases the burden of the coding and decoding scheme, and the decoding end can sort the original and redundant packets out of order according to the sending order. Selecting the decoding matrix and then decoding, the resource overhead and calculation delay are very large.
  • the embodiments of the present application provide an encoding and decoding method, which uses a standard Cauchy matrix as the encoding matrix to reduce the burden of encoding and decoding; since the encoding matrix is a standard Cauchy matrix, the decoding end can The receiving order determines the decoding matrix for decoding, which eliminates the need to sort out-of-order original packets and redundant packets, reduces resource overhead, improves computing effect, and thus reduces computing delay.
  • the encoding and decoding methods provided in the embodiments of the present application may be applied to the communication system shown in FIG. 1 .
  • the communication system may include an encoding end device 101 , a communication link 102 and a decoding end device 103 .
  • the encoding end device 101 is used to obtain and encode the code stream to be transmitted, obtain the encoded code stream (including original packets and redundant packets), and then send the encoded code stream to the decoding end device 103 through the communication link 102 . During the sending process, there may be packet loss and disorder. After receiving the code stream, the decoding end device 103 decodes and obtains the code stream.
  • the decoding end device 103 decodes and obtains the code stream.
  • the encoding end device 101 may be a switch connected to a video processing device (such as a conference terminal) at one end of the conference, and the decoding end device 103 may be a switch connected to the video processing device at the other end of the conference.
  • the road 102 may be a wide area network (WAN).
  • an embodiment of the present application provides a communication apparatus for executing the encoding method or the decoding method provided by the present application.
  • the communication apparatus may be deployed in the encoding end device 101 or the decoding end device 103 shown in FIG. 1 .
  • the communication device may be a functional module or chip in the encoding end device 101 or the decoding end device 103 .
  • FIG. 2 shows a communication device 20 related to various embodiments of the present application.
  • the communication apparatus 20 may include a processor 201 , a memory 202 and a transceiver 203 .
  • the memory 202 may be a volatile memory (volatile memory), such as random-access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (read-only memory).
  • volatile memory such as random-access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (read-only memory).
  • ROM read-only memory
  • flash memory flash memory
  • HDD hard disk drive
  • solid-state drive solid-state drive
  • the processor 201 is the control center of the communication device 20 .
  • the processor 201 may be a central processing unit (CPU), may also be a specific integrated circuit (application specific integrated circuit, ASIC), or be configured to implement one or more integrated circuits of the embodiments of the present application Circuits, such as: one or more microprocessors (digital singnal processor, DSP), or, one or more field programmable gate array (field programmable gate array, FPGA).
  • CPU central processing unit
  • ASIC application specific integrated circuit
  • DSP digital singnal processor
  • FPGA field programmable gate array
  • the transceiver 203 is used to communicate with other devices.
  • Transceiver 203 may be a communication port or otherwise.
  • the processor 201 executes the software program and/or module stored in the memory 202 by running or executing, and calling the data stored in the memory 302.
  • the code stream includes X original packets and Q redundant packets; according to the number of original packets M, the number of redundant packets R and the packet length L when the code stream is encoded, analyze the code stream to obtain X original packets and Q redundant packets, determine the number N of lost original packets, N is equal to M minus X; Q is less than or equal to R; the P redundant packets in the Q redundant packets are eliminated by eliminating the original packets.
  • the original result among them, the redundant packets that meet the conditions in the P redundant packets; P is the smaller value of Q and N; according to the packet receiving order and packet identification in the code stream, construct a standard Cauchy with R rows and M columns matrix; select the columns corresponding to the P lost original packets in the standard Cauchy matrix, and the elements corresponding to the overlapping positions of the rows corresponding to the P redundant packets participating in the elimination to obtain the P-order decoding matrix; leave the elimination result to the left Multiply the inverse matrix of the P-order decoding matrix to obtain P lost original packets.
  • the code stream to be sent includes M original packets, and the M original packets correspond to R redundant packets.
  • the processor 201 runs or executes the software programs and/or modules stored in the memory 202 and calls the data stored in the memory 302, Execute the following functions:
  • an embodiment of the present application provides an encoding and decoding method, wherein the encoding end device executes the encoding method, and the decoding end device executes the decoding method.
  • the encoding and decoding method provided by this application includes:
  • the encoding end device obtains the number M of original packets, the number R of redundant packets, and the packet length L.
  • the number M of original packets, the number R of redundant packets, and the packet length L are encoding parameters, and the encoding parameters can be configured in the encoding end device and/or the decoding end device according to actual requirements.
  • the coding parameters can also be input into the coding and decoding system by the user in real time.
  • the encoding parameters may also be input by the user into the encoding end device, and sent by the encoding end device to the decoding end device.
  • the encoding end device obtains M original packets.
  • the encoding end device divides the data to be transmitted according to the packet length L according to the number of original packets M in the encoding parameters, and the data to be transmitted of each L length is regarded as an original packet, and selects the constructed data packets from the data packets.
  • the M data packets are used as the original packets of this encoding operation, and the M original packets in S302 can be obtained.
  • M data packets may be selected according to a preset rule, and the selection process is not limited in this embodiment of the present application.
  • the preset rule may be to select the original package in chronological order, or the preset rule may be to select the original package according to the urgency of the business.
  • the preset rule can also be other, which can be configured according to actual needs, and is not limited.
  • the encoding end device may select M data packets and construct them in the form of encoding blocks.
  • the M original packets are respectively recorded as M 1 to M M , which can represent the following data matrix form, each row is an original packet, and its length is L, that is, L elements, and one element is data of a fixed size.
  • one element may be 8-bit (bit)-sized data.
  • Original package M M [M M1 M M2 M M3 ... M ML ].
  • the number of rows of the data matrix is the number of original packets M in the encoding parameter, also called the number of original packets.
  • the encoding length is based on the maximum length L of the original packet, and the tail of the original packet less than L can be filled with 0 (padding0).
  • the encoding end device constructs a standard Cauchy matrix with R rows and M columns as an encoding matrix.
  • a standard Cauchy matrix with R rows and M columns can be constructed according to M and R in the encoding parameters obtained in S301.
  • the standard Cauchy matrix with R rows and M columns constructed in S303 is used by the encoding device to encode the original packets to generate redundant packets.
  • a standard Cauchy matrix with m rows and n columns can be described as follows:
  • the x element (for example, x(i) in the above formula) and the y element (for example, y(i) in the above formula) in the standard Cauchy matrix are both elements in the mathematical domain to which they belong.
  • the standard Cauchy matrix has the following characteristics: any sub-square matrix of the standard Cauchy matrix is a singular matrix, and there is an inverse matrix.
  • the standard Cauchy matrix with R rows and M columns constructed in S303 may be the Cauchy matrix of the Galois field, and the elements in the matrix are taken from the Galois field, and the x elements (for example, the above The x(i) and y elements in the formula (eg y(i) in the above formula) are both elements in the Galois field GF( 2W ).
  • the inversion operation of the standard Cauchy matrix on the Galois field can be completed within the complexity of O(n 2 ).
  • the encoding end device can construct an encoding matrix with R rows and M columns according to the following steps 1 and 2:
  • Step 1 The encoding end device constructs an element set for constructing a standard Cauchy matrix (ie, an encoding matrix).
  • the element set constructed in step 1 includes a set X and a set Y, the set X includes the x element in the Cauchy matrix, and the set Y includes the y element in the Cauchy matrix.
  • the set X includes ⁇ x 1 , x 2 ,..., x R-1 , x R ⁇ , and the set Y includes ⁇ y 1 , y 2 ,..., y M-1 , y M ⁇ .
  • x i and y j are mutually independent elements, i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1, and less than or equal to M.
  • the elements in the set X and the set Y are all elements in the Galois field GF(2 8 ).
  • x i and y j are mutually independent elements on the Galois field, and x i +y j is less than 2 8 .
  • set X and the set Y may be configured according to actual requirements, which are not limited in this embodiment of the present application. Constraints of set X and set Y can also be configured according to actual requirements.
  • set X and set Y may have no intersection.
  • set Y may be ⁇ 0, 1, ..., M-2, M-1 ⁇
  • Step 2 According to the element set constructed in step 1, the encoding end device constructs a standard Cauchy matrix with R rows and M columns as an encoding matrix.
  • a standard Cauchy matrix (coding matrix) with R rows and M columns can be represented as the following matrix:
  • the elements of the i-th row and the j-th column in the encoding matrix are x i belongs to a set X of R elements, and y j belongs to a set Y of M elements.
  • the number of rows of the encoding matrix is the number R of redundant packets
  • the number of columns is the number M of the original packets
  • the column is in Byte
  • the length of the column is the number M of the original packets in the encoding parameters.
  • elements are selected from the finite element set constructed in step 1, which can reduce unreasonable value selection and redundant computing resource overhead, and can construct the coding matrix more accurately.
  • each value of M and R can be accurately represented in the circuit without additional logic overhead.
  • the encoding end device multiplies the M original packets by the encoding matrix to obtain R redundant packets.
  • the encoding end device multiplies the M original packets obtained in S302 with the encoding matrix constructed in S303 to obtain R redundant packets.
  • the right side of the equal sign in the above formula is the redundant packet matrix, which contains R redundant packets, each row is a redundant packet, the length of each redundant packet is L, and the R redundant packets are recorded as M respectively. ' 1 to MR' R .
  • redundant packet M' 1 [M' 11 M' 12 M' 13 ... M' 1L ];
  • Redundant packet M' 2 [M' 21 M' 22 M' 23 ... M' 2L ];
  • the generated redundant packet is the encoding result.
  • each element in the redundant packet contains the element information of the original packet and the encoding matrix, which is the basis for successfully decoding and recovering the lost original packet.
  • each element contains the element information of the original packet and the encoding matrix:
  • each element contains the element information of the original packet and the encoding matrix:
  • each element contains the element information of the original packet and the encoding matrix:
  • the encoding end device sends M original packets and R redundant packets.
  • the encoding end device uses the M original packets and the R redundant packets as transmission code streams, and sends them together to the communication link with the decoding end device.
  • a packet identification is marked in each packet to indicate the packet sequence during encoding of this data packet, so that the decoding end can identify the packet according to the packet identification. Determine the decoding matrix.
  • the packet identifier of the mth original packet may be m, and m is less than or equal to M; the packet identifier of the rth redundant packet may be r, and r is less than or equal to R.
  • the packet identifier may further include indication information for indicating whether the data packet is an original packet or a redundant packet.
  • the encoding end device may send the M original packets and the R redundant packets in sequence according to the numbering sequence of the M original packets and the R redundant packets.
  • the encoding end device may send the M original packets and the R redundant packets out of sequence.
  • the decoding end device After the encoding end device sends the M original packets and the R redundant packets in S305, due to the influence of the communication link, the transmission scene, or the transmission environment, there may be a situation that some of the M original packets are lost, and it is necessary to The decoding end decodes and recovers by using the method provided in this application.
  • the decoding end device obtains a code stream, where the code stream includes X original packets and Q redundant packets.
  • the code stream obtained by the decoding end device in S306 is the code stream received from the communication link, which may be referred to as a received code stream.
  • the received code stream is the transmitted code stream sent by the encoding end device in S305 after transmission. Due to the possibility of packet loss when the transmitted code stream is transmitted in the communication link, X is less than or equal to M, and Q is less than or equal to R.
  • the decoding end device analyzes the code stream to obtain X original packets and Q redundant packets according to the number M of original packets, the number R of redundant packets and the packet length L during encoding of the code stream, and determines the lost original packets the number N.
  • the number of original packets M, the number of redundant packets R and the packet length L in the code stream encoding are decoding parameters.
  • the decoding parameters can be configured on the decoding end device according to actual needs, and are consistent with the encoding parameters of the encoding end.
  • the decoding end device can directly obtain the original packet of the configured code stream during encoding.
  • the encoding end device through the interaction between the encoding end device and the decoding end device, the encoding end device sends its encoding parameters to the decoding end device as the decoding parameters of the decoding end device.
  • the decoding end device in S307 The device can receive the number M of original packets, the number R of redundant packets, and the packet length L when the code stream is encoded by the encoding end device.
  • N is equal to M minus X. N is greater than or equal to 0.
  • the decoding end device can parse the code stream (for example, the code stream can be identified as one data packet according to the size of the data packet), obtain X original packets and Q redundant packets contained in it, and subtract M from M. Go to X and get N. For example, the decoding end device can determine whether each data packet is an original packet or a redundant packet according to the mark of each data packet.
  • N is 3 in S307.
  • the decoding end device performs cancellation on P redundant packets in the Q redundant packets to obtain a cancellation result.
  • P is the fault tolerance capability of the decoding end device, that is, the number of lost original packets that can be recovered, and P is the smaller value of Q and N.
  • Q is less than N
  • the decoding end device supports recovering at most Q original packets among the N lost original packets.
  • the lost original packets to be recovered may be selected according to actual requirements, which is not limited in this embodiment of the present application.
  • the P elimination packets described in S308 are redundant packets satisfying the condition among the Q redundant packets. It should be noted that the conditions for selecting the P redundant packets may be configured according to actual requirements, which is not limited in this embodiment of the present application.
  • the first P redundant packets in the order of redundant packets among the Q redundant packets may be selected.
  • P redundant packets may be randomly selected from among the Q redundant packets.
  • the elimination result may include the elimination result of each redundant packet in the P redundant packets.
  • the elimination result of a redundant packet is the elimination result of the elements contained in the redundant packet.
  • the elimination result of an element is the part calculated from the P lost original packets (original packets to be restored) when the element is coded by subtracting the element. Since each element in the redundant packet carries the information of each original packet, the purpose of eliminating an element is to eliminate the information of the lost original packet carried by the element and retain the received X information of the original package, so as to achieve the purpose of recovering the lost original package with the received original package subsequently.
  • the P lost original packets are lost original packets to be recovered.
  • the P lost original packets may be selected from the N lost original packets according to actual requirements, which is not limited in this embodiment of the present application.
  • the elimination result of the elimination package M′ 6 includes M′′ 61 . in:
  • the elimination result of the elimination package M'9 includes M"91 ... M " 9L . in:
  • the decoding end device constructs a standard Cauchy matrix with R rows and M columns according to the packet receiving sequence and packet identifiers in the code stream.
  • the standard Cauchy matrix with R rows and M columns constructed in S309 is used to select the decoding matrix. It should be noted that the standard Cauchy matrix with R rows and M columns constructed in S309 is the same in form as the standard Cauchy matrix with R rows and M columns constructed by the coding end device in S303, and the content is constructed according to actual needs. limited.
  • the standard Cauchy matrix with R rows and M columns constructed in S309 may be a Galois Field Cauchy matrix with R rows and M columns.
  • the decoding end device constructs a standard Cauchy matrix with R rows and M columns according to the packet receiving sequence and the packet identifiers in the code stream.
  • row g column element Determining each element in the standard Cauchy matrix in this way can obtain a standard Cauchy matrix with R rows and M columns.
  • the set X and the set Y are the same as the set X and the set Y described in the foregoing S303, and are not repeated here.
  • f is greater than or equal to 1 and less than or equal to R
  • g is greater than or equal to 1 and less than or equal to M.
  • the packet identifier of the third received original packet in the received packet sequence of the received code stream is 5, and the packet identifier of the fourth received redundant packet in the received packet sequence of the received code stream is 2,
  • the packet identifier of the fourth received redundant packet in the received packet sequence of the received code stream is 2,
  • the decoding end device selects the elements corresponding to the columns corresponding to the P lost original packets and the overlapping positions of the rows corresponding to the P redundant packets in the standard Cauchy matrix with R rows and M columns, to obtain a P-order decoding matrix.
  • the P lost original packets described in S310 are lost original packets to be recovered.
  • the P lost original packets may be selected from the N lost original packets according to actual requirements, which is not limited in this embodiment of the present application.
  • the P redundant packets are redundant packets to be eliminated.
  • the decoding end device multiplies the original elimination result by left-multiplying the inverse matrix of the P-order decoding matrix to obtain P lost original packets.
  • the operation process of the lost original packets M 1 , M 7 , and M 8 in the encoding process may be:
  • the original packet can only be restored by obtaining the inverse matrix of the P-order decoding matrix.
  • the standard Cauchy matrix is selected as the encoding and decoding matrix, because the Keuchy matrix is selected as the encoding and decoding matrix.
  • the west matrix must have an inverse matrix, and the embodiments of the present application provide the following possible implementation manners.
  • a possible implementation manner is to obtain the inverse matrix of the P-order decoding matrix according to the inversion method of the mathematical operation for the P-order decoding matrix, and this process is not repeated in this embodiment of the present application.
  • the P-order decoding matrix can be decomposed into LDU, and decomposed into upper and lower triangular matrices and a diagonal matrix, and after finding the inverse matrices of L, D, and U respectively , the inverse matrix product of L, D, and U is used as the inverse matrix of P-order decoding.
  • the software and hardware codes of the LDU decomposition part can refer to Stanford University. Professor Thomas' "Pivoting and Backward Stability of Fast Algorithms for Solving Cauchy Linear Equations", the algorithm idea of LDU decomposition is to use the displacement structure of the matrix to specify the appropriate A displacement operator is used to speed up the Gaussian elimination process, which is not repeated in this embodiment of the present application.
  • other algorithms may also be referred to for LDU decomposition, which is not limited in this embodiment of the present application.
  • the process of finding the inverse matrices of L, D, and U may refer to the inversion method of mathematical operations, which is not limited in the embodiment of the present application.
  • an embodiment of the present application provides a method for obtaining an inverse matrix of a lower triangular matrix from the Galois field, which may specifically include: determining the inverse element of each element in the lower triangular matrix; The inverse elements of each element are arranged according to the positions of the elements in the lower triangular matrix to form the inverse matrix of the lower triangular matrix.
  • the diagonal element in the lower triangular matrix and the inverse element of the first element below the diagonal element are itself; the elements other than the diagonal element and the first element below the diagonal element in the lower triangular matrix are The inverse element is obtained according to the following formula:
  • L o,s -1 is the inverse element of the element L o,s in the o-th row and the s-th column in the lower triangular matrix
  • L o,s i is the diagonal element of the column where L o,s is located in the lower triangular matrix
  • the inverse element of the i-th element below, L o,s i′ is the inverse element of the i-th element on the right side of L o,s in the lower triangular matrix
  • A is L o,s in the column direction or row direction and the diagonal element The number of elements in the interval.
  • the inversion process of the lower triangular matrix is expressed by code, the elements on the rows and columns of the corresponding matrix are parsed from right to left, and the matrix is denoted as L, and the rows and columns are denoted as i and j respectively, and the diagonal
  • L the matrix
  • i and j the rows and columns
  • the diagonal The element and the first element below it remain unchanged. From the second element below the diagonal element, the multiplication and accumulation are performed in turn, and the following expression is derived:
  • the pseudocode expression of the lower triangular matrix inversion process can be:
  • the inverse matrix of the lower triangular matrix is a matrix formed by the inverse elements of the elements in the lower triangular matrix: the inverse element of the diagonal element 1 of the lower triangular matrix is itself, which remains unchanged, and the first element g below the diagonal element The inverse elements of , a, d, and f are also themselves and remain unchanged.
  • the inverse elements of the elements in the lower triangular matrix except the diagonal element and the first element below the diagonal element are as follows:
  • the inverse element of the element is a
  • the inverse element of the first element d on the right side of L 4,2 is d
  • the inverse element of the element is d
  • the inverse element of the element is g
  • the inverse element of the first element b to the right of L 4,1 is S
  • the inverse element of the second element below the diagonal element of the column where L 4,1 is located is H
  • the inverse element of the element is a
  • the inverse element of the first element e on the right side of L 5,2 is K
  • the inverse element of the second element below the diagonal element of the column where L 5,2 is located is S
  • the inverse element of the element is g
  • the inverse element of the first element c to the right of L 5,1 is Y
  • the inverse element of the second element below the diagonal element of the column where L 5,1 is located H
  • the inverse element of the second element e on the right side of 1 is K
  • the inverse element of the third element below the diagonal element of the column where L 5,1 is located is Z
  • an embodiment of the present application provides a method for obtaining an inverse matrix of an upper triangular matrix from the Galois field, which may specifically include: determining the inverse element of each element in the upper triangular matrix; The inverse elements of each element are arranged according to the positions of the elements in the upper triangular matrix to form the inverse matrix of the upper triangular matrix.
  • the inverse element of the diagonal element in the upper triangular matrix and the first element above the diagonal element is itself; the inverse of other elements except the diagonal element and the first element above the diagonal element in the upper triangular matrix
  • the elements are obtained according to the following formula:
  • L p,q -1 is the inverse element of the element L p,q in the p-th row and the q-th column in the upper triangular matrix
  • L p,q i is the diagonal element of the column where L p,q is located in the upper triangular matrix
  • the inverse element of the i-th element above, L p, q i' is the inverse element of the i-th element on the left side of L p, q in the upper triangular matrix
  • B is L p, q in the column direction or row direction and the diagonal element The number of elements in the interval.
  • the inversion process of the upper triangular matrix is expressed by code, and the elements on the rows and columns of the corresponding matrix are parsed from right to left once, and the matrix is denoted as L, and the rows and columns are denoted as i and j respectively, and the diagonal The element and the first element above it remain unchanged. From the second element above the diagonal element, the multiplication and accumulation are performed in turn.
  • the pseudocode expression of the inversion process of the upper triangular matrix can be as follows:
  • the inverse matrix of the upper triangular matrix is a matrix formed by the inverse elements of the elements in the upper triangular matrix: the inverse element of the diagonal element 1 of the upper triangular matrix is itself, which remains unchanged, and the first element g above the diagonal element The inverse elements of , a, d, and f are also themselves and remain unchanged.
  • the inverse elements of the elements in the upper triangular matrix except the diagonal elements and the first element above the diagonal elements are as follows:
  • the inverse element of the element is d
  • the inverse element of the element is g
  • the inverse element of the first element b to the left of L 2,5 is S
  • the inverse element of the second element above the diagonal element of the column where L 2, 5 is located H, L 2
  • the inverse element of the element is a
  • the inverse element of the first element e to the left of L 1,4 is K
  • the inverse element of the second element above the diagonal element of the column where L 1,4 is located is S
  • L 1 The inverse element of the second element f to the left of 4
  • the inverse element of the element is g
  • the inverse element of the first element c to the left of L 1,5 is Y
  • the inverse element of the second element above the diagonal element of the column where L 1,5 is located H
  • the inverse element of the 2nd element e to the left of 5 is K
  • the inverse element of the 3rd element above the diagonal element of the column where L 1,5 is located is Z
  • the decoding matrix is a standard Cauchy matrix
  • the construction is simple and the burden of encoding and decoding is reduced.
  • the decoding end can directly determine the elements to construct the decoding matrix according to the receiving order of the data packets in the code stream and the packet identification. resource overhead and computational delay.
  • the performance of the FEC hardware accelerator using the solution of the present application is tested in three dimensions through experiments.
  • the three parameters M, R, and L carried in the encoding parameters represent the number of original packets, and the redundancy
  • the number of packets, the length of the code, and the double data rate (DDR) delay of the code is 200 nanoseconds (nano second, ns), and there is a 3% bus delay of 1000ns.
  • Figures 4 to 6 are respectively the performance diagrams of fixing two of the parameters and changing the other parameter.
  • FEC fixes the original number of packets M, the packet length L, and changes the number of redundant packets R.
  • the curve of performance data changing with the number of redundant packets R is shown in Figure 4.
  • FEC fixes the number of redundant packets R, the packet length L, changes the original number of packets M, and the curve of the performance data changing with the original number of packets M is shown in Figure 5.
  • FEC fixes the number of original packets M, the number of redundant packets R, and changes the packet length L.
  • the curve of the performance data changing with the packet length L is shown in Figure 6.
  • the above-mentioned encoding device and decoding device include corresponding hardware structures and/or software modules for executing each function.
  • the unit in the encoding device for performing the functions in the above method embodiments is referred to as an encoding device
  • the unit in the decoding device for performing the functions in the above method embodiments is referred to as a decoding device.
  • the present application can be implemented in hardware or a combination of hardware and computer software with the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
  • each functional module may be divided according to each function, or two or more functions may be integrated in in a processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • FIG. 7 shows a possible schematic structural diagram of a decoding apparatus 70 deployed in the decoding device involved in the above embodiment and executing the decoding method provided by the present application.
  • the decoding device 70 may be a functional module or a chip.
  • the decoding apparatus 70 may include: an acquisition unit 701 , a determination unit 702 , a cancellation unit 703 , a construction unit 704 , a selection unit 705 , and a processing unit 706 .
  • the obtaining unit 701 is used for executing the process S306 in FIG. 3;
  • the determining unit 702 is used for executing the process S307 in FIG.
  • the eliminating unit 703 is used for executing the process S308 in FIG. 3; the constructing unit 704 is used for executing the process S308 in FIG. 3
  • the selection unit 705 is used for executing the process S310 in FIG. 3 ; the processing unit 706 is used for executing the process S311 in FIG. 3 .
  • FIG. 8 shows a possible schematic structural diagram of the decoding device involved in the above embodiment.
  • the decoding device 80 may include: a processing module 801 and a communication module 802 .
  • the processing module 801 is used to control and manage the actions of the decoding device 80, and the communication module 802 is used to communicate with other devices.
  • the processing module 801 is configured to execute any one of the processes S306 to S311 in FIG. 3 .
  • the decoding device 80 may further include a storage module 803 for storing program codes and data of the decoding device 80 .
  • the processing module 801 may be the processor 201 in the physical structure of the communication apparatus 20 shown in FIG. 2 , and may be a processor or a controller. For example, it may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure.
  • the processing module 801 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
  • the communication module 802 may be the transceiver 203 in the physical structure of the communication apparatus 20 shown in FIG.
  • the communication module 802 may be a communication port, or may be a transceiver, a transceiver circuit, or a communication interface.
  • the above-mentioned communication interface may implement communication with other devices through the above-mentioned components with a transceiving function.
  • the above-mentioned components with transceiving functions may be implemented by antennas and/or radio frequency devices.
  • the storage module 803 may be the memory 202 in the physical structure of the communication device 20 shown in FIG. 2 .
  • the processing module 801 is a processor
  • the communication module 802 is a transceiver
  • the storage module 803 is a memory
  • the decoding device 80 involved in FIG. 8 in the embodiment of the present application may be the communication device 20 shown in FIG. 2 .
  • the decoding apparatus 70 or the decoding device 80 provided by the embodiments of the present application may be used to implement the corresponding functions in the methods implemented by the above embodiments of the present application.
  • the decoding apparatus 70 or the decoding device 80 provided by the embodiments of the present application may be used to implement the corresponding functions in the methods implemented by the above embodiments of the present application.
  • the parts related to the embodiments of the present application are shown. , if the specific technical details are not disclosed, please refer to the embodiments of the present application.
  • FIG. 9 shows a possible schematic structural diagram of the encoding apparatus 90 deployed in the encoding device involved in the above embodiment and executing the encoding method provided by the present application.
  • the encoding device 90 may be a functional module or a chip.
  • the encoding apparatus 90 may include: an obtaining unit 901 , a constructing unit 902 , an encoding unit 903 , and a sending unit 904 .
  • the obtaining unit 901 is used for executing the process S301 or S302 in FIG. 3;
  • the constructing unit 902 is used for executing the process S303 in FIG. 3;
  • the encoding unit 903 is used for executing the process S304 in FIG. Process S305 in 3.
  • all relevant contents of the steps involved in the above method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.
  • FIG. 10 shows a possible schematic structural diagram of the encoding device involved in the above embodiment.
  • the encoding device 100 may include: a processing module 1001 and a communication module 1002 .
  • the processing module 1001 is used to control and manage the actions of the encoding device 100, and the communication module 1002 is used to communicate with other devices.
  • the processing module 1001 is configured to execute any one of the processes S301 to S304 in FIG. 3 , and the processing module 1001 executes the process S305 in FIG. 3 through the communication module 1002 .
  • the encoding device 100 may further include a storage module 1003 for storing program codes and data of the encoding device 100 .
  • the processing module 1001 may be the processor 201 in the physical structure of the communication apparatus 20 shown in FIG. 2 , and may be a processor or a controller. For example, it may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure.
  • the processing module 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
  • the communication module 1002 may be the transceiver 203 in the physical structure of the communication apparatus 20 shown in FIG.
  • the communication module 1002 may be a communication port, or may be a transceiver, a transceiver circuit, or a communication interface.
  • the above-mentioned communication interface may implement communication with other devices through the above-mentioned components with a transceiving function.
  • the above-mentioned components with transceiving functions may be implemented by antennas and/or radio frequency devices.
  • the storage module 1003 may be the memory 202 in the physical structure of the communication device 20 shown in FIG. 2 .
  • the processing module 1001 is a processor
  • the communication module 1002 is a transceiver
  • the storage module 1003 is a memory
  • the encoding device 100 involved in FIG. 10 in the embodiment of the present application may be the communication apparatus 20 shown in FIG. 2 .
  • the encoding apparatus 90 or the encoding device 100 provided by the embodiments of the present application may be used to implement the corresponding functions in the methods implemented by the above embodiments of the present application.
  • the encoding apparatus 90 or the encoding device 100 provided by the embodiments of the present application may be used to implement the corresponding functions in the methods implemented by the above embodiments of the present application.
  • the parts related to the embodiments of the present application are shown. , if the specific technical details are not disclosed, please refer to the embodiments of the present application.
  • a computer-readable storage medium on which instructions are stored, and when the instructions are executed, the encoding and decoding methods in the foregoing method embodiments are executed.
  • a computer program product containing instructions is provided, when the computer program product runs on a computer, the computer executes the encoding and decoding methods in the above method embodiments when executed.
  • An embodiment of the present application further provides a chip system, where the chip system includes a processor for implementing the technical method of the embodiment of the present invention.
  • the chip system further includes a memory for storing necessary program instructions and/or data in the embodiments of the present invention.
  • the system-on-a-chip also includes memory for the processor to invoke the application code stored in the memory.
  • the chip system may be composed of one or more chips, and may also include chips and other discrete devices, which are not specifically limited in this embodiment of the present application.
  • the steps of the methods or algorithms described in conjunction with the disclosure of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in RAM, flash memory, ROM, erasable programmable read-only memory (erasable programmable read-only memory, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disk, removable hard disk, compact disk read only (CD-ROM), or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor, such that the processor can read information from, and write information to, the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage medium may reside in an ASIC.
  • the ASIC may be located in the core network interface device.
  • the processor and the storage medium may also exist in the core network interface device as discrete components.
  • the memory may be coupled to the processor, eg, the memory may exist independently and be connected to the processor through a bus.
  • the memory can also be integrated with the processor.
  • the memory may be used to store application code for executing the technical solutions provided by the embodiments of the present application, and the execution is controlled by the processor.
  • the processor is configured to execute the application program code stored in the memory, thereby implementing the technical solutions provided by the embodiments of the present application.
  • the steps of the methods or algorithms described in conjunction with the disclosure of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in RAM, flash memory, ROM, erasable programmable read-only memory (erasable programmable read-only memory, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disk, removable hard disk, compact disk read only (CD-ROM), or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor, such that the processor can read information from, and write information to, the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage medium may reside in an ASIC.
  • the ASIC may be located in the core network interface device.
  • the processor and the storage medium may also exist in the core network interface device as discrete components.
  • the memory may be coupled to the processor, eg, the memory may exist independently and be connected to the processor through a bus.
  • the memory can also be integrated with the processor.
  • the memory may be used to store application code for executing the technical solutions provided by the embodiments of the present application, and the execution is controlled by the processor.
  • the processor is configured to execute the application program code stored in the memory, thereby implementing the technical solutions provided by the embodiments of the present application.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.

Abstract

Embodiments of the present application disclose an encoding and decoding method and apparatus, relating to the field of communications. The present invention is capable of effectively recovering entire lost packets, while also reducing resource consumption and calculation delay. The specific solution comprises: obtaining a code stream; according to a number M of original packets, a number R of redundant packets R, and a packet length L during encoding of the code stream, determining a number N of lost original packets; eliminating P redundant packets to obtain an elimination result; according to the packet reception order and the packet identification of the code stream, constructing a standard Cauchy matrix having R rows and M columns; selecting, from the standard Cauchy matrix, corresponding elements at overlapping positions of corresponding columns of P lost original packets and corresponding rows of P redundant packets to obtain a P-order decoding matrix; left multiplying the inverse matrix of the P-order decoding matrix by the elimination result to obtain the P lost original packets.

Description

一种编解码方法及装置A method and device for encoding and decoding 技术领域technical field
本申请实施例涉及通信领域,尤其涉及一种编解码方法及装置。The embodiments of the present application relate to the field of communications, and in particular, to an encoding and decoding method and apparatus.
背景技术Background technique
随着通信技术的快速发展,视频会议系统已经广泛应用。视频会议系统是一款基于网络的多媒体通信系统,可以支持多人视频会议、视频通讯、多人语音、屏幕共享、动态文稿演讲、文字交流、短信留言、电子白板、多人桌面共享、文件传输等功能,为企业提供便捷的沟通渠道。With the rapid development of communication technology, video conference systems have been widely used. The video conference system is a network-based multimedia communication system, which can support multi-person video conference, video communication, multi-person voice, screen sharing, dynamic manuscript speech, text exchange, text message, electronic whiteboard, multi-person desktop sharing, file transfer and other functions to provide convenient communication channels for enterprises.
在实际应用中,网络质量(例如网络丢包)是影响视频会议体验的主要因素。例如,网络丢包会直接导致画面花屏、凝固、卡顿等现象,严重影响用户体验与会议质量,视频传输的编解码过程中的抗丢包优化技术是视频会议系统的一项必要措施。In practical applications, network quality (such as network packet loss) is the main factor affecting the video conference experience. For example, network packet loss will directly lead to screen blur, freeze, freeze and other phenomena, seriously affecting user experience and conference quality. Anti-packet loss optimization technology in the video transmission encoding and decoding process is a necessary measure for video conference systems.
传统的前向纠错(forward error correction,FEC)技术只对于数据出错的比特位进行识别和修改,对于突发性的长时间连续丢包恢复能力很有限。新型的FEC技术为整包的丢包恢复提供端到端的芯片解决方案,具体为:发送端基于原始包(原始待发送的数据包,也可以称为原包),按照编解码算法构造编码矩阵生成冗余包,将原始包和冗余包都发送;接收端根据实际收到的数据包,基于该编解码算法解码恢复出丢失的原包。The traditional forward error correction (FEC) technology only identifies and modifies the bits of data errors, and has limited recovery capability for sudden long-term continuous packet loss. The new FEC technology provides an end-to-end chip solution for the whole packet loss recovery, specifically: the sender constructs an encoding matrix based on the original packet (the original data packet to be sent, also known as the original packet) according to the encoding and decoding algorithm Generate redundant packets, send both original packets and redundant packets; the receiving end decodes and recovers the lost original packets based on the codec algorithm according to the actual received data packets.
但是,新型的FEC技术存在如下缺陷:当前发送端构造的编码矩阵复杂,增加了编、解码方案的负担;接收端对乱序的原始包及冗余包排序后才能选取解码矩阵,资源开销和计算延时非常大。However, the new FEC technology has the following defects: the encoding matrix constructed by the current sender is complex, which increases the burden of the encoding and decoding scheme; the receiver can only select the decoding matrix after sorting the original packets and redundant packets out of sequence, and the resource overhead and The calculation delay is very large.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种编解码方法及装置,在有效恢复整包丢包的前提下,降低资源开销及计算延时。The embodiments of the present application provide an encoding and decoding method and apparatus, which can reduce resource overhead and calculation delay on the premise of effectively recovering lost packets of the entire packet.
为达到上述目的,本申请实施例采用如下技术方案:In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
第一方面,提供一种解码方法,该方法可以应用于解码设备,该方法可以包括:获取码流,该码流包括X个原包及Q个冗余包;根据码流编码时的原包个数M、冗余包个数R及包长L,对码流解析获取X个原包及Q个冗余包,确定丢失的原包的个数N,N等于M减X;Q小于或等于R;对Q个冗余包中的P个冗余包进行消原得到消原结果;其中,P个冗余包为满足条件的冗余包;P为N与Q中的较小值;根据码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵;选取该标准柯西矩阵中,P个丢失的原包对应的列,P个冗余包对应的行的交叠位置对应的元素,得到P阶解码矩阵;将消原结果左乘P阶解码矩阵的逆矩阵,得到P个丢失的原包。In a first aspect, a decoding method is provided, the method can be applied to a decoding device, and the method can include: acquiring a code stream, the code stream including X original packets and Q redundant packets; The number M, the number R of redundant packets and the packet length L, analyze the code stream to obtain X original packets and Q redundant packets, and determine the number N of lost original packets, where N equals M minus X; Q is less than or Equal to R; eliminate the P redundant packets in the Q redundant packets to obtain the elimination result; wherein, the P redundant packets are redundant packets that satisfy the conditions; P is the smaller value of N and Q; According to the packet receiving order and packet identification in the code stream, construct a standard Cauchy matrix with R rows and M columns; select the columns corresponding to the P lost original packets and the rows corresponding to the P redundant packets in the standard Cauchy matrix. The elements corresponding to the overlapping positions are obtained to obtain the P-order decoding matrix; the inverse matrix of the P-order decoding matrix is left multiplied by the original elimination result to obtain P lost original packets.
通过本申请实施例提供的解码步骤,由于解码矩阵为标准柯西矩阵,构建简单,降低了编解码的负担。另外,由于解码矩阵为标准柯西矩阵,解码端可以按照码流中数据包的接收顺序及包标识可以直接确定元素构建解码矩阵,即使原包及冗余包乱序也无需重新排序,大大降低了资源开销及计算时延。Through the decoding steps provided by the embodiments of the present application, since the decoding matrix is a standard Cauchy matrix, the construction is simple, and the burden of encoding and decoding is reduced. In addition, since the decoding matrix is a standard Cauchy matrix, the decoding end can directly determine the elements to construct the decoding matrix according to the receiving order of the data packets in the code stream and the packet identification. resource overhead and computational delay.
其中,P个丢失的原包为N个丢失的原包中的部分或全部。当Q小于N时,则编解码系统的纠错能力最大为Q,则P等于Q,此时,P个丢失的原包为N个丢失的原包中任意P个。Wherein, the P lost original packets are part or all of the N lost original packets. When Q is less than N, the maximum error correction capability of the codec system is Q, and P is equal to Q. At this time, the P lost original packets are any P of the N lost original packets.
在一种可能的实现方式中,上述消原结果包括P个冗余包的消原结果。一个冗余包的消原结果包括该冗余包包含的元素的消原结果,一个元素的消原结果为该元素减去该元素编码时由待恢复的P个原包计算得到的部分。其中,P个原包为解码端接收到的码流中接收成功的原包中的部分或全部。In a possible implementation manner, the above-mentioned elimination results include elimination results of P redundant packets. The elimination result of a redundant packet includes the elimination result of the elements contained in the redundant packet, and the elimination result of an element is the part calculated by subtracting the element encoding from the P original packets to be restored. Wherein, the P original packets are part or all of the successfully received original packets in the code stream received by the decoding end.
在另一种可能的实现方式中,原包个数M、冗余包个数R及包长L为编码参数,编码参数可以根据实际需求配置于编码端设备和/或解码端设备中。或者,编码参数也可以由用户实时输入编解码系统中的编码端设备和/或解码端设备。或者,编码参数也可以由用户输入编码端设备中,由编码端设备发送至解码端设备。In another possible implementation manner, the number M of original packets, the number R of redundant packets, and the packet length L are encoding parameters, and the encoding parameters can be configured in the encoding end device and/or the decoding end device according to actual requirements. Alternatively, the encoding parameters may also be input by the user to the encoding end device and/or the decoding end device in the encoding and decoding system in real time. Alternatively, the encoding parameters may also be input by the user into the encoding end device, and sent by the encoding end device to the decoding end device.
在另一种可能的实现方式中,根据码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵,具体可以包括:In another possible implementation manner, a standard Cauchy matrix with R rows and M columns is constructed according to the packet receiving order and packet identifiers in the code stream, which may specifically include:
根据接收的码流的接收包顺序中第f个接收的原包的包标识indxf、接收的码流的接收包顺序中第g个接收的冗余包的包标识indxg,以及标准柯西矩阵元素集合X及Y,确定该标准柯西矩阵中第f行第g列元素
Figure PCTCN2020105310-appb-000001
其中,X包括x i,Y包括y j,i大于或等于1,且小于或等于R,j大于或等于1,且小于或等于M;x i与y j为相互独立的元素;f大于或等于1,且小于或等于R,g大于或等于1,且小于或等于M。
According to the packet identifier indxf of the f-th received original packet in the received packet sequence of the received code stream, the packet identifier indxg of the g-th received redundant packet in the received packet sequence of the received code stream, and the standard Cauchy matrix elements Set X and Y, determine the element in the fth row and the gth column of the standard Cauchy matrix
Figure PCTCN2020105310-appb-000001
Among them, X includes x i , Y includes y j , i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1, and less than or equal to M; x i and y j are independent elements; f is greater than or equal to is equal to 1 and less than or equal to R, and g is greater than or equal to 1 and less than or equal to M.
其中,该R行M列的标准柯西矩阵元素中的x i、y j与原包、冗余包在编码时的顺序强相关,该编码时的顺序可以由包标识体现,因此,可以根据包标识确定解码矩阵中元素的取值,根据接收的码流的包的接收顺序,可以确定解码矩阵中元素的位置,因此,无需对乱序重排即可确定出用于选取解码矩阵的R行M列的标准柯西矩阵,可以大大降低资源开销。 Among them, x i and y j in the standard Cauchy matrix elements of R row and M column are strongly related to the order of the original packet and the redundant packet during encoding, and the encoding sequence can be reflected by the packet identifier. Therefore, according to The packet identifier determines the value of the elements in the decoding matrix. According to the receiving order of the packets of the received code stream, the position of the elements in the decoding matrix can be determined. Therefore, the R used to select the decoding matrix can be determined without rearranging out of order. A standard Cauchy matrix with rows and columns can greatly reduce resource overhead.
在一种可能的实现方式中,上述标准柯西矩阵可以为伽罗华域的柯西矩阵。In a possible implementation manner, the above standard Cauchy matrix may be the Cauchy matrix of Galois Field.
在一种可能的实现方式中,上述标准柯西矩阵可以为伽罗华域的柯西矩阵,本申请提供的解码方法还可以包括:对P阶解码矩阵进行上三角矩阵、对角矩阵及下三角矩阵(lower triangular matrix,diagonal matrix,upper triangular matrix,LDU)分解,得到上三角矩阵、对角矩阵及下三角矩阵;分别获取上三角矩阵的逆矩阵、对角矩阵的逆矩阵及下三角矩阵的逆矩阵,将上三角矩阵的逆矩阵、对角矩阵的逆矩阵及下三角矩阵的逆矩阵的乘积作为P阶解码矩阵的逆矩阵。In a possible implementation manner, the above-mentioned standard Cauchy matrix may be a Cauchy matrix in the Galois field, and the decoding method provided by the present application may further include: performing an upper triangular matrix, a diagonal matrix and a lower triangular matrix on the P-order decoding matrix. Triangular matrix (lower triangular matrix, diagonal matrix, upper triangular matrix, LDU) is decomposed to obtain upper triangular matrix, diagonal matrix and lower triangular matrix; respectively obtain the inverse matrix of the upper triangular matrix, the inverse matrix of the diagonal matrix and the lower triangular matrix The inverse matrix of , the product of the inverse matrix of the upper triangular matrix, the inverse matrix of the diagonal matrix and the inverse matrix of the lower triangular matrix is used as the inverse matrix of the P-order decoding matrix.
经验证,在伽罗华域对矩阵LDU分解后分别求逆再求乘积,结果与数学求逆算法的结果一致,而通过LDU分解后求逆,可以降低求逆过程的复杂度,提高解码效率。It has been verified that after decomposing the matrix LDU in the Galois field, inverting the matrix and then calculating the product, the results are consistent with the results of the mathematical inversion algorithm. By decomposing and inverting the LDU, the complexity of the inversion process can be reduced and the decoding efficiency can be improved. .
在一种可能的实现方式中,获取下三角矩阵的逆矩阵,具体可以包括:确定下三角矩阵中每个元素的逆元素,将下三角矩阵中每个元素的逆元素,按照元素在该下三角矩阵中的位置排列,构成下三角矩阵的逆矩阵。其中,下三角矩阵中的对角元素及对角元素下方的首个元素的逆元素为其自身;对下三角矩阵中除对角元素及对角元素下方的首个元素之外的其他元素的逆元素按照如下公式得到:
Figure PCTCN2020105310-appb-000002
In a possible implementation manner, acquiring the inverse matrix of the lower triangular matrix may specifically include: determining the inverse element of each element in the lower triangular matrix, and calculating the inverse element of each element in the lower triangular matrix according to the element in the lower triangular matrix. The positions in the triangular matrix are arranged to form the inverse of the lower triangular matrix. Among them, the inverse element of the diagonal element in the lower triangular matrix and the first element below the diagonal element is itself; for the other elements in the lower triangular matrix except the diagonal element and the first element below the diagonal element The inverse element is obtained according to the following formula:
Figure PCTCN2020105310-appb-000002
其中,L o,s -1为下三角矩阵中第o行第s列元素L o,s的逆元素;L o,s i为下三角矩阵中L o,s所在列的对角元素下方第i个元素的逆元素,L o,s i′为下三角矩阵中L o,s右侧第i个元素的逆元素;A为L o,s在列方向或者行方向与对角元素间隔的元素个数。 Among them, L o,s -1 is the inverse element of the element L o,s in the o-th row and the s-th column in the lower triangular matrix; L o,s i is the diagonal element in the lower triangular matrix where L o,s is located. The inverse element of i elements, L o,s i′ is the inverse element of the i-th element on the right side of L o,s in the lower triangular matrix; A is the distance between L o,s and the diagonal elements in the column direction or row direction. number of elements.
在一种可能的实现方式中,获取上三角矩阵的逆矩阵,具体可以包括:确定上三角矩阵中每个元素的逆元素;将上三角矩阵中每个元素的逆元素,按照元素在该上三角矩阵中的位置排列,构成该上三角矩阵的逆矩阵。其中,上三角矩阵中的对角元素及对角元素上方的首个元素的逆元素为其自身;上三角矩阵中除对角元素及对角元素上方的首个元素之外的其他元素的逆元素按照如下公式得到:
Figure PCTCN2020105310-appb-000003
In a possible implementation manner, obtaining the inverse matrix of the upper triangular matrix may specifically include: determining the inverse element of each element in the upper triangular matrix; The positions in the triangular matrix are arranged to form the inverse of the upper triangular matrix. Among them, the inverse element of the diagonal element in the upper triangular matrix and the first element above the diagonal element is itself; the inverse of other elements except the diagonal element and the first element above the diagonal element in the upper triangular matrix The elements are obtained according to the following formula:
Figure PCTCN2020105310-appb-000003
其中,L p,q -1为上三角矩阵中第p行第q列元素L p,q的逆元素;L p,q i为上三角矩阵中L p,q所在列的对角元素上方第i个元素的逆元素,L p,q i′为上三角矩阵中L p,q左侧第i个元素的逆元素;B为L p,q在列方向或者行方向与对角元素间隔的元素个数。 Among them, L p,q -1 is the inverse element of the element L p,q in the p-th row and the q-th column in the upper triangular matrix; L p, q i is the upper triangular matrix where L p, q is located in the diagonal element of the column. The inverse element of i elements, L p, q i' is the inverse element of the i-th element on the left side of L p, q in the upper triangular matrix; B is the distance between L p, q and the diagonal elements in the column direction or row direction. number of elements.
结合第一方面或上述任一种可能的实现方式,在另一种可能的实现方式中,X与Y不存在交集。X、Y作为构建上述标准柯西矩阵的元素集合,两者相互独立不存在交集,提高了上述标准柯西矩阵中每个元素的独立性,使得编解码性能更优。With reference to the first aspect or any of the above possible implementation manners, in another possible implementation manner, X and Y do not have an intersection. X and Y are used as a set of elements to construct the above standard Cauchy matrix, and they are independent of each other and have no intersection, which improves the independence of each element in the above standard Cauchy matrix, and makes the encoding and decoding performance better.
结合第一方面或上述任一种可能的实现方式,在另一种可能的实现方式中,Y为{0,1,……,M-2,M-1},X为{M,M+1,……,M+R-2,M+R-1}。该实现方式提供了构建上述标准柯西矩阵的元素集合具体数值,提高了方案可行性。With reference to the first aspect or any of the above possible implementation manners, in another possible implementation manner, Y is {0, 1, ..., M-2, M-1}, and X is {M, M+ 1, ..., M+R-2, M+R-1}. This implementation provides specific values of the element set for constructing the above standard Cauchy matrix, which improves the feasibility of the solution.
第二方面,提供一种编码方法,该方法应用于编码设备,该方法可以包括:获取原包个数M、冗余包个数R及包长L;获取M个原包;构建R行M列的标准柯西矩阵,作为编码矩阵,该编码矩阵中第i行第j列元素为
Figure PCTCN2020105310-appb-000004
x i与y j为相互独立的元素,x i属于包括R个元素的集合X,y j属于包括M个元素的集合Y,i大于或等于1,且小于或等于R,j大于或等于1,且小于或等于M。将M个原包左乘编码矩阵,得到R个冗余包;发送M个原包及R个冗余包。
In a second aspect, an encoding method is provided. The method is applied to an encoding device. The method may include: acquiring the number M of original packets, the number R of redundant packets, and the packet length L; acquiring M original packets; The standard Cauchy matrix of columns, as an encoding matrix, the elements in the i-th row and the j-th column of the encoding matrix are
Figure PCTCN2020105310-appb-000004
x i and y j are independent elements, x i belongs to the set X including R elements, y j belongs to the set Y including M elements, i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1 , and less than or equal to M. Multiply the M original packets by the encoding matrix to the left to obtain R redundant packets; send M original packets and R redundant packets.
在一种可能的实现方式中,上述编码矩阵为伽罗华域柯西矩阵,x i+y j小于2 8(即小于256,或者也可以等价为:小于或等于255)。经验证,在伽罗华域对矩阵LDU分解后分别求逆再求乘积,结果与数学求逆算法的结果一致,而通过LDU分解后求逆,可以降低求逆过程的复杂度,以提高解码效率。 In a possible implementation manner, the above encoding matrix is a Galois Field Cauchy matrix, and x i +y j is less than 2 8 (that is, less than 256, or equivalently: less than or equal to 255). It has been verified that after decomposing the matrix LDU in the Galois field, inverting the matrix and then calculating the product, the results are consistent with the results of the mathematical inversion algorithm. By decomposing the LDU and then inverting, the complexity of the inversion process can be reduced to improve decoding. efficient.
在另一种可能的实现方式中,X与Y不存在交集。X、Y作为构建上述标准柯西矩阵的元素集合,两者相互独立不存在交集,提高了上述标准柯西矩阵中每个元素的独立性,使得编解码性能更优。In another possible implementation, X and Y do not intersect. X and Y are used as a set of elements to construct the above standard Cauchy matrix, and they are independent of each other and have no intersection, which improves the independence of each element in the above standard Cauchy matrix, and makes the encoding and decoding performance better.
在另一种可能的实现方式中,Y为{0,1,……,M-2,M-1},X为{M,M+1,……,M+R-2,M+R-1}。该实现方式提供了构建上述标准柯西矩阵的元素集合具体数值,提高了方案可行性。In another possible implementation, Y is {0, 1, ..., M-2, M-1}, and X is {M, M+1, ..., M+R-2, M+R -1}. This implementation provides specific values of the element set for constructing the above standard Cauchy matrix, which improves the feasibility of the solution.
第三方面,提供一种解码装置,该装置可以包括:获取单元、确定单元、消原单元、构建单元以及处理单元。其中:In a third aspect, a decoding apparatus is provided, and the apparatus may include: an acquisition unit, a determination unit, a cancellation unit, a construction unit, and a processing unit. in:
获取单元,用于获取码流,该码流包括X个原包及Q个冗余包。an acquisition unit, configured to acquire a code stream, where the code stream includes X original packets and Q redundant packets.
确定单元,用于根据获取单元获取的码流编码时的原包个数M、冗余包个数R及 包长L,对该码流解析获取X个原包及Q个冗余包,确定丢失的原包的个数N,N等于M减所述X;Q小于或等于R。The determining unit is used to analyze the code stream to obtain X original packets and Q redundant packets according to the original packet number M, the redundant packet number R and the packet length L during encoding of the code stream obtained by the acquisition unit, and determine The number N of lost original packets, N is equal to M minus the X; Q is less than or equal to R.
消原单元,用于对Q个冗余包中的P个冗余包进行消原得到消原结果。其中,该P个冗余包为满足条件的冗余包;P为N与Q中的较小值。The elimination unit is used to eliminate the P redundant packets in the Q redundant packets to obtain the elimination result. Wherein, the P redundant packets are redundant packets satisfying the condition; P is the smaller value of N and Q.
构建单元,用于根据码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵。其中,包标识用于指示数据包编码时的包顺序。The construction unit is used to construct a standard Cauchy matrix with R rows and M columns according to the packet receiving sequence and packet identifiers in the code stream. Wherein, the packet identifier is used to indicate the packet sequence when the data packet is encoded.
选取单元,用于选取标准柯西矩阵中,P个丢失的原包对应的列,P个冗余包对应的行的交叠位置对应的元素,得到P阶解码矩阵。The selection unit is used to select the columns corresponding to the P lost original packets and the elements corresponding to the overlapping positions of the rows corresponding to the P redundant packets in the standard Cauchy matrix to obtain a P-order decoding matrix.
处理单元,用于将消原结果左乘P阶解码矩阵的逆矩阵,得到P个丢失的原包。The processing unit is used for left-multiplying the original elimination result by the inverse matrix of the P-order decoding matrix to obtain P lost original packets.
需要说明的是,第三方面提供的解码装置用于执行上述第一方面或第一方面的任一种可能的实现方式提供的解码方法,其具体实现可以参照前述第一方面或第一方面的任一种可能的实现方式。It should be noted that the decoding apparatus provided in the third aspect is used to execute the decoding method provided in the first aspect or any possible implementation manner of the first aspect, and for the specific implementation, refer to the foregoing first aspect or the first aspect. any possible implementation.
第四方面,提供一种编码装置,该编码装置可以包括:获取单元、构建单元、编码单元及发送单元。其中:In a fourth aspect, an encoding apparatus is provided, and the encoding apparatus may include: an acquisition unit, a construction unit, an encoding unit, and a sending unit. in:
获取单元,用于获取原包个数M、冗余包个数R及包长L;获取M个原包。The acquiring unit is used to acquire the number M of original packets, the number R of redundant packets and the packet length L; and acquire M original packets.
构建单元,用于构建R行M列的标准柯西矩阵。该编码矩阵中第i行第j列元素为
Figure PCTCN2020105310-appb-000005
x i与y j为相互独立的元素,x i属于包括R个元素的集合X,y j属于包括M个元素的集合Y,i大于或等于1,且小于或等于R,j大于或等于1,且小于或等于M。
Build cells for building a standard Cauchy matrix with R rows and M columns. The element in the i-th row and the j-th column of the encoding matrix is
Figure PCTCN2020105310-appb-000005
x i and y j are independent elements, x i belongs to the set X including R elements, y j belongs to the set Y including M elements, i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1 , and less than or equal to M.
编码单元,用于将M个原包左乘编码矩阵,得到R个冗余包。The coding unit is used to left-multiply the M original packets by the coding matrix to obtain R redundant packets.
发送单元,用于发送M个原包及R个冗余包。The sending unit is used for sending M original packets and R redundant packets.
需要说明的是,第四方面提供的编码装置用于执行上述第二方面或第二方面的任一种可能的实现方式提供的编码方法,其具体实现可以参照前述第二方面或第二方面的任一种可能的实现方式。It should be noted that the encoding device provided in the fourth aspect is used to execute the encoding method provided by the second aspect or any possible implementation manner of the second aspect, and for specific implementation, refer to the second aspect or the second aspect. any possible implementation.
第五方面,本申请提供了一种解码装置,该解码装置可以实现上述第一方面描述的方法示例中的功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个上述功能相应的模块。该解码装置可以以芯片的产品形态存在。In a fifth aspect, the present application provides a decoding apparatus, which can implement the functions in the method examples described in the first aspect above, and the functions can be implemented by hardware or by executing corresponding software in hardware. The hardware or software includes one or more modules corresponding to the above functions. The decoding device may exist in the form of a chip product.
在一种可能的实现方式中,该解码装置可以包括处理器和传输接口。其中,传输接口用于接收和发送数据。处理器被配置为调用存储在存储器中的软件指令,以使得该解码装置执行上述第一方面描述的方法示例中的功能。In a possible implementation, the decoding apparatus may include a processor and a transmission interface. Among them, the transmission interface is used to receive and send data. The processor is configured to invoke software instructions stored in the memory to cause the decoding apparatus to perform the functions in the method examples described in the first aspect above.
第六方面,本申请提供了一种编码装置,该编码装置可以实现上述所述第二方面描述的方法示例中的功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个上述功能相应的模块。该编码装置可以以芯片的产品形态存在。In a sixth aspect, the present application provides an encoding device, which can implement the functions in the method examples described in the second aspect above, and the functions can be implemented by hardware or by executing corresponding software in hardware. The hardware or software includes one or more modules corresponding to the above functions. The encoding device may exist in the form of a chip product.
在一种可能的实现方式中,该编码装置可以包括处理器和传输接口。其中,传输接口用于接收和发送数据。处理器被配置为调用存储在存储器中的软件指令,以使得该编码装置执行上述第二方面描述的方法示例中的功能。In a possible implementation, the encoding apparatus may include a processor and a transmission interface. Among them, the transmission interface is used to receive and send data. The processor is configured to invoke software instructions stored in the memory to cause the encoding apparatus to perform the functions of the method examples described in the second aspect above.
第七方面,提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上或处理器上运行时,使得计算机或处理器执行上述第一方面或第二方面或其任一种可能的实现方式提供的解码方法或编码方法。In a seventh aspect, a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer or a processor, the computer or the processor is made to execute the above-mentioned first aspect or second. The decoding method or the encoding method provided by the aspect or any of its possible implementation manners.
第八方面,提供一种计算机程序产品,该计算机程序产品包括指令,当该指令在计算机或处理器上运行时,使得计算机或处理器执行上述第一方面或第二方面或其任一种可能的实现方式提供的解码方法或编码方法。In an eighth aspect, a computer program product is provided, the computer program product comprising instructions that, when executed on a computer or processor, cause the computer or processor to perform the above-mentioned first aspect or the second aspect or any possibility thereof The decoding method or encoding method provided by the implementation.
第九方面,提供一种芯片系统,该芯片系统包括处理器,还可以包括存储器,用于实现上述方法中相应的功能。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In a ninth aspect, a chip system is provided, the chip system includes a processor, and may also include a memory, for implementing the corresponding functions in the above method. The chip system can be composed of chips, and can also include chips and other discrete devices.
第十方面,提供一种编解码系统,该系统包括第五方面的解码装置、第六方面的编码装置,分别具备上述各个方面以及任一可能的实现方式的功能。According to a tenth aspect, an encoding and decoding system is provided. The system includes the decoding device of the fifth aspect and the encoding device of the sixth aspect, respectively having the functions of the above aspects and any possible implementation manner.
其中,需要说明的是,上述各个方面中的任意一个方面的各种可能的实现方式,在方案不矛盾的前提下,均可以进行组合。It should be noted that various possible implementation manners of any one of the above aspects can be combined on the premise that the solutions are not contradictory.
附图说明Description of drawings
图1为本申请实施例提供的一种通信系统的结构示意图;FIG. 1 is a schematic structural diagram of a communication system according to an embodiment of the present application;
图2为本申请实施例提供的一种通信装置的结构示意图;FIG. 2 is a schematic structural diagram of a communication device according to an embodiment of the present application;
图3为本申请实施例提供的一种编解码方法的流程示意图;3 is a schematic flowchart of an encoding and decoding method provided by an embodiment of the present application;
图4为本申请实施例提供的一种性能数据随冗余包个数R变化的曲线示意图;FIG. 4 is a schematic diagram of a curve of performance data varying with the number R of redundant packets according to an embodiment of the present application;
图5为本申请实施例提供的一种性能数据随原包数M变化的曲线示意图;FIG. 5 is a schematic diagram of a curve of performance data varying with the number of original packets M provided by an embodiment of the present application;
图6为本申请实施例提供的一种性能数据随包长L变化的曲线示意图;6 is a schematic diagram of a curve of performance data varying with packet length L according to an embodiment of the present application;
图7为本申请实施例提供的一种解码装置的结构示意图;FIG. 7 is a schematic structural diagram of a decoding apparatus provided by an embodiment of the present application;
图8为本申请实施例提供的一种解码设备的结构示意图;FIG. 8 is a schematic structural diagram of a decoding device provided by an embodiment of the present application;
图9为本申请实施例提供的一种编码装置的结构示意图;FIG. 9 is a schematic structural diagram of an encoding device provided by an embodiment of the present application;
图10为本申请实施例提供的一种编码设备的结构示意图。FIG. 10 is a schematic structural diagram of an encoding device according to an embodiment of the present application.
具体实施方式detailed description
在本申请实施例中,为了便于清楚描述本申请实施例的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。该“第一”、第二”描述的技术特征间无先后顺序或者大小顺序。In the embodiments of the present application, in order to clearly describe the technical solutions of the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same functions and functions. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like are not necessarily different. The technical features described in the "first" and second" have no sequence or order of magnitude.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念,便于理解。In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or illustrations. Any embodiments or designs described in the embodiments of the present application as "exemplary" or "such as" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present the related concepts in a specific manner to facilitate understanding.
在本申请的描述中,除非另有说明,“/”表示前后关联的对象是一种“或”的关系,例如,A/B可以表示A或B;本申请中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。并且,在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。“以下至少一项(个)”或 其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the description of this application, unless otherwise stated, "/" indicates that the object associated with it is an "or" relationship, for example, A/B can indicate A or B; "and/or" in this application is only It is an association relationship that describes an associated object, which means that there can be three kinds of relationships, for example, A and/or B, which can be expressed as: A alone exists, A and B exist at the same time, and B exists alone, among which A, B Can be singular or plural. Also, in the description of the present application, unless stated otherwise, "plurality" means two or more than two. "At least one item(s) below" or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural item(s). For example, at least one item (a) of a, b, or c may represent: a, b, c, ab, ac, bc, or abc, where a, b, and c may be single or multiple .
在本申请实施例中,至少一个还可以描述为一个或多个,多个可以是两个、三个、四个或者更多个,本申请不做限制。In the embodiments of the present application, at least one may also be described as one or more, and the multiple may be two, three, four or more, which is not limited in this application.
在描述本申请实施例之前,先对本申请涉及的名词进行解释说明。Before describing the embodiments of the present application, the terms involved in the present application are explained.
原包(也可称为原始包),是指编解码系统中待传输的数据包。编码参数中定义了原包的包长L,将待传输的数据构建为多个长度为L的数据包,则为原包。The original packet (also referred to as the original packet) refers to the data packet to be transmitted in the codec system. The packet length L of the original packet is defined in the encoding parameter, and the data to be transmitted is constructed into multiple data packets of length L, which are the original packets.
冗余包,是指编码时与原包一起发送的与原包相关的参考数据包,用于解码端参考解码。在编码端,可以将原包与编解码算法对应的编码矩阵进行乘法运算得到冗余包。在解码端,可以将冗余包与编解码算法对应的解码矩阵的逆矩阵进行乘法运算得到丢弃的原包。A redundant packet refers to a reference data packet related to the original packet that is sent together with the original packet during encoding, and is used for reference decoding at the decoding end. At the encoding end, the redundant packet can be obtained by multiplying the original packet with the encoding matrix corresponding to the encoding and decoding algorithm. At the decoding end, the discarded original packet can be obtained by multiplying the redundant packet with the inverse matrix of the decoding matrix corresponding to the encoding and decoding algorithm.
目前的FEC技术在恢复长时间连续丢包时,选取的编码矩阵为非标准矩阵,增加了编、解码方案的负担,且解码端对乱序的原包及冗余包按照发送顺序排序后才能选取解码矩阵进而解码,资源开销和计算延时非常大。When the current FEC technology recovers long-term continuous packet loss, the selected coding matrix is a non-standard matrix, which increases the burden of the coding and decoding scheme, and the decoding end can sort the original and redundant packets out of order according to the sending order. Selecting the decoding matrix and then decoding, the resource overhead and calculation delay are very large.
基于此,本申请实施例提供一种编解码方法,采用标准柯西矩阵作为编码矩阵以降低编、解码的负担;由于编码矩阵为标准柯西矩阵,解码端就可以根据码流中数据包的接收顺序确定解码矩阵进行解码,无需对乱序的原包和冗余包排序,减少了资源开销、提高了计算效果,因此降低了计算时延。Based on this, the embodiments of the present application provide an encoding and decoding method, which uses a standard Cauchy matrix as the encoding matrix to reduce the burden of encoding and decoding; since the encoding matrix is a standard Cauchy matrix, the decoding end can The receiving order determines the decoding matrix for decoding, which eliminates the need to sort out-of-order original packets and redundant packets, reduces resource overhead, improves computing effect, and thus reduces computing delay.
本申请实施例提供的编解码方法可以应用于图1所示的通信系统中。如图1所示,该通信系统可以包括编码端设备101、通信链路102以及解码端设备103。The encoding and decoding methods provided in the embodiments of the present application may be applied to the communication system shown in FIG. 1 . As shown in FIG. 1 , the communication system may include an encoding end device 101 , a communication link 102 and a decoding end device 103 .
其中,编码端设备101用于获取待传输码流并进行编码,得到编码后的码流(包括原包和冗余包),然后通过通信链路102向解码端设备103发送编码后的码流。在发送过程中,可能存在丢包及乱序的情况。解码端设备103在接收到码流后,解码获取码流。对于编码端设备101以及解码端设备103的具体处理过程,可以参照后续实施例,此处不做详细说明。The encoding end device 101 is used to obtain and encode the code stream to be transmitted, obtain the encoded code stream (including original packets and redundant packets), and then send the encoded code stream to the decoding end device 103 through the communication link 102 . During the sending process, there may be packet loss and disorder. After receiving the code stream, the decoding end device 103 decodes and obtains the code stream. For the specific processing procedures of the encoding end device 101 and the decoding end device 103, reference may be made to the subsequent embodiments, which will not be described in detail here.
需要说明的是,在不同的应用场景中,图1示意的通信系统中的各个组成部分的形式不同,本申请实施例对于图1示意的通信系统中各个组成部分的实际形态不予限定。It should be noted that, in different application scenarios, the forms of each component in the communication system shown in FIG. 1 are different, and the embodiment of the present application does not limit the actual form of each component in the communication system shown in FIG. 1 .
例如,在视频会议场景中,编码端设备101可以为会议一端的视频处理设备(例如会议终端)接入的交换机,解码端设备103可以为会议另一端的视频处理设备接入的交换机,通信链路102可以为广域网(wide area network,WAN)。For example, in a video conference scenario, the encoding end device 101 may be a switch connected to a video processing device (such as a conference terminal) at one end of the conference, and the decoding end device 103 may be a switch connected to the video processing device at the other end of the conference. The road 102 may be a wide area network (WAN).
下面结合附图,对本申请的实施例进行具体阐述。The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
一方面,本申请实施例提供一种通信装置,用于执行本申请提供的编码方法或者解码方法。该通信装置可以部署于图1所示的编码端设备101或解码端设备103中。例如,该通信装置可以为编码端设备101或解码端设备103中的功能模块或者芯片。On the one hand, an embodiment of the present application provides a communication apparatus for executing the encoding method or the decoding method provided by the present application. The communication apparatus may be deployed in the encoding end device 101 or the decoding end device 103 shown in FIG. 1 . For example, the communication device may be a functional module or chip in the encoding end device 101 or the decoding end device 103 .
图2示出的是与本申请各实施例相关的一种通信装置20。如图2所示,通信装置20可以包括处理器201、存储器202以及收发器203。FIG. 2 shows a communication device 20 related to various embodiments of the present application. As shown in FIG. 2 , the communication apparatus 20 may include a processor 201 , a memory 202 and a transceiver 203 .
下面结合图2对通信装置20的各个构成部件进行具体的介绍:Below in conjunction with FIG. 2, each constituent component of the communication device 20 will be specifically introduced:
其中,存储器202可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);或者上述种类的存储器的组合,用于存储可实现本申请方法的程序代码、配置文件或其他内容。The memory 202 may be a volatile memory (volatile memory), such as random-access memory (RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (read-only memory). memory, ROM), flash memory (flash memory), hard disk drive (HDD) or solid-state drive (solid-state drive, SSD); or a combination of the above-mentioned types of memory, for storing the memory that can implement the method of the present application Program code, configuration files, or other content.
处理器201是通信装置20的控制中心。例如,处理器201可以是一个中央处理器(central processing unit,CPU),也可以是特定集成电路(application specific integrated circuit,ASIC),或者是被配置成实施本申请实施例的一个或多个集成电路,例如:一个或多个微处理器(digital singnal processor,DSP),或,一个或者多个现场可编程门阵列(field programmable gate array,FPGA)。The processor 201 is the control center of the communication device 20 . For example, the processor 201 may be a central processing unit (CPU), may also be a specific integrated circuit (application specific integrated circuit, ASIC), or be configured to implement one or more integrated circuits of the embodiments of the present application Circuits, such as: one or more microprocessors (digital singnal processor, DSP), or, one or more field programmable gate array (field programmable gate array, FPGA).
收发器203用于与其他设备进行通信。收发器203可以为通信端口或者其他。The transceiver 203 is used to communicate with other devices. Transceiver 203 may be a communication port or otherwise.
一种可能的实现方式中,通信装置20部署于解码端设备中时,处理器201通过运行或执行存储在存储器202内的软件程序和/或模块,以及调用存储在存储器302内的数据,执行如下功能:In a possible implementation manner, when the communication device 20 is deployed in the decoding end device, the processor 201 executes the software program and/or module stored in the memory 202 by running or executing, and calling the data stored in the memory 302. The following functions:
获取码流,该码流包括X个原包及Q个冗余包;根据该码流编码时的原包个数M、冗余包个数R及包长L,对该码流解析获取X个原包及Q个冗余包,确定丢失的原包的个数N,N等于M减X;Q小于或等于R;对Q个冗余包中的P个冗余包进行消原得到消原结果;其中,P个冗余包中满足条件的冗余包;P为Q与N中的较小值;根据码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵;选取标准柯西矩阵中,P个丢失的原包对应的列,参与消原的P个冗余包对应的行的交叠位置对应的元素,得到P阶解码矩阵;将消原结果左乘P阶解码矩阵的逆矩阵,得到P个丢失的原包。应当理解,本申请实施例中,待发送的码流包括M个原包,该M个原包对应R个冗余包。Obtain a code stream, the code stream includes X original packets and Q redundant packets; according to the number of original packets M, the number of redundant packets R and the packet length L when the code stream is encoded, analyze the code stream to obtain X original packets and Q redundant packets, determine the number N of lost original packets, N is equal to M minus X; Q is less than or equal to R; the P redundant packets in the Q redundant packets are eliminated by eliminating the original packets. The original result; among them, the redundant packets that meet the conditions in the P redundant packets; P is the smaller value of Q and N; according to the packet receiving order and packet identification in the code stream, construct a standard Cauchy with R rows and M columns matrix; select the columns corresponding to the P lost original packets in the standard Cauchy matrix, and the elements corresponding to the overlapping positions of the rows corresponding to the P redundant packets participating in the elimination to obtain the P-order decoding matrix; leave the elimination result to the left Multiply the inverse matrix of the P-order decoding matrix to obtain P lost original packets. It should be understood that, in this embodiment of the present application, the code stream to be sent includes M original packets, and the M original packets correspond to R redundant packets.
另一种可能的实现方式中,通信装置20部署于编码端设备中时,处理器201通过运行或执行存储在存储器202内的软件程序和/或模块,以及调用存储在存储器302内的数据,执行如下功能:In another possible implementation manner, when the communication apparatus 20 is deployed in the encoding end device, the processor 201 runs or executes the software programs and/or modules stored in the memory 202 and calls the data stored in the memory 302, Execute the following functions:
获取原包个数M、冗余包个数R及包长L;获取M个原包;构建R行M列的标准柯西矩阵,作为编码矩阵;该编码矩阵中第i行第j列元素为
Figure PCTCN2020105310-appb-000006
x i与y j为相互独立的元素,x i属于包括R个元素的集合X,y j属于包括M个元素的集合Y,i大于或等于1,且小于或等于R,j大于或等于1,且小于或等于M;将M个原包左乘编码矩阵,得到R个冗余包;发送M个原包及R个冗余包。
Obtain the number of original packets M, the number of redundant packets R and the packet length L; obtain M original packets; construct a standard Cauchy matrix with R rows and M columns as an encoding matrix; elements in the i-th row and the j-th column of the encoding matrix for
Figure PCTCN2020105310-appb-000006
x i and y j are independent elements, x i belongs to the set X including R elements, y j belongs to the set Y including M elements, i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1 , and less than or equal to M; multiply M original packets by the encoding matrix to obtain R redundant packets; send M original packets and R redundant packets.
另一方面,本申请实施例提供一种编解码方法,由编码端设备执行编码方法,解码端设备执行解码方法。如图3所示,本申请提供的编解码方法包括:On the other hand, an embodiment of the present application provides an encoding and decoding method, wherein the encoding end device executes the encoding method, and the decoding end device executes the decoding method. As shown in Figure 3, the encoding and decoding method provided by this application includes:
S301、编码端设备获取原包个数M、冗余包个数R及包长L。S301. The encoding end device obtains the number M of original packets, the number R of redundant packets, and the packet length L.
其中,原包个数M、冗余包个数R及包长L为编码参数,编码参数可以根据实际需求配置于编码端设备和/或解码端设备中。或者,编码参数也可以由用户实时输入编解码系统中。或者,编码参数也可以由用户输入编码端设备中,由编码端设备发送至解码端设备。The number M of original packets, the number R of redundant packets, and the packet length L are encoding parameters, and the encoding parameters can be configured in the encoding end device and/or the decoding end device according to actual requirements. Alternatively, the coding parameters can also be input into the coding and decoding system by the user in real time. Alternatively, the encoding parameters may also be input by the user into the encoding end device, and sent by the encoding end device to the decoding end device.
S302、编码端设备获取M个原包。S302. The encoding end device obtains M original packets.
具体的,在S302中,编码端设备根据编码参数中的原包个数M,从待传数据按照包长L划分,每L长度的待传数据作为一个原包,将构建的数据包中选取M个数据包作为本次编码操作的原包,即可得到S302中的M个原包。Specifically, in S302, the encoding end device divides the data to be transmitted according to the packet length L according to the number of original packets M in the encoding parameters, and the data to be transmitted of each L length is regarded as an original packet, and selects the constructed data packets from the data packets. The M data packets are used as the original packets of this encoding operation, and the M original packets in S302 can be obtained.
可选的,在实际应用中,可以根据预设规则选取M个数据包,本申请实施例对该选取过程不予限定。例如,该预设规则可以为按照时间顺序选取原包,或者,该预设规则可以为按照业务紧急程度选取原包。当然,该预设规则还可以为其他,均可以根据实际需求配置,不予限定。Optionally, in practical applications, M data packets may be selected according to a preset rule, and the selection process is not limited in this embodiment of the present application. For example, the preset rule may be to select the original package in chronological order, or the preset rule may be to select the original package according to the urgency of the business. Of course, the preset rule can also be other, which can be configured according to actual needs, and is not limited.
例如,编码端设备在S302中可以选取M个数据包构建为编码block的形式。For example, in S302, the encoding end device may select M data packets and construct them in the form of encoding blocks.
示例性的,M个原包分别记录为M 1至M M,可以示意如下数据矩阵形式,每一行为一个原包,其长度为L,即L个元素,一个元素为固定大小的数据。例如,一个元素可以为8比特(bit)大小的数据。 Exemplarily, the M original packets are respectively recorded as M 1 to M M , which can represent the following data matrix form, each row is an original packet, and its length is L, that is, L elements, and one element is data of a fixed size. For example, one element may be 8-bit (bit)-sized data.
Figure PCTCN2020105310-appb-000007
Figure PCTCN2020105310-appb-000007
其中,原包M 1=[M 11 M 12 M 13 … M 1L]; Wherein, the original package M 1 =[M 11 M 12 M 13 ... M 1L ];
原包M 2=[M 21 M 22 M 23 … M 2L]; original package M 2 = [M 21 M 22 M 23 ... M 2L ];
……...
原包M M=[M M1 M M2 M M3 … M ML]。 Original package M M = [M M1 M M2 M M3 ... M ML ].
数据矩阵的行数就是编码参数中的原包个数M,也叫原始包个数,列可以以字节(Byte)为单位,列长度在构建Block的时候可以有长有短,数据矩阵的编码长度以原始包最大长度L为准,不足L的原始包尾部可以填充0(打padding0)补齐。The number of rows of the data matrix is the number of original packets M in the encoding parameter, also called the number of original packets. The encoding length is based on the maximum length L of the original packet, and the tail of the original packet less than L can be filled with 0 (padding0).
S303、编码端设备构建R行M列的标准柯西矩阵,作为编码矩阵。S303. The encoding end device constructs a standard Cauchy matrix with R rows and M columns as an encoding matrix.
具体的,可以根据S301中获取的编码参数中的M及R,构建R行M列的标准柯西矩阵。Specifically, a standard Cauchy matrix with R rows and M columns can be constructed according to M and R in the encoding parameters obtained in S301.
其中,S303中构建的R行M列的标准柯西矩阵用于编码设备对原包编码生成冗余包。Among them, the standard Cauchy matrix with R rows and M columns constructed in S303 is used by the encoding device to encode the original packets to generate redundant packets.
示例性的,m行n列的标准柯西矩阵可以描述如下:Exemplarily, a standard Cauchy matrix with m rows and n columns can be described as follows:
Figure PCTCN2020105310-appb-000008
Figure PCTCN2020105310-appb-000008
其中,标准柯西矩阵中的x元素(例如上式中的x(i))和y元素(例如上式中的y(i))都是其所属数学域中的元素。标准柯西矩阵具备如下特点:标准柯西矩阵任意一个子方阵都是奇异矩阵,存在逆矩阵。Among them, the x element (for example, x(i) in the above formula) and the y element (for example, y(i) in the above formula) in the standard Cauchy matrix are both elements in the mathematical domain to which they belong. The standard Cauchy matrix has the following characteristics: any sub-square matrix of the standard Cauchy matrix is a singular matrix, and there is an inverse matrix.
一种可能的实现方式中,S303中构建的R行M列的标准柯西矩阵,可以为伽罗 华域的柯西矩阵,该矩阵内的元素取自伽罗华域,x元素(例如上式中的x(i))和y元素(例如上式中的y(i))都是迦罗华域GF(2 W)中的元素。标准柯西矩阵在迦罗华域上的求逆运算,可以在O(n 2)的运算复杂度内完成。 In a possible implementation, the standard Cauchy matrix with R rows and M columns constructed in S303 may be the Cauchy matrix of the Galois field, and the elements in the matrix are taken from the Galois field, and the x elements (for example, the above The x(i) and y elements in the formula (eg y(i) in the above formula) are both elements in the Galois field GF( 2W ). The inversion operation of the standard Cauchy matrix on the Galois field can be completed within the complexity of O(n 2 ).
示例性的,在S303中,编码端设备可以按照下述步骤1和步骤2,构建R行M列的编码矩阵:Exemplarily, in S303, the encoding end device can construct an encoding matrix with R rows and M columns according to the following steps 1 and 2:
步骤1、编码端设备构造用于构建标准柯西矩阵(即编码矩阵)的元素集合。 Step 1. The encoding end device constructs an element set for constructing a standard Cauchy matrix (ie, an encoding matrix).
其中,步骤1中构建的元素集合包括集合X和集合Y,集合X包括柯西矩阵中的x元素,集合Y包括柯西矩阵中的y元素。集合X包括{x 1,x 2,...,x R-1,x R},集合Y包括{y 1,y 2,...,y M-1,y M}。其中,x i与y j为相互独立的元素,i大于或等于1,且小于或等于R,j大于或等于1,且小于或等于M。 The element set constructed in step 1 includes a set X and a set Y, the set X includes the x element in the Cauchy matrix, and the set Y includes the y element in the Cauchy matrix. The set X includes {x 1 , x 2 ,..., x R-1 , x R }, and the set Y includes {y 1 , y 2 ,..., y M-1 , y M }. Among them, x i and y j are mutually independent elements, i is greater than or equal to 1, and less than or equal to R, j is greater than or equal to 1, and less than or equal to M.
示例性的,当S303中构建的R行M列的标准柯西矩阵为伽罗华域的柯西矩阵,集合X、集合Y中的元素都是迦罗华域GF(2 8)中的元素。其中,x i与y j为伽罗华域上相互独立的元素,x i+y j小于2 8Exemplarily, when the standard Cauchy matrix with R rows and M columns constructed in S303 is the Cauchy matrix of the Galois field, the elements in the set X and the set Y are all elements in the Galois field GF(2 8 ). . Among them, x i and y j are mutually independent elements on the Galois field, and x i +y j is less than 2 8 .
需要说明的是,集合X及集合Y中的元素,可以根据实际需求配置,本申请实施例对此不予限定。也可以根据实际需求,配置集合X以及集合Y的约束条件。It should be noted that the elements in the set X and the set Y may be configured according to actual requirements, which are not limited in this embodiment of the present application. Constraints of set X and set Y can also be configured according to actual requirements.
例如,集合X与集合Y可以不存在交集。For example, set X and set Y may have no intersection.
例如,集合Y可以为{0,1,……,M-2,M-1},集合X可以为{M,M+1,……,M+R-2,M+R-1}。即y 1=0,……,y M=M-1,x 1=M,……,x R=M+R-1。 For example, set Y may be {0, 1, ..., M-2, M-1}, and set X may be {M, M+1, ..., M+R-2, M+R-1}. That is, y 1 =0, ..., y M =M-1, x 1 =M, ..., x R =M+R-1.
步骤2、编码端设备根据步骤1中构造的元素集合,构造R行M列的标准柯西矩阵作为编码矩阵。Step 2: According to the element set constructed in step 1, the encoding end device constructs a standard Cauchy matrix with R rows and M columns as an encoding matrix.
示例性的,R行M列的标准柯西矩阵(编码矩阵)可以表示为如下矩阵:Exemplarily, a standard Cauchy matrix (coding matrix) with R rows and M columns can be represented as the following matrix:
Figure PCTCN2020105310-appb-000009
Figure PCTCN2020105310-appb-000009
其中,编码矩阵中第i行第j列元素为
Figure PCTCN2020105310-appb-000010
x i属于包括R个元素的集合X,y j属于包括M个元素的集合Y。该编码矩阵的行数为冗余包的个数R,列数为原包的个数M,列以Byte为单位,列长度就是编码参数中的原包个数M。该编码矩阵构造方式,从步骤1中构造的有限元素集合中选取元素,可以减少不合理的取值和多余计算资源开销,可以更加精准的构造编码矩阵。当构造过程通过硬件实现时,每一个M和R的取值在电路中都可以有精准的表示,无需额外逻辑开销。
Among them, the elements of the i-th row and the j-th column in the encoding matrix are
Figure PCTCN2020105310-appb-000010
x i belongs to a set X of R elements, and y j belongs to a set Y of M elements. The number of rows of the encoding matrix is the number R of redundant packets, the number of columns is the number M of the original packets, the column is in Byte, and the length of the column is the number M of the original packets in the encoding parameters. In this coding matrix construction method, elements are selected from the finite element set constructed in step 1, which can reduce unreasonable value selection and redundant computing resource overhead, and can construct the coding matrix more accurately. When the construction process is implemented by hardware, each value of M and R can be accurately represented in the circuit without additional logic overhead.
S304、编码端设备将M个原包左乘编码矩阵,得到R个冗余包。S304. The encoding end device multiplies the M original packets by the encoding matrix to obtain R redundant packets.
在S304中,编码端设备将S302中获取的M个原包,左乘S303中构建的编码矩阵,即可得到R个冗余包。In S304, the encoding end device multiplies the M original packets obtained in S302 with the encoding matrix constructed in S303 to obtain R redundant packets.
例如,S304的过程可以示意为:For example, the process of S304 can be illustrated as:
Figure PCTCN2020105310-appb-000011
Figure PCTCN2020105310-appb-000011
其中,上式中等号的右侧为冗余包矩阵,其中包含R个冗余包,每一行为一个冗余包,每个冗余包的长度为L,R个冗余包分别记录为M′ 1至MR′ RAmong them, the right side of the equal sign in the above formula is the redundant packet matrix, which contains R redundant packets, each row is a redundant packet, the length of each redundant packet is L, and the R redundant packets are recorded as M respectively. ' 1 to MR' R .
其中,冗余包M′ 1=[M′ 11 M′ 12 M′ 13 … M′ 1L]; Wherein, redundant packet M' 1 =[M' 11 M' 12 M' 13 ... M' 1L ];
冗余包M′ 2=[M′ 21 M′ 22 M′ 23 … M′ 2L]; Redundant packet M' 2 =[M' 21 M' 22 M' 23 ... M' 2L ];
……...
冗余包M′ R=[M′ R1 M′ R2 M′ R3 … M′ RL]。 Redundant packets M' R = [M' R1 M' R2 M' R3 ... M' RL ].
生成的冗余包为编码结果,根据矩阵乘法的原理,冗余包中每一个元素都包含了原包和编码矩阵的元素信息,是能成功解码恢复出丢失原包的基础。The generated redundant packet is the encoding result. According to the principle of matrix multiplication, each element in the redundant packet contains the element information of the original packet and the encoding matrix, which is the basis for successfully decoding and recovering the lost original packet.
例如,对于冗余包M′ 2,根据矩阵乘法的原理,其中的元素满足如下等式,其中每一个元素都包含原包和编码矩阵的元素信息: For example, for the redundant packet M′ 2 , according to the principle of matrix multiplication, its elements satisfy the following equation, where each element contains the element information of the original packet and the encoding matrix:
Figure PCTCN2020105310-appb-000012
Figure PCTCN2020105310-appb-000012
Figure PCTCN2020105310-appb-000013
Figure PCTCN2020105310-appb-000013
……...
Figure PCTCN2020105310-appb-000014
Figure PCTCN2020105310-appb-000014
例如,对于冗余包M′ 6,根据矩阵乘法的原理,其中的元素满足如下等式,其中每一个元素都包含原包和编码矩阵的元素信息: For example, for the redundant packet M′ 6 , according to the principle of matrix multiplication, its elements satisfy the following equation, where each element contains the element information of the original packet and the encoding matrix:
Figure PCTCN2020105310-appb-000015
Figure PCTCN2020105310-appb-000015
Figure PCTCN2020105310-appb-000016
Figure PCTCN2020105310-appb-000016
……...
Figure PCTCN2020105310-appb-000017
Figure PCTCN2020105310-appb-000017
例如,对于冗余包M′ 9,根据矩阵乘法的原理,其中的元素满足如下等式,其中每一个元素都包含原包和编码矩阵的元素信息: For example, for the redundant packet M′ 9 , according to the principle of matrix multiplication, its elements satisfy the following equation, where each element contains the element information of the original packet and the encoding matrix:
Figure PCTCN2020105310-appb-000018
Figure PCTCN2020105310-appb-000018
Figure PCTCN2020105310-appb-000019
Figure PCTCN2020105310-appb-000019
……...
Figure PCTCN2020105310-appb-000020
Figure PCTCN2020105310-appb-000020
S305、编码端设备发送M个原包及R个冗余包。S305. The encoding end device sends M original packets and R redundant packets.
具体的,在S305中,编码端设备将M个原包以及R个冗余包作为发送码流,一起发送至与解码端设备间的通信链路。Specifically, in S305, the encoding end device uses the M original packets and the R redundant packets as transmission code streams, and sends them together to the communication link with the decoding end device.
进一步的,S305中编码端设备发送M个原包及R个冗余包时,在每个包中标记了包标识,用于指示该数据包编码时的包顺序,以便于解码端根据包标识确定解码矩阵。Further, when the encoding end device sends M original packets and R redundant packets in S305, a packet identification is marked in each packet to indicate the packet sequence during encoding of this data packet, so that the decoding end can identify the packet according to the packet identification. Determine the decoding matrix.
例如,第m个原包的包标识则可以为m,m小于或等于M;第r个冗余包的包标识则可以为r,r小于或等于R。For example, the packet identifier of the mth original packet may be m, and m is less than or equal to M; the packet identifier of the rth redundant packet may be r, and r is less than or equal to R.
可选的,包标识还可以包括用于指示数据包是原包还是冗余包的指示信息。Optionally, the packet identifier may further include indication information for indicating whether the data packet is an original packet or a redundant packet.
一种可能的实现方式中,编码端设备可以按照M个原包及R个冗余包的编号顺序,将M个原包以及R个冗余包依次发送。In a possible implementation manner, the encoding end device may send the M original packets and the R redundant packets in sequence according to the numbering sequence of the M original packets and the R redundant packets.
另一种可能的实现方式中,编码端设备为了提高传输安全性或者基于其他原因,可以将M个原包及R个冗余包乱序发出。In another possible implementation manner, in order to improve transmission security or for other reasons, the encoding end device may send the M original packets and the R redundant packets out of sequence.
进一步的,在S305中编码端设备发送M个原包及R个冗余包后,由于通信链路、传输场景、或传输环境的影响,可能存在M个原包中部分丢失的情况,需要在解码端通过本申请提供的方法解码恢复。Further, after the encoding end device sends the M original packets and the R redundant packets in S305, due to the influence of the communication link, the transmission scene, or the transmission environment, there may be a situation that some of the M original packets are lost, and it is necessary to The decoding end decodes and recovers by using the method provided in this application.
S306、解码端设备获取码流,该码流包括X个原包及Q个冗余包。S306. The decoding end device obtains a code stream, where the code stream includes X original packets and Q redundant packets.
其中,S306中解码端设备获取的码流为从通信链路上接收的码流,可以称为接收码流。接收码流是S305中编码端设备发送的发送码流经过传输后的码流。由于发送码流在通信链路传输时,可能存在丢包现象,因此,X小于或等于M,Q小于或等于R。The code stream obtained by the decoding end device in S306 is the code stream received from the communication link, which may be referred to as a received code stream. The received code stream is the transmitted code stream sent by the encoding end device in S305 after transmission. Due to the possibility of packet loss when the transmitted code stream is transmitted in the communication link, X is less than or equal to M, and Q is less than or equal to R.
示例性的,假设S305中编码端设备发送的发送码流中包括的M个原包及R个冗余包,传输过程中丢失了原包M 1、M 7、M 8。需要说明的是,对于冗余包的传输过程丢失,本申请实施例不考虑也不赘述。 Exemplarily, it is assumed that the M original packets and R redundant packets included in the transmission code stream sent by the encoding end device in S305 have lost the original packets M 1 , M 7 , and M 8 during the transmission process. It should be noted that, for the loss of the transmission process of the redundant packet, this embodiment of the present application does not consider or repeat them.
S307、解码端设备根据码流编码时的原包个数M、冗余包个数R及包长L,对该码流解析获取X个原包及Q个冗余包,确定丢失的原包的个数N。S307. The decoding end device analyzes the code stream to obtain X original packets and Q redundant packets according to the number M of original packets, the number R of redundant packets and the packet length L during encoding of the code stream, and determines the lost original packets the number N.
其中,码流编码时的原包个数M、冗余包个数R及包长L为解码参数。Among them, the number of original packets M, the number of redundant packets R and the packet length L in the code stream encoding are decoding parameters.
一种可能的实现方式中,解码参数可以根据实际需求配置于解码端设备,且与编码端的编码参数保持一致,相应的,S307中解码端设备可以直接获取该配置的码流编码时的原包个数M、冗余包个数R及包长L。In a possible implementation manner, the decoding parameters can be configured on the decoding end device according to actual needs, and are consistent with the encoding parameters of the encoding end. Correspondingly, in S307, the decoding end device can directly obtain the original packet of the configured code stream during encoding. The number M, the number R of redundant packets, and the packet length L.
另一种可能的实现方式中,可以通过编码端设备与解码端设备的交互,由编码端设备将其编码参数发送给解码端设备,作为解码端设备的解码参数,相应的,S307中解码端设备可以接收编码端设备发送的码流编码时的原包个数M、冗余包个数R及包 长L。In another possible implementation manner, through the interaction between the encoding end device and the decoding end device, the encoding end device sends its encoding parameters to the decoding end device as the decoding parameters of the decoding end device. Correspondingly, the decoding end device in S307 The device can receive the number M of original packets, the number R of redundant packets, and the packet length L when the code stream is encoded by the encoding end device.
具体的,由于发送码流在通信链路传输时,可能存在丢包现象,因此,N等于M减X。N大于或等于0。Specifically, since the packet loss phenomenon may exist when the transmitted code stream is transmitted in the communication link, N is equal to M minus X. N is greater than or equal to 0.
进一步的,S307中解码端设备可以解析码流(例如可以根据数据包的大小,将码流识别为一个一个数据包),获取其包含的X个原包及Q个冗余包,将M减去X则得到N。例如,解码端设备可以根据每个数据包的标记确定其为原包或者冗余包。Further, in S307, the decoding end device can parse the code stream (for example, the code stream can be identified as one data packet according to the size of the data packet), obtain X original packets and Q redundant packets contained in it, and subtract M from M. Go to X and get N. For example, the decoding end device can determine whether each data packet is an original packet or a redundant packet according to the mark of each data packet.
示例性的,基于S306中示例,S307中可以得出N为3。Exemplarily, based on the example in S306, it can be concluded that N is 3 in S307.
S308、解码端设备对Q个冗余包中的P个冗余包进行消原得到消原结果。S308, the decoding end device performs cancellation on P redundant packets in the Q redundant packets to obtain a cancellation result.
其中,P为解码端设备的容错能力,即可以恢复出的丢失原包的个数,P为Q与N中的较小值。当Q小于N时,解码端设备最大支持恢复丢失的N个原包中的Q个原包,此时,可以根据实际需求选取要恢复的丢失原包,本申请实施例对此不予限定。Among them, P is the fault tolerance capability of the decoding end device, that is, the number of lost original packets that can be recovered, and P is the smaller value of Q and N. When Q is less than N, the decoding end device supports recovering at most Q original packets among the N lost original packets. In this case, the lost original packets to be recovered may be selected according to actual requirements, which is not limited in this embodiment of the present application.
S308中描述的P个消原包为Q个冗余包中满足条件的冗余包。需要说明的是,可以根据实际需求配置选取P个冗余包的条件,本申请实施例对此不予限定。The P elimination packets described in S308 are redundant packets satisfying the condition among the Q redundant packets. It should be noted that the conditions for selecting the P redundant packets may be configured according to actual requirements, which is not limited in this embodiment of the present application.
一种可能的实现方式中,可以选取Q个冗余包中按照冗余包顺序的前P个冗余包。In a possible implementation manner, the first P redundant packets in the order of redundant packets among the Q redundant packets may be selected.
另一种可能的实现方式中,可以在Q个冗余包中随机选取P个冗余包。In another possible implementation manner, P redundant packets may be randomly selected from among the Q redundant packets.
示例性的,基于S306及S307中的示例,假设M个原包传输过程中丢包3个(M 1、M 7、M 8),R个冗余包经过传输,解码端设备接收的码流中的Q个冗余包中按照顺序的前3个冗余包为M′ 2、M′ 6、M′ 9,可以选取冗余包M′ 2、M′ 6、M′ 9进行消原。 Exemplarily, based on the examples in S306 and S307, it is assumed that 3 packets (M 1 , M 7 , M 8 ) are lost during the transmission of the M original packets, the R redundant packets are transmitted, and the code stream received by the decoding end device The first three redundant packets in the order of the Q redundant packets are M′ 2 , M′ 6 , and M′ 9 , and the redundant packets M′ 2 , M′ 6 , and M′ 9 can be selected for elimination.
进一步的,消原结果可以包括P个冗余包中每个冗余包的消原结果。一个冗余包的消原结果为该冗余包包含的元素的消原结果。Further, the elimination result may include the elimination result of each redundant packet in the P redundant packets. The elimination result of a redundant packet is the elimination result of the elements contained in the redundant packet.
一个元素的消原结果为该元素减去该元素编码时由P个丢失的原包(待恢复的原包)计算得到的部分。由于冗余包中每个元素都携带了每个原包的信息,对一个元素进行消原的目的,就是将该元素携带的丢失的原包的信息消除,保留该元素携带的接收到的X个原包的信息,以实现后续用接收到的原包恢复丢失的原包的目的。The elimination result of an element is the part calculated from the P lost original packets (original packets to be restored) when the element is coded by subtracting the element. Since each element in the redundant packet carries the information of each original packet, the purpose of eliminating an element is to eliminate the information of the lost original packet carried by the element and retain the received X information of the original package, so as to achieve the purpose of recovering the lost original package with the received original package subsequently.
其中,P个丢失的原包为待恢复的丢失原包。可以根据实际需求从N个丢失的原包中选取P个丢失的原包,本申请实施例对此不予限定。Among them, the P lost original packets are lost original packets to be recovered. The P lost original packets may be selected from the N lost original packets according to actual requirements, which is not limited in this embodiment of the present application.
下面以S306及S307中的示例为基础,描述S308的具体实现。The specific implementation of S308 is described below based on the examples in S306 and S307.
示例性的,基于S307及S308中的示例,假设对冗余包M′ 2、M′ 6、M′ 9进行消原,根据S304中对M′ 2、M′ 6、M′ 9中的元素满足的等式的描述,对等式进行变换以进行消原,将与丢失的原包相关的部分消除,保留与接收的原包相关的部分作为消原结果。冗余包M′ 2、M′ 6、M′ 9的消原过程如下等式所示。 Exemplarily, based on the examples in S307 and S308, it is assumed that the redundant packets M' 2 , M' 6 , and M' 9 are eliminated, according to the elements of M' 2 , M' 6 , and M' 9 in S304 The description of the satisfied equation, the equation is transformed to perform cancellation, the part related to the lost original packet is eliminated, and the part related to the received original packet is retained as the cancellation result. The elimination process of redundant packets M' 2 , M' 6 , and M' 9 is shown in the following equation.
对于冗余包M′ 2,其包括元素M′ 21……M′ 2L,假设冗余包M′ 2的消原结果包括M″ 21……M″ 2L。其中: For the redundant packet M' 2 , which includes elements M' 21 . . . M' 2L , it is assumed that the elimination result of the redundant packet M' 2 includes M″ 21 . . . M″ 2L . in:
M′ 21的消原结果M″ 21为: The elimination result M″ 21 of M′ 21 is :
Figure PCTCN2020105310-appb-000021
Figure PCTCN2020105310-appb-000021
M′ 22的消原结果M″ 22为: The elimination result M″ 22 of M′ 22 is :
Figure PCTCN2020105310-appb-000022
Figure PCTCN2020105310-appb-000022
……...
M′ 2L的消原结果M″ 2L为: The elimination result M″ 2L of M′ 2L is :
Figure PCTCN2020105310-appb-000023
Figure PCTCN2020105310-appb-000023
对于消原包M′ 6,其包括元素M′ 61……M′ 6L,消原包M′ 6的消原结果包括M″ 61……M″ 6L。其中: For the elimination package M′ 6 , which includes the elements M′ 61 . . . M′ 6L , the elimination result of the elimination package M′ 6 includes M″ 61 . in:
M′ 61的消原结果M″ 61为: The elimination result M″ 61 of M′ 61 is :
Figure PCTCN2020105310-appb-000024
Figure PCTCN2020105310-appb-000024
M′ 62的消原结果M″ 62为: The elimination result M″ 62 of M′ 62 is :
Figure PCTCN2020105310-appb-000025
Figure PCTCN2020105310-appb-000025
……...
M′ 6L的消原结果M″ 6L为: The elimination result of M′ 6L M″ 6L is:
Figure PCTCN2020105310-appb-000026
Figure PCTCN2020105310-appb-000026
对于消原包M′ 9,其包括元素M′ 91……M′ 9L,消原包M′ 9的消原结果包括M″ 91……M″ 9L。其中: For the elimination package M'9 , which includes the elements M'91...M'9L, the elimination result of the elimination package M'9 includes M"91 ... M " 9L . in:
M′ 91的消原结果M″ 91为: The elimination result of M′ 91 M″ 91 is:
Figure PCTCN2020105310-appb-000027
Figure PCTCN2020105310-appb-000027
M′ 92的消原结果M″ 92为: The elimination result M″ 92 of M′ 92 is :
Figure PCTCN2020105310-appb-000028
Figure PCTCN2020105310-appb-000028
……...
M′ 9L的消原结果M″ 9L为: The elimination result of M′ 9L M″ 9L is:
Figure PCTCN2020105310-appb-000029
Figure PCTCN2020105310-appb-000029
消原包为M′ 2、M′ 6、M′ 9的消原结果可以描述为:
Figure PCTCN2020105310-appb-000030
The elimination results of the elimination packages M′ 2 , M′ 6 , and M′ 9 can be described as:
Figure PCTCN2020105310-appb-000030
S309、解码端设备根据码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵。S309, the decoding end device constructs a standard Cauchy matrix with R rows and M columns according to the packet receiving sequence and packet identifiers in the code stream.
其中,S309中构建的R行M列的标准柯西矩阵用于选取解码矩阵。需要说明的是,S309中构建的R行M列的标准柯西矩阵,与S303中编码端设备构建的R行M列的标准柯西矩阵只是形式上相同,内容上根据实际需求构建,不予限定。The standard Cauchy matrix with R rows and M columns constructed in S309 is used to select the decoding matrix. It should be noted that the standard Cauchy matrix with R rows and M columns constructed in S309 is the same in form as the standard Cauchy matrix with R rows and M columns constructed by the coding end device in S303, and the content is constructed according to actual needs. limited.
一种可能的实现方式中,S309中构建的R行M列的标准柯西矩阵可以为R行M列的伽罗华域柯西矩阵。In a possible implementation manner, the standard Cauchy matrix with R rows and M columns constructed in S309 may be a Galois Field Cauchy matrix with R rows and M columns.
具体的,S309中解码端设备根据码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵,具体可以实现为:根据所述码流的接收包顺序中第f个接收的原包 的包标识indxf、所述码流的接收包顺序中第g个接收的冗余包的包标识indxg,以及标准柯西矩阵元素集合X及Y,确定该标准柯西矩阵中第f行第g列元素
Figure PCTCN2020105310-appb-000031
按照此方式确定该标准柯西矩阵中每一个元素,即可得到R行M列的标准柯西矩阵。
Specifically, in S309, the decoding end device constructs a standard Cauchy matrix with R rows and M columns according to the packet receiving sequence and the packet identifiers in the code stream. The package identifier indxf of the original package, the package identifier indxg of the redundant package received at the gth in the received packet sequence of the code stream, and the standard Cauchy matrix element sets X and Y, determine the fth in the standard Cauchy matrix. row g column element
Figure PCTCN2020105310-appb-000031
Determining each element in the standard Cauchy matrix in this way can obtain a standard Cauchy matrix with R rows and M columns.
其中,对于集合X及集合Y,与前述S303中描述的集合X及集合Y相同,此处不再赘述。f大于或等于1,且小于或等于R,g大于或等于1,且小于或等于M。Wherein, the set X and the set Y are the same as the set X and the set Y described in the foregoing S303, and are not repeated here. f is greater than or equal to 1 and less than or equal to R, and g is greater than or equal to 1 and less than or equal to M.
示例性的,假设接收的码流的接收包顺序中第3个接收的原包的包标识为5、接收的码流的接收包顺序中第4个接收的冗余包的包标识为2,确定该标准柯西矩阵中第3行第4列元素
Figure PCTCN2020105310-appb-000032
假设标准柯西矩阵元素集合Y为{0,1,……,M-2,M-1},X为{M,M+1,……,M+R-2,M+R-1},因此,x 5=M+4,y 2=1,
Figure PCTCN2020105310-appb-000033
Exemplarily, it is assumed that the packet identifier of the third received original packet in the received packet sequence of the received code stream is 5, and the packet identifier of the fourth received redundant packet in the received packet sequence of the received code stream is 2, Determine the element in row 3 and column 4 of this standard Cauchy matrix
Figure PCTCN2020105310-appb-000032
Suppose the standard Cauchy matrix element set Y is {0, 1, ..., M-2, M-1}, and X is {M, M+1, ..., M+R-2, M+R-1} , therefore, x 5 =M+4, y 2 =1,
Figure PCTCN2020105310-appb-000033
S310、解码端设备选取R行M列标准柯西矩阵中,P个丢失的原包对应的列,P个冗余包对应的行的交叠位置对应的元素,得到P阶解码矩阵。S310. The decoding end device selects the elements corresponding to the columns corresponding to the P lost original packets and the overlapping positions of the rows corresponding to the P redundant packets in the standard Cauchy matrix with R rows and M columns, to obtain a P-order decoding matrix.
其中,S310中描述的P个丢失的原包为待恢复的丢失原包。可以根据实际需求从N个丢失的原包中选取P个丢失的原包,本申请实施例对此不予限定。P个冗余包为进行消原的冗余包。The P lost original packets described in S310 are lost original packets to be recovered. The P lost original packets may be selected from the N lost original packets according to actual requirements, which is not limited in this embodiment of the present application. The P redundant packets are redundant packets to be eliminated.
示例性的,在S306至S308的示例的基础上,假设S309中构建的R行M列标准柯西矩阵如S309中示意的矩阵的形式,选取该R行M列标准柯西矩阵中,P个丢失的原包(待恢复的原包,例如M 1、M 7、M 8)对应的列(第1列、第7列、第8列),P个冗余包(进行消原的冗余包M′ 2、M′ 6、M′ 9)对应的行(第2行、第6行、第9行)的交叠位置对应的元素,得到3阶解码矩阵如下: Exemplarily, on the basis of the examples of S306 to S308, it is assumed that the standard Cauchy matrix with R rows and M columns constructed in S309 is in the form of the matrix shown in S309, and in the standard Cauchy matrix with R rows and M columns, P Columns (columns 1, 7, and 8 ) corresponding to the lost original packets (original packets to be restored, such as M 1 , M 7 , and M 8 ), and P redundant packets (redundancy to be eliminated) The elements corresponding to the overlapping positions of the rows (the 2nd row, the 6th row, and the 9th row) corresponding to the packets M' 2 , M' 6 , M' 9 ) are obtained, and the third-order decoding matrix is obtained as follows:
Figure PCTCN2020105310-appb-000034
Figure PCTCN2020105310-appb-000034
S311、解码端设备将消原结果左乘P阶解码矩阵的逆矩阵,得到P个丢失的原包。S311. The decoding end device multiplies the original elimination result by left-multiplying the inverse matrix of the P-order decoding matrix to obtain P lost original packets.
示例性的,以S306至S310的示例为基础,丢失的原包M 1、M 7、M 8在编码过程中的运算过程可以为: Exemplarily, based on the examples of S306 to S310, the operation process of the lost original packets M 1 , M 7 , and M 8 in the encoding process may be:
Figure PCTCN2020105310-appb-000035
Figure PCTCN2020105310-appb-000035
Figure PCTCN2020105310-appb-000036
Figure PCTCN2020105310-appb-000036
将丢失的原包M 1、M 7、M 8在编码过程中的运算过程进行逆运算,可以将丢失的原包M 1、M 7、M 8表示为3阶解码矩阵的逆矩阵与消原结果的矩阵乘的结果,具体表达式如下: The operation process of the lost original packets M 1 , M 7 , and M 8 in the encoding process is reversed, and the lost original packets M 1 , M 7 , and M 8 can be expressed as the inverse matrix of the third-order decoding matrix and the elimination The result of the matrix multiplication of the result, the specific expression is as follows:
Figure PCTCN2020105310-appb-000037
Figure PCTCN2020105310-appb-000037
这样,就恢复了3个丢失的原包。In this way, the 3 lost original packages are recovered.
在S311中恢复原包的过程中,只有获取P阶解码矩阵的逆矩阵,才能恢复原包,对于获取P阶解码矩阵的逆矩阵的实现,选取标准柯西矩阵作为编解码矩阵,是因为柯西矩阵必然存在逆矩阵,本申请实施例提供下述几种可能的实现方式。In the process of restoring the original packet in S311, the original packet can only be restored by obtaining the inverse matrix of the P-order decoding matrix. For the realization of obtaining the inverse matrix of the P-order decoding matrix, the standard Cauchy matrix is selected as the encoding and decoding matrix, because the Keuchy matrix is selected as the encoding and decoding matrix. The west matrix must have an inverse matrix, and the embodiments of the present application provide the following possible implementation manners.
一种可能的实现方式,对P阶解码矩阵按照数学运算的求逆方式,获取P阶解码矩阵的逆矩阵,该过程本申请实施例不予赘述。A possible implementation manner is to obtain the inverse matrix of the P-order decoding matrix according to the inversion method of the mathematical operation for the P-order decoding matrix, and this process is not repeated in this embodiment of the present application.
示例性的,对于2阶矩阵
Figure PCTCN2020105310-appb-000038
求逆,交换a和d的位置,将负数置于b和c的前面,并除以行列式(ad-bc),则有下式(1):
Exemplarily, for a matrix of order 2
Figure PCTCN2020105310-appb-000038
Inverse, swap the positions of a and d, put the negative numbers in front of b and c, and divide by the determinant (ad-bc), there is the following formula (1):
Figure PCTCN2020105310-appb-000039
Figure PCTCN2020105310-appb-000039
示例性的,对于P阶上(下)三角矩阵求逆(式(2)所示),可以使用矩阵的初等变换,得到式(3)所示的逆矩阵。Exemplarily, for the inversion of a P-order upper (lower) triangular matrix (shown in equation (2)), an elementary transformation of the matrix can be used to obtain the inverse matrix shown in equation (3).
Figure PCTCN2020105310-appb-000040
Figure PCTCN2020105310-appb-000040
初等变换为:
Figure PCTCN2020105310-appb-000041
The elementary transformation is:
Figure PCTCN2020105310-appb-000041
另一种可能的实现方式中,对于非上(下)三角阵的求逆,如果直接初等变换,其计算量非常大,且中间的变换步骤需要记录,当编解码矩阵为伽罗华域的标准柯西 矩阵时,一种简化求逆的方法可以为:可以先将P阶解码矩阵做LDU分解,分解为上下三角矩阵和一个对角矩阵,在分别求L、D、U的逆矩阵之后,将L、D、U的逆矩阵乘积作为P阶解码的逆矩阵。In another possible implementation, for the inversion of non-upper (lower) triangular matrices, if the direct elementary transformation is performed, the amount of computation is very large, and the intermediate transformation steps need to be recorded. When the codec matrix is the Galois field In the case of standard Cauchy matrix, a simplified inversion method can be as follows: First, the P-order decoding matrix can be decomposed into LDU, and decomposed into upper and lower triangular matrices and a diagonal matrix, and after finding the inverse matrices of L, D, and U respectively , the inverse matrix product of L, D, and U is used as the inverse matrix of P-order decoding.
示例性的,LDU分解部分的软硬件代码均可以参考斯坦福大学.托马斯教授的《Pivoting and Backward Stability of Fast Algorithms for Solving Cauchy Linear Equations》,其LDU分解的算法思想是利用矩阵的位移结构指定合适的位移算子来加速高斯消除过程,本申请实施例对此不做赘述。当然,LDU分解也可以参照其他算法,本申请实施例对此不予限定。Exemplarily, the software and hardware codes of the LDU decomposition part can refer to Stanford University. Professor Thomas' "Pivoting and Backward Stability of Fast Algorithms for Solving Cauchy Linear Equations", the algorithm idea of LDU decomposition is to use the displacement structure of the matrix to specify the appropriate A displacement operator is used to speed up the Gaussian elimination process, which is not repeated in this embodiment of the present application. Of course, other algorithms may also be referred to for LDU decomposition, which is not limited in this embodiment of the present application.
一种可能的实现方式中,求L、D、U的逆矩阵的过程可以参照数学运算的求逆方式,本申请实施例不予限定。In a possible implementation manner, the process of finding the inverse matrices of L, D, and U may refer to the inversion method of mathematical operations, which is not limited in the embodiment of the present application.
进一步的,对上述式(2)矩阵求逆得到式(3)矩阵的过程进行演示,对于P阶上(下)三角矩阵求逆,可以表示为:Further, the process of inverting the matrix of the above formula (2) to obtain the matrix of formula (3) is demonstrated. For the inversion of the upper (lower) triangular matrix of the P-order, it can be expressed as:
将P阶左下三角矩阵
Figure PCTCN2020105310-appb-000042
按列拆分为如下P个矩阵:
The lower left triangular matrix of order P
Figure PCTCN2020105310-appb-000042
The columns are split into P matrices as follows:
Figure PCTCN2020105310-appb-000043
Figure PCTCN2020105310-appb-000043
将拆分的P个矩阵,从右向左乘,过程如下式(4):Multiply the split P matrices from right to left, the process is as follows (4):
Figure PCTCN2020105310-appb-000044
Figure PCTCN2020105310-appb-000044
继续向左乘,过程如下式(5):Continue to multiply to the left, the process is as follows (5):
Figure PCTCN2020105310-appb-000045
Figure PCTCN2020105310-appb-000045
将式(5)中的右侧结果
Figure PCTCN2020105310-appb-000046
与式(3)中的右半部分内容
Figure PCTCN2020105310-appb-000047
对比,两者仅仅在加减运算的符号上有区别,在伽罗华域是完全等价的,伽罗华域的加法和减法都是二进制的异或运算。所以,在 伽罗华域,上述演示过程即可作为下三角矩阵求逆方法,可以基于同样的思路计算上三角矩阵的逆矩阵。
Convert the result on the right side of equation (5)
Figure PCTCN2020105310-appb-000046
and the content of the right half of equation (3)
Figure PCTCN2020105310-appb-000047
In contrast, the two only differ in the sign of the addition and subtraction operations, which are completely equivalent in the Galois field. The addition and subtraction of the Galois field are both binary XOR operations. Therefore, in the Galois field, the above demonstration process can be used as the inversion method of the lower triangular matrix, and the inverse matrix of the upper triangular matrix can be calculated based on the same idea.
示例性的,基于上述思路,本申请实施例提供一种伽罗华域获取下三角矩阵的逆矩阵的方法,具体可以包括:确定下三角矩阵中每个元素的逆元素;将下三角矩阵中每个元素的逆元素,按照元素在下三角矩阵中的位置排列,构成下三角矩阵的逆矩阵。Exemplarily, based on the above idea, an embodiment of the present application provides a method for obtaining an inverse matrix of a lower triangular matrix from the Galois field, which may specifically include: determining the inverse element of each element in the lower triangular matrix; The inverse elements of each element are arranged according to the positions of the elements in the lower triangular matrix to form the inverse matrix of the lower triangular matrix.
其中,该下三角矩阵中的对角元素及对角元素下方的首个元素的逆元素为其自身;下三角矩阵中除对角元素及对角元素下方的首个元素之外的其他元素的逆元素按照如下公式得到:Among them, the diagonal element in the lower triangular matrix and the inverse element of the first element below the diagonal element are itself; the elements other than the diagonal element and the first element below the diagonal element in the lower triangular matrix are The inverse element is obtained according to the following formula:
Figure PCTCN2020105310-appb-000048
Figure PCTCN2020105310-appb-000048
其中,L o,s -1为所述下三角矩阵中第o行第s列元素L o,s的逆元素;L o,s i为下三角矩阵中L o,s所在列的对角元素下方第i个元素的逆元素,L o,s i′为下三角矩阵中L o,s右侧第i个元素的逆元素;A为L o,s在列方向或者行方向与对角元素间隔的元素个数。 Wherein, L o,s -1 is the inverse element of the element L o,s in the o-th row and the s-th column in the lower triangular matrix; L o,s i is the diagonal element of the column where L o,s is located in the lower triangular matrix The inverse element of the i-th element below, L o,s i′ is the inverse element of the i-th element on the right side of L o,s in the lower triangular matrix; A is L o,s in the column direction or row direction and the diagonal element The number of elements in the interval.
示例性的,将下三角矩阵的求逆过程通过代码表达,对应矩阵的行和列上的元素从右向左一次解析,将矩阵记做L,行和列分别记做i和j,对角元素及其下方的首个元素保持不变,从对角元素下方第二个元素开始依次做乘积累加,推导出如下表达式:Exemplarily, the inversion process of the lower triangular matrix is expressed by code, the elements on the rows and columns of the corresponding matrix are parsed from right to left, and the matrix is denoted as L, and the rows and columns are denoted as i and j respectively, and the diagonal The element and the first element below it remain unchanged. From the second element below the diagonal element, the multiplication and accumulation are performed in turn, and the following expression is derived:
L[i][i]==1;(即对角线元素保持不变);L[i][i]==1; (that is, the diagonal elements remain unchanged);
L[i+1][i]==L[i+1][i];(对角元素下方的首个元素保持不变);L[i+1][i]==L[i+1][i]; (the first element below the diagonal element remains unchanged);
L[j][i]==L[j-1][i]*L[j][i+1]+L[j][i];L[j][i]==L[j-1][i]*L[j][i+1]+L[j][i];
j==R(>=3);i==R-2时,j==R时,L[j][i]==L[j-1][i]*L[j][i+1]+L[j][i];j==R(>=3); when i==R-2, when j==R, L[j][i]==L[j-1][i]*L[j][i+ 1]+L[j][i];
i==R-3时,j==R-1时,L[j][i]==L[j-1][i]*L[j][i+1]+L[j][i]。When i==R-3, when j==R-1, L[j][i]==L[j-1][i]*L[j][i+1]+L[j][ i].
示例性的,下三角矩阵求逆过程的伪码表达式可以为:Exemplarily, the pseudocode expression of the lower triangular matrix inversion process can be:
Figure PCTCN2020105310-appb-000049
Figure PCTCN2020105310-appb-000049
例如,基于上述伪码表达式,当i=2,j=4,j++=5,k=3,k++=4时,L[3][2]*L[4][3]==>L[3][2]*L[5][3]+L[4][2]*L[5][4]。For example, based on the above pseudo-code expression, when i=2, j=4, j++=5, k=3, k++=4, L[3][2]*L[4][3]==>L [3][2]*L[5][3]+L[4][2]*L[5][4].
例如,对于下三角矩阵
Figure PCTCN2020105310-appb-000050
该下三角矩阵的逆矩阵为该下三角矩阵中元素的逆元素构成的矩阵:该下三角矩阵的对角元素1的逆元素为其自身,保持不变,对角元素下方的首个元素g、a、d、f的逆元素也为其自身,保持不变。下三角矩阵中除对角元素及对角元素下方的首个元素之外的元素的逆元素如下:
For example, for a lower triangular matrix
Figure PCTCN2020105310-appb-000050
The inverse matrix of the lower triangular matrix is a matrix formed by the inverse elements of the elements in the lower triangular matrix: the inverse element of the diagonal element 1 of the lower triangular matrix is itself, which remains unchanged, and the first element g below the diagonal element The inverse elements of , a, d, and f are also themselves and remain unchanged. The inverse elements of the elements in the lower triangular matrix except the diagonal element and the first element below the diagonal element are as follows:
元素h为第o=3行第s=1列元素L 3,1,其在列方向或者行方向与对角元素间隔1个元素,L 3,1所在列的对角元素下方的第1个元素的逆元素为g,L 3,1右侧的第1个元素a 的逆元素为a,即元素h的逆元素H=ga+h。 The element h is the element L 3,1 of the o=3 row and the s=1 column, which is separated from the diagonal element by 1 element in the column direction or row direction, and the first element below the diagonal element of the column where L 3,1 is located. The inverse element of the element is g, and the inverse element of the first element a on the right side of L 3,1 is a, that is, the inverse element H=ga+h of the element h.
元素b为第o=4行第s=2列元素L 4,2,其在列方向或者行方向与对角元素间隔1个元素,L 4,2所在列的对角元素下方的第1个元素的逆元素为a,L 4,2右侧的第1个元素d的逆元素为d,即元素b的逆元素S=ad+b。 The element b is the element L 4,2 in the o=4th row and the s=2nd column, which is separated by 1 element from the diagonal element in the column direction or row direction, and the first element below the diagonal element of the column where L 4,2 is located The inverse element of the element is a, and the inverse element of the first element d on the right side of L 4,2 is d, that is, the inverse element of element b is S=ad+b.
元素e为第o=5行第s=3列元素L 5,3,其在列方向或者行方向与对角元素间隔1个元素,L 5,3所在列的对角元素下方的第1个元素的逆元素为d,L 5,3右侧的第1个元素f的逆元素为f,即元素e的逆元素K=df+e。 The element e is the element L 5,3 in the o=5th row and the s=3rd column, which is separated from the diagonal element by 1 element in the column direction or row direction, and the first element below the diagonal element of the column where L 5,3 is located. The inverse element of the element is d, and the inverse element of the first element f on the right side of L 5,3 is f, that is, the inverse element K=df+e of the element e.
元素i为第o=4行第s=1列元素L 4,1,其在列方向或者行方向与对角元素间隔2个元素,L 4,1所在列的对角元素下方的第1个元素的逆元素为g,L 4,1右侧的第1个元素b的逆元素为S,L 4,1所在列的对角元素下方的第2个元素的逆元素为H,L 4,1右侧的第2个元素d的逆元素为d,即元素i的逆元素Z=gS+Hd+i。 The element i is the element L 4,1 of the o-th row and the s=1 column, which is separated from the diagonal element by 2 elements in the column direction or row direction, and the first element below the diagonal element of the column where L 4,1 is located. The inverse element of the element is g, the inverse element of the first element b to the right of L 4,1 is S, the inverse element of the second element below the diagonal element of the column where L 4,1 is located is H, L 4, The inverse element of the second element d to the right of 1 is d, that is, the inverse element Z=gS+Hd+i of element i.
元素c为第o=5行第s=2列元素L 5,2,其在列方向或者行方向与对角元素间隔2个元素,L 5,2所在列的对角元素下方的第1个元素的逆元素为a,L 5,2右侧的第1个元素e的逆元素为K,L 5,2所在列的对角元素下方的第2个元素的逆元素为S,L 5,2右侧的第2个元素f的逆元素为f,即元素c的逆元素Y=aK+Sf+c。 The element c is the element L 5,2 in the o=5th row and the s=2 column, which is separated from the diagonal element by 2 elements in the column direction or row direction, and the first element below the diagonal element of the column where L 5,2 is located The inverse element of the element is a, the inverse element of the first element e on the right side of L 5,2 is K, the inverse element of the second element below the diagonal element of the column where L 5,2 is located is S, L 5, The inverse element of the second element f to the right of 2 is f, that is, the inverse element of element c Y=aK+Sf+c.
元素j为第o=5行第s=1列元素L 5,1,其在列方向或者行方向与对角元素间隔3个元素,L 5,1所在列的对角元素下方的第1个元素的逆元素为g,L 5,1右侧的第1个元素c的逆元素为Y,L 5,1所在列的对角元素下方的第2个元素的逆元素为H,L 5,1右侧的第2个元素e的逆元素为K,L 5,1所在列的对角元素下方的第3个元素的逆元素为Z,L 5,1右侧的第3个元素f的逆元素为f,即元素j的逆元素P=gY+HK++Zf+j。 Element j is the element L 5,1 in the o=5th row and the s=1st column, which is separated from the diagonal element by 3 elements in the column direction or row direction, and the first element below the diagonal element in the column where L 5,1 is located The inverse element of the element is g, the inverse element of the first element c to the right of L 5,1 is Y, the inverse element of the second element below the diagonal element of the column where L 5,1 is located is H, L 5, The inverse element of the second element e on the right side of 1 is K, the inverse element of the third element below the diagonal element of the column where L 5,1 is located is Z, and the inverse element of the third element f on the right side of L 5,1 The inverse element is f, that is, the inverse element P=gY+HK++Zf+j of element j.
因此,该下三角矩阵的逆矩阵表达为下式:Therefore, the inverse of this lower triangular matrix is expressed as:
Figure PCTCN2020105310-appb-000051
Figure PCTCN2020105310-appb-000051
示例性的,基于上述思路,本申请实施例提供一种伽罗华域获取上三角矩阵的逆矩阵的方法,具体可以包括:确定上三角矩阵中每个元素的逆元素;将上三角矩阵中每个元素的逆元素,按照元素在上三角矩阵中的位置排列,构成上三角矩阵的逆矩阵。Exemplarily, based on the above idea, an embodiment of the present application provides a method for obtaining an inverse matrix of an upper triangular matrix from the Galois field, which may specifically include: determining the inverse element of each element in the upper triangular matrix; The inverse elements of each element are arranged according to the positions of the elements in the upper triangular matrix to form the inverse matrix of the upper triangular matrix.
其中,上三角矩阵中的对角元素及对角元素上方的首个元素的逆元素为其自身;上三角矩阵中除对角元素及对角元素上方的首个元素之外的其他元素的逆元素按照如下公式得到:Among them, the inverse element of the diagonal element in the upper triangular matrix and the first element above the diagonal element is itself; the inverse of other elements except the diagonal element and the first element above the diagonal element in the upper triangular matrix The elements are obtained according to the following formula:
Figure PCTCN2020105310-appb-000052
Figure PCTCN2020105310-appb-000052
其中,L p,q -1为所述上三角矩阵中第p行第q列元素L p,q的逆元素;L p,q i为上三角矩阵中L p,q所在列的对角元素上方第i个元素的逆元素,L p,q i′为上三角矩阵中L p,q左侧第i个元素的逆元素;B为L p,q在列方向或者行方向与对角元素间隔的元素个数。 Wherein, L p,q -1 is the inverse element of the element L p,q in the p-th row and the q-th column in the upper triangular matrix; L p,q i is the diagonal element of the column where L p,q is located in the upper triangular matrix The inverse element of the i-th element above, L p, q i' is the inverse element of the i-th element on the left side of L p, q in the upper triangular matrix; B is L p, q in the column direction or row direction and the diagonal element The number of elements in the interval.
示例性的,将上三角矩阵的求逆过程通过代码表达,对应矩阵的行和列上的元素从右向左一次解析,将矩阵记做L,行和列分别记做i和j,对角元素及其上方的首个 元素保持不变,从对角元素上方第二个元素开始依次做乘积累加,上三角矩阵求逆过程的伪码表达式可以为:Exemplarily, the inversion process of the upper triangular matrix is expressed by code, and the elements on the rows and columns of the corresponding matrix are parsed from right to left once, and the matrix is denoted as L, and the rows and columns are denoted as i and j respectively, and the diagonal The element and the first element above it remain unchanged. From the second element above the diagonal element, the multiplication and accumulation are performed in turn. The pseudocode expression of the inversion process of the upper triangular matrix can be as follows:
Figure PCTCN2020105310-appb-000053
Figure PCTCN2020105310-appb-000053
例如,对上三角矩阵
Figure PCTCN2020105310-appb-000054
该上三角矩阵的逆矩阵为该上三角矩阵中元素的逆元素构成的矩阵:该上三角矩阵的对角元素1的逆元素为其自身,保持不变,对角元素上方的首个元素g、a、d、f的逆元素也为其自身,保持不变。上三角矩阵中除对角元素及对角元素上方的首个元素之外的元素的逆元素如下:
For example, for an upper triangular matrix
Figure PCTCN2020105310-appb-000054
The inverse matrix of the upper triangular matrix is a matrix formed by the inverse elements of the elements in the upper triangular matrix: the inverse element of the diagonal element 1 of the upper triangular matrix is itself, which remains unchanged, and the first element g above the diagonal element The inverse elements of , a, d, and f are also themselves and remain unchanged. The inverse elements of the elements in the upper triangular matrix except the diagonal elements and the first element above the diagonal elements are as follows:
元素h为第p=3行第q=5列元素L 3,5,其在列方向或者行方向与对角元素间隔1个元素,L 3,5所在列的对角元素上方的第1个元素的逆元素为g,L 3,5左侧的第1个元素a的逆元素为a,即元素h的逆元素H=ga+h。 The element h is the element L 3,5 in the p=3 row and the q=5 column, which is separated from the diagonal element by 1 element in the column direction or row direction, and the first element above the diagonal element in the column where L 3,5 is located. The inverse element of the element is g, and the inverse element of the first element a to the left of L 3,5 is a, that is, the inverse element H=ga+h of the element h.
元素b为第p=2行第q=4列元素L 2,4,其在列方向或者行方向与对角元素间隔1个元素,L 2,4所在列的对角元素上方的第1个元素的逆元素为a,L 2,4左侧的第1个元素d的逆元素为d,即元素b的逆元素S=ad+b。 The element b is the element L 2,4 of the p=2th row and the q=4th column, which is separated from the diagonal element by 1 element in the column direction or row direction, and the first element above the diagonal element of the column where L 2,4 is located. The inverse element of the element is a, and the inverse element of the first element d to the left of L 2,4 is d, that is, the inverse element of element b is S=ad+b.
元素e为第p=1行第s=3列元素L 1,3,其在列方向或者行方向与对角元素间隔1个元素,L 1,3所在列的对角元素上方的第1个元素的逆元素为d,L 1,3左侧的第1个元素f的逆元素为f,即元素e的逆元素K=df+e。 The element e is the element L 1,3 in the p=1th row and the s=3rd column, which is separated from the diagonal element by 1 element in the column direction or row direction, and the first element above the diagonal element of the column where L 1,3 is located. The inverse element of the element is d, and the inverse element of the first element f to the left of L 1,3 is f, that is, the inverse element K=df+e of the element e.
元素i为第p=2行第q=5列元素L 2,5,其在列方向或者行方向与对角元素间隔2个元素,L 2,5所在列的对角元素上方的第1个元素的逆元素为g,L 2,5左侧的第1个元素b的逆元素为S,L 2,5所在列的对角元素上方的第2个元素的逆元素为H,L 2,5左侧的第2个元素d的逆元素为d,即元素i的逆元素Z=gS+Hd+i。 The element i is the element L 2,5 of the p=2th row and the q=5th column, which is separated from the diagonal element by 2 elements in the column direction or row direction, and the first element above the diagonal element of the column where L 2,5 is located The inverse element of the element is g, the inverse element of the first element b to the left of L 2,5 is S, and the inverse element of the second element above the diagonal element of the column where L 2, 5 is located is H, L 2, The inverse element of the second element d to the left of 5 is d, that is, the inverse element Z=gS+Hd+i of element i.
元素c为第p=1行第q=4列元素L 1,4,其在列方向或者行方向与对角元素间隔2个元素,L 1,4所在列的对角元素上方的第1个元素的逆元素为a,L 1,4左侧的第1个元素e的逆元素为K,L 1,4所在列的对角元素上方的第2个元素的逆元素为S,L 1,4左侧的第2个元素f的逆元素为f,即元素c的逆元素Y=aK+Sf+c。 The element c is the element L 1,4 of the p=1th row and the q=4th column, which is separated from the diagonal element by 2 elements in the column direction or row direction, and the first element above the diagonal element of the column where L 1,4 is located. The inverse element of the element is a, the inverse element of the first element e to the left of L 1,4 is K, and the inverse element of the second element above the diagonal element of the column where L 1,4 is located is S, L 1, The inverse element of the second element f to the left of 4 is f, that is, the inverse element of element c Y=aK+Sf+c.
元素j为第p=1行第q=5列元素L 1,5,其在列方向或者行方向与对角元素间隔3个元素,L 1,5所在列的对角元素上方的第1个元素的逆元素为g,L 1,5左侧的第1个元素c的逆元素为Y,L 1,5所在列的对角元素上方的第2个元素的逆元素为H,L 1,5左侧的第2个元素e的逆元素为K,L 1,5所在列的对角元素上方的第3个元素的逆元素为Z,L 1,5左侧的第3个元素f的逆元素为f,即元素j的逆元素P=gY+HK++Zf+j。 Element j is the element L 1,5 in the p=1th row and the q=5th column, which is separated from the diagonal element by 3 elements in the column direction or row direction, and the first element above the diagonal element in the column where L 1,5 is located The inverse element of the element is g, the inverse element of the first element c to the left of L 1,5 is Y, the inverse element of the second element above the diagonal element of the column where L 1,5 is located is H, L 1, The inverse element of the 2nd element e to the left of 5 is K, the inverse element of the 3rd element above the diagonal element of the column where L 1,5 is located is Z, and the inverse element of the 3rd element f to the left of L 1,5 The inverse element is f, that is, the inverse element P=gY+HK++Zf+j of element j.
因此,该上三角矩阵的逆矩阵表达为下式:Therefore, the inverse of this upper triangular matrix is expressed as:
Figure PCTCN2020105310-appb-000055
Figure PCTCN2020105310-appb-000055
需要说明的是,通过上述上下三角矩阵求逆的过程可知,该求逆算法的复杂度主要集中在上述推导的P元素位置,即L下三角矩阵的第一列最后一行(左下角)和U上三角矩阵的第一行最后一列(右上角),其余元素的计算复杂度依次递减。如此一来,对比P阶矩阵的连乘的资源开销和计算延迟有很明显的优化效果。It should be noted that, through the process of inversion of the upper and lower triangular matrices above, it can be seen that the complexity of the inversion algorithm is mainly concentrated in the position of the P element derived above, that is, the last row of the first column of the lower triangular matrix of L (lower left corner) and U The first row and last column (upper right corner) of the upper triangular matrix, and the computational complexity of the remaining elements decreases in turn. In this way, there is an obvious optimization effect comparing the resource overhead and calculation delay of the continuous multiplication of the P-order matrix.
需要说明的是,本申请实施例提供的编解码方法包括的步骤的执行顺序,可以根据实际需求配置,本申请实施例的附图仅示意了可能的执行顺序,并不构成限定。It should be noted that, the execution order of the steps included in the encoding and decoding method provided by the embodiments of the present application may be configured according to actual requirements.
通过本申请实施例提供的编解码步骤,由于解码矩阵为标准柯西矩阵,构建简单,降低了编解码的负担。另外,由于解码矩阵为标准柯西矩阵,解码端可以按照码流中数据包的接收顺序及包标识可以直接确定元素构建解码矩阵,即使原包及冗余包乱序也无需重新排序,大大降低了资源开销及计算时延。Through the encoding and decoding steps provided by the embodiments of the present application, since the decoding matrix is a standard Cauchy matrix, the construction is simple and the burden of encoding and decoding is reduced. In addition, since the decoding matrix is a standard Cauchy matrix, the decoding end can directly determine the elements to construct the decoding matrix according to the receiving order of the data packets in the code stream and the packet identification. resource overhead and computational delay.
基于本申请提供的方案,通过实验对采用本申请方案的FEC硬件加速器的性能分三个维度进行了测试,编码参数中携带的三个参数M、R、L分别表示原包个数,冗余包个数、编码长度,编码双倍速率同步动态随机存储器(double data rate,DDR)延时200纳秒(nano second,ns),有3%的1000ns总线大延时。在500兆赫兹时钟频率下的性能数据,基于典型场景M=78,R=22,L=800时,图4至图6分别是固定其中2个参数,改变另一个参数的性能示意。Based on the solution provided by the present application, the performance of the FEC hardware accelerator using the solution of the present application is tested in three dimensions through experiments. The three parameters M, R, and L carried in the encoding parameters represent the number of original packets, and the redundancy The number of packets, the length of the code, and the double data rate (DDR) delay of the code is 200 nanoseconds (nano second, ns), and there is a 3% bus delay of 1000ns. The performance data at a clock frequency of 500 MHz is based on a typical scenario of M=78, R=22, and L=800. Figures 4 to 6 are respectively the performance diagrams of fixing two of the parameters and changing the other parameter.
FEC固定原包数M,包长L,变化冗余包个数R,性能数据随冗余包个数R变化的曲线如图4所示。FEC fixes the original number of packets M, the packet length L, and changes the number of redundant packets R. The curve of performance data changing with the number of redundant packets R is shown in Figure 4.
FEC固定冗余包个数R,包长L,变化原包数M,性能数据随原包数M变化的曲线如图5所示。FEC fixes the number of redundant packets R, the packet length L, changes the original number of packets M, and the curve of the performance data changing with the original number of packets M is shown in Figure 5.
FEC固定原包数M,冗余包个数R,变化包长L,性能数据随包长L变化的曲线如图6所示。FEC fixes the number of original packets M, the number of redundant packets R, and changes the packet length L. The curve of the performance data changing with the packet length L is shown in Figure 6.
上述主要从编码设备、解码设备的工作原理角度对本申请实施例提供的方案进行了介绍。可以理解的是,上述编码设备、解码设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。将编码设备中用于执行上述方法实施例中功能的单元称为编码装置,将解码设备中用于执行上述方法实施例中功能的单元称为解码装置。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solutions provided by the embodiments of the present application from the perspective of the working principles of the encoding device and the decoding device. It can be understood that, in order to realize the above functions, the above-mentioned encoding device and decoding device include corresponding hardware structures and/or software modules for executing each function. The unit in the encoding device for performing the functions in the above method embodiments is referred to as an encoding device, and the unit in the decoding device for performing the functions in the above method embodiments is referred to as a decoding device. Those skilled in the art should easily realize that the present application can be implemented in hardware or a combination of hardware and computer software with the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对执行本申请提供的编解码方法的装置进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也 可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment of the present application, functional modules may be divided for the apparatus for executing the encoding and decoding method provided by the present application according to the foregoing method examples. For example, each functional module may be divided according to each function, or two or more functions may be integrated in in a processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
在采用对应各个功能划分各个功能模块的情况下,图7示出了上述实施例中所涉及的解码设备中部署的执行本申请提供的解码方法的解码装置70的一种可能的结构示意图。该解码装置70可以为功能模块或者芯片。如图7所示,解码装置70可以包括:获取单元701、确定单元702、消原单元703、构建单元704、选取单元705、处理单元706。其中,获取单元701用于执行图3中的过程S306;确定单元702用于执行图3中的过程S307;消原单元703用于执行图3中的过程S308;构建单元704用于执行图3中的过程S309;选取单元705用于执行图3中的过程S310;处理单元706用于执行图3中的过程S311。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。In the case where each functional module is divided according to each function, FIG. 7 shows a possible schematic structural diagram of a decoding apparatus 70 deployed in the decoding device involved in the above embodiment and executing the decoding method provided by the present application. The decoding device 70 may be a functional module or a chip. As shown in FIG. 7 , the decoding apparatus 70 may include: an acquisition unit 701 , a determination unit 702 , a cancellation unit 703 , a construction unit 704 , a selection unit 705 , and a processing unit 706 . Wherein, the obtaining unit 701 is used for executing the process S306 in FIG. 3; the determining unit 702 is used for executing the process S307 in FIG. 3; the eliminating unit 703 is used for executing the process S308 in FIG. 3; the constructing unit 704 is used for executing the process S308 in FIG. 3 The selection unit 705 is used for executing the process S310 in FIG. 3 ; the processing unit 706 is used for executing the process S311 in FIG. 3 . Wherein, all relevant contents of the steps involved in the above method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.
在采用集成的单元的情况下,图8示出了上述实施例中所涉及的解码设备的一种可能的结构示意图。如图8所示,解码设备80可以包括:处理模块801、通信模块802。处理模块801用于对解码设备80的动作进行控制管理,通信模块802用于与其他设备通信。例如,处理模块801用于执行图3中的过程S306至S311中任一过程。解码设备80还可以包括存储模块803,用于存储解码设备80的程序代码和数据。In the case of using an integrated unit, FIG. 8 shows a possible schematic structural diagram of the decoding device involved in the above embodiment. As shown in FIG. 8 , the decoding device 80 may include: a processing module 801 and a communication module 802 . The processing module 801 is used to control and manage the actions of the decoding device 80, and the communication module 802 is used to communicate with other devices. For example, the processing module 801 is configured to execute any one of the processes S306 to S311 in FIG. 3 . The decoding device 80 may further include a storage module 803 for storing program codes and data of the decoding device 80 .
其中,处理模块801可以为图2所示的通信装置20的实体结构中的处理器201,可以是处理器或控制器。例如可以是CPU,通用处理器,DSP,ASIC,FPGA或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理模块801也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信模块802可以为图2所示的通信装置20的实体结构中的收发器203,通信模块802可以是通信端口,或者可以是收发器、收发电路或通信接口等。或者,上述通信接口可以通过上述具有收发功能的元件,实现与其他设备的通信。上述具有收发功能的元件可以由天线和/或射频装置实现。存储模块803可以是图2所示的通信装置20的实体结构中的存储器202。The processing module 801 may be the processor 201 in the physical structure of the communication apparatus 20 shown in FIG. 2 , and may be a processor or a controller. For example, it may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure. The processing module 801 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication module 802 may be the transceiver 203 in the physical structure of the communication apparatus 20 shown in FIG. 2 , and the communication module 802 may be a communication port, or may be a transceiver, a transceiver circuit, or a communication interface. Alternatively, the above-mentioned communication interface may implement communication with other devices through the above-mentioned components with a transceiving function. The above-mentioned components with transceiving functions may be implemented by antennas and/or radio frequency devices. The storage module 803 may be the memory 202 in the physical structure of the communication device 20 shown in FIG. 2 .
当处理模块801为处理器,通信模块802为收发器,存储模块803为存储器时,本申请实施例图8所涉及的解码设备80可以为图2所示的通信装置20。When the processing module 801 is a processor, the communication module 802 is a transceiver, and the storage module 803 is a memory, the decoding device 80 involved in FIG. 8 in the embodiment of the present application may be the communication device 20 shown in FIG. 2 .
如前述,本申请实施例提供的解码装置70或解码设备80可以用于实施上述本申请各实施例实现的方法中相应的功能,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请各实施例。As described above, the decoding apparatus 70 or the decoding device 80 provided by the embodiments of the present application may be used to implement the corresponding functions in the methods implemented by the above embodiments of the present application. For the convenience of description, only the parts related to the embodiments of the present application are shown. , if the specific technical details are not disclosed, please refer to the embodiments of the present application.
在采用对应各个功能划分各个功能模块的情况下,图9示出了上述实施例中所涉及的编码设备中部署的执行本申请提供的编码方法的编码装置90的一种可能的结构示意图。该编码装置90可以为功能模块或者芯片。如图9所示,编码装置90可以包括:获取单元901、构建单元902、编码单元903、发送单元904。其中,获取单元901用于执行图3中的过程S301或S302;构建单元902用于执行图3中的过程S303;编码单元903用于执行图3中的过程S304;发送单元904用于执行图3中的过程S305。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。In the case where each functional module is divided according to each function, FIG. 9 shows a possible schematic structural diagram of the encoding apparatus 90 deployed in the encoding device involved in the above embodiment and executing the encoding method provided by the present application. The encoding device 90 may be a functional module or a chip. As shown in FIG. 9 , the encoding apparatus 90 may include: an obtaining unit 901 , a constructing unit 902 , an encoding unit 903 , and a sending unit 904 . Wherein, the obtaining unit 901 is used for executing the process S301 or S302 in FIG. 3; the constructing unit 902 is used for executing the process S303 in FIG. 3; the encoding unit 903 is used for executing the process S304 in FIG. Process S305 in 3. Wherein, all relevant contents of the steps involved in the above method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.
在采用集成的单元的情况下,图10示出了上述实施例中所涉及的编码设备的一种可能的结构示意图。如图10所示,编码设备100可以包括:处理模块1001、通信模块1002。处理模块1001用于对编码设备100的动作进行控制管理,通信模块1002用于与其他设备通信。例如,处理模块1001用于执行图3中的过程S301至S304中任一过程,处理模块1001通过通信模块1002执行图3中的过程S305。编码设备100还可以包括存储模块1003,用于存储编码设备100的程序代码和数据。In the case of using an integrated unit, FIG. 10 shows a possible schematic structural diagram of the encoding device involved in the above embodiment. As shown in FIG. 10 , the encoding device 100 may include: a processing module 1001 and a communication module 1002 . The processing module 1001 is used to control and manage the actions of the encoding device 100, and the communication module 1002 is used to communicate with other devices. For example, the processing module 1001 is configured to execute any one of the processes S301 to S304 in FIG. 3 , and the processing module 1001 executes the process S305 in FIG. 3 through the communication module 1002 . The encoding device 100 may further include a storage module 1003 for storing program codes and data of the encoding device 100 .
其中,处理模块1001可以为图2所示的通信装置20的实体结构中的处理器201,可以是处理器或控制器。例如可以是CPU,通用处理器,DSP,ASIC,FPGA或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理模块1001也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信模块1002可以为图2所示的通信装置20的实体结构中的收发器203,通信模块1002可以是通信端口,或者可以是收发器、收发电路或通信接口等。或者,上述通信接口可以通过上述具有收发功能的元件,实现与其他设备的通信。上述具有收发功能的元件可以由天线和/或射频装置实现。存储模块1003可以是图2所示的通信装置20的实体结构中的存储器202。The processing module 1001 may be the processor 201 in the physical structure of the communication apparatus 20 shown in FIG. 2 , and may be a processor or a controller. For example, it may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure. The processing module 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication module 1002 may be the transceiver 203 in the physical structure of the communication apparatus 20 shown in FIG. 2 , and the communication module 1002 may be a communication port, or may be a transceiver, a transceiver circuit, or a communication interface. Alternatively, the above-mentioned communication interface may implement communication with other devices through the above-mentioned components with a transceiving function. The above-mentioned components with transceiving functions may be implemented by antennas and/or radio frequency devices. The storage module 1003 may be the memory 202 in the physical structure of the communication device 20 shown in FIG. 2 .
当处理模块1001为处理器,通信模块1002为收发器,存储模块1003为存储器时,本申请实施例图10所涉及的编码设备100可以为图2所示的通信装置20。When the processing module 1001 is a processor, the communication module 1002 is a transceiver, and the storage module 1003 is a memory, the encoding device 100 involved in FIG. 10 in the embodiment of the present application may be the communication apparatus 20 shown in FIG. 2 .
如前述,本申请实施例提供的编码装置90或编码设备100可以用于实施上述本申请各实施例实现的方法中相应的功能,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请各实施例。As mentioned above, the encoding apparatus 90 or the encoding device 100 provided by the embodiments of the present application may be used to implement the corresponding functions in the methods implemented by the above embodiments of the present application. For the convenience of description, only the parts related to the embodiments of the present application are shown. , if the specific technical details are not disclosed, please refer to the embodiments of the present application.
作为本实施例的另一种形式,提供一种计算机可读存储介质,其上存储有指令,该指令被执行时执行上述方法实施例中的编解码方法。As another form of this embodiment, a computer-readable storage medium is provided, on which instructions are stored, and when the instructions are executed, the encoding and decoding methods in the foregoing method embodiments are executed.
作为本实施例的另一种形式,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得该计算机执行时执行上述方法实施例中的编解码方法。As another form of this embodiment, a computer program product containing instructions is provided, when the computer program product runs on a computer, the computer executes the encoding and decoding methods in the above method embodiments when executed.
本申请实施例再提供一种芯片系统,该芯片系统包括处理器,用于实现本发明实施例的技术方法。在一种可能的设计中,该芯片系统还包括存储器,用于保存本发明实施例必要的程序指令和/或数据。在一种可能的设计中,该芯片系统还包括存储器,用于处理器调用存储器中存储的应用程序代码。该芯片系统,可以由一个或多个芯片构成,也可以包含芯片和其他分立器件,本申请实施例对此不作具体限定。An embodiment of the present application further provides a chip system, where the chip system includes a processor for implementing the technical method of the embodiment of the present invention. In a possible design, the chip system further includes a memory for storing necessary program instructions and/or data in the embodiments of the present invention. In one possible design, the system-on-a-chip also includes memory for the processor to invoke the application code stored in the memory. The chip system may be composed of one or more chips, and may also include chips and other discrete devices, which are not specifically limited in this embodiment of the present application.
结合本申请公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM、闪存、ROM、可擦除可编程只读存储器(erasable programmable ROM,EPROM)、电可擦可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于核心网 接口设备中。当然,处理器和存储介质也可以作为分立组件存在于核心网接口设备中。或者,存储器可以与处理器耦合,例如存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。存储器可以用于存储执行本申请实施例提供的技术方案的应用程序代码,并由处理器来控制执行。处理器用于执行存储器中存储的应用程序代码,从而实现本申请实施例提供的技术方案。The steps of the methods or algorithms described in conjunction with the disclosure of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions. Software instructions can be composed of corresponding software modules, and software modules can be stored in RAM, flash memory, ROM, erasable programmable read-only memory (erasable programmable read-only memory, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disk, removable hard disk, compact disk read only (CD-ROM), or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium may reside in an ASIC. Alternatively, the ASIC may be located in the core network interface device. Of course, the processor and the storage medium may also exist in the core network interface device as discrete components. Alternatively, the memory may be coupled to the processor, eg, the memory may exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor. The memory may be used to store application code for executing the technical solutions provided by the embodiments of the present application, and the execution is controlled by the processor. The processor is configured to execute the application program code stored in the memory, thereby implementing the technical solutions provided by the embodiments of the present application.
结合本申请公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM、闪存、ROM、可擦除可编程只读存储器(erasable programmable ROM,EPROM)、电可擦可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于核心网接口设备中。当然,处理器和存储介质也可以作为分立组件存在于核心网接口设备中。或者,存储器可以与处理器耦合,例如存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。存储器可以用于存储执行本申请实施例提供的技术方案的应用程序代码,并由处理器来控制执行。处理器用于执行存储器中存储的应用程序代码,从而实现本申请实施例提供的技术方案。The steps of the methods or algorithms described in conjunction with the disclosure of the present application may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions. Software instructions can be composed of corresponding software modules, and software modules can be stored in RAM, flash memory, ROM, erasable programmable read-only memory (erasable programmable read-only memory, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disk, removable hard disk, compact disk read only (CD-ROM), or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium may reside in an ASIC. Alternatively, the ASIC may be located in the core network interface device. Of course, the processor and the storage medium may also exist in the core network interface device as discrete components. Alternatively, the memory may be coupled to the processor, eg, the memory may exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor. The memory may be used to store application code for executing the technical solutions provided by the embodiments of the present application, and the execution is controlled by the processor. The processor is configured to execute the application program code stored in the memory, thereby implementing the technical solutions provided by the embodiments of the present application.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated as required. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个 设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the protection scope of the present application. . Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (28)

  1. 一种解码方法,其特征在于,所述方法包括:A decoding method, characterized in that the method comprises:
    获取码流,所述码流包括X个原包及Q个冗余包;Obtaining a code stream, the code stream includes X original packets and Q redundant packets;
    根据所述码流编码时的原包个数M、冗余包个数R及包长L,对所述码流解析获取所述X个原包及所述Q个冗余包,确定丢失的原包的个数N,所述N等于所述M减所述X;所述Q小于或等于所述R;According to the number M of original packets, the number R of redundant packets and the packet length L during encoding of the code stream, analyze the code stream to obtain the X original packets and the Q redundant packets, and determine the missing packets. The number N of the original packets, the N is equal to the M minus the X; the Q is less than or equal to the R;
    对所述Q个冗余包中的P个冗余包进行消原得到消原结果;其中,所述P个冗余包为满足条件的冗余包;所述P为所述N与所述Q中的较小值;Eliminate the P redundant packets in the Q redundant packets to obtain a cancellation result; wherein, the P redundant packets are redundant packets that meet the conditions; the P is the N and the the smaller value in Q;
    根据所述码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵;其中,所述包标识用于指示编码时的包顺序;According to the packet receiving sequence and the packet identification in the code stream, construct a standard Cauchy matrix with R rows and M columns; wherein, the packet identification is used to indicate the packet sequence during encoding;
    选取所述标准柯西矩阵中,P个丢失的原包对应的列,所述P个冗余包对应的行的交叠位置对应的元素,得到P阶解码矩阵;In the standard Cauchy matrix, the columns corresponding to the P lost original packets and the elements corresponding to the overlapping positions of the rows corresponding to the P redundant packets are selected to obtain a P-order decoding matrix;
    将所述消原结果左乘所述P阶解码矩阵的逆矩阵,得到所述P个丢失的原包。Left-multiplying the cancellation result by the inverse matrix of the P-order decoding matrix to obtain the P lost original packets.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵,包括:The method according to claim 1, wherein, constructing a standard Cauchy matrix with R rows and M columns according to the packet receiving order and packet identifiers in the code stream, comprising:
    根据所述码流的接收包顺序中第f个接收的原包的包标识indxf、所述码流的接收包顺序中第g个接收的冗余包的包标识indxg,以及标准柯西矩阵元素集合X及Y,确定所述标准柯西矩阵中第f行第g列元素
    Figure PCTCN2020105310-appb-100001
    According to the packet identifier indxf of the f-th received original packet in the received packet sequence of the code stream, the packet identifier indxg of the g-th received redundant packet in the received packet sequence of the code stream, and the standard Cauchy matrix elements Set X and Y, determine the element in the fth row and the gth column of the standard Cauchy matrix
    Figure PCTCN2020105310-appb-100001
    其中,所述X包括x i,所述Y包括y j,所述i大于或等于1,且小于或等于所述R,所述j大于或等于1,且小于或等于所述M;所述x i与所述y j为相互独立的元素;所述f大于或等于1,且小于或等于所述R,所述g大于或等于1,且小于或等于所述M。 wherein, the X includes x i , the Y includes y j , the i is greater than or equal to 1 and less than or equal to the R, the j is greater than or equal to 1 and less than or equal to the M; the xi and y j are mutually independent elements; the f is greater than or equal to 1 and less than or equal to the R, and the g is greater than or equal to 1 and less than or equal to the M.
  3. 根据权利要求1或2所述的方法,其特征在于,所述标准柯西矩阵为伽罗华域的柯西矩阵。The method according to claim 1 or 2, wherein the standard Cauchy matrix is a Cauchy matrix of Galois Field.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    对所述P阶解码矩阵进行上三角矩阵、对角矩阵及下三角矩阵LDU分解,得到上三角矩阵、对角矩阵及下三角矩阵;LDU decomposition is performed on the P-order decoding matrix to obtain an upper triangular matrix, a diagonal matrix and a lower triangular matrix to obtain an upper triangular matrix, a diagonal matrix and a lower triangular matrix;
    分别获取所述上三角矩阵的逆矩阵、所述对角矩阵的逆矩阵及所述下三角矩阵的逆矩阵;respectively acquiring the inverse matrix of the upper triangular matrix, the inverse matrix of the diagonal matrix and the inverse matrix of the lower triangular matrix;
    将所述上三角矩阵的逆矩阵、所述对角矩阵的逆矩阵及所述下三角矩阵的逆矩阵的乘积作为所述P阶解码矩阵的逆矩阵。The product of the inverse matrix of the upper triangular matrix, the inverse matrix of the diagonal matrix, and the inverse matrix of the lower triangular matrix is used as the inverse matrix of the P-order decoding matrix.
  5. 根据权利要求4所述的方法,其特征在于,获取所述下三角矩阵的逆矩阵,包括:The method according to claim 4, wherein obtaining the inverse matrix of the lower triangular matrix comprises:
    确定所述下三角矩阵中每个元素的逆元素;determine the inverse element of each element in the lower triangular matrix;
    将所述下三角矩阵中每个元素的逆元素,按照元素在所述下三角矩阵中的位置排列,构成所述下三角矩阵的逆矩阵;Arranging the inverse elements of each element in the lower triangular matrix according to the positions of the elements in the lower triangular matrix to form the inverse matrix of the lower triangular matrix;
    其中,所述下三角矩阵中的对角元素及对角元素下方的首个元素的逆元素为其自身;Wherein, the diagonal element in the lower triangular matrix and the inverse element of the first element below the diagonal element is itself;
    所述下三角矩阵中除所述对角元素及所述对角元素下方的首个元素之外的其他元素的逆元素按照如下公式得到:The inverse elements of other elements in the lower triangular matrix except the diagonal element and the first element below the diagonal element are obtained according to the following formula:
    Figure PCTCN2020105310-appb-100002
    Figure PCTCN2020105310-appb-100002
    其中,所述L o,s -1为所述下三角矩阵中第o行第s列元素L o,s的逆元素;所述L o,s i为所述下三角矩阵中所述L o,s所在列的对角元素下方第i个元素的逆元素,所述L o,s i′为所述下三角矩阵中所述L o,s右侧第i个元素的逆元素;所述A为所述L o,s在列方向或者行方向与对角元素间隔的元素个数。 Wherein, the L o,s -1 is the inverse element of the element L o,s in the o-th row and the s-th column in the lower triangular matrix; the L o,s i is the L o in the lower triangular matrix , the inverse element of the i-th element below the diagonal element of the column where s is located, the L o,s i′ is the inverse element of the i-th element on the right side of the L o,s in the lower triangular matrix; the A is the number of elements of the L o,s spaced from the diagonal elements in the column direction or row direction.
  6. 根据权利要求4或5所述的方法,其特征在于,获取所述上三角矩阵的逆矩阵,包括:The method according to claim 4 or 5, wherein obtaining the inverse matrix of the upper triangular matrix comprises:
    确定所述上三角矩阵中每个元素的逆元素;determine the inverse element of each element in the upper triangular matrix;
    将所述上三角矩阵中每个元素的逆元素,按照元素在所述上三角矩阵中的位置排列,构成所述上三角矩阵的逆矩阵;Arranging the inverse elements of each element in the upper triangular matrix according to the position of the elements in the upper triangular matrix to form the inverse matrix of the upper triangular matrix;
    其中,所述上三角矩阵中的对角元素及所述对角元素上方的首个元素的逆元素为其自身;Wherein, the diagonal element in the upper triangular matrix and the inverse element of the first element above the diagonal element is itself;
    所述上三角矩阵中除所述对角元素及所述对角元素上方的首个元素之外的其他元素的逆元素按照如下公式得到:The inverse elements of other elements in the upper triangular matrix except the diagonal element and the first element above the diagonal element are obtained according to the following formula:
    Figure PCTCN2020105310-appb-100003
    Figure PCTCN2020105310-appb-100003
    其中,所述L p,q -1为所述上三角矩阵中第p行第q列元素L p,q的逆元素;所述L p,q i为所述上三角矩阵中所述L p,q所在列的对角元素上方第i个元素的逆元素,所述L p,q i′为所述上三角矩阵中所述L p,q左侧第i个元素的逆元素;所述B为所述L p,q在列方向或者行方向与对角元素间隔的元素个数。 Wherein, the L p,q −1 is the inverse element of the element L p,q in the p-th row and the q-th column in the upper triangular matrix; the L p,q i is the L p in the upper triangular matrix , the inverse element of the i-th element above the diagonal element of the column where q is located, and the L p,q i' is the inverse element of the i-th element on the left side of the L p,q in the upper triangular matrix; the B is the number of elements of the L p,q spaced from the diagonal elements in the column direction or the row direction.
  7. 根据权利要求3-6任一项所述的方法,其特征在于,所述X与所述Y不存在交集。The method according to any one of claims 3-6, wherein the X and the Y do not have an intersection.
  8. 根据权利要求3所述的方法,其特征在于,所述Y为{0,1,……,M-2,M-1},所述X为{M,M+1,……,M+R-2,M+R-1}。The method according to claim 3, wherein the Y is {0, 1, ..., M-2, M-1}, and the X is {M, M+1, ..., M+ R-2, M+R-1}.
  9. 一种编码方法,其特征在于,所述方法包括:An encoding method, characterized in that the method comprises:
    获取原包个数M、冗余包个数R及包长L;Obtain the number of original packets M, the number of redundant packets R and the packet length L;
    获取M个原包;Get M original packages;
    构建R行M列的标准柯西矩阵,作为编码矩阵,所述编码矩阵中第i行第j列元素为
    Figure PCTCN2020105310-appb-100004
    所述x i与所述y j为相互独立的元素,所述x i属于包括R个元素的集合X,所述y j属于包括M个元素的集合Y,所述i大于或等于1,且小于或等于所述R,所述j大于或等于1,且小于或等于所述M;
    A standard Cauchy matrix with R rows and M columns is constructed as an encoding matrix, and the elements in the i-th row and the j-th column of the encoding matrix are
    Figure PCTCN2020105310-appb-100004
    The x i and the y j are mutually independent elements, the x i belongs to the set X including R elements, the y j belongs to the set Y including M elements, the i is greater than or equal to 1, and is less than or equal to said R, said j is greater than or equal to 1, and less than or equal to said M;
    将所述M个原包左乘所述编码矩阵,得到R个冗余包;The M original packets are left-multiplied by the encoding matrix to obtain R redundant packets;
    发送所述M个原包及所述R个冗余包。Send the M original packets and the R redundant packets.
  10. 根据权利要求9所述的方法,其特征在于,所述编码矩阵为2 8伽罗华域柯西矩阵,所述x i+y j小于2 8The method according to claim 9, wherein the encoding matrix is a 2 8 Galois Field Cauchy matrix, and the x i +y j is less than 2 8 .
  11. 根据权利要求9或10所述的方法,其特征在于,所述X与所述Y不存在交集。The method according to claim 9 or 10, wherein the X and the Y do not have an intersection.
  12. 根据权利要求9-11任一项所述的方法,其特征在于,所述Y为{0,1,……,M-2,M-1},所述X为{M,M+1,……,M+R-2,M+R-1}。The method according to any one of claims 9-11, wherein the Y is {0, 1, ..., M-2, M-1}, and the X is {M, M+1, ..., M+R-2, M+R-1}.
  13. 一种解码装置,其特征在于,所述装置包括:A decoding device, characterized in that the device comprises:
    获取单元,用于获取码流,所述码流包括X个原包及Q个冗余包;an acquisition unit, configured to acquire a code stream, the code stream includes X original packets and Q redundant packets;
    确定单元,用于根据所述码流编码时的原包个数M、冗余包个数R及包长L,对所述码流解析获取所述X个原包及所述Q个冗余包,确定丢失的原包的个数N,所述N等于所述M减所述X;所述Q小于或等于所述R;A determination unit, configured to analyze the code stream to obtain the X original packets and the Q redundant packets according to the number M of original packets, the number R of redundant packets and the packet length L during encoding of the code stream packets, determine the number N of lost original packets, the N is equal to the M minus the X; the Q is less than or equal to the R;
    消原单元,用于对所述Q个冗余包中的P个冗余包进行消原得到消原结果;其中,所述P个冗余包为满足条件的冗余包;所述P为所述N与所述Q中的较小值;The elimination unit is used to eliminate the P redundant packets in the Q redundant packets to obtain the elimination result; wherein, the P redundant packets are redundant packets that meet the conditions; the P is the smaller of the N and the Q;
    构建单元,用于根据所述码流中的包接收顺序及包标识,构建R行M列的标准柯西矩阵;其中,所述包标识用于指示编码时的包顺序;A construction unit is used to construct a standard Cauchy matrix of R rows and M columns according to the packet reception sequence and the packet identification in the code stream; wherein, the packet identification is used to indicate the packet sequence during encoding;
    选取单元,用于选取所述标准柯西矩阵中,P个丢失的原包对应的列,所述P个冗余包对应的行的交叠位置对应的元素,得到P阶解码矩阵;A selection unit is used to select, in the standard Cauchy matrix, the columns corresponding to the P lost original packets, and the elements corresponding to the overlapping positions of the rows corresponding to the P redundant packets, to obtain a P-order decoding matrix;
    处理单元,用于将所述消原结果左乘所述P阶解码矩阵的逆矩阵,得到所述P个丢失的原包。A processing unit, configured to left-multiply the cancellation result by the inverse matrix of the P-order decoding matrix to obtain the P lost original packets.
  14. 根据权利要求13所述的解码装置,其特征在于,所述构建单元具体用于:The decoding device according to claim 13, wherein the construction unit is specifically used for:
    根据所述码流的接收包顺序中第f个接收的原包的包标识indxf、所述码流的接收包顺序中第g个接收的冗余包的包标识indxg,以及标准柯西矩阵元素集合X及Y,确定所述标准柯西矩阵中第f行第g列元素
    Figure PCTCN2020105310-appb-100005
    According to the packet identifier indxf of the f-th received original packet in the received packet sequence of the code stream, the packet identifier indxg of the g-th received redundant packet in the received packet sequence of the code stream, and the standard Cauchy matrix elements Set X and Y, determine the element in the fth row and the gth column of the standard Cauchy matrix
    Figure PCTCN2020105310-appb-100005
    其中,所述X包括x i,所述Y包括y j,所述i大于或等于1,且小于或等于所述R,所述j大于或等于1,且小于或等于所述M;所述x i与所述y j为相互独立的元素;所述f大于或等于1,且小于或等于所述R,所述g大于或等于1,且小于或等于所述M。 wherein, the X includes x i , the Y includes y j , the i is greater than or equal to 1 and less than or equal to the R, the j is greater than or equal to 1 and less than or equal to the M; the xi and y j are mutually independent elements; the f is greater than or equal to 1 and less than or equal to the R, and the g is greater than or equal to 1 and less than or equal to the M.
  15. 根据权利要求13或14所述的解码装置,其特征在于,所述标准柯西矩阵为伽罗华域的柯西矩阵。The decoding device according to claim 13 or 14, wherein the standard Cauchy matrix is a Galois field Cauchy matrix.
  16. 根据权利要求15所述的解码装置,其特征在于,所述解码装置还包括求逆单元,用于:The decoding device according to claim 15, wherein the decoding device further comprises an inversion unit for:
    对所述P阶解码矩阵进行上三角矩阵、对角矩阵及下三角矩阵LDU分解,得到上三角矩阵、对角矩阵及下三角矩阵;LDU decomposition is performed on the P-order decoding matrix to obtain an upper triangular matrix, a diagonal matrix and a lower triangular matrix to obtain an upper triangular matrix, a diagonal matrix and a lower triangular matrix;
    分别获取所述上三角矩阵的逆矩阵、所述对角矩阵的逆矩阵及所述下三角矩阵的逆矩阵;respectively acquiring the inverse matrix of the upper triangular matrix, the inverse matrix of the diagonal matrix and the inverse matrix of the lower triangular matrix;
    将所述上三角矩阵的逆矩阵、所述对角矩阵的逆矩阵及所述下三角矩阵的逆矩阵的乘积作为所述P阶解码矩阵的逆矩阵。The product of the inverse matrix of the upper triangular matrix, the inverse matrix of the diagonal matrix, and the inverse matrix of the lower triangular matrix is used as the inverse matrix of the P-order decoding matrix.
  17. 根据权利要求16所述的解码装置,其特征在于,所述求逆单元具体用于:The decoding apparatus according to claim 16, wherein the inversion unit is specifically used for:
    确定所述下三角矩阵中每个元素的逆元素;determine the inverse element of each element in the lower triangular matrix;
    将所述下三角矩阵中每个元素的逆元素,按照元素在所述下三角矩阵中的位置排列,构成所述下三角矩阵的逆矩阵;Arranging the inverse elements of each element in the lower triangular matrix according to the positions of the elements in the lower triangular matrix to form the inverse matrix of the lower triangular matrix;
    其中,所述下三角矩阵中的对角元素及对角元素下方的首个元素的逆元素为其自身;Wherein, the diagonal element in the lower triangular matrix and the inverse element of the first element below the diagonal element is itself;
    所述下三角矩阵中除所述对角元素及所述对角元素下方的首个元素之外的其他元素的逆元素按照如下公式得到:The inverse elements of other elements in the lower triangular matrix except the diagonal element and the first element below the diagonal element are obtained according to the following formula:
    Figure PCTCN2020105310-appb-100006
    Figure PCTCN2020105310-appb-100006
    其中,所述L o,s -1为所述下三角矩阵中第o行第s列元素L o,s的逆元素;L o,s i为所述下三角矩阵中所述L o,s所在列的对角元素下方第i个元素的逆元素,所述L o,s i′为所述下三角矩阵中所述L o,s右侧第i个元素的逆元素;所述A为所述L o,s在列方向或者行方向与对角元素间隔的元素个数。 Wherein, the L o,s −1 is the inverse element of the element L o,s in the o-th row and the s-th column in the lower triangular matrix; L o,s i is the L o ,s in the lower triangular matrix The inverse element of the i-th element below the diagonal element of the column, the L o,s i' is the inverse element of the i-th element on the right side of the L o,s in the lower triangular matrix; the A is The L o,s is the number of elements spaced from diagonal elements in the column direction or row direction.
  18. 根据权利要求16或17所述的解码装置,其特征在于,所述求逆单元具体用于:The decoding device according to claim 16 or 17, wherein the inversion unit is specifically used for:
    确定所述上三角矩阵中每个元素的逆元素;determine the inverse element of each element in the upper triangular matrix;
    将所述上三角矩阵中每个元素的逆元素,按照元素在所述上三角矩阵中的位置排列,构成所述上三角矩阵的逆矩阵;Arranging the inverse elements of each element in the upper triangular matrix according to the position of the elements in the upper triangular matrix to form the inverse matrix of the upper triangular matrix;
    其中,所述上三角矩阵中的对角元素及所述对角元素上方的首个元素的逆元素为其自身;Wherein, the diagonal element in the upper triangular matrix and the inverse element of the first element above the diagonal element is itself;
    所述上三角矩阵中除所述对角元素及所述对角元素上方的首个元素之外的其他元素的逆元素按照如下公式得到:The inverse elements of other elements in the upper triangular matrix except the diagonal element and the first element above the diagonal element are obtained according to the following formula:
    Figure PCTCN2020105310-appb-100007
    Figure PCTCN2020105310-appb-100007
    其中,所述L p,q -1为所述上三角矩阵中第p行第q列元素L p,q的逆元素;所述L p,q i为所述上三角矩阵中所述L p,q所在列的对角元素上方第i个元素的逆元素,所述L p,q i′为所述上三角矩阵中所述L p,q左侧第i个元素的逆元素;所述B为所述L p,q在列方向或者行方向与对角元素间隔的元素个数。 Wherein, the L p,q −1 is the inverse element of the element L p,q in the p-th row and the q-th column in the upper triangular matrix; the L p,q i is the L p in the upper triangular matrix , the inverse element of the i-th element above the diagonal element of the column where q is located, and the L p,q i' is the inverse element of the i-th element on the left side of the L p,q in the upper triangular matrix; the B is the number of elements of the L p,q spaced from the diagonal elements in the column direction or the row direction.
  19. 根据权利要求15-18任一项所述的解码装置,其特征在于,所述X与所述Y不存在交集。The decoding apparatus according to any one of claims 15-18, wherein the X and the Y do not have an intersection.
  20. 根据权利要求15所述的解码装置,其特征在于,所述Y为{0,1,……,M-2,M-1},所述X为{M,M+1,……,M+R-2,M+R-1}。The decoding apparatus according to claim 15, wherein the Y is {0, 1, ..., M-2, M-1}, and the X is {M, M+1, ..., M +R-2, M+R-1}.
  21. 一种编码装置,其特征在于,所述编码装置包括:An encoding device, characterized in that the encoding device comprises:
    获取单元,用于获取原包个数M、冗余包个数R及包长L;The acquisition unit is used to acquire the number M of original packets, the number R of redundant packets and the packet length L;
    所述获取单元还用于,获取M个原包;The obtaining unit is also used to obtain M original packages;
    构建单元,用于构建R行M列的标准柯西矩阵,作为编码矩阵,所述编码矩阵中第i行第j列元素为
    Figure PCTCN2020105310-appb-100008
    所述x i与所述y j为相互独立的元素,所述x i属于包括R个元素的集合X,所述y j属于包括M个元素的集合Y,所述i大于或等于1,且小于或等于所述R,所述j大于或等于1,且小于或等于所述M;
    The construction unit is used to construct a standard Cauchy matrix with R rows and M columns as an encoding matrix, and the elements of the i-th row and the j-th column in the encoding matrix are
    Figure PCTCN2020105310-appb-100008
    The x i and the y j are mutually independent elements, the x i belongs to the set X including R elements, the y j belongs to the set Y including M elements, the i is greater than or equal to 1, and is less than or equal to said R, said j is greater than or equal to 1, and less than or equal to said M;
    编码单元,用于将所述M个原包左乘所述编码矩阵,得到R个冗余包;an encoding unit, used for left-multiplying the M original packets by the encoding matrix to obtain R redundant packets;
    发送单元,用于发送所述M个原包及所述R个冗余包。A sending unit, configured to send the M original packets and the R redundant packets.
  22. 根据权利要求21所述的编码装置,其特征在于,所述编码矩阵为2 8伽罗华域柯西矩阵,所述x i+y j小于2 8The encoding device according to claim 21, wherein the encoding matrix is a 2 8 Galois Field Cauchy matrix, and the x i +y j is less than 2 8 .
  23. 根据权利要求21或22所述的编码装置,其特征在于,所述X与所述Y不存在交集。The encoding device according to claim 21 or 22, wherein the X and the Y do not have an intersection.
  24. 根据权利要求21-23任一项所述的编码装置,其特征在于,所述Y为{0,1,……,M-2,M-1},所述X为{M,M+1,……,M+R-2,M+R-1}。The encoding device according to any one of claims 21-23, wherein the Y is {0, 1, ..., M-2, M-1}, and the X is {M, M+1 , ..., M+R-2, M+R-1}.
  25. 一种解码装置,其特征在于,所述解码装置包括:处理器和传输接口;A decoding device, characterized in that the decoding device comprises: a processor and a transmission interface;
    所述传输接口用于接收和发送数据;The transmission interface is used for receiving and sending data;
    所述处理器被配置为调用存储在存储器中的软件指令,以使得所述解码装置执行如权利要求1至8中任一项所述的解码方法。The processor is configured to invoke software instructions stored in the memory to cause the decoding apparatus to perform the decoding method of any one of claims 1 to 8.
  26. 一种编码装置,其特征在于,所述编码装置包括:处理器和传输接口;An encoding device, characterized in that the encoding device comprises: a processor and a transmission interface;
    所述传输接口用于接收和发送数据;The transmission interface is used for receiving and sending data;
    所述处理器被配置为调用存储在存储器中的软件指令,以使得所述编码装置执行如权利要求9至12中任一项所述的编码方法。The processor is configured to invoke software instructions stored in the memory to cause the encoding apparatus to perform the encoding method of any one of claims 9 to 12.
  27. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在计算机或处理器上运行时,使得所述计算机或所述处理器执行如权利要求1至12中任一项所述的解码方法或编码方法。A computer-readable storage medium having instructions stored in the computer-readable storage medium, when the instructions are executed on a computer or a processor, the computer or the processor causes the computer or the processor to perform as in claims 1 to 12 Any one of the decoding method or encoding method.
  28. 一种计算机程序产品,其特征在于,包括指令,当所述指令在计算机或处理器上运行时,使得所述计算机或所述处理器执行如权利要求1至12中任一项所述的解码方法或编码方法。A computer program product, characterized by comprising instructions that, when executed on a computer or processor, cause the computer or the processor to perform the decoding of any one of claims 1 to 12 method or encoding method.
PCT/CN2020/105310 2020-07-28 2020-07-28 Encoding and decoding method and apparatus WO2022021098A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080102961.7A CN115812305A (en) 2020-07-28 2020-07-28 Encoding and decoding method and device
PCT/CN2020/105310 WO2022021098A1 (en) 2020-07-28 2020-07-28 Encoding and decoding method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/105310 WO2022021098A1 (en) 2020-07-28 2020-07-28 Encoding and decoding method and apparatus

Publications (1)

Publication Number Publication Date
WO2022021098A1 true WO2022021098A1 (en) 2022-02-03

Family

ID=80036924

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/105310 WO2022021098A1 (en) 2020-07-28 2020-07-28 Encoding and decoding method and apparatus

Country Status (2)

Country Link
CN (1) CN115812305A (en)
WO (1) WO2022021098A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114760009A (en) * 2022-04-01 2022-07-15 国网综合能源服务集团有限公司 Method, device and storage medium for encoding and decoding data stream

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060212782A1 (en) * 2005-03-15 2006-09-21 Microsoft Corporation Efficient implementation of reed-solomon erasure resilient codes in high-rate applications
CN101505201A (en) * 2009-03-18 2009-08-12 吕晓雯 Error control method and system
CN101540778A (en) * 2008-03-19 2009-09-23 华为技术有限公司 Method, device and system for transmitting data
CN105915317A (en) * 2016-06-15 2016-08-31 浙江大学 Method for constructing coding coefficient matrix of Zigzag decodable forward erasure code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060212782A1 (en) * 2005-03-15 2006-09-21 Microsoft Corporation Efficient implementation of reed-solomon erasure resilient codes in high-rate applications
CN101540778A (en) * 2008-03-19 2009-09-23 华为技术有限公司 Method, device and system for transmitting data
CN101505201A (en) * 2009-03-18 2009-08-12 吕晓雯 Error control method and system
CN105915317A (en) * 2016-06-15 2016-08-31 浙江大学 Method for constructing coding coefficient matrix of Zigzag decodable forward erasure code

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114760009A (en) * 2022-04-01 2022-07-15 国网综合能源服务集团有限公司 Method, device and storage medium for encoding and decoding data stream
CN114760009B (en) * 2022-04-01 2023-07-25 国网综合能源服务集团有限公司 Encoding and decoding method and device for data stream and storage medium

Also Published As

Publication number Publication date
CN115812305A (en) 2023-03-17

Similar Documents

Publication Publication Date Title
US20140040214A1 (en) Entropy Coding and Decoding Using Polar Codes
WO2019128707A1 (en) Rate matching and polar code encoding method and device
US20160218750A1 (en) Parity check code encoder
US10218821B2 (en) Apparatus and method of transmitting and receiving packet in a broadcasting and communication system
US11395010B2 (en) Massive picture processing method converting decimal element in matrices into binary element
US20100070825A1 (en) Fast Low-Density Parity-Check Code Encoder
US11245423B2 (en) Interleaving method and apparatus
Hou et al. BASIC regenerating code: Binary addition and shift for exact repair
CN107124251B (en) Polarization code encoding method based on any kernel
US20220399906A1 (en) Rate matching method and apparatus for polar code
US20120317466A1 (en) Method and apparatus for data check processing
WO2022021098A1 (en) Encoding and decoding method and apparatus
KR102383892B1 (en) Coding and decoding method, apparatus, system and medium of self-adapting system code FEC based on media content
CN114499541A (en) Layered decoding method, device, terminal equipment and medium
JP5458451B2 (en) Rate matching method, rate matching device, rate dematching method, and rate dematching device
CN111694692B (en) Data storage erasure method, device and equipment and readable storage medium
CN103312577B (en) A kind of method and device of processing MAC data
TWI520528B (en) Supercharged codes
Chen et al. A new Zigzag MDS code with optimal encoding and efficient decoding
WO2018133415A1 (en) Method and device for coding and decoding data of physical coding sublayer and storage medium
CN109245775B (en) Decoder and method for realizing decoding
CN108566210B (en) LDPC (Low Density parity check) coding system and method compatible with IEEE (institute of Electrical and electronics Engineers) 802.11n standard and LDPC coder
WO2012149741A1 (en) De-interleaving method and device for rate de-matching
WO2019137231A1 (en) Decoding method and device
CN105871508B (en) Network coding and decoding method and system

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20947256

Country of ref document: EP

Kind code of ref document: A1