1. An encoding method of an Ethernet physical layer, the method comprising: determining a to-be-encoded first information group, wherein the first information group comprises m characters, m≧2, and m is an integer, wherein a character attribute of any character is a data character, a boundary character, or a third-type character, one character occupies one byte, and the third-type character is a character except the data character and the boundary character; detecting a character attribute of each character in the first information group; if the first information group comprises n boundary characters, wherein n≧1, and n is an integer, deleting the n boundary characters, and generating a second information group by using a character, except the n boundary characters, in the first information group, and type information and position information that are of the n boundary characters, wherein the second information group comprises m bytes; and adding header information to the second information group according to a type of the first information group and a correspondence between a prestored type of a information group and a type of header information of the information group, wherein the type of the first information group is determined by the prestored type of the information group and character attributes of the characters in the first information group.
1. An encoding method of an Ethernet physical layer, the method comprising: determining a to-be-encoded first information group, wherein the first information group comprises m characters, m≧2, and m is an integer, wherein a character attribute of any character is a data character, a boundary character, or a third-type character, one character occupies one byte, and the third-type character is a character except the data character and the boundary character; detecting a character attribute of each character in the first information group; if the first information group comprises n boundary characters, wherein n≧1, and n is an integer, deleting the n boundary characters, and generating a second information group by using a character, except the n boundary characters, in the first information group, and type information and position information that are of the n boundary characters, wherein the second information group comprises m bytes; and adding header information to the second information group according to a type of the first information group and a correspondence between a prestored type of a information group and a type of header information of the information group, wherein the type of the first information group is determined by the prestored type of the information group and character attributes of the characters in the first information group. 6. The encoding method according to claim 1 , wherein if the characters in the first information group are all third-type characters, the method further comprises: compressing at least one third-type character to make an idle bit appear in the front of the first information group; recording, in the idle bit, that the characters in the first information group are all third-type characters to obtain a third information group, wherein the third information group comprises m bytes; and adding header information to the third information group according to the type of the first information group and the correspondence between the prestored type of the information group and the type of the header information of the information group; or adding header information to the first information group according to the type of the first information group and the correspondence between the prestored type of the information group and the type of the header information of the information group, wherein the header information of the first information group is used to mark that the characters in the first information group are all third-type characters.