A memory system comprising: a memory, configured to, during a read or write operation, write or read a plurality of data, wherein the plurality of data are divided into M bytes, each having N data; and an encoding module, configured to generate, at an encoding stage, X first check codes, each based on a subset of the data at fixed bits among all the bytes, and to generate, at the encoding stage, Y second check codes based on all data in a subset of the bytes, wherein the X first check codes are configured for at least one of error detection or error correction on the N data in each of the bytes, and the Y second check codes are configured for at least one of error detection or error correction on the M bytes; wherein each of M, N, X and Y is a positive natural number; wherein the encoding module comprises a first encoding unit configured to generate the X first check codes, and the X first check codes constitute an X-bit first binary number; each of the first check codes is obtained by performing a first encoding operation on the subset of the data in all the bytes, and the X first check codes correspond to X subsets of the data in a one-to-one manner, different subsets corresponding to different bit combinations in the bytes; wherein the encoding module further comprises a second encoding unit, configured to generate the Y second check codes, and the Y second check codes constitute a Y-bit second binary number; and each of the second check codes is obtained by performing a second encoding operation on a subset of the bytes; characterized in that, the second encoding unit is configured such that a number of times that each of the bytes participates in the second encoding operation is a, wherein a is a positive integer greater than or equal to (Y-1)/2 and less than or equal to (Y+1)/2; wherein M is 16 and Y is 5; the M bytes are divided into zeroth to fifteenth bytes in natural number increments; the Y second check codes are divided into third to seventh second check codes in natural number increments; the third second check code is an exclusive OR or a not exclusive OR (XNOR) on all data of the zeroth, second, third, fourth, fifth, sixth and eighth bytes; the fourth second check code is XOR or XNOR on all data of the zeroth, first, fourth, fifth, seventh, ninth, tenth and twelfth bytes; the fifth second check code is XOR or XNOR on all data of the first, second, fourth, sixth, ninth, eleventh, thirteenth and fourteenth bytes; the sixth second check code is XOR or XNOR on all data of the third, fifth, sixth, seventh, tenth, eleventh, fourteenth and fifteenth bytes; the seventh second check code is XOR or XNOR on all data of the eighth, ninth, tenth, eleventh, twelfth, thirteenth and fifteenth bytes. a memory, configured to, during a read or write operation, write or read a plurality of data, wherein the plurality of data are divided into M bytes, each having N data; and an encoding module, configured to generate, at an encoding stage, X first check codes, each based on a subset of the data at fixed bits among all the bytes, and to generate, at the encoding stage, Y second check codes based on all data in a subset of the bytes, wherein the X first check codes are configured for at least one of error detection or error correction on the N data in each of the bytes, and the Y second check codes are configured for at least one of error detection or error correction on the M bytes; wherein each of M, N, X and Y is a positive natural number; wherein the encoding module comprises a first encoding unit configured to generate the X first check codes, and the X first check codes constitute an X-bit first binary number; each of the first check codes is obtained by performing a first encoding operation on the subset of the data in all the bytes, and the X first check codes correspond to X subsets of the data in a one-to-one manner, different subsets corresponding to different bit combinations in the bytes; wherein the encoding module further comprises a second encoding unit, configured to generate the Y second check codes, and the Y second check codes constitute a Y-bit second binary number; and each of the second check codes is obtained by performing a second encoding operation on a subset of the bytes; characterized in that, the second encoding unit is configured such that a number of times that each of the bytes participates in the second encoding operation is a, wherein a is a positive integer greater than or equal to (Y-1)/2 and less than or equal to (Y+1)/2; wherein M is 16 and Y is 5; the M bytes are divided into zeroth to fifteenth bytes in natural number increments; the Y second check codes are divided into third to seventh second check codes in natural number increments; the third second check code is an exclusive OR or a not exclusive OR (XNOR) on all data of the zeroth, second, third, fourth, fifth, sixth and eighth bytes; the fourth second check code is XOR or XNOR on all data of the zeroth, first, fourth, fifth, seventh, ninth, tenth and twelfth bytes; the fifth second check code is XOR or XNOR on all data of the first, second, fourth, sixth, ninth, eleventh, thirteenth and fourteenth bytes; the sixth second check code is XOR or XNOR on all data of the third, fifth, sixth, seventh, tenth, eleventh, fourteenth and fifteenth bytes; the seventh second check code is XOR or XNOR on all data of the eighth, ninth, tenth, eleventh, twelfth, thirteenth and fifteenth bytes.