CN117579225A - Sparse matrix coding and data storage method for unstructured regular distribution - Google Patents

Sparse matrix coding and data storage method for unstructured regular distribution Download PDF

Info

Publication number
CN117579225A
CN117579225A CN202311559642.0A CN202311559642A CN117579225A CN 117579225 A CN117579225 A CN 117579225A CN 202311559642 A CN202311559642 A CN 202311559642A CN 117579225 A CN117579225 A CN 117579225A
Authority
CN
China
Prior art keywords
matrix
field
zero
sequence
sparse matrix
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.)
Granted
Application number
CN202311559642.0A
Other languages
Chinese (zh)
Other versions
CN117579225B (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.)
Sichuan Xinshi Chuangwei Ultra High Definition Technology Co ltd
Original Assignee
Sichuan Xinshi Chuangwei Ultra High Definition Technology Co ltd
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 Sichuan Xinshi Chuangwei Ultra High Definition Technology Co ltd filed Critical Sichuan Xinshi Chuangwei Ultra High Definition Technology Co ltd
Priority to CN202311559642.0A priority Critical patent/CN117579225B/en
Publication of CN117579225A publication Critical patent/CN117579225A/en
Application granted granted Critical
Publication of CN117579225B publication Critical patent/CN117579225B/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/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • H04L1/0007Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length
    • H04L1/0008Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length by supplementing frame payload, e.g. with padding bits
    • 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/0076Distributed coding, e.g. network coding, involving channel coding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Complex Calculations (AREA)

Abstract

The invention discloses a sparse matrix coding and data storage method aiming at unstructured regular distribution. A sparse matrix coding and data storage method for unstructured regular distribution, comprising: acquiring non-zero elements in an original sparse matrix, and generating a first field according to the non-zero elements; acquiring the positions of non-zero elements in an original sparse matrix, and generating a second field according to the positions of the non-zero elements; when the column number of the original sparse matrix is larger than a preset value, calculating a non-zero line number relation of the head and the tail of the original sparse matrix to obtain a third field; when the number of columns of the original sparse matrix is smaller than or equal to a preset value, storing a first field and a second field; and when the number of columns of the original sparse matrix is larger than a preset value, storing the first field, the second field and the third field. The storage structure source in the invention is equation solution, an M matrix is constructed by the identity matrix, the algorithm is simple, the storage data size is small, and the method is suitable for hardware realization.

Description

Sparse matrix coding and data storage method for unstructured regular distribution
Technical Field
The invention relates to a sparse matrix coding and data storage method aiming at unstructured regular distribution.
Background
The distribution of the sparse matrix is closely related to the coding efficiency of the sparse matrix; for the sparse matrix distributed irregularly, most of sparse matrix codes at present mainly encode the value and the position information of non-0 element, such as COO. The prior art (e.g., COO, CSR) requires 3 fields to describe for all sparse matrix sizes and does not specifically optimize the compression field of images or video.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a sparse matrix coding and data storage method aiming at unstructured regular distribution.
The aim of the invention is realized by the following technical scheme: a sparse matrix coding and data storage method for unstructured regular distribution, comprising:
acquiring non-zero elements in an original sparse matrix, and generating a first field according to the non-zero elements;
acquiring the positions of non-zero elements in an original sparse matrix, and generating a second field according to the positions of the non-zero elements;
when the column number of the original sparse matrix is larger than a preset value, calculating a non-zero line number relation of the head and the tail of the original sparse matrix to obtain a third field;
when the number of columns of the original sparse matrix is smaller than or equal to a preset value, storing a first field and a second field;
and when the number of columns of the original sparse matrix is larger than a preset value, storing the first field, the second field and the third field.
Further, obtaining a non-zero element in the original sparse matrix, generating a first field according to the non-zero element, including:
recording non-zero elements in an original sparse matrix;
and arranging non-zero elements in the original sparse matrix in sequence from left to right and from top to bottom to form a first field.
Further, obtaining the position of the non-zero element in the original sparse matrix, generating a second field according to the position of the non-zero element, including:
judging whether the first row and the last row of the original sparse matrix are zero elements or not;
when the first row and the last row of the original sparse matrix are zero elements, the first row and the last row of the original sparse matrix are removed at the same time, the steps are repeated until non-zero elements exist in the first row or the last row of the original sparse matrix, and the matrix obtained at the moment is recorded as a first intermediate matrix;
when non-zero elements exist in the first row or the last row of the original sparse matrix, the original sparse matrix is marked as a first intermediate matrix;
modifying the value of the non-zero element of the first intermediate matrix to be 1, and setting the values of the rest positions of the first intermediate matrix to be 0 to obtain a non-zero element position matrix;
traversing the non-zero element position matrix from left to right downwards from the first row, and obtaining a full zero sequence from the beginning to the first non-zero element according to the traversing sequence, and recording the full zero sequence as a first sequence;
traversing the non-zero element position matrix from the last row from right to left upwards, obtaining the all-zero sequence from the last non-zero element to the end according to the traversing sequence, and marking the all-zero sequence as a second sequence;
if the length of the first sequence and/or the length of the second sequence is 0, sequentially arranging the values in the non-zero element position matrix from left to right and from top to bottom to form a second field;
if the length of the first sequence and the length of the second sequence are not 0, comparing the lengths of the first sequence and the second sequence: if the lengths of the first sequence and the second sequence are different, removing the longer sequences in the first sequence and the second sequence from the non-zero element position matrix to obtain a second intermediate matrix; if the lengths of the first sequence and the second sequence are the same, removing the second sequence from the non-zero element position matrix to obtain a second intermediate matrix;
and arranging the values in the second intermediate matrix in sequence from left to right and from top to bottom to form a second field.
Further, calculating a non-zero line number relation of the head and the tail of the original sparse matrix to obtain a third field, including:
and calculating a third field, wherein the calculation formula of the value of the third field is as follows:
where k represents the value of the third field, c represents the number of all zero rows of the first sequence, d represents the number of all zero rows of the second sequence,representing a rounding down.
Further, the method further comprises a recovery step comprising:
generating a third intermediate matrix according to the second field, wherein the number of columns of the third intermediate matrix is n, and n is the number of columns of the original sparse matrix;
determining the filling direction according to the value of the head and tail characters in the second field: if the first character of the second field is 1 and the last character is 0, the filling direction is from the first character to the left; if the first character of the second field is 0 and the last character is 1, the filling direction is from the last character to the right; if the first character of the second field is 1 and the last character is 1, the first field is not filled;
filling 0 into the third intermediate matrix according to the filling direction until the number of elements in the third intermediate matrix is divided by m for the first time, wherein m is the number of rows of the original sparse matrix;
when n is smaller than or equal to a preset value, judging whether (h+ 2*m) is smaller than m, wherein h is the number of elements of the third intermediate matrix; when n is greater than a preset value, supplementing all zero rows of corresponding rows in the filling direction according to the value of the third field, and then judging whether (h+ 2*m) is smaller than m×n;
when (h+ 2*m) is smaller than m×n, adding one row of all zero rows to each of the head and tail of the third intermediate matrix until (h+ 2*m) is equal to m×n;
and filling the values in the first field into corresponding positions in the third intermediate matrix to obtain an original sparse matrix.
Further, the preset value is 4.
Further, according to the value of the third field, the full zero rows of the corresponding rows are supplemented in the filling direction, the number of the supplemented full zero rows is 2 x k x m, k is the value of the third field, and m is the number of the rows of the original sparse matrix.
The beneficial effects of the invention are as follows:
(1) The storage structure source in the invention is equation solution, an M matrix is constructed through the identity matrix, the algorithm is simple, the storage data volume is small, and the method is suitable for hardware realization;
(2) The invention can quickly construct the F matrix through the value of the third field, and the implicit calculation logic F is equal to A=A; the M matrix can be obtained rapidly through the F matrix, and logic M x=alpha is calculated implicitly; for some special matrices, the method can directly operate;
(3) The method provided by the invention uses a binary character string for representing the second field (the position matrix of the non-zero element) and the third field, can be better compatible with a compression algorithm of an image or a video, further increases the compression rate, and is suitable for scenes of coding transmission.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a schematic diagram of matrix A in one embodiment;
FIG. 3 is a schematic diagram of matrix B in one embodiment;
FIG. 4 is a schematic diagram of a non-zero element position matrix S in one embodiment;
FIG. 5 is a schematic diagram of two subsequences in one embodiment;
FIG. 6 is a diagram of calculating a second field value in one embodiment;
FIG. 7 is a schematic diagram of a coefficient flag sequence in one embodiment;
FIG. 8 is a schematic diagram of padding 0 according to the Long_flag direction in one embodiment;
FIG. 9 is a schematic diagram of one embodiment with one row added up and down;
FIG. 10 is a diagram of raw matrix position information in one embodiment;
FIG. 11 is a schematic diagram of an original sparse matrix in one embodiment.
Detailed Description
The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments, and it is apparent that the described embodiments are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by a person skilled in the art without any inventive effort, are intended to be within the scope of the present invention, based on the embodiments of the present invention.
Referring to fig. 1 to 11, the present invention provides a sparse matrix coding and data storage method for unstructured regular distribution:
as shown in fig. 1, a sparse matrix coding and data storage method for irregular distribution includes a storage step including S100 to S400.
S100, acquiring non-zero elements in an original sparse matrix, and generating a first field according to the non-zero elements.
In some embodiments, obtaining non-zero elements in an original sparse matrix, generating a first field from the non-zero elements, includes: recording non-zero elements in an original sparse matrix; and arranging non-zero elements in the original sparse matrix in sequence from left to right and from top to bottom to form a first field.
S200, acquiring the positions of non-zero elements in the original sparse matrix, and generating a second field according to the positions of the non-zero elements.
In some embodiments, the positions of non-zero elements in the original sparse matrix are obtained, and a second field is generated according to the positions of the non-zero elements, including S210 to S290.
S210, judging whether the first row and the last row of the original sparse matrix are zero elements: when the first row and the last row of the original sparse matrix are zero elements, the first row and the last row of the original sparse matrix are removed at the same time, the steps are repeated until non-zero elements exist in the first row or the last row of the original sparse matrix, and the matrix obtained at the moment is recorded as a first intermediate matrix; when non-zero elements exist in the first row or the last row of the original sparse matrix, the original sparse matrix is marked as a first intermediate matrix.
Specifically, when the first row and the last row of the original sparse matrix are zero elements (i.e., the first row and the last row are all zero rows), the first row and the last row of the original sparse matrix are removed simultaneously to obtain a new matrix, then whether the first row and the last row of the new matrix are zero elements is judged, if yes, the first row and the last row of the new matrix are removed simultaneously, and the like until non-zero elements exist in the first row or the last row of the obtained new matrix, and the new matrix obtained at the moment is marked as a first intermediate matrix. When non-zero elements exist in the first row or the last row of the original sparse matrix (i.e., the first row and/or the last row is not all zero rows), the original sparse matrix is directly marked as a first intermediate matrix.
S220, modifying the value of the non-zero element of the first intermediate matrix to be 1, and setting the values of the rest positions of the first intermediate matrix to be 0 to obtain a non-zero element position matrix.
S230, traversing the non-zero element position matrix from left to right downwards from the first row, and obtaining a full zero sequence from the beginning to the first non-zero element according to the traversing order, and recording the full zero sequence as a first sequence.
Specifically, the traversal order is to traverse the first row from left to right, then the second row from left to right, and so on, until the first non-zero element is traversed.
S240, traversing the non-zero element position matrix from the last row from right to left upwards, and obtaining the all-zero sequence from the last non-zero element to the end according to the traversing sequence, and marking the all-zero sequence as a second sequence.
Specifically, the traversal order is to traverse the last row from right to left, then traverse the penultimate row from right to left, and so on, until the first non-zero element is traversed.
S250, judging the length of the first sequence and the length of the second sequence: if the length of the first sequence and/or the length of the second sequence is 0, marking the non-zero element position matrix as a second intermediate matrix, and then executing S290; if the length of the first sequence and the length of the second sequence are not 0, S260 is performed.
S260, comparing the lengths of the first sequence and the second sequence: if the lengths of the first sequence and the second sequence are different, removing the longer sequences in the first sequence and the second sequence from the non-zero element position matrix to obtain a second intermediate matrix; if the lengths of the first sequence and the second sequence are the same, removing the second sequence from the non-zero element position matrix to obtain a second intermediate matrix; then S270 is performed.
S270, sequentially arranging the values in the second intermediate matrix from left to right and from top to bottom to form a second field.
S300, when the number of columns of the original sparse matrix is larger than a preset value, calculating a non-zero line number relation of the head and the tail of the original sparse matrix, and obtaining a third field.
In some embodiments, calculating the non-zero row number relationship of the head and tail of the original sparse matrix to obtain a third field includes: and calculating a third field, wherein the calculation formula of the value of the third field is as follows:
where k represents the value of the third field, c represents the number of all zero rows of the first sequence, d represents the number of all zero rows of the second sequence,representing a rounding down.
In some embodiments, the preset value is 4.
S400, when the number of columns of the original sparse matrix is smaller than or equal to a preset value, storing a first field and a second field; and when the number of columns of the original sparse matrix is larger than a preset value, storing the first field, the second field and the third field.
The principle of the method in the embodiment is as follows: expanding the original matrix B (m, n) into a matrix a (mxn, 1); the non-zero elements in the record matrix a (mxn, 1) are Values, the Values are recorded as a vector α, and the number of non-zero elements is a1. A new matrix M (a, M x n) is constructed based on an mxn identity matrix, such that M x a = a. The matrix a can be obtained by solving equation x, where all column vectors Mj are 0 vectors, with xj=0, by M x=α.
The construction process of the matrix M is as follows: constructing an m x n identity matrix; element a in matrix A (m n, 1) i When the element is 0, setting the element in the identity matrix to 0 to obtain a matrix F (m multiplied by n, 1); and removing all zero row vectors in the F matrix to obtain an M matrix.
Therefore, the method of this embodiment only needs to store the diagonal element values of the matrix F and all non-zero elements to construct m×a=α, and then the original matrix a can be obtained.
As shown in table 1, the method of this embodiment only needs to store three fields.
TABLE 1
The method of the present embodiment will be described below in one example.
Matrix a, whose original sparse matrix is mxn, is known as shown in fig. 2.
Non-zero-element vaules= (a, b, c, d, e) are recorded.
Since the first row and the last row of matrix a are zero elements, two rows are removed simultaneously to obtain matrix B, as shown in fig. 3.
A non-zero element position matrix S is obtained from the matrix B as shown in fig. 4.
The matrix S is traversed from left to right down from the first row, and an all zero bit sub-sequence from the beginning to the first non-zero element, start0 sub array= (0), is obtained according to the traversal order, as shown in fig. 5.
Traversing the matrix S from right to left starting from the last row finds the last non-zero element to end all zero bit subsequence according to the traversal order, end0_sub_array= (0,0,0,0,0,0,0,0,0,0,0,0,0), as shown in fig. 5.
The number of lines of all zero elements of the two subsequences is compared, the difference is divided by 2, and the result is zero_2line_flag, which is obtained by rounding down, as shown in fig. 6.
zero_2line_flag=(len(start0_sub_array)/m-len(end0_sub_array)/m)/2=(1-0)/2=0。
Since both sub-sequences are not 0 in length, a coefficient flag sequence position= (0100010000000000100000000000000001001) is obtained as shown in fig. 7.
In some embodiments, the method further comprises a recovery step comprising
K100. And generating a third intermediate matrix according to the second field, wherein the number of columns of the third intermediate matrix is n, and n is the number of columns of the original sparse matrix.
K200. Determining the filling direction according to the value of the head and tail characters in the second field: if the first character of the second field is 1 and the last character is 0, the filling direction is from the first character to the left; if the first character of the second field is 0 and the last character is 1, the filling direction is from the last character to the right; if the first character of the second field is 1 and the last character is 1, the filling is not performed.
K300. And filling 0 into the third intermediate matrix according to the filling direction until the number of elements in the third intermediate matrix is divided by m for the first time, wherein m is the number of rows of the original sparse matrix.
K400. When n is smaller than or equal to a preset value, judging whether (h+ 2*m) is smaller than m×n, and then executing K500, wherein h is the number of elements of the third intermediate matrix; when n is greater than a preset value, supplementing all zero rows of the corresponding rows in the filling direction according to the value of the third field, judging whether (h+ 2*m) is smaller than m×n, and executing K500.
In some embodiments, the preset value is 4.
K500. When (h+ 2*m) is smaller than m×n, the head and tail of the third intermediate matrix are each increased by one row of all zero rows until (h+ 2*m) is equal to m×n, and then K600 is performed.
When (h+ 2*m) is equal to m×n, no more all zero rows are added, resulting in an original position matrix. If (h+ 2*m) is greater than m n, an error occurs.
K600. And filling the values in the first field into corresponding positions in the third intermediate matrix to obtain an original sparse matrix.
The method of the present embodiment will be described below in one example.
And finding out the element with 1 in the first element and the last element based on the coefficient mark sequence Position obtained in the previous case. As shown in table 2, the direction 1 indicates the position of the Long string, if the first character is 1, the flag long_flag=l, and if the last character is 1, the flag long_flag=r; if both are 1, the flag long_flag=n.
TABLE 2
Long_flag 0 filling direction
First character is 1 L Padding 0 from first character to left
The tail character is 1 R Padding 0 from the tail character to the right
The first character is 1 and the last character is 1 N Not filled with
As shown in table 2, 0 is padded according to the long_flag direction until the sequence element is just divisible by m, as shown in fig. 8.
And supplementing all zero lines in the Long_flag direction according to the value of the zero_2line_flag. The number of the supplementary elements is zero_2line_flag 2×m. Since the value of zero_2line_flag is 0, the all zero line is not replenished here.
Since (40+2×7) ×7×10, one row of all zero rows is added up and down, as shown in fig. 9.
Filling 0 according to the Long_flag direction until all elements are m×n, and obtaining the original matrix position information, as shown in FIG. 10.
The Values are filled into the matrix to obtain the original sparse matrix, as shown in fig. 11.
Table 3 lists some 4x4 matrices, since n <4, the zero_2line_flag field is not needed.
TABLE 3 Table 3
The foregoing is merely a preferred embodiment of the invention, and it is to be understood that the invention is not limited to the form disclosed herein but is not to be construed as excluding other embodiments, but is capable of numerous other combinations, modifications and environments and is capable of modifications within the scope of the inventive concept, either as taught or as a matter of routine skill or knowledge in the relevant art. And that modifications and variations which do not depart from the spirit and scope of the invention are intended to be within the scope of the appended claims.

Claims (7)

1. A sparse matrix coding and data storage method for unstructured regular distribution, comprising:
acquiring non-zero elements in an original sparse matrix, and generating a first field according to the non-zero elements;
acquiring the positions of non-zero elements in an original sparse matrix, and generating a second field according to the positions of the non-zero elements;
when the column number of the original sparse matrix is larger than a preset value, calculating a non-zero line number relation of the head and the tail of the original sparse matrix to obtain a third field;
when the number of columns of the original sparse matrix is smaller than or equal to a preset value, storing a first field and a second field;
and when the number of columns of the original sparse matrix is larger than a preset value, storing the first field, the second field and the third field.
2. The method for encoding and storing data according to claim 1, wherein obtaining non-zero elements in an original sparse matrix, generating a first field according to the non-zero elements, comprises:
recording non-zero elements in an original sparse matrix;
and arranging non-zero elements in the original sparse matrix in sequence from left to right and from top to bottom to form a first field.
3. The method for encoding and storing data according to claim 1, wherein obtaining the positions of non-zero elements in the original sparse matrix, and generating the second field according to the positions of the non-zero elements, comprises:
judging whether the first row and the last row of the original sparse matrix are zero elements or not;
when the first row and the last row of the original sparse matrix are zero elements, the first row and the last row of the original sparse matrix are removed at the same time, the steps are repeated until non-zero elements exist in the first row or the last row of the original sparse matrix, and the matrix obtained at the moment is recorded as a first intermediate matrix;
when non-zero elements exist in the first row or the last row of the original sparse matrix, the original sparse matrix is marked as a first intermediate matrix;
modifying the value of the non-zero element of the first intermediate matrix to be 1, and setting the values of the rest positions of the first intermediate matrix to be 0 to obtain a non-zero element position matrix;
traversing the non-zero element position matrix from left to right downwards from the first row, and obtaining a full zero sequence from the beginning to the first non-zero element according to the traversing sequence, and recording the full zero sequence as a first sequence;
traversing the non-zero element position matrix from the last row from right to left upwards, obtaining the all-zero sequence from the last non-zero element to the end according to the traversing sequence, and marking the all-zero sequence as a second sequence;
if the length of the first sequence and/or the length of the second sequence is 0, sequentially arranging the values in the non-zero element position matrix from left to right and from top to bottom to form a second field;
if the length of the first sequence and the length of the second sequence are not 0, comparing the lengths of the first sequence and the second sequence: if the lengths of the first sequence and the second sequence are different, removing the longer sequences in the first sequence and the second sequence from the non-zero element position matrix to obtain a second intermediate matrix; if the lengths of the first sequence and the second sequence are the same, removing the second sequence from the non-zero element position matrix to obtain a second intermediate matrix;
and arranging the values in the second intermediate matrix in sequence from left to right and from top to bottom to form a second field.
4. The method for encoding and storing data according to claim 3, wherein calculating a non-zero row number relationship between the head and tail of the original sparse matrix to obtain a third field comprises:
and calculating a third field, wherein the calculation formula of the value of the third field is as follows:
where k represents the value of the third field, c represents the number of all zero rows of the first sequence, d represents the number of all zero rows of the second sequence,representing a rounding down.
5. A sparse matrix coding and data storage method for unstructured regular distribution according to claim 1, further comprising a recovery step comprising:
generating a third intermediate matrix according to the second field, wherein the number of columns of the third intermediate matrix is n, and n is the number of columns of the original sparse matrix;
determining the filling direction according to the value of the head and tail characters in the second field: if the first character of the second field is 1 and the last character is 0, the filling direction is from the first character to the left; if the first character of the second field is 0 and the last character is 1, the filling direction is from the last character to the right; if the first character of the second field is 1 and the last character is 1, the first field is not filled;
filling 0 into the third intermediate matrix according to the filling direction until the number of elements in the third intermediate matrix is divided by m for the first time, wherein m is the number of rows of the original sparse matrix;
when n is smaller than or equal to a preset value, judging whether (h+ 2*m) is smaller than m, wherein h is the number of elements of the third intermediate matrix; when n is greater than a preset value, supplementing all zero rows of corresponding rows in the filling direction according to the value of the third field, and then judging whether (h+ 2*m) is smaller than m×n;
when (h+ 2*m) is smaller than m×n, adding one row of all zero rows to each of the head and tail of the third intermediate matrix until (h+ 2*m) is equal to m×n;
and filling the values in the first field into corresponding positions in the third intermediate matrix to obtain an original sparse matrix.
6. A sparse matrix coding and data storage method for unstructured regular distribution according to claim 1 or 5, wherein said preset value is 4.
7. The method for encoding and storing data according to claim 5, wherein the number of rows of the complementary all-zero rows is 2 x k x m, k is the value of the third field, and m is the number of rows of the original sparse matrix.
CN202311559642.0A 2023-11-21 2023-11-21 Sparse matrix coding and data storage method for unstructured regular distribution Active CN117579225B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311559642.0A CN117579225B (en) 2023-11-21 2023-11-21 Sparse matrix coding and data storage method for unstructured regular distribution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311559642.0A CN117579225B (en) 2023-11-21 2023-11-21 Sparse matrix coding and data storage method for unstructured regular distribution

Publications (2)

Publication Number Publication Date
CN117579225A true CN117579225A (en) 2024-02-20
CN117579225B CN117579225B (en) 2024-05-10

Family

ID=89860249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311559642.0A Active CN117579225B (en) 2023-11-21 2023-11-21 Sparse matrix coding and data storage method for unstructured regular distribution

Country Status (1)

Country Link
CN (1) CN117579225B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021051448A (en) * 2019-09-24 2021-04-01 日本電気株式会社 Information processing device, sparse matrix storage method and program
CN112953549A (en) * 2021-02-08 2021-06-11 中国科学院计算机网络信息中心 Storage processing method and device for sparse matrix
CN114945917A (en) * 2020-01-15 2022-08-26 谷歌有限责任公司 Sparse matrix operations for deep learning
CN115309333A (en) * 2022-07-29 2022-11-08 中国科学院重庆绿色智能技术研究院 Data storage format of strip-shaped sparse matrix and multiplication acceleration method thereof
CN116257209A (en) * 2021-12-10 2023-06-13 沐曦集成电路(上海)有限公司 Compressed storage of sparse matrix and parallel processing method of vector multiplication thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2021051448A (en) * 2019-09-24 2021-04-01 日本電気株式会社 Information processing device, sparse matrix storage method and program
CN114945917A (en) * 2020-01-15 2022-08-26 谷歌有限责任公司 Sparse matrix operations for deep learning
CN112953549A (en) * 2021-02-08 2021-06-11 中国科学院计算机网络信息中心 Storage processing method and device for sparse matrix
CN116257209A (en) * 2021-12-10 2023-06-13 沐曦集成电路(上海)有限公司 Compressed storage of sparse matrix and parallel processing method of vector multiplication thereof
CN115309333A (en) * 2022-07-29 2022-11-08 中国科学院重庆绿色智能技术研究院 Data storage format of strip-shaped sparse matrix and multiplication acceleration method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谢佩珍: "适合向量化的稀疏矩阵存储格式研究", 中国优秀硕士学位论文全文数据库(信息科技辑), no. 2019, 15 January 2019 (2019-01-15) *

Also Published As

Publication number Publication date
CN117579225B (en) 2024-05-10

Similar Documents

Publication Publication Date Title
CN113904764B (en) Image encryption method based on multi-scale compressed sensing and Markov model
US10411735B1 (en) Systems and methods for an iterative decoding scheme
TWI227394B (en) Error correction coding apparatus and method
WO2006062993A2 (en) Lossy data compression exploiting distortion side information
CN109889205B (en) Coding method and system, decoding method and system, coding and decoding method and system
CN109979540A (en) A kind of DNA information storage coding method
WO2006109951A1 (en) Method and apparatus for generating block-based low-density parity check matrix and recording medium having recorded thereon code for implementing the method
CN106936444B (en) Set decoding method and set decoder
CN109547032B (en) Confidence propagation LDPC decoding method based on deep learning
KR20070063851A (en) Parity check matrix, method for generating parity check matrix, encoding method and error correction apparatus
CN117579225B (en) Sparse matrix coding and data storage method for unstructured regular distribution
WO2019001263A1 (en) Design method and apparatus for quasi-cyclic low-density parity-check
KR100918741B1 (en) Apparatus and method for channel coding in mobile communication system
CN114499541A (en) Layered decoding method, device, terminal equipment and medium
KR20210004897A (en) A method and apparatus for fast decoding a linear code based on bit matching
KR20080030329A (en) Method for reduced complexity encoder generating low density parity check codes
CN108933604B (en) Variable node processing method and device
US20070186139A1 (en) Interleaving method for low density parity check encoding
US9160364B1 (en) Code word formatter of shortened non-binary linear error correction code
CN110365864B (en) Image steganography method, image steganography system, computer device and computer-readable storage medium
CN107959502B (en) LDPC coding method
CN117609488B (en) Method and device for searching small-weight code words, computer storage medium and terminal
TWI384377B (en) Data encoding and decoding method
CN117375636B (en) Method, device and equipment for improving throughput rate of QC-LDPC decoder
RU2365034C2 (en) Method and device for data coding and decoding

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