CN113541863B - Data encoding method, data decoding method, electronic device, and storage medium - Google Patents

Data encoding method, data decoding method, electronic device, and storage medium Download PDF

Info

Publication number
CN113541863B
CN113541863B CN202110628836.6A CN202110628836A CN113541863B CN 113541863 B CN113541863 B CN 113541863B CN 202110628836 A CN202110628836 A CN 202110628836A CN 113541863 B CN113541863 B CN 113541863B
Authority
CN
China
Prior art keywords
matrix
elements
vanishing
elimination
data packets
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110628836.6A
Other languages
Chinese (zh)
Other versions
CN113541863A (en
Inventor
付希明
张逸衡
杨升浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chinese University of Hong Kong Shenzhen
Original Assignee
Chinese University of Hong Kong Shenzhen
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 Chinese University of Hong Kong Shenzhen filed Critical Chinese University of Hong Kong Shenzhen
Priority to CN202110628836.6A priority Critical patent/CN113541863B/en
Publication of CN113541863A publication Critical patent/CN113541863A/en
Application granted granted Critical
Publication of CN113541863B publication Critical patent/CN113541863B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/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/0041Arrangements at the transmitter end
    • 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
    • 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

Abstract

The application discloses a data encoding method, a data decoding method, electronic equipment and a storage medium. The data encoding method comprises the following steps: the method comprises the steps of obtaining original data to be encoded, dividing the obtained original data into a plurality of original data packets, generating a first matrix according to the plurality of original data packets, and calculating according to each original data packet and the first matrix to obtain a plurality of encoded data packets. The data decoding method comprises the following steps: acquiring a plurality of coded data packets generated by the data coding method, generating an augmentation matrix according to the plurality of coded data packets and a preset generation matrix, performing Gaussian elimination operation on the augmentation matrix to obtain a second matrix, and decoding the plurality of coded data packets according to the obtained second matrix to obtain a plurality of decoded data packets. The coding and data decoding method reduces the complexity of coding and decoding, and further reduces the calculation cost and the transmission bandwidth cost of coding and decoding.

Description

Data encoding method, data decoding method, electronic device, and storage medium
Technical Field
The present disclosure relates to the field of coding and decoding technologies, and in particular, to a data coding method, a data decoding method, an electronic device, and a storage medium.
Background
In the field of internet of things, a source node sends a data packet, and each relay node receives data of adjacent nodes and forwards the data to other nodes, so that a wireless multi-hop network is formed. In wireless multi-hop networks, there may be a problem of loss of forwarded packets due to poor channels.
In order to solve the problem of packet loss during forwarding, there are two solutions in the current computer network protocol: one is a TCP protocol-based method, and the other is a UDP protocol-based method. In the TCP protocol, the source waits for the acknowledgement signal from the receiver, and if the acknowledgement signal cannot be received within a certain time, the data is retransmitted once, but this is obviously unrealistic in a multi-hop network, because the multi-hop may cause a great delay, and the service represented by 5G has extremely high requirements on low delay. In the UDP protocol, the source end always sends out a data packet, and whether the receiving end receives the data packet or not, the adoption of the UDP protocol causes a large amount of data packet loss due to a high packet loss rate.
The method is characterized in that the method is improved on the basis of a TCP protocol and UDP protocol for solving the packet loss scheme, a network coding solution is provided, in the network coding, an information source end firstly codes original data, the coding process is called outer code, and a relay node needs to recode received data packets, and the coding process is called inner code. The receiving end decodes the received data packet to recover the original data, and the data packet in the transmission process has a corresponding coefficient vector representing the linear relationship between the data packet and the original data.
In network coding, batch sparse coding (BATS) is generally adopted to solve the problem of data packet loss, but in BATS, the coding of an outer code and an inner code adopts finite field operation, and decoding at a receiving end needs to solve a linear equation set on a finite field, and larger coding and decoding calculation and bandwidth overhead are generated due to higher complexity of finite field operation and lower probability of random square matrix full rank.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides a data encoding method, a data decoding method, electronic equipment and a storage medium, which can realize the encoding and decoding processes only through shift and exclusive OR operation, reduce the complexity of encoding and decoding, and further reduce the calculation cost and the transmission bandwidth cost of encoding and decoding.
According to an embodiment of the first aspect of the present application, a data encoding method includes:
acquiring original data to be encoded;
dividing the original data into a plurality of original data packets;
generating a first matrix according to the plurality of original data packets;
and calculating to obtain a coded data packet according to each original data packet and the first matrix to obtain a plurality of coded data packets.
The data encoding method according to the embodiment of the application has at least the following beneficial effects:
the method comprises the steps of obtaining original data to be encoded, dividing the obtained original data into a plurality of original data packets, generating a first matrix according to the plurality of original data packets, and calculating according to each original data packet and the first matrix to obtain a plurality of encoded data packets.
According to some embodiments of the present application, the generating a first matrix according to the plurality of original data packets includes:
acquiring a plurality of preset matrix elements;
generating a first matrix according to the number of the plurality of original data packets and a plurality of preset matrix elements.
According to a second aspect of the present application, a data decoding method includes:
acquiring a plurality of coded data packets, the plurality of coded data packets being generated according to the data encoding method of any one of claims 1-2;
generating an augmentation matrix according to the plurality of coded data packets and a preset generation matrix;
performing Gaussian elimination operation on the augmentation matrix to obtain a second matrix;
and decoding the plurality of coded data packets according to the second matrix to obtain a plurality of decoded data packets.
The data decoding method according to the embodiment of the application has at least the following beneficial effects:
the method comprises the steps of obtaining a plurality of coded data packets generated according to the first aspect of the application, generating an augmentation matrix according to the plurality of coded data packets and a preset generation matrix, performing Gaussian elimination operation on the augmentation matrix to obtain a second matrix, and decoding the plurality of coded data packets according to the obtained second matrix to obtain a plurality of decoded data packets.
According to some embodiments of the present application, the generating an augmentation matrix according to the plurality of encoded data packets and a preset generation matrix includes:
generating a third matrix and a fourth matrix according to the generated matrix;
and generating an augmentation matrix according to the plurality of coded data packets, the third matrix and the fourth matrix.
According to some embodiments of the present application, the performing a gaussian elimination operation on the augmentation matrix to obtain a second matrix includes:
acquiring a third matrix according to the augmentation matrix;
obtaining a first preset variable according to the order of the augmentation matrix;
Executing the first cyclic process until the number of times of executing the first cyclic process is greater than or equal to the first preset variable;
judging whether the first cyclic process is executed;
if the first cyclic process is executed, a second matrix is obtained according to the updated third matrix;
the first cyclic process includes:
judging whether the third matrix element of each third matrix is a preset first preset element,
if the third matrix element is not the first preset element, executing a second circulation process, and if the third matrix element is the first preset element, executing a third circulation process;
the second cyclic process includes:
the third matrix element is taken as a first switching element to be switched,
obtaining a second exchange element to be exchanged from the third matrix according to the position relation of the first exchange element,
exchanging the first exchange element and the second exchange element in the third matrix to obtain an updated third matrix;
the third cycle process includes:
the third matrix element is taken as a third exchange element to be exchanged,
exclusive-or processing is carried out on the third exchange element to obtain the updated third exchange element,
Acquiring a fourth exchange element to be exchanged from the third matrix according to the position relation of the third exchange element,
and in the third matrix, exchanging the updated third exchange element with the fourth exchange element to obtain an updated third matrix.
According to some embodiments of the present application, the decoding the plurality of encoded data packets according to the second matrix to obtain a plurality of decoded data packets includes:
extracting a plurality of second matrixes as a fifth matrix;
performing shift operation on each coded data packet in the fifth matrix to obtain an updated fifth matrix;
obtaining an initial vanishing matrix according to the second matrix and the fifth matrix;
performing Gaussian elimination operation on the initial elimination matrix to obtain an updated elimination matrix;
and obtaining a plurality of decoding data packets according to the updated vanishing matrix.
According to some embodiments of the present application, the performing a gaussian elimination operation on the initial elimination matrix to obtain an updated elimination matrix includes;
extracting a plurality of first element elements, a plurality of second element elements, a plurality of third element elements and a plurality of fourth element elements from the initial element elimination matrix;
Generating a first vanishing matrix according to the plurality of first vanishing elements, generating a second vanishing matrix according to the plurality of second vanishing elements, generating a third vanishing matrix according to the plurality of third vanishing elements and generating a fourth vanishing matrix according to the plurality of fourth vanishing elements;
judging whether the first row position and the first principal element position of each first element are the same or not;
if the first row position and the first principal element position of the first element are the same, updating a third element of a row where the third element is located according to the first row position and the first element eliminating matrix, and updating a fourth element of a row where the fourth element eliminating matrix is located according to the first row position and the second element eliminating matrix, so as to obtain an updated element eliminating matrix.
According to some embodiments of the present application, the method further comprises:
judging whether the first row position and the first principal element position of each first element are the same or not;
if the first row position and the first principal element position of the first element are different, updating the first element of the row where the first element is located according to the first row position and the third element array, and updating the second element of the row where the second element is located according to the first row position and the fourth element array, so as to obtain an updated element array.
According to some embodiments of the present application, the obtaining a plurality of decoding data packets according to the updated cancellation matrix includes:
extracting a plurality of fifth element elements, a plurality of sixth element elements, a plurality of seventh element elements, a plurality of eighth element elements and a plurality of ninth element elements from the updated element matrix;
generating a fifth vanishing matrix according to the plurality of fifth vanishing elements, generating a sixth vanishing matrix according to the plurality of sixth vanishing elements, generating a seventh vanishing matrix according to the plurality of seventh vanishing elements, generating an eighth vanishing matrix according to the plurality of eighth vanishing elements and generating a ninth vanishing matrix according to the plurality of ninth vanishing elements;
obtaining a second preset variable according to the order of the seventh elimination matrix;
judging whether the fifth vanishing element matrix has a second preset element which is preset by whether the fifth vanishing element corresponding to a certain row exists or not;
if the fifth element eliminating matrix does not have any row of corresponding fifth element eliminating elements which are all the second preset elements, executing the fourth circulation process until the number of times of executing the fourth circulation process is larger than or equal to the second preset variable;
judging whether the fourth cyclic process is executed;
If the fourth cyclic process is executed, gaussian elimination operation is executed on the seventh elimination matrix and the ninth elimination matrix, and an updated elimination matrix is obtained;
extracting a plurality of tenth element elements and a plurality of eleventh element elements from the updated element elimination matrix;
generating a tenth element elimination matrix according to the tenth element elimination elements, and generating an eleventh element elimination matrix according to the eleventh element elimination elements;
judging whether the tenth vanishing element matrix is an empty set and whether the eleventh vanishing element matrix is full of rank;
if the tenth element eliminating matrix is an empty set and the eleventh element eliminating matrix is full rank, or the tenth element eliminating matrix is not an empty set, obtaining a plurality of decoding data packets according to the updated element eliminating matrix;
the fourth cycle includes:
finding a principal element row position identical to a fifth principal element position of the fifth vanishing element matrix and a seventh principal element position of the seventh vanishing element matrix,
and updating a seventh element of the row of the seventh element elimination matrix according to the position of the main element row and the fifth element elimination matrix, and updating a ninth element of the row of the ninth element elimination matrix according to the position of the main element row and the sixth element elimination matrix.
According to some embodiments of the present application, the obtaining a plurality of decoding data packets according to the updated update metadata includes:
judging whether the tenth elimination matrix is an empty set or not;
if the tenth element elimination matrix is not an empty set, extracting a plurality of twelfth element elimination elements from the updated element elimination matrix;
generating a twelfth element elimination matrix according to a plurality of the twelfth element elimination elements;
adjusting the twelfth vanishing element matrix;
and obtaining a plurality of decoding data packets according to the adjusted eleventh vanishing element matrix, the twelfth vanishing element matrix and the plurality of coding data packets.
An electronic device according to an embodiment of a third aspect of the present application includes:
a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized by: the processor, when executing the computer program, implements a data encoding method as described in any of the embodiments of the first aspect of the application or a data decoding method as described in any of the embodiments of the second aspect of the application.
A computer readable storage medium according to an embodiment of a fourth aspect of the present application, comprising:
the computer readable storage medium stores computer executable instructions for causing a computer to perform a data encoding method according to any one of the embodiments of the first aspect of the present application or a data decoding method according to any one of the embodiments of the second aspect of the present application.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Drawings
The application is further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of a data encoding method provided in some embodiments of the present application;
fig. 2 is a specific flowchart of step S130 in the data encoding method according to some embodiments of the present application;
FIG. 3 is a flow chart of a method for decoding data according to some embodiments of the present application;
fig. 4 is a specific flowchart of step S220 in the data decoding method according to some embodiments of the present application;
fig. 5 is a specific flowchart of step S230 in the data decoding method according to some embodiments of the present application;
FIG. 6 is a flowchart illustrating a data decoding method according to some embodiments of the present application in step S240;
fig. 7 is a flowchart illustrating a data decoding method according to some embodiments of the present application in step S244;
fig. 8 is a wireless multi-hop network topology provided in some embodiments of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
In the description of the present application, a description with reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In network coding, batch sparse coding (BATS) is generally adopted to solve the problem of data packet loss. In BATS, the encoding of the outer code and the inner code adopts finite field operation, the decoding at the receiving end needs to solve a linear equation set on the finite field, if the coefficient matrix is full of rank, the corresponding linear equation set has unique solution, the decoding result can be obtained according to the unique solution of the linear equation set, and if the corresponding linear equation set has no unique solution, more data packets need to be obtained for decoding. In order to reduce the transmission bandwidth overhead, it is necessary to ensure as much as possible that the coefficient matrix has a higher probability of full rank, so as to ensure that the corresponding linear equation has a unique solution. In BATS, the encoding of the outer code and the inner code adopts finite field operation, and decoding at the receiving end needs to solve a linear equation set on a finite field, and larger encoding and decoding calculation cost is generated due to higher complexity of finite field operation and lower probability of random square matrix full rank. Therefore, in order to reduce bandwidth overhead, a larger finite field is needed, but operation is performed on the larger finite field, so that large calculation overhead is needed, but in the internet of things, the calculation capability of a single node is limited, and complex coding and decoding calculation limits the application of the network coding technology in the internet of things to a great extent.
Based on the above, the application provides a data encoding method, a data decoding method, electronic equipment and a storage medium, wherein the data encoding method can acquire original data to be encoded, divide the acquired original data into a plurality of original data packets, generate a first matrix according to the plurality of original data packets, and calculate a plurality of encoded data packets according to each original data packet and the first matrix; according to the data decoding method, a plurality of coded data packets can be obtained, an augmentation matrix is generated according to the plurality of coded data packets and the preset generation matrix, gaussian elimination operation is carried out on the augmentation matrix to obtain a second matrix, the plurality of coded data packets are decoded according to the obtained second matrix, and a plurality of decoded data packets are obtained.
First, several terms and techniques involved in the present disclosure are explained:
XOR: exclusive-or, a mathematical operator applied to a logical operation, is the algorithm: If the two values of a and b are not the same, the exclusive OR result is 1, ifa. b are the same, the exclusive or result is 0.
shift: the shift operator is one of the bit manipulation operators in programming. The shift operator can translate the numbers on the basis of binary, the shift is divided into left shift and right shift, the left shift operation is to shift an operand of one binary bit leftwards according to the number of bits of the designated shift, the shift bit is discarded, and the shift-out vacancy on the right is uniformly complemented with 0; the right shift operation is to shift one binary operand to the right by the number of bits specified to be shifted, the shifted-out bits are discarded, and the left shifted-out spaces are uniformly complemented with 0's, or complemented with sign bits.
Principal component: the first non-0 element in the vector.
All zero rows: each element is a row of 0.
Operator z: representing shifting a data packet by one unit to the right and supplementing 0 in front, the left shifting operation represents shifting the data packet by one unit to the left, and deleting the original first bit, and it should be noted that one unit of the present application may be set to one bit, one byte or one word according to actual situations.
In a first aspect, embodiments of the present application provide a data encoding method.
Referring to fig. 1, the data encoding method of the present application specifically includes the steps of:
s110, obtaining original data to be coded;
s120, dividing the original data into a plurality of original data packets;
s130, generating a first matrix according to a plurality of original data packets;
and S140, calculating to obtain a coded data packet according to each original data packet and the first matrix to obtain a plurality of coded data packets.
In step S110, encoded raw data is acquired, where the raw data refers to a message with a length of kL bits in a storage system, and an encoding operation may be performed according to the acquired raw data.
In step S120, the original data is divided into a plurality of original data packets, such as original data with a length of kL bits, e.g. message data, which can be divided intok blocks of a plurality of original data packets with the length of L bits of each block are marked as x 1 ,...,x k
In step S130, a first matrix is generated according to the plurality of original data packets, and an encoding operation is performed according to the generated first matrix.
In some embodiments, as shown in fig. 2, step S130 specifically includes the steps of:
s131, acquiring a plurality of preset matrix elements;
s132, generating a first matrix according to the number of the plurality of original data packets and a plurality of preset matrix elements.
In step S131, a preset plurality of preset matrix elements are obtained, a user may set a plurality of preset matrix elements, and the preset plurality of preset matrix elements form a preset element set, in practical application, four elements of 0,1, z,1+z may be selected as preset matrix elements, and form a preset element set, where a specific form of the preset element set may be expressed as: {0,1, z,1+z }, the user randomly selects a plurality of preset matrix elements from the preset element set, for constructing the first matrix.
In step S132, a first matrix is generated according to the number of the plurality of original data packets and a plurality of preset matrix elements, the order of the matrix is determined according to the number of the original data packets, specific matrix elements are determined according to the plurality of preset matrix elements, each matrix element can be randomly selected from the plurality of preset matrix elements, and elements other than the preset matrix elements cannot be selected as matrix elements of the first matrix, because of the original data packet x in the embodiment of the present application 1 ,...,x k Since the number of the first matrix, that is, the generated matrix G is denoted as n×k, it should be noted that n in the embodiment of the present application may be set according to a specific case of the original data packet, which is not described herein.
In step S140, a plurality of encoded data packets are obtained by calculating an encoded data packet according to each original data packet and the first matrix, and in this embodiment, each original data packet and the first matrix are multiplied, and the encoded data packet is calculated according to the following specific calculation formula:
wherein y is 1 ,...,y k For the encoded data packet generated after encoding, it is to be noted that, for any one data packet x i (1≤i≤k),zx i Represents shifting right, x i (1+z)x i =x i +zx i Represents X i And zx i Bit-added coded data packet, when x i When multiplied by the element including z in G, the shift operation, such as the right shift operation, is performed, and a corresponding encoded packet is generated after the shift operation.
In the embodiment of the application, the data encoding method can acquire the original data to be encoded, divide the acquired original data into a plurality of original data packets, generate the first matrix according to the plurality of original data packets, calculate the plurality of encoded data packets according to each original data packet and the first matrix, and reduce the complexity of encoding by executing the data encoding method, thereby reducing the calculation cost and the transmission bandwidth cost of encoding.
In a second aspect, embodiments of the present application provide a data decoding method.
Referring to fig. 3, the data decoding method of the present application specifically includes the steps of:
s210, acquiring a plurality of coded data packets;
s220, generating an augmentation matrix according to the plurality of coded data packets and a preset generation matrix;
s230, performing Gaussian elimination operation on the augmentation matrix to obtain a second matrix;
s240, decoding the plurality of coded data packets according to the second matrix to obtain a plurality of decoded data packets.
In step S210, a plurality of encoded data packets obtained by performing the data encoding method mentioned in the embodiment of the first aspect of the present application are acquired, and denoted as y 1 ,...,y n The decoding process is essentially that of the encoded y 1 ,...,y n Decoding to obtain multiple original data packets x before encoding 1 ,...,x k
In step S220, an augmentation matrix is generated according to the plurality of encoded data packets and a preset generation matrix, where the preset generation matrix is a user-defined matrix, matrix elements and matrix orders of the generation matrix are set according to actual requirements, in practical application, the generation matrix is generally a binary matrix, and elements of the generation matrix are randomly selected from a set {0,1, z,1+z }.
In some embodiments, as shown in fig. 4, step S220 specifically includes the steps of:
S221, generating a third matrix and a fourth matrix according to the generated matrix;
s222, generating an augmentation matrix according to the plurality of coded data packets, the third matrix and the fourth matrix.
In step S221, a third matrix and a fourth matrix are generated according to the generated matrix, first, the value ranges of matrix elements in the third matrix and the fourth matrix need to be specified, after the generated matrix is obtained, the third matrix and the fourth matrix are generated according to the value ranges of matrix elements in the third matrix and the fourth matrix, in practical application, the matrix elements in the third matrix and the fourth matrix are usually specified to be only 0 or 1, the generated matrix is obtained, the form of the generated matrix is transformed, and the generated matrix is transformed to meet the requirement of matrix elements of the third matrix and the fourth matrix, that is, the matrix elements of the third matrix can only be 0 or 1, and the matrix elements of the fourth matrix can only be 0 or 1, for example, the specific form of the generated matrix is:transforming the form of the generator matrix to +.>The generator matrix is expressed as G=A+Bz, and the corresponding +.>Wherein a is the third matrix mentioned in the embodiments of the present application, and B is the fourth matrix mentioned in the embodiments of the present application.
In step S222, an augmentation matrix is generated according to the acquired plurality of encoded data packets, the third matrix and the fourth matrix, where the plurality of encoded data packets are in the form of: y is 1 ,...,y n Let y= (y) 1 … y n ) T The form of the augmentation matrix is then set to t= (ab y), where T is used i Line i, denoted T, with A i,j Elements representing the j-th column position of row i of matrix a.
In step S230, gaussian elimination is performed on the augmentation matrix to obtain a second matrix, where the second matrix is used to decode the plurality of encoded data packets after encoding.
In some embodiments, as shown in fig. 5, step S230 specifically includes the steps of:
s231, acquiring a third matrix according to the augmentation matrix;
s232, obtaining a first preset variable according to the order of the augmentation matrix;
s233, executing a first circulation process until the number of times of executing the first circulation process is greater than or equal to a first preset variable;
s234, judging whether the first cyclic process is executed;
s235, if the first cyclic process is executed, obtaining a second matrix according to the updated third matrix;
in step S231, a third matrix is obtained according to the augmentation matrix, that is, a part of the elements of the augmentation matrix are obtained, so as to form the third matrix, and in this application, the augmentation matrix t= (ab y) needs to be obtained, that is, the third matrix in the augmentation matrix, that is, the matrix a.
In step S232, a first preset variable is obtained according to the order of the augmentation matrix, and if the augmentation matrix is an n-order matrix, the first preset variable is set to n.
In step S233, the first cyclic process is performed until the number of times the first cyclic process is performed is greater than or equal to the first preset variable, in other words, n times the first cyclic process is performed, and in practical application, one variable i, i.e., the first preset variable, may be introduced, and the first cyclic process is sequentially performed for the variable i from 1 to n.
Specifically, the first cyclic process includes: judging whether the third matrix element of each third matrix is a preset first preset element, if the third matrix element is not the first preset element, executing a second circulation process, if the third matrix element is the first preset element, executing the third circulation process, wherein the preset first preset element is obtained by self setting by a user according to actual decoding requirements, judging whether the third matrix element of each third matrix is the preset first preset element, judging the basic idea of judging is that all elements in each row of the matrix are selected one by one, for example, all elements in a first row of the matrix of the third matrix are selected for judgment until all elements in a first row of the third matrix are judged, then taking elements in a second row of the first matrix and elements … … in a second row of the second row until all elements in the second row of the third matrix are judged, taking all elements in the third matrix and judging the elements and the first preset element, and ending the first circulation process. In practical application, after the first preset element is set to 1 and the first cyclic process is entered, it is necessary to determine a in the third matrix i,i Whether or not to be equal to the first preset element, i.e. A i,i Whether or not equal to 1, if A i,i Not equal to 1, a second loop procedure is performed if a i,i The third loop process is performed, =1.
Specifically, the second cycle includes: the third matrix element is used as a first exchange element to be exchanged, a second exchange element to be exchanged is obtained from the third matrix according to the position relation of the first exchange element, the first exchange element and the second exchange element in the third matrix are exchanged to obtain an updated third matrix, in practical application, a variable j is introduced in the process of a second cycle, the variable j is from i+1 to n, and A is as follows j,i =1, then T in the third matrix i Set as the first exchange element to be exchanged, T is j Is set asA second switching element to be switched, switching the first switching element and the second switching element in the third matrix, i.e. switching T in the third matrix i And T j And performing exchange to obtain an updated third matrix.
Specifically, the third cycle includes: taking the third matrix element as a third exchange element to be exchanged, performing exclusive OR processing on the third exchange element to obtain an updated third exchange element, acquiring a fourth exchange element to be exchanged from the third matrix according to the specific position relation of the third exchange element in the third matrix, performing position exchange on the updated third exchange element and the fourth exchange element in the third matrix to obtain an updated third matrix, introducing a variable j in the third cycle process, wherein the variable j is from 1 to n and j is equal to i, and A j,i =1, then T in the third matrix i Set as the third exchange element to be exchanged, T is j Setting the third conversion element as a fourth conversion element to be converted, performing exclusive OR processing on the third conversion element to obtain an updated third conversion element, namely calculatingObtaining T after exclusive OR processing i Exchanging the updated third exchange element and fourth exchange element in the third matrix, namely, performing exclusive-or processing to obtain T i And T is j And performing exchange to obtain an updated third matrix.
In step S234, it is determined whether the first cyclic process is completed, and if the first cyclic process is not completed, execution needs to be continued until the first cyclic process is completed.
In step S235, if the first cyclic process has been performed, a second matrix is obtained according to the updated third matrix, and the updated third matrix is changed into the form of an upper triangle, i.eWherein P is 2 Is an upper triangular matrix, and then is matched withIs transformed to obtain +.>I.e. a second matrix, where P 1 And y a Are empty sets.
In step S240, the plurality of encoded data packets are decoded according to the second matrix, so as to obtain a plurality of decoded data packets.
In some embodiments, as shown in fig. 6, step S240 specifically includes the steps of:
S241, extracting a plurality of second matrixes as a fifth matrix;
s242, performing shift operation on each coded data packet in the fifth matrix to obtain an updated fifth matrix;
s243, obtaining an initial vanishing matrix according to the second matrix and the fifth matrix;
s244, performing Gaussian elimination operation on the initial elimination matrix to obtain an updated elimination matrix;
s245, obtaining a plurality of decoding data packets according to the updated vanishing matrix.
In step S241, a plurality of second matrices are extracted as a fifth matrix, and in the embodiment of the present application, y in the second matrices is extracted c A fifth matrix is obtained.
In step S242, a shift operation is performed on each encoded data packet in the fifth matrix to obtain an updated fifth matrix, specifically, y will be c All data packets in (a) shift left and are marked as y' c ,y' c The updated fifth matrix.
In step S243, an initial vanishing matrix is obtained based on the second matrix and the fifth matrix, specifically, the second matrix is extractedA first row and a third row of the matrix elements of the third row are shifted to obtainThen in->Will y in (1) c Replaced with the updated fifth matrix y' c Obtaining an initial elimination matrix
In step S244, a gaussian elimination operation is performed on the initial elimination matrix, so as to obtain an updated elimination matrix, where the updated elimination matrix is used to decode the plurality of encoded data packets after encoding.
In some embodiments, as shown in fig. 7, step S244 specifically includes the steps of:
s2441, extracting a plurality of first element elements, a plurality of second element elements, a plurality of third element elements and a plurality of fourth element elements from the initial element elimination matrix;
s2442, generating a first element elimination matrix according to the first element elimination elements, generating a second element elimination matrix according to the second element elimination elements, generating a third element elimination matrix according to the third element elimination elements and generating a fourth element elimination matrix according to the fourth element elimination elements;
s2443, judging whether the first row position and the first principal element position of each first element are the same;
and S2444, if the first row position of the first element is the same as the first main element position, updating the third element of the row of the third element matrix according to the first row position and the first element matrix, and updating the fourth element of the row of the fourth element matrix according to the first row position and the second element matrix to obtain an updated element matrix.
In steps S2441 and S2442, a plurality of first element elements, a plurality of second element elements, a plurality of third element elements, and a plurality of fourth element elements are extracted from the initial element elimination matrix, a first element elimination matrix is generated from the plurality of first element elements, a second element elimination matrix is generated from the plurality of second element elements, and a third element elimination matrix is generated from the plurality of third element elementsThe three-element matrix and generating a fourth element matrix from the plurality of fourth element elements. In the present application, fromExtracting multiple first element elements to form a first element matrix P 1 Extracting a plurality of second element elements to form a second element matrix y a Extracting multiple third element elements to form a third element matrix P 4 Extracting multiple fourth element elements to form a fourth element matrix y' c
In step S2443, it is determined whether the first row position and the first principal element position of each first element are the same, specifically, for the third element matrix P 4 Checking the first vanishing matrix P 1 If there is a row that is the same as the first principal element position, which is the position of the first non-0 element in the matrix vector of the first vanishing matrix.
In step S2444, if the first row position and the first principal element position of the first element are the same, updating the third element of the row of the third element array according to the first row position and the first element array, and updating the fourth element of the row of the fourth element array according to the first row position and the second element array to obtain an updated element array, specifically, if the first row position and the first principal element position of the first element array are the same, updating the first element array P 1 The first element of the row is added to the third element matrix P 4 In the third element of the row and the second element matrix y a The second element of the row is added to the fourth element matrix y' c And in the fourth element of the row, obtaining an updated element elimination matrix.
In some embodiments, step S244 specifically further includes the steps of:
and S2445, if the first row position and the first main element position of the first element are different, updating the first element of the row where the first element is located according to the first row position and the third element array, and updating the second element of the row where the second element is located according to the first row position and the fourth element array, so as to obtain an updated element array.
In step S2445, if the first row position and the first principal element position of the first element are different, updating the first element of the row of the first element array according to the first row position and the third element array, updating the second element of the row of the second element array according to the first row position and the fourth element array, and obtaining an updated element array, specifically, if the first row position and the first principal element position of the first element array are different, updating the third element array P 4 The third element of the row is added to the first element matrix P 1 In the first element of the row and the fourth element matrix y' c The fourth element of the row is added to the second element matrix y a And in the second element of the row, obtaining an updated element elimination matrix.
In the embodiment of the present application, after the update vanishing matrix is constructed, the form of the update vanishing matrix is transformed into (P 1 ' 0 y' a ) Will (P) 1 ' 0 y' a ) And a second matrixThe first row element of the second matrix is replaced, matrix elements of the first row and the second row element of the second matrix are taken, the augmentation matrix is reconstructed to be used as an updated element elimination matrix, and the updated element elimination matrix is in the form of: />
In step S245, a plurality of decoding data packets are obtained according to the updated binary matrix.
In some embodiments, step S245 specifically includes the steps of:
s501, extracting a plurality of fifth element elements, a plurality of sixth element elements, a plurality of seventh element elements, a plurality of eighth element elements and a plurality of ninth element elements from the updated element elimination matrix;
s502, generating a fifth element elimination matrix according to a plurality of fifth element elimination elements, generating a sixth element elimination matrix according to a plurality of sixth element elimination elements, generating a seventh element elimination matrix according to a plurality of seventh element elimination elements, generating an eighth element elimination matrix according to a plurality of eighth element elimination elements and generating a ninth element elimination matrix according to a plurality of ninth element elimination elements;
S503, obtaining a second preset variable according to the order of the seventh elimination matrix;
s504, judging whether a fifth vanishing element matrix exists in which a certain row of corresponding fifth vanishing elements are all preset second preset elements;
s505, if the fifth element elimination matrix does not have any row of corresponding fifth element elimination elements which are all the second preset elements, executing a fourth cycle process until the number of times of executing the fourth cycle process is greater than or equal to a second preset variable;
s506, judging whether the fourth cycle process is executed;
s507, if the fourth cyclic process is executed, gaussian elimination operation is executed on the seventh elimination matrix and the ninth elimination matrix, and an updated elimination matrix is obtained;
s508, extracting a plurality of tenth element elements and a plurality of eleventh element elements from the updated element elimination matrix;
s509, generating a tenth element elimination matrix according to the tenth element elimination elements, and generating an eleventh element elimination matrix according to the eleventh element elimination elements;
s510, judging whether the tenth vanishing element matrix is an empty set and whether the eleventh vanishing element matrix is full of rank;
s511, if the tenth element eliminating matrix is an empty set and the eleventh element eliminating matrix is a full rank, or the tenth element eliminating matrix is not an empty set, obtaining a plurality of decoding data packets according to the updated element eliminating matrix after updating;
In step S501 and step S502, a plurality of fifth element, a plurality of sixth element, a plurality of seventh element, a plurality of eighth element and a plurality of ninth element are extracted from the updated element matrix, a fifth element matrix is generated from the plurality of fifth element, a sixth element matrix is generated from the plurality of sixth element, a seventh element matrix is generated from the plurality of seventh element, and a third element matrix is generated from the plurality of eighth elementGenerating an eighth vanishing matrix by the element elements and generating a ninth vanishing matrix according to the ninth vanishing elements; specifically, fromExtracting multiple fifth vanishing elements to form a fifth vanishing matrix P 1 'extracting multiple sixth element elements to form a sixth element matrix y' a Extracting multiple seventh element elements to form seventh element matrix P 2 Extracting multiple eighth vanishing elements to form an eighth vanishing matrix P 3 Extracting multiple ninth element elements to form a ninth element matrix y b
In step S503, according to the seventh vanishing matrix P 2 The order of (2) to obtain a second predetermined variable, i.e. according to a seventh vanishing matrix P 2 Obtaining a second preset variable.
In step S504, a fifth vanishing matrix P is determined 1 Whether a fifth element corresponding to a certain row is a preset second preset element or not is judged, in the embodiment of the application, the second preset element is set to 0, and P is judged 1 ' whether there is an all zero line, i.e. at P 1 ' whether or not there is a row of elements all 0.
In step S505, if P 1 ' have all zero rows, the system has no unique solution, i.e. cannot uniquely decode, algorithm is interrupted, if P 1 ' without all zero lines, a fourth loop is performed until the number of times the fourth loop is performed is greater than or equal to the second preset variable, in other words, if P 1 ' no all zero line, a fourth loop process is performed for the second preset variable number of times.
Specifically, the fourth cycle includes: finding out a principal element row position identical to a fifth principal element position of the fifth vanishing element matrix and a seventh principal element position of the seventh vanishing element matrix, updating a seventh vanishing element of a row in which the seventh vanishing element matrix is located according to the principal element row position and the fifth vanishing element matrix, and updating a ninth vanishing element of a row in which the ninth vanishing element matrix is located according to the principal element row position and the sixth vanishing element matrix, specifically, for the seventh vanishing element matrix P 2 Find out the fifth rowDe-metamorphic matrix P 1 The same seventh principal component position of the fifth principal component position in' to obtain a principal component row position, and according to the principal component row position, the fifth elimination matrix P 1 ' fifth element of corresponding row and seventh element matrix P 2 The seventh element of the corresponding row is added and the addition result is updated to the seventh element matrix P 2 In the seventh element of the corresponding row, the sixth element matrix y 'is formed' a The sixth and ninth vanishing elements of the corresponding row y b And in the ninth element of the corresponding row, obtaining the updated element matrix.
In step S506, it is determined whether the fourth cycle is completed, and if the fourth cycle is not completed, execution is continued until the fourth cycle is completed. In the fourth cycle, each time a cycle is performed, the seventh elimination matrix P needs to be determined 2 All row principal elements and a fifth vanishing element matrix P 1 ' whether the principal elements of all rows are identical, if a seventh vanishing matrix P is present 2 All row principal elements and a fifth vanishing element matrix P 1 The fourth round process continues if the principal elements of all rows are identical, the seventh vanishing matrix P 2 All row principal elements and a fifth vanishing element matrix P 1 ' the principal elements of all rows are not identical, the fourth loop process is exited.
In step S507, if the fourth cyclic process has been executed, gaussian elimination operation is performed on the seventh elimination matrix and the ninth elimination matrix, so as to obtain an updated elimination matrix, where the specific form of the updated elimination matrix is:
In step S508 and step S509, a plurality of tenth and eleventh element elements are extracted from the updated element-elimination matrix, a tenth element-elimination matrix is generated from the plurality of tenth element-elimination elements, and an eleventh element-elimination matrix is generated from the plurality of eleventh element-elimination elements, specifically, fromExtracting multiple tenth element elements to form tenth element matrix P 4 ' extracting multiple eleventh vanishing elements to form eleventh vanishing matrix +.>
In step S510, it is determined whether the tenth vanishing matrix is an empty set and whether the eleventh vanishing matrix is full of rank, specifically, the tenth vanishing matrix P 4 ' whether it is an empty set or an eleventh vanishing matrixWhether or not the rank is full, if the tenth vanishing matrix P 4 ' is an empty set and the eleventh vanishing matrix +.>Not full rank, i.e. P 1 If the' all zero rows exist, the system has no unique solution and cannot be uniquely decoded, otherwise, the system has unique solution and can be uniquely decoded, and it is to be noted that if r (a) =n, the system is called a full rank matrix, and the full rank is not limited to the n rank matrix.
In step S511, if the tenth cancellation matrix is an empty set and the eleventh cancellation matrix is not full rank, a plurality of decoding data packets are obtained according to the updated cancellation matrix.
In some embodiments, step S511 specifically includes the steps of:
s5111, judging whether the tenth elimination matrix is an empty set;
s5112, if the tenth element eliminating matrix is not an empty set, extracting a plurality of twelfth element eliminating elements from the updated element eliminating matrix;
s5113, generating a twelfth element elimination matrix according to the twelfth element elimination elements;
s5114, adjusting a twelfth element elimination matrix;
s5115, obtaining a plurality of decoding data packets according to the adjusted eleventh vanishing element matrix, the twelfth vanishing element matrix and the plurality of coding data packets.
In step S5111, a tenth elimination matrix P is determined 4 ' whether or not it is empty, if the tenth vanishing matrix P 4 ' is an empty set, and the decoding operation is stopped.
In steps S5112 and S5113, if the tenth vanishing matrix P 4 If 'is not the empty set', extracting a plurality of twelfth element elements from the updated element elimination matrix after updating, and generating a twelfth element elimination matrix according to the twelfth element elimination elements; specifically, fromExtracting a plurality of twelfth vanishing elements, e.g. extracting a first row and a second row, constructing a twelfth vanishing matrix according to the updated first row and the second row in the updated vanishing matrix>Wherein the eleventh vanishing element matrixIs a full rank square matrix.
In steps S5114 to S5115, the twelfth vanishing matrix is adjusted, and a plurality of decoding data packets are obtained according to the adjusted eleventh vanishing matrix, twelfth vanishing matrix and a plurality of encoding data packets. The adjustment thinking is as follows: adjusting a twelfth vanishing matrixBecomes an upper triangular matrix, and then obtains a plurality of decoding data packets according to an eleventh vanishing matrix, a twelfth vanishing matrix and a plurality of coding data packets, wherein the specific implementation process is as follows:
in addition, another
It should be noted that, due to the eleventh vanishing matrixAfter the row sequence is adjusted, the upper triangular square matrix is obtained by substituting the formula (1) with the element elimination>From the formula (2), it can be seen that +.>Substitution can then be converted into formula (1) so that +.>Finally according to->A plurality of decoded data packets x can be obtained 1 ,...,x k To complete the decoding process.
It should be noted that the encoding and data decoding methods of the present application have the following advantages: (1) The probability of generating a matrix full rank is greatly improved, and fewer data packets can be decoded compared with the traditional data coding method, so that communication overhead can be reduced. (2) The encoding and decoding only need exclusive or operation, which can fully utilize SIMD (single instruction multiple data stream, single Instruction Multiple Data) instruction acceleration to improve encoding and decoding speed, wherein the single instruction multiple data stream can copy a plurality of operands and pack them into a group of instruction sets of a large register, and is suitable for data-intensive operations such as multimedia application and the like.
It should be noted that, the present application is mainly directed to the problem of higher complexity of encoding and decoding of the conventional finite field encoding, and because the finite field operation has wide application in communication and storage encoding, the present application is expected to generate wide application value, and several typical application scenarios are described below, and it should be understood that the following description is merely illustrative and not a specific limitation of the present application.
In the first application scenario, the decentralized distributed storage system, in the traditional distributed storage system, a centralized encoder is required to divide the original data into data packets with equal length, encode the data packets, and then distribute the encoded data packets to storage nodes, but in the actual distributed storage system, there is often no centralized encoder, so that in order to solve the problem, the encoding and data decoding methods mentioned in the embodiments of the present application can be applied, and the specific procedures are as follows: assume that there are k data nodes, correspondingly k data packets x 1 ,x 2 ,...,x k The storage node randomly generates a vector v= (v) 1 ,...,v k ) Wherein v is i E {0,1, z,1+z }, calculate (v 1 ,...,v k )(x 1 ,...,x k ) T And storing the calculated data packet locally. Assuming the system has n-k storage nodes, a generator matrix is formed Wherein I is a matrix of units of k x k and Φ is a randomly generated matrix of (n-k) x k, each element being randomly selected from the set {0,1, z,1+z }, the above encoding process can be further optimized as follows, since each element has a probability of taking 0 as 1/4, and the multiplication with the corresponding packet does not require any operation and can not transmit the packet, thereby reducing the bandwidth:
(1) Each data node independently transmits the data packet to the storage node with a probability of 3/4;
(2) Assume that a storage node receives a data packetThe storage node randomly generates a vector v= (v) 1 ,...,v s ) Wherein v is i E {1, z,1+z }, calculate +.>And storing the calculated data packet locally. On average, 3/4 of the packets need to be transmitted, so the systemIs 3/4 of the original average bandwidth.
The second application scenario is a batch sparse coding system, and the coding and data decoding method of the present application may be applied in a network coding system represented by batch sparse coding, and is oriented to a multi-hop network, where the network topology structure of the multi-hop network is shown in fig. 8, where S represents an information source node, an outer code encoder is executed, I is a relay node, an inner code encoder is executed, D is a receiving end node, and a decoder is executed.
The outer code encoding process in the batch coefficient encoding system is as follows, dividing the original data into k data packets, denoted as x 1 ,...,x k . Generating a probability distribution (ψ) at the source end 1 ,...,Ψ m ) I.e. the probability corresponding to a degree d is ψ d Wherein B is a system parameter, which can be adjusted according to the size of the data packet and the size of the original data, in the encoding system of the present application, encoding and decoding are performed by lot, and the number of lots with a degree d is Bψ assuming that a total of B lots are generated d Assuming that the number of times of the ith lot is d, the outer code packet may be generated as follows: firstly, generating an Mxd random matrix G, wherein elements in the matrix G are randomly selected from a {0,1, z,1+z } set, so as to obtain an outer code data packet of the batch, and the specific form of the outer code data packet is as follows:
wherein, the internal code coding process in the batch coefficient coding system is as follows, and the transmission matrix corresponding to the ith batch is recorded as T i The relay node receives k of lot i i Data packet T i b i After that, for T i b i Performing inner code coding to obtain M i Data packet, M i Generally chosen as a constant, the specific operation is as follows:
(1) Generating a binary k i ×M i Random matrix H of (2) i ,H i Each element of (2) is randomly valued at 0 or 1.
(2) Inner codeThe coded data packet is b' i =H i T i b i
The coding process of the receiving end in the batch coefficient coding system is as follows, and the decoding of the receiving end can adopt a method called BP decoding, and the specific flow is as follows:
(1) Firstly, finding a batch with the lowest frequency, setting the frequency as d, and if the number of data packets received in the batch is not less than d, executing a data decoding method in 3.1;
(2) And (3) wrapping the data packet obtained by decoding in the step (1) into data packets of other batches, and executing the step (1) until all the data packets are decoded.
Application scenario three, the present application may also apply the data encoding method and the data decoding method to a wireless communication system typified by 5G, based on a communication system of shift operation. In 5G, delay is an important indicator, in order to reduce delay, data can be divided into small data blocks, each data block is independently encoded, and is independently decoded at a receiving end, but the decoding success rate of the method is low, and in order to balance delay and decoding success rate, sliding window encoding is a better solution. The data coding method can be applied to sliding window coding, in which three parameters n, k and d are included, wherein k represents window size, n represents size after each window coding, d represents depth, and original data is firstly divided into x with equal length 1 ,x 2 ,., the present application may employ systematic code encoding, the encoding process being as follows:
wherein 0 is an all 0 matrix of kx (d-k), I represents an identity matrix of kx k, G i And T i Matrices of (n-k) x (d-k) and (n-k) x k, respectively, each matrix element of which is independently randomly taken from the set {0,1, z,1+z }.
In this embodiment of the present application, a plurality of encoded data packets generated in the first embodiment of the present application may be obtained, an augmentation matrix may be generated according to the plurality of encoded data packets and a preset generation matrix, gaussian elimination operation may be performed on the augmentation matrix to obtain a second matrix, and decoding may be performed on the plurality of encoded data packets according to the obtained second matrix to obtain a plurality of decoded data packets.
In a third aspect, an embodiment of the present application further provides an electronic device.
In some embodiments, an electronic device includes: at least one processor, and a memory communicatively coupled to the at least one processor; the memory stores instructions that are executed by the at least one processor to cause the at least one processor to implement any one of the data encoding methods or the data decoding methods of the embodiments of the present application when executing the instructions.
The processor and the memory may be connected by a bus or other means.
The memory, as a non-transitory computer readable storage medium, may be used to store a non-transitory software program and a non-transitory computer executable program, such as the data encoding method or the data decoding method described in the embodiments of the present application. The processor implements the data encoding method or the data decoding method described above by running a non-transitory software program and instructions stored in a memory.
The memory may include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data for performing the above-described data encoding method or data decoding method. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The non-transitory software programs and instructions required to implement the data encoding or decoding methods described above are stored in memory and when executed by one or more processors perform the data encoding or decoding methods mentioned in the embodiments of the first aspect described above.
In a fourth aspect, embodiments of the present application also provide a computer-readable storage medium.
In some embodiments, a computer-readable storage medium stores computer-executable instructions for performing the data encoding method or the data decoding method mentioned in the embodiments of the first aspect.
In some embodiments, the storage medium stores computer-executable instructions that are executed by one or more control processors, e.g., by one of the processors in the electronic device, to cause the one or more processors to perform the data encoding method or the data decoding method.
The above described apparatus embodiments are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
The embodiments of the present application have been described in detail above with reference to the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge of one of ordinary skill in the art without departing from the spirit of the present application. Furthermore, embodiments of the present application and features of the embodiments may be combined with each other without conflict.

Claims (10)

1. A method of decoding data, comprising:
obtaining a plurality of coded data packets, the plurality of coded data packets being obtained by: acquiring original data to be encoded; dividing the original data into a plurality of original data packets, generating a first matrix according to the plurality of original data packets, and calculating to obtain a coded data packet according to each original data packet and the first matrix to obtain a plurality of coded data packets;
generating an augmentation matrix according to the plurality of coded data packets and a preset generation matrix;
performing Gaussian elimination operation on the augmentation matrix to obtain a second matrix;
decoding the plurality of coded data packets according to the second matrix to obtain a plurality of decoded data packets;
and performing Gaussian elimination operation on the augmentation matrix to obtain a second matrix, wherein the Gaussian elimination operation comprises the following steps:
Acquiring a third matrix according to the augmentation matrix;
obtaining a first preset variable according to the order of the augmentation matrix;
executing a first cyclic process until the number of times of executing the first cyclic process is greater than or equal to the first preset variable;
judging whether the first cyclic process is executed;
if the first cyclic process is executed, a second matrix is obtained according to the updated third matrix;
the first cyclic process includes:
judging whether the third matrix element of each third matrix is a preset first preset element,
if the third matrix element is not the first preset element, executing a second circulation process, and if the third matrix element is the first preset element, executing a third circulation process;
the second cyclic process includes:
the third matrix element is taken as a first switching element to be switched,
obtaining a second exchange element to be exchanged from the third matrix according to the position relation of the first exchange element,
exchanging the first exchange element and the second exchange element in the third matrix to obtain an updated third matrix;
the third cycle process includes:
The third matrix element is taken as a third exchange element to be exchanged,
exclusive-or processing is carried out on the third exchange element to obtain the updated third exchange element,
acquiring a fourth exchange element to be exchanged from the third matrix according to the position relation of the third exchange element,
and in the third matrix, exchanging the updated third exchange element with the fourth exchange element to obtain an updated third matrix.
2. The method of claim 1, wherein generating a first matrix from the plurality of original data packets comprises:
acquiring a plurality of preset matrix elements;
generating a first matrix according to the number of the plurality of original data packets and a plurality of preset matrix elements.
3. The method of claim 1, wherein generating an augmentation matrix from the plurality of encoded data packets and a predetermined generation matrix comprises:
generating a third matrix and a fourth matrix according to the generated matrix;
and generating an augmentation matrix according to the plurality of coded data packets, the third matrix and the fourth matrix.
4. The method for decoding data according to claim 1, wherein decoding the plurality of encoded data packets according to the second matrix to obtain a plurality of decoded data packets comprises:
Extracting a plurality of second matrixes as a fifth matrix;
performing shift operation on each coded data packet in the fifth matrix to obtain an updated fifth matrix;
obtaining an initial vanishing matrix according to the second matrix and the fifth matrix;
performing Gaussian elimination operation on the initial elimination matrix to obtain an updated elimination matrix;
and obtaining a plurality of decoding data packets according to the updated vanishing matrix.
5. The method of claim 4, wherein said performing a gaussian elimination operation on said initial elimination matrix results in an updated elimination matrix, comprising;
extracting a plurality of first element elements, a plurality of second element elements, a plurality of third element elements and a plurality of fourth element elements from the initial element elimination matrix;
generating a first vanishing matrix according to the plurality of first vanishing elements, generating a second vanishing matrix according to the plurality of second vanishing elements, generating a third vanishing matrix according to the plurality of third vanishing elements and generating a fourth vanishing matrix according to the plurality of fourth vanishing elements;
judging whether the first row position and the first principal element position of each first element are the same or not;
If the first row position and the first principal element position of the first element are the same, updating a third element of a row where the third element is located according to the first row position and the first element eliminating matrix, and updating a fourth element of a row where the fourth element eliminating matrix is located according to the first row position and the second element eliminating matrix, so as to obtain an updated element eliminating matrix.
6. The method of data decoding according to claim 5, further comprising:
judging whether the first row position and the first principal element position of each first element are the same or not;
if the first row position and the first principal element position of the first element are different, updating the first element of the row where the first element is located according to the first row position and the third element array, and updating the second element of the row where the second element is located according to the first row position and the fourth element array, so as to obtain an updated element array.
7. The method of claim 6, wherein said updating the cancellation matrix to obtain a plurality of decoded data packets comprises:
Extracting a plurality of fifth element elements, a plurality of sixth element elements, a plurality of seventh element elements, a plurality of eighth element elements and a plurality of ninth element elements from the updated element matrix;
generating a fifth vanishing matrix according to the plurality of fifth vanishing elements, generating a sixth vanishing matrix according to the plurality of sixth vanishing elements, generating a seventh vanishing matrix according to the plurality of seventh vanishing elements, generating an eighth vanishing matrix according to the plurality of eighth vanishing elements and generating a ninth vanishing matrix according to the plurality of ninth vanishing elements;
obtaining a second preset variable according to the order of the seventh elimination matrix;
judging whether the fifth vanishing element matrix has a second preset element which is preset by whether the fifth vanishing element corresponding to a certain row exists or not;
if the fifth element eliminating matrix does not have any row of corresponding fifth element eliminating elements which are all the second preset elements, executing a fourth circulation process until the number of times of executing the fourth circulation process is larger than or equal to the second preset variable;
judging whether the fourth cyclic process is executed;
if the fourth cyclic process is executed, gaussian elimination operation is executed on the seventh elimination matrix and the ninth elimination matrix, and an updated elimination matrix is obtained;
Extracting a plurality of tenth element elements and a plurality of eleventh element elements from the updated element elimination matrix;
generating a tenth element elimination matrix according to the tenth element elimination elements, and generating an eleventh element elimination matrix according to the eleventh element elimination elements;
judging whether the tenth vanishing element matrix is an empty set and whether the eleventh vanishing element matrix is full of rank;
if the tenth element eliminating matrix is an empty set and the eleventh element eliminating matrix is full rank, or the tenth element eliminating matrix is not an empty set, obtaining a plurality of decoding data packets according to the updated element eliminating matrix;
the fourth cycle includes:
finding a principal element row position identical to a fifth principal element position of the fifth vanishing element matrix and a seventh principal element position of the seventh vanishing element matrix,
and updating a seventh element of the row of the seventh element elimination matrix according to the position of the main element row and the fifth element elimination matrix, and updating a ninth element of the row of the ninth element elimination matrix according to the position of the main element row and the sixth element elimination matrix.
8. The method for decoding data according to claim 7, wherein said obtaining a plurality of decoded data packets based on said updated cancellation matrix comprises:
Judging whether the tenth elimination matrix is an empty set or not;
if the tenth element elimination matrix is not an empty set, extracting a plurality of twelfth element elimination elements from the updated element elimination matrix;
generating a twelfth element elimination matrix according to a plurality of the twelfth element elimination elements;
adjusting the twelfth vanishing element matrix;
and obtaining a plurality of decoding data packets according to the adjusted eleventh vanishing element matrix, the twelfth vanishing element matrix and the plurality of coding data packets.
9. An electronic device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized by: the processor, when executing the computer program, implements a data decoding method as claimed in any one of claims 1 to 8.
10. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the data decoding method according to any one of claims 1 to 8.
CN202110628836.6A 2021-06-02 2021-06-02 Data encoding method, data decoding method, electronic device, and storage medium Active CN113541863B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110628836.6A CN113541863B (en) 2021-06-02 2021-06-02 Data encoding method, data decoding method, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110628836.6A CN113541863B (en) 2021-06-02 2021-06-02 Data encoding method, data decoding method, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN113541863A CN113541863A (en) 2021-10-22
CN113541863B true CN113541863B (en) 2024-01-09

Family

ID=78124577

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110628836.6A Active CN113541863B (en) 2021-06-02 2021-06-02 Data encoding method, data decoding method, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN113541863B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115378548A (en) * 2022-08-17 2022-11-22 中国人民解放军63892部队 Connectionless-oriented binary superposition determined linear network coding transmission method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012175564A (en) * 2011-02-23 2012-09-10 Jvc Kenwood Corp Decoding apparatus, encoding apparatus, decoding method and encoding method
CN102891737A (en) * 2012-10-18 2013-01-23 电子科技大学 Method and system for coding and decoding binary rateless codes
CN106877975A (en) * 2016-12-30 2017-06-20 深圳大学 Can sawtooth decoding distributed storage in hard decision joint decoding method
CN111447044A (en) * 2020-03-10 2020-07-24 深圳市大数据研究院 Distributed storage method and transmission decoding method
CN111628783A (en) * 2019-02-27 2020-09-04 西南科技大学 EG-LDPC decoder
CN112532252A (en) * 2020-11-24 2021-03-19 深圳市大数据研究院 Encoding method, decoding method, electronic device, and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8117514B2 (en) * 2006-11-13 2012-02-14 Qualcomm Incorporated Methods and apparatus for encoding data in a communication network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012175564A (en) * 2011-02-23 2012-09-10 Jvc Kenwood Corp Decoding apparatus, encoding apparatus, decoding method and encoding method
CN102891737A (en) * 2012-10-18 2013-01-23 电子科技大学 Method and system for coding and decoding binary rateless codes
CN106877975A (en) * 2016-12-30 2017-06-20 深圳大学 Can sawtooth decoding distributed storage in hard decision joint decoding method
CN111628783A (en) * 2019-02-27 2020-09-04 西南科技大学 EG-LDPC decoder
CN111447044A (en) * 2020-03-10 2020-07-24 深圳市大数据研究院 Distributed storage method and transmission decoding method
CN112532252A (en) * 2020-11-24 2021-03-19 深圳市大数据研究院 Encoding method, decoding method, electronic device, and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A ZigZag-Decodable Code with the MDS Property for Distributed Storage Systems;Chi Wan Sung et al.;《2013 IEEE International Symposium on Information Theory》;全文 *
Decoding and Repair Schemes for Shift-XOR Regenerating Codes;Ximing Fu et al.;《IEEE TRANSACTIONS ON INFORMATION THEORY》;第66卷(第12期);第7371-7385页 *
基于逻辑运算的光域网络编码节点模型;曲志坚 等;电子学报(第07期);全文 *

Also Published As

Publication number Publication date
CN113541863A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
EP1612982B1 (en) Content distribution using network coding
WO2017092543A1 (en) Method and device for rate matching of polar code
CN106877973A (en) The method and communication equipment of polarization code treatment
CN109347604B (en) Multi-hop network communication method and system based on batched sparse codes
Mayekar et al. Optimal lossless source codes for timely updates
CN101459430B (en) Encoding method and apparatus for low density generation matrix code
CN110326221A (en) A method of for generating ordered sequence for polarization code
WO2018019044A1 (en) Encoding method and device
CN113541863B (en) Data encoding method, data decoding method, electronic device, and storage medium
CN107040334A (en) Loss for communication network restores agreement
CN108631925A (en) A kind of quasi-circulating low-density parity check code processing method and device
JP2023157921A (en) Method, device, system, and medium for self-adaptive system code fec encoding and decoding based on media content
Li et al. Multi-sender index coding for collaborative broadcasting: A rank-minimization approach
CN111447044B (en) Distributed storage method and transmission decoding method
CN102761394A (en) Method and device for processing data
CN107733440B (en) Polygonal structured LDPC processing method and device
CN109547160B (en) Cyclic shift network coding construction method
EP2876832B1 (en) Communication method and apparatus
CN112532252B (en) Encoding method, decoding method, electronic device, and storage medium
CN114079530A (en) Encoding method and device
CN104821881B (en) A kind of thing network sensing layer data safety fusion method based on compression and Error Correction of Coding
Schütz et al. Adding a network coding extension to CoAP for large resource transfer
CN110808739A (en) Binary coding method and device with unknown source symbol probability distribution
CN111865488B (en) Code selection method for multi-hop short packet communication
CN110430011B (en) BATS code coding method based on regular variable node degree distribution

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant