An encoding method, wherein the method comprises: receiving a data bitstream; performing forward error correction FEC encoding on the data bitstream to obtain X reed solomon RS outer codes, wherein each of the X RS outer codes comprises N1 symbols, K1 of the N1 symbols are payload symbols, N1 > K1, N1 and K1 are integers greater than 1, and X is an integer greater than 0; and performing FEC encoding on the X RS outer codes to obtain Y RS inner codes, wherein each of the Y RS inner codes comprises N2 symbols, K2 of the N2 symbols are payload symbols, N2 > K2, N2 and K2 are integers greater than 0, Y is an integer greater than 1, and N1 > N2; wherein the performing FEC encoding on the X RS outer codes to obtain Y RS inner codes comprises: for each of the Y RS inner codes, determining K2 payload symbols comprised in the RS inner code; and performing FEC encoding on the K2 payload symbols to obtain the RS inner code that comprises N2 symbols. wherein the determining K2 payload symbols comprised in the RS inner code comprises: for each of the K2 payload symbols, based on a number j of an RS outer code to which the payload symbol belongs and a number i of the payload symbol in the RS outer code j, determining, according to the following first formulas, a number h of an RS inner code to which the payload symbol belongs and a number c of the payload symbol in the RS inner code h, wherein j = 0, 1,..., X - 1, and i = 0, 1,..., N1 - 1, wherein the first formulas are: h = floor((i ∗ X + j)/K2) and c = (i ∗ X + j) MOD K2, wherein floor represents a rounding down operation, and MOD represents a modulo operation. receiving a data bitstream; performing forward error correction FEC encoding on the data bitstream to obtain X reed solomon RS outer codes, wherein each of the X RS outer codes comprises N1 symbols, K1 of the N1 symbols are payload symbols, N1 > K1, N1 and K1 are integers greater than 1, and X is an integer greater than 0; and performing FEC encoding on the X RS outer codes to obtain Y RS inner codes, wherein each of the Y RS inner codes comprises N2 symbols, K2 of the N2 symbols are payload symbols, N2 > K2, N2 and K2 are integers greater than 0, Y is an integer greater than 1, and N1 > N2; wherein the performing FEC encoding on the X RS outer codes to obtain Y RS inner codes comprises: for each of the Y RS inner codes, determining K2 payload symbols comprised in the RS inner code; and performing FEC encoding on the K2 payload symbols to obtain the RS inner code that comprises N2 symbols. wherein the determining K2 payload symbols comprised in the RS inner code comprises: for each of the K2 payload symbols, based on a number j of an RS outer code to which the payload symbol belongs and a number i of the payload symbol in the RS outer code j, determining, according to the following first formulas, a number h of an RS inner code to which the payload symbol belongs and a number c of the payload symbol in the RS inner code h, wherein j = 0, 1,..., X - 1, and i = 0, 1,..., N1 - 1, wherein the first formulas are: h = floor((i ∗ X + j)/K2) and c = (i ∗ X + j) MOD K2, wherein floor represents a rounding down operation, and MOD represents a modulo operation. for each of the Y RS inner codes, determining K2 payload symbols comprised in the RS inner code; and performing FEC encoding on the K2 payload symbols to obtain the RS inner code that comprises N2 symbols. wherein the determining K2 payload symbols comprised in the RS inner code comprises: for each of the K2 payload symbols, based on a number j of an RS outer code to which the payload symbol belongs and a number i of the payload symbol in the RS outer code j, determining, according to the following first formulas, a number h of an RS inner code to which the payload symbol belongs and a number c of the payload symbol in the RS inner code h, wherein j = 0, 1,..., X - 1, and i = 0, 1,..., N1 - 1, wherein the first formulas are: h = floor((i ∗ X + j)/K2) and c = (i ∗ X + j) MOD K2, wherein floor represents a rounding down operation, and MOD represents a modulo operation. for each of the K2 payload symbols, based on a number j of an RS outer code to which the payload symbol belongs and a number i of the payload symbol in the RS outer code j, determining, according to the following first formulas, a number h of an RS inner code to which the payload symbol belongs and a number c of the payload symbol in the RS inner code h, wherein j = 0, 1,..., X - 1, and i = 0, 1,..., N1 - 1, wherein the first formulas are: h = floor((i ∗ X + j)/K2) and c = (i ∗ X + j) MOD K2, wherein floor represents a rounding down operation, and MOD represents a modulo operation.