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. 2. The encoding method according to claim 1 , wherein 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 comprises: interchanging first n characters in the first information group and the n boundary characters, deleting the n boundary characters, and recording, in at least first n bytes of the first information group, the type information and the position information that are of the n boundary characters to obtain the second information group, wherein the second information group comprises the m bytes; or deleting the n boundary characters to obtain n idle bytes; moving backward a character preceding the n th idle byte in the n idle bytes, so that remaining m-n characters in the first information group are recorded in consecutive bytes; and recording, in at least first n bytes of the first information group, the type information and the position information that are of the n boundary characters to obtain the second information group, wherein the second information group comprises the m bytes.