TECHNICAL FIELD

The present invention relates to the field of communications, and in particular, to a data receiving method and device, and a data sending method and device.

BACKGROUND

With the development of the Internet, traffic of a telecommunications backbone network is rapidly growing by 50% to 80% each year. At the beginning of the year 2011, the IEEE 802.3 working group started to collect a bandwidth development requirement after a 100GE Ethernet interface. With regard to the development of network bandwidth in the future, the IEEE 802.3 working group considered that network traffic in the year 2015 could reach 10 times what it was in the year 2010. According to a preliminary analysis, there would be two rates of 400GE/1TE for an Ethernet interface in the future, and such requirements would appear and begin to be applied in the year 2015 and the year 2020, respectively.

As a transmission rate increases, a high frequency loss of a signal on a high-speed transmission link increases; therefore, intersymbol interference affects an indicator such as signal quality or a bit error rate. However, currently, a decision feedback equalizer (English full name: decision feedback equalizer, English acronym: DFE) is universally used on a receive side of a high-speed interface, which embodies distortion caused by white noise on the link in a form of an error burst. Therefore, the industry begins to study how to perform error correction on a bit error in the Ethernet by using an FEC algorithm.

In the prior art, an interleaver (English: Interleaver) in a sending device writes by row and then reads by column a section of data on which FEC encoding has been performed. The sending device then sends, to a receiving device, the data read by column. For example, when data 1 on which the FEC encoding has been performed includes data units U0 to U4, and data 2 on which the FEC encoding has been performed includes data units U5 to U9, the 10 data units are written by row, and it is set that each row includes five data units, and then written data is shown in Table 1.

TABLE 1U4U3U2U1U0U9U8U7U6U5

The data shown in Table 1 is read by column, and then data shown in Table 2 can be obtained.

TABLE 2U9U4U8U3U7U2U6U1U5U0

The data read by column is sent to the receiving device. The receiving device performs an operation inverse to that of the sending device on the received data, and in a normal case, the data shown in Table 1 can be obtained again.

During a transmission process, a bit error may occur in the data read by column and shown in Table 2, for example, a bit error occurs in the three successive data units U6, U2, and U7. The receiving device restores an arrangement order of the data units in Table 3 to that shown in Table 1. Therefore, the three successive data units U6, U2, and U7 are not successive any longer. In other words, a probability that multiple error codes occur in one code word decreases. In this way, error correction pressure of an FEC unit in the receiving device can be reduced to some extent.

However, in the foregoing method, such a special interleaving manner of writing by row and reading by column needs to be performed. In this interleaving manner, a section of data needs to be written before the section of data begins to be read, which generates an obvious delay.

SUMMARY

An objective of embodiments of the present invention is to provide a data sending method and a data receiving method, and a corresponding sending device and a corresponding receiving device, to correct a bit error generated during a data transmission process.

The technical solutions of the embodiments of the present invention include:

According to a first aspect, a data sending method includes:

sending, by a first forward error correction FEC unit of a sending device, by using a first channel, a first data stream on which first FEC encoding has been performed, where the first data stream includes a channel identifier of the first channel;

sending, by a second FEC unit of the sending device, by using a second channel, a second data stream on which second FEC encoding has been performed, where the second data stream includes a channel identifier of the second channel;

performing interleaving, by the sending device, on the first data stream and the second data stream, to obtain an output data stream; and

sending the output data stream to a receiving device. Optionally, the first FEC encoding may be performed by the first FEC unit or another FEC unit, and the second FEC encoding may be performed by the second FEC unit or another FEC unit.

In a first implementation manner of the first aspect, the method further includes:

sending, by the first FEC unit, by using a third channel, a third data stream on which third FEC encoding has been performed, where the third data stream includes a channel identifier of the third channel; and

sending, by the second FEC unit, by using a fourth channel, a fourth data stream on which fourth FEC encoding has been performed, where the fourth data stream includes a channel identifier of the fourth channel. The first implementation manner of the first aspect is based on the first aspect.

In a second implementation manner of the first aspect, the performing interleaving, by the sending device, on the first data stream and the second data stream, to obtain an output data stream specifically includes:

performing first interleaving, by the sending device, on the first data stream and the second data stream;

performing second interleaving, by the sending device, on the third data stream and the fourth data stream; and

performing third interleaving on a data stream that is obtained by performing the first interleaving and a data stream that is obtained by performing the second interleaving, to obtain the output data stream;

or,

performing first interleaving, by the sending device, on the first data stream and the second data stream; and

performing second interleaving, by the sending device, on the third data stream and the fourth data stream, where the output data stream includes a data stream that is obtained by performing the first interleaving and a data stream that is obtained by performing the second interleaving.

The second implementation manner of the first aspect is based on the first implementation manner of the first aspect.

In a third implementation manner of the first aspect, for the first interleaving, the interleaving is performed according to a first data unit, for the second interleaving, the interleaving is performed according to a second data unit, where the first data unit includes at least two bits, and the second data unit includes at least two bits, and for the third interleaving, the interleaving is performed according to a bit.

Preferably, performing interleaving according to a data unit refers to dividing, according to a length of the data unit, each of at least two to-be-interleaved data streams into data blocks, and then performing the interleaving on the obtained data blocks, where the length of the data unit refers to the number of bits included in the data unit.

According to a second aspect, a data receiving method includes:

receiving, by a receiving device, a first data stream from a sending device;

performing de-interleaving on the first data stream, to obtain a second data stream and a third data stream;

determining that the second data stream includes a first channel identifier and the third data stream includes a second channel identifier, where the first channel identifier is a channel identifier of a first channel that is connected to a first FEC unit in the sending device, and the second channel identifier is a channel identifier of a second channel that is connected to a second FEC unit in the sending device;

determining, according to the first channel identifier and a first correspondence that is configured in the receiving device, a third channel identifier corresponding to the first channel identifier, where the first correspondence includes a correspondence between the first channel identifier and the third channel identifier, and the third channel identifier is a channel identifier of a third channel that is connected to a third FEC unit in the receiving device;

sending the second data stream to the third FEC unit in the receiving device by using the third channel, for FEC decoding;

determining, according to the second channel identifier and a second correspondence that is configured in the receiving device, a fourth channel identifier corresponding to the second channel identifier, where the second correspondence includes a correspondence between the second channel identifier and the fourth channel identifier, and the fourth channel identifier is a channel identifier of a fourth channel that is connected to a fourth FEC unit in the receiving device; and

sending the third data stream to the fourth FEC unit in the receiving device by using the fourth channel, for FEC decoding.

Optionally, the sending the second data stream to the third FEC unit in the receiving device by using the third channel, for FEC decoding may refer to performing FEC decoding by the third FEC unit or forwarding, by the third FEC unit, the second data stream to another FEC unit, for the another FEC unit to perform decoding.

In a first implementation manner of the second aspect, the performing de-interleaving on the first data stream, to obtain a second data stream and a third data stream specifically includes:

performing first de-interleaving on the first data stream, to obtain a fourth data stream and a fifth data stream; and

performing second de-interleaving on the fourth data stream, obtaining the second data stream and the third data stream according to the fourth data stream, performing third de-interleaving on the fifth data stream, and obtaining a sixth data stream and a seventh data stream according to the fifth data stream, where the sixth data stream includes a fifth channel identifier, the fifth channel identifier is a channel identifier of a fifth channel that is connected to the first FEC unit in the sending device, the seventh data stream includes a sixth channel identifier, and the sixth channel identifier is a channel identifier of a sixth channel that is connected to the second FEC unit in the sending device.

In a second implementation manner of the second aspect, the method further includes:

determining, according to the fifth channel identifier and a third correspondence that is configured in the receiving device, a seventh channel identifier corresponding to the fifth channel identifier, where the third correspondence includes a correspondence between the fifth channel identifier and the seventh channel identifier, and the seventh channel identifier is a channel identifier of a seventh channel that is connected to the third FEC unit in the receiving device;

sending the sixth data stream to the third FEC unit in the receiving device by using the seventh channel, for FEC decoding;

determining, according to the sixth channel identifier and a fourth correspondence that is configured in the receiving device, an eighth channel identifier corresponding to the sixth channel identifier, where the fourth correspondence includes a correspondence between the sixth channel identifier and the eighth channel identifier, and the eighth channel identifier is a channel identifier of an eighth channel that is connected to the fourth FEC unit in the receiving device; and

sending the seventh data stream to the fourth FEC unit in the receiving device by using the eighth channel, for FEC decoding. The second implementation manner of the second aspect is based on the first implementation manner of the second aspect.

In a third implementation manner of the second aspect, for the first de-interleaving, the de-interleaving is performed according to a bit, for the second de-interleaving, the de-interleaving is performed according to a first data unit, and for the third de-interleaving, the de-interleaving is performed according to a second data unit, where the first data unit includes at least two bits, and the second data unit includes at least two bits. The third implementation manner of the second aspect is based on the first implementation manner of the second aspect or the second implementation manner of the second aspect.

According to a third aspect, a sending device includes:

a first forward error correction FEC unit, configured to send, by using a first channel, a first data stream on which first FEC encoding has been performed, where the first data stream includes a channel identifier of the first channel;

a second FEC unit, configured to send, by using a second channel, a second data stream on which second FEC encoding has been performed, where the second data stream includes a channel identifier of the second channel;

an interleaving unit, configured to perform interleaving on the first data stream and the second data stream, to obtain an output data stream; and

a sending unit, configured to send the output data stream to a receiving device.

In a first implementation manner of the third aspect, the first FEC unit is further configured to send, by using a third channel, a third data stream on which third FEC encoding has been performed, where the third data stream includes a channel identifier of the third channel; and

the second FEC unit is further configured to send, by using a fourth channel, a fourth data stream on which fourth FEC encoding has been performed, where the fourth data stream includes a channel identifier of the fourth channel. The first implementation manner of the third aspect is based on the third aspect.

In a second implementation manner of the third aspect, the interleaving unit is specifically configured to:

perform first interleaving on the first data stream and the second data stream;

perform second interleaving on the third data stream and the fourth data stream; and

perform third interleaving on a data stream that is obtained by performing the first interleaving and a data stream that is obtained by performing the second interleaving, to obtain the output data stream;

or,

perform first interleaving on the first data stream and the second data stream; and

perform second interleaving on the third data stream and the fourth data stream, where the output data stream includes a data stream that is obtained by performing the first interleaving and a data stream that is obtained by performing the second interleaving. The second implementation manner of the third aspect is based on the first implementation manner of the third aspect.

In a third implementation manner of the third aspect, for the first interleaving, the interleaving is performed according to a first data unit, for the second interleaving, the interleaving is performed according to a second data unit, where the first data unit includes at least two bits, and the second data unit includes at least two bits, and for the third interleaving, the interleaving is performed according to a bit. The third implementation manner of the third aspect is based on the second implementation manner of the third aspect.

According to a fourth aspect, a receiving device includes:

a receiving unit, configured to receive a first data stream from a sending device;

a de-interleaving unit, configured to perform de-interleaving on the first data stream, to obtain a second data stream and a third data stream; and

a determining unit, configured to:

determine that the second data stream includes a first channel identifier and the third data stream includes a second channel identifier, where the first channel identifier is a channel identifier of a first channel that is connected to a first FEC unit in the sending device, and the second channel identifier is a channel identifier of a second channel that is connected to a second FEC unit in the sending device;

determine, according to the first channel identifier and a first correspondence that is configured in the receiving device, a third channel identifier corresponding to the first channel identifier, where the first correspondence includes a correspondence between the first channel identifier and the third channel identifier, and the third channel identifier is a channel identifier of a third channel that is connected to a third FEC unit in the receiving device, and send the second data stream to the third FEC unit in the receiving device by using the third channel, for FEC decoding; and

determine, according to the second channel identifier and a second correspondence that is configured in the receiving device, a fourth channel identifier corresponding to the second channel identifier, where the second correspondence includes a correspondence between the second channel identifier and the fourth channel identifier, and the fourth channel identifier is a channel identifier of a fourth channel that is connected to a fourth FEC unit in the receiving device, and send the third data stream to the fourth FEC unit in the receiving device by using the fourth channel, for FEC decoding.

In a first implementation manner of the fourth aspect, the de-interleaving unit is specifically configured to:

perform first de-interleaving on the first data stream, to obtain a fourth data stream and a fifth data stream; and

perform second de-interleaving on the fourth data stream, obtain the second data stream and the third data stream according to the fourth data stream, perform third de-interleaving on the fifth data stream, and obtain a sixth data stream and a seventh data stream according to the fifth data stream, where the sixth data stream includes a fifth channel identifier, the fifth channel identifier is a channel identifier of a fifth channel that is connected to the first FEC unit in the sending device, the seventh data stream includes a sixth channel identifier, and the sixth channel identifier is a channel identifier of a sixth channel that is connected to the second FEC unit in the sending device. The first implementation manner of the fourth aspect is based on the fourth aspect.

In a second implementation manner of the fourth aspect, the determining unit is further configured to:

determine, according to the fifth channel identifier and a third correspondence that is configured in the receiving device, a seventh channel identifier corresponding to the fifth channel identifier, where the third correspondence includes a correspondence between the fifth channel identifier and the seventh channel identifier, and the seventh channel identifier is a channel identifier of a seventh channel that is connected to the third FEC unit in the receiving device, and send the sixth data stream to the third FEC unit in the receiving device by using the seventh channel, for FEC decoding; and

determine, according to the sixth channel identifier and a fourth correspondence that is configured in the receiving device, an eighth channel identifier corresponding to the sixth channel identifier, where the fourth correspondence includes a correspondence between the sixth channel identifier and the eighth channel identifier, and the eighth channel identifier is a channel identifier of an eighth channel that is connected to the fourth FEC unit in the receiving device, and send the seventh data stream to the fourth FEC unit in the receiving device by using the eighth channel, for FEC decoding. The second implementation manner of the fourth aspect is based on the first implementation manner of the fourth aspect.

In a third implementation manner of the fourth aspect, for the first de-interleaving, the de-interleaving is performed according to a bit, for the second de-interleaving, the de-interleaving is performed according to a first data unit, and for the third de-interleaving, the de-interleaving is performed according to a second data unit, where the first data unit includes at least two bits, and the second data unit includes at least two bits. The third implementation manner of the fourth aspect is based on the first implementation manner of the fourth aspect or the second implementation manner of the fourth aspect.

An advantage according to one aspect of the present invention lies in that, a receiving device can send, to different FEC units of the receiving device, data units in which an error occurs; therefore, a case in which error correction is performed by using only one FEC unit can be prevented to a great extent. In this case, for an FEC unit, the number of bit errors received by the FEC unit decreases. In other words, a probability that the FEC unit performs error correction successfully increases. On the whole, when success rates of error correction of one or more FEC units in the receiving device increase, an error correction capability of the receiving device is improved. In addition, in this embodiment, an interleaving manner of writing by row and reading by column is not needed; therefore, no delay is generated.

