A packet processing method, performed by a packet processing apparatus comprising a processor and a target hardware engine, the method comprising: obtaining, by the processor, a plurality of original packets; performing concatenation processing on other original packets other than a first packet in the plurality of original packets based on a size of the first packet, to obtain at least one concatenated packet, wherein the first packet is a largest packet in the plurality of original packets; when a size of any concatenated packet in the at least one concatenated packet is less than the size of the first packet, performing, by the processor, padding processing on the at least one concatenated packet to obtain equal-length data blocks, wherein a size of each data block in the equal-length data blocks is the size of the first packet; and performing, by the processor, forward error correction, FEC, encoding processing on the first packet and the equal-length data block, to obtain at least one redundant packet, wherein the performing concatenation processing on other original packets other than the first packet in the plurality of original packets based on the size of the first packet, to obtain the at least one concatenated packet comprises: grouping, by the processor, the other original packets other than the first packet in the plurality of original packets, based on the size of the first packet in the plurality of original packets, to obtain at least one packet group, and generating, by the processor, an encoding task based on the at least one packet group, wherein the encoding task comprises address information of each packet group; and performing, by the target hardware engine, concatenation processing on each packet group based on the encoding task, to obtain the at least one concatenated packet. obtaining, by the processor, a plurality of original packets; performing concatenation processing on other original packets other than a first packet in the plurality of original packets based on a size of the first packet, to obtain at least one concatenated packet, wherein the first packet is a largest packet in the plurality of original packets; when a size of any concatenated packet in the at least one concatenated packet is less than the size of the first packet, performing, by the processor, padding processing on the at least one concatenated packet to obtain equal-length data blocks, wherein a size of each data block in the equal-length data blocks is the size of the first packet; and performing, by the processor, forward error correction, FEC, encoding processing on the first packet and the equal-length data block, to obtain at least one redundant packet, wherein the performing concatenation processing on other original packets other than the first packet in the plurality of original packets based on the size of the first packet, to obtain the at least one concatenated packet comprises: grouping, by the processor, the other original packets other than the first packet in the plurality of original packets, based on the size of the first packet in the plurality of original packets, to obtain at least one packet group, and generating, by the processor, an encoding task based on the at least one packet group, wherein the encoding task comprises address information of each packet group; and performing, by the target hardware engine, concatenation processing on each packet group based on the encoding task, to obtain the at least one concatenated packet. grouping, by the processor, the other original packets other than the first packet in the plurality of original packets, based on the size of the first packet in the plurality of original packets, to obtain at least one packet group, and generating, by the processor, an encoding task based on the at least one packet group, wherein the encoding task comprises address information of each packet group; and performing, by the target hardware engine, concatenation processing on each packet group based on the encoding task, to obtain the at least one concatenated packet.