Forward error correction switching method and device and computer storage medium

文档序号:1660254 发布日期:2019-12-27 浏览:8次 中文

阅读说明:本技术 一种前向纠错的切换方法、装置及计算机存储介质 (Forward error correction switching method and device and computer storage medium ) 是由 秦川 于 2018-06-19 设计创作,主要内容包括:本发明实施例公开了一种前向纠错的切换方法,应用于本端,包括:接收对端发送的数据码流;根据设置的码字标识对所述数据码流进行码字标识检测,获得所述设置的码字标识是否同步的检测结果;根据所述检测结果对所述本端是否开启前向纠错进行切换。本发明实施例还公开了一种前向纠错的切换装置及计算机存储介质。(The embodiment of the invention discloses a forward error correction switching method, which is applied to a home terminal and comprises the following steps: receiving a data code stream sent by an opposite terminal; carrying out code word identification detection on the data code stream according to the set code word identification to obtain a detection result whether the set code word identification is synchronous or not; and switching whether the home terminal starts forward error correction or not according to the detection result. The embodiment of the invention also discloses a forward error correction switching device and a computer storage medium.)

1. A forward error correction switching method is applied to a local terminal, and is characterized in that the method comprises the following steps:

receiving a data code stream sent by an opposite terminal;

carrying out code word identification detection on the data code stream according to the set code word identification to obtain a detection result whether the set code word identification is synchronous or not;

and switching whether the home terminal starts forward error correction or not according to the detection result.

2. The method of claim 1, wherein the performing codeword identifier detection on the data code stream according to the set codeword identifier to obtain a detection result of whether the set codeword identifier is synchronous comprises:

determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current code block to be matched is matched with the set code word identification, determining the next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and when the next code block to be matched is detected to be matched with the set code word identification, determining that the set code word identification is synchronous.

3. The method of claim 2, wherein the determining a current code block to be matched from the data code stream and detecting whether the current code block to be matched matches a set code word identifier comprises:

selecting continuous bits with a set threshold size from a current data packet of the data code stream by taking the current bit as a starting point to serve as a current code block to be matched;

detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current module to be matched is determined not to be matched with the set code word identifier, selecting continuous bits with the set threshold size as updated current code blocks to be matched by taking the next bit of the current bit as a starting point, and returning to the step of detecting whether the current code blocks to be matched are matched with the set code word identifier.

4. The method of claim 3, wherein the determining a next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identification transmission frequency of the data code stream comprises:

determining a target data packet from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream;

and determining continuous bits with the same position relation from the target data packet as a next code block to be matched according to the position relation between the current code block to be matched and the current data packet.

5. The method of claim 3, further comprising:

and when the code block to be matched next corresponds to the set code word identifier, determining that the set code word identifier is not synchronous, selecting continuous bits with a set threshold size as the updated current code block to be matched by taking the next bit of the last bit of the next code block to be matched in the target data packet as a starting point, and returning to the step of detecting whether the current code block to be matched is matched with the set code word identifier.

6. The method of claim 2, wherein after determining the set codeword identification synchronization, further comprising:

and deleting the set code word identification from the decoded data code stream according to the position relation between the set code word identification and the data code stream.

7. The method according to claim 1, wherein said switching whether forward error correction is turned on by the local end according to the detection result comprises:

when the set code word identification is determined to be synchronous, controlling the local terminal to start forward error correction;

and controlling the local terminal not to start forward error correction when the set code word identification is determined to be asynchronous.

8. A forward error correction switching device applied to a local terminal is characterized by comprising:

the receiving module is used for receiving a data code stream sent by an opposite terminal;

the detection module is used for carrying out code word identification detection on the data code stream according to the set code word identification to obtain a detection result of whether the set code word identification is synchronous or not;

and the switching module is used for switching whether the home terminal starts forward error correction according to the detection result.

9. A forward error correction switching apparatus, comprising a processor and a memory for storing a computer program capable of running on the processor; wherein the content of the first and second substances,

the processor is configured to execute the steps of the forward error correction handover method according to any one of claims 1 to 7 when running the computer program.

10. A computer storage medium, characterized in that a computer program is stored in the computer storage medium, which computer program, when being executed by a processor, implements the steps of the forward error correction handover method according to any one of claims 1 to 7.

Technical Field

The present invention relates to the field of communications, and in particular, to a forward error correction handover method, apparatus, and computer storage medium.

Background

The rapid development of communication networks has brought about the requirement of long-distance and large-bandwidth transmission, but the realization of long-distance transmission has encountered many problems in the optical and electronic fields. For example, the higher the signal rate, the more the optical signal is affected by noise, dispersion, nonlinear effects, electromagnetic interference, etc. during transmission, the more errors are generated when the receiving side recovers data. In addition, in order to reduce the cost, improve the utilization rate of the system equipment, and prolong the service life of the optical communication system, when the optical fiber line with degraded service performance is used to transmit signals, the stability of the received signals is inevitably affected. In order to solve the above problems, when ethernet interfaces such as 25G, 40G, 50G, 100G, and 200G are involved, the IEEE802.3 standard has already described that Forward Error Correction (FEC) technology may be added to the ethernet interfaces to solve the problem of data loss caused by channel bit errors, and improve the adaptability of the ethernet to physical channels. Moreover, it is specified that both ends of the device can be successfully interfaced only by using the same form of FEC, and the ethernet interface with the FEC function turned on and the ethernet interface without the FEC function turned on cannot be successfully interfaced. The standard FEC algorithm can obtain a net coding gain of at least 5dB although a certain error correction redundancy is added and occupies a certain effective bandwidth.

Although the IEEE802.3 standard specifies a method for implementing the FEC function on the ethernet interface, some devices still do not support the FEC function. In addition, the configuration of each manufacturer for the default FEC function is different, for example, some manufacturers may default to turn on the FEC function, and some manufacturers may default to turn off no FEC function, so that the ethernet interface with the FEC function turned on fails to interface with the ethernet interface without the FEC function turned on. Therefore, the FEC configuration needs to be checked manually before the two ends of the device are used for docking. In addition, there are also cases of manual real-time FEC configuration operation during the network operation. However, the manual operation may cause packet loss due to long time, thereby reducing the quality of service transmission.

Disclosure of Invention

In order to solve the existing technical problem, embodiments of the present invention provide a forward error correction handover method, apparatus, and computer storage medium capable of improving service transmission quality.

In order to achieve the above purpose, the technical solution of the embodiment of the present invention is realized as follows:

in a first aspect, an embodiment of the present invention provides a forward error correction switching method, which is applied to a home terminal, and includes:

receiving a data code stream sent by an opposite terminal;

carrying out code word identification detection on the data code stream according to the set code word identification to obtain a detection result whether the set code word identification is synchronous or not;

and switching whether the home terminal starts forward error correction or not according to the detection result.

In the foregoing solution, the performing codeword identifier detection on the data code stream according to the set codeword identifier to obtain a detection result of whether the set codeword identifier is synchronous includes:

determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current code block to be matched is matched with the set code word identification, determining the next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and when the next code block to be matched is detected to be matched with the set code word identification, determining that the set code word identification is synchronous.

In the foregoing solution, the determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched matches a set code word identifier includes:

selecting continuous bits with a set threshold size from a current data packet of the data code stream by taking the current bit as a starting point to serve as a current code block to be matched;

detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current module to be matched is determined not to be matched with the set code word identifier, selecting continuous bits with the set threshold size as updated current code blocks to be matched by taking the next bit of the current bit as a starting point, and returning to the step of detecting whether the current code blocks to be matched are matched with the set code word identifier.

In the foregoing solution, the determining a next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identifier sending frequency of the data code stream includes:

determining a target data packet from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream;

and determining continuous bits with the same position relation from the target data packet as a next code block to be matched according to the position relation between the current code block to be matched and the current data packet.

In the above scheme, the method further comprises:

and when the code block to be matched next corresponds to the set code word identifier, determining that the set code word identifier is not synchronous, selecting continuous bits with a set threshold size as the updated current code block to be matched by taking the next bit of the last bit of the next code block to be matched in the target data packet as a starting point, and returning to the step of detecting whether the current code block to be matched is matched with the set code word identifier.

In the foregoing solution, after determining that the set codeword identifier is synchronized, the method further includes:

and deleting the set code word identification from the decoded data code stream according to the position relation between the set code word identification and the data code stream.

In the foregoing solution, the switching whether forward error correction is turned on for the local terminal according to the detection result includes:

when the set code word identification is determined to be synchronous, controlling the local terminal to start forward error correction;

and controlling the local terminal not to start forward error correction when the set code word identification is determined to be asynchronous.

In a second aspect, an embodiment of the present invention further provides a forward error correction switching apparatus, which is applied to a home terminal, and includes:

the receiving module is used for receiving a data code stream sent by an opposite terminal;

the detection module is used for carrying out code word identification detection on the data code stream according to the set code word identification to obtain a detection result of whether the set code word identification is synchronous or not;

and the switching module is used for switching whether the home terminal starts forward error correction according to the detection result.

In the foregoing solution, the detection module is specifically configured to:

determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current code block to be matched is matched with the set code word identification, determining the next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and when the next code block to be matched is detected to be matched with the set code word identification, determining that the set code word identification is synchronous.

In the foregoing solution, the detection module is specifically configured to:

selecting continuous bits with a set threshold size from a current data packet of the data code stream by taking the current bit as a starting point to serve as a current code block to be matched;

detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current module to be matched is determined not to be matched with the set code word identifier, selecting continuous bits with the set threshold size as updated current code blocks to be matched by taking the next bit of the current bit as a starting point, and returning to the step of detecting whether the current code blocks to be matched are matched with the set code word identifier.

In the foregoing solution, the detection module is specifically configured to:

determining a target data packet from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream;

and determining continuous bits with the same position relation from the target data packet as a next code block to be matched according to the position relation between the current code block to be matched and the current data packet.

In the foregoing solution, the detection module is further configured to:

and when the code block to be matched next corresponds to the set code word identifier, determining that the set code word identifier is not synchronous, selecting continuous bits with a set threshold size as the updated current code block to be matched by taking the next bit of the last bit of the next code block to be matched in the target data packet as a starting point, and returning to the step of detecting whether the current code block to be matched is matched with the set code word identifier.

In the above scheme, the apparatus further comprises: and the processing module is used for deleting the set code word identification from the decoded data code stream according to the position relation between the set code word identification and the data code stream.

In the foregoing solution, the switching module is specifically configured to:

when the set code word identification is determined to be synchronous, controlling the local terminal to start forward error correction;

and controlling the local terminal not to start forward error correction when the set code word identification is determined to be asynchronous.

In a third aspect, an embodiment of the present invention provides a forward error correction switching apparatus, including a processor and a memory for storing a computer program capable of running on the processor; wherein the processor is configured to execute the forward error correction handover method according to the first aspect when running the computer program.

In a fourth aspect, an embodiment of the present invention provides a computer storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for performing forward error correction handover in the first aspect is implemented.

In the forward error correction switching method and apparatus and the computer storage medium provided in the foregoing embodiments, the home terminal performs codeword identifier detection on a data code stream sent by an opposite terminal through a set codeword identifier, so as to detect whether the opposite terminal starts an FEC mode supported by the home terminal, and performs automatic switching on whether the home terminal starts forward error correction according to a detection result, so that when the home terminal detects that the opposite terminal starts the FEC mode supported by the home terminal, the home terminal also automatically starts FEC to ensure that the home terminal and the opposite terminal are successfully docked. Therefore, the problems of long operation time, high possibility of errors and the like in a mode of manually judging that the opposite end starts the FEC mode and then the home end starts the FEC are solved, packet loss is reduced, and therefore the service transmission quality is improved.

Drawings

Fig. 1 is a flowchart illustrating a forward error correction handover method according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of the structure of an FEC layer;

fig. 3 is a schematic flowchart of a forward error correction handover method according to an embodiment of the present invention;

FIG. 4 is a block diagram of a synchronous state machine according to an embodiment of the present invention;

FIG. 5 is a schematic structural diagram of a forward error correction switch device according to an embodiment of the present invention;

fig. 6 is a schematic structural diagram of a forward error correction switching apparatus according to another embodiment of the present invention.

Detailed Description

The technical scheme of the invention is further elaborated by combining the drawings and the specific embodiments in the specification. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.

Referring to fig. 1, a forward error correction handover method provided in an embodiment of the present invention includes the following steps:

s101: receiving a data code stream sent by an opposite terminal;

it is understood that the home terminal and the opposite terminal are in terms of any two ethernet interfaces according to their relative positions or functions. Generally, an ethernet interface (also referred to as an ethernet port) includes a Physical Coding Sublayer (PCS) and a Physical Medium access layer (PMA). In this embodiment, a home terminal receives a data code stream sent by an opposite terminal as an example. Specifically, please refer to fig. 2 in combination, if the home terminal has turned on FEC, when sending data through ethernet, the sending entity of the home terminal obtains a data Code stream composed of ethernet data packets from the PCS sublayer of the home terminal, and performs operations such as block synchronization, rate compensation, transcoding, codeword identifier insertion, Reed-Solomon Code (RS, Reed-Solomon Code) FEC encoding and the like on the ethernet data packets in sequence, and then sends the encoded data Code stream to the opposite terminal through the PMA interface of the home terminal; when receiving data through Ethernet, the receiving side entity of the local terminal obtains the data code stream from the PMA interface of the local terminal, and executes the operations of code word identification synchronization, RS FEC decoding, code word identification deletion, transcoding, rate compensation and the like on the data code stream, and then sends the obtained data code stream to the PCS sublayer of the local terminal. If the home terminal does not start the FEC, when the data is sent through the Ethernet, a sending side entity of the home terminal obtains a data code stream consisting of Ethernet data packets from a home terminal PCS sublayer and directly sends the data code stream to an opposite terminal through a home terminal PMA interface; when receiving data through Ethernet, the receiving side entity of the local terminal obtains the data code stream from the PMA interface of the local terminal and directly sends the data code stream to the PCS sublayer of the local terminal.

S102: carrying out code word identification detection on the data code stream according to the set code word identification to obtain a detection result whether the set code word identification is synchronous or not;

it is understood that the set codeword identification may be preset according to the FEC mode adopted by the local end. If the FEC is not opened at the opposite end, the data code stream does not contain the set code word identification; if the opposite end starts FEC and the FEC mode adopted by the opposite end is different from the FEC mode adopted by the local end, the data code stream does not contain the set code word identification; and if the opposite end starts FEC and the FEC mode adopted by the opposite end is the same as that adopted by the local end, the data code stream contains the set code word identification. Therefore, the codeword identifier detection is performed on the data code stream according to the set codeword identifier, so as to obtain whether the set codeword identifier is synchronous, that is, whether the FEC of the opposite end and the home end is synchronous, where the FEC asynchronism between the opposite end and the home end may be that the opposite end does not start FEC, or the opposite end starts FEC but the employed FEC mode is different from the employed FEC mode of the home end.

In an optional embodiment, step S102, performing codeword identifier detection on the data code stream according to a set codeword identifier, and obtaining a detection result of whether the set codeword identifier is synchronous, includes:

determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current code block to be matched is matched with the set code word identification, determining the next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and when the next code block to be matched is detected to be matched with the set code word identification, determining that the set code word identification is synchronous.

It should be noted that the set codeword identifier is identification information corresponding to the FEC mode supported by the local terminal, and the size of the set codeword identifier may be set and adjusted according to an actual situation, for example, may be set to 8 bits. The size of the code block to be matched is the same as the size of the set code word identifier, and correspondingly, the matching between the code block to be matched and the set code word identifier may be that the code block to be matched is the same as the set code word identifier. Because data identical to the set codeword identifier may exist in the data code stream, when the current code block to be matched matches the set codeword identifier, it cannot be determined that the set codeword identifier is synchronous. However, if the opposite end opens FEC, the opposite end may insert a codeword identifier periodically into a data code stream, so that if a next code block to be matched is determined from the data code stream according to the transmission speed of the data code stream and the codeword identifier sending frequency of the data code stream, and it is detected that the next code block to be matched matches the set codeword identifier, it may be considered that the opposite end opens FEC and an FEC mode opened by the opposite end is the same as an FEC mode supported by the local end. It can be understood that the codeword identifier sending frequency of the data code stream may be a codeword identifier sending frequency corresponding to an FEC mode supported by the local terminal, and when an FEC mode supported by the opposite terminal is the same as the FEC mode supported by the local terminal, the codeword identifier sending frequencies corresponding to the opposite terminal and the local terminal should be the same.

Therefore, the code blocks to be matched are selected twice from the received data code stream to be matched with the set code word identifiers for matching, and the set code word identifiers are determined to be synchronous when the code blocks to be matched are matched twice, so that the detection accuracy is improved.

In an optional embodiment, the determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched matches a set code word identifier includes:

selecting continuous bits with a set threshold size from a current data packet of the data code stream by taking the current bit as a starting point to serve as a current code block to be matched;

detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current module to be matched is determined not to be matched with the set code word identifier, selecting continuous bits with the set threshold size as updated current code blocks to be matched by taking the next bit of the current bit as a starting point, and returning to the step of detecting whether the current code blocks to be matched are matched with the set code word identifier.

It can be understood that, the set threshold may be the same as the size of the set codeword identifier, and correspondingly, the detecting whether the current code block to be matched matches the set codeword identifier may be detecting whether the code block to be matched is the same as the set codeword identifier. The current data packet may be a first data packet in the data code stream received by the local terminal, or may be other data packets in the data code stream received by the local terminal. The method comprises the steps that whether an opposite end is started with FEC or not needs to be determined, when the opposite end is started with FEC, the position of a code word identifier inserted into a data code stream by the opposite end needs to be determined, therefore, continuous bits with a set threshold value size are selected as a current code block to be matched with the set code word identifier by taking a current bit as a starting point, when the continuous bits are not matched, the next bit of the current bit is taken as the starting point to continue selecting the code block to be matched and executing matching operation, and therefore, the code block to be matched is sequentially shifted to be selected until matching detection of the current data packet and the set code word identifier is completed, and quick.

In an optional embodiment, the determining, according to the transmission speed of the data code stream and the code word identifier sending frequency of the data code stream, a next code block to be matched from the data code stream includes:

determining a target data packet from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream;

and determining continuous bits with the same position relation from the target data packet as a next code block to be matched according to the position relation between the current code block to be matched and the current data packet.

Here, the local end can know the size of the data received in unit time according to the transmission speed of the data code stream, and can know the transmission interval between two adjacent codeword identifications according to the codeword identification transmission frequency of the data code stream, so that the relative position between two adjacent codeword identifications in the data code stream, that is, the target data packet where the next codeword identification is located, can be known according to the transmission speed of the data code stream and the codeword identification transmission frequency of the data code stream. And determining the next code block to be matched according to the position of the start code word of the code block to be matched in the current data packet. For example, assuming that the transmission speed of the data code stream is 16 bytes per millisecond, the sending frequency of the codeword identifier is 200 hz, that is, the sending period of the codeword identifier is 5 milliseconds, and the size of each data packet is 16 bytes, if the current data packet is the first data packet in the data code stream, the current bit is the first bit of the first data packet, the threshold value is set to be 8 bits, and the current code block to be matched with the code identifier, which has the size of 8 bits and is selected with the current bit as the starting point, is matched with the set codeword identifier, the first bit of the sixth data packet in the data code stream is used as the starting point, and the continuous bits with the size of 8 bits are selected as the next. Therefore, the code block to be matched can be quickly determined according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and whether the set code word identification is synchronous or not can be quickly detected.

In an optional embodiment, the method may further include:

and when the code block to be matched next corresponds to the set code word identifier, determining that the set code word identifier is not synchronous, selecting continuous bits with a set threshold size as the updated current code block to be matched by taking the next bit of the last bit of the next code block to be matched in the target data packet as a starting point, and returning to the step of detecting whether the current code block to be matched is matched with the set code word identifier.

Here, when the current module to be matched matches the set codeword identifier and the next code block to be matched does not match the set codeword identifier, it indicates that the current data packet of the data code stream may be caused by the presence of data identical to the set codeword identifier in the current data packet, and the like, and it is determined that the set codeword identifiers are not synchronized at this time. The set code word identifier may not be synchronized, that is, the FEC is not currently turned on by the opposite end, and since the opposite end may turn on the FEC in real time in the service transmission process, it is necessary to continue to use the next bit of the last bit of the next code block to be matched in the target data packet as a starting point, select a continuous bit with a set threshold size as the updated current code block to be matched, and continue to detect whether the current code block to be matched matches with the set code word identifier. Therefore, the code word identification real-time detection is carried out on the data code stream through the set code word identification so as to ensure that whether the home terminal starts forward error correction is switched in time.

S103: and switching whether the home terminal starts forward error correction or not according to the detection result.

Specifically, when the local terminal determines that the set codeword identifiers are synchronous, the local terminal is controlled to start forward error correction so as to ensure that the local terminal and the opposite terminal both start FEC of the same mode and realize successful docking; and controlling the local terminal not to start forward error correction when the set code word identification is determined to be asynchronous.

Here, the controlling of the local end to turn on the forward error correction includes controlling a transmitting side entity of the local end to turn on the forward error correction and controlling a receiving side entity of the local end to turn on the forward error correction, and the controlling of the local end not to turn on the forward error correction includes controlling neither the transmitting side entity nor the receiving side entity of the local end to turn on the forward error correction.

In summary, in the forward error correction switching method provided in this embodiment, the home terminal performs codeword identifier detection on a data code stream sent by the opposite terminal through the set codeword identifier, so as to detect whether the opposite terminal starts an FEC mode supported by the home terminal, and performs automatic switching on whether the home terminal starts forward error correction according to a detection result, so that when the home terminal detects that the opposite terminal starts the FEC mode supported by the home terminal, the home terminal also automatically starts FEC, so as to ensure that the home terminal and the opposite terminal are successfully docked. Therefore, the problems of long operation time, high possibility of errors and the like in a mode of manually judging that the opposite end starts the FEC mode and then the home end starts the FEC are solved, packet loss is reduced, and therefore the service transmission quality is improved.

In an optional embodiment, after determining that the set codeword identifier is synchronized, the method may further include:

and deleting the set code word identification from the decoded data code stream according to the position relation between the set code word identification and the data code stream.

It can be understood that the determining that the set codeword identifiers are synchronous indicates that the opposite end has started the same FEC mode as the home end, and since the opposite end performs operations such as encoding on a data code stream and inserting the set codeword identifiers into the data code stream after FEC is started, after the home end receives the data code stream sent by the opposite end, the home end needs to delete the set codeword identifiers from the decoded data code stream according to the position relationship between the set codeword identifiers and the data code stream. When the current module to be matched is matched with the set code word identifier and the next code block to be matched is also matched with the set code word identifier, deleting the set code word identifier from the decoded data code stream according to the position relationship between the set code word identifier and the data code stream, including: deleting the current code block to be matched from the decoded current data packet according to the position relationship between the current code block to be matched and the current data packet, and deleting the next code block to be matched from the decoded target data packet according to the position relationship between the next code block to be matched and the target data packet. Therefore, only the effective information required by the local terminal is reserved in the data code stream by deleting the code word identification in time, and the resource overhead of the local terminal can be saved.

The following describes the embodiments of the present invention in further detail by using specific examples, please refer to fig. 2 and fig. 3 in combination, and take an example that both the home terminal and the peer terminal include an ethernet receiving side and an ethernet transmitting side. On one hand, if the ethernet receiving side of the local end is to realize the automatic FEC switching function, the ethernet transmitting side of the opposite end needs to transmit data according to the IEEE802.3 standard, that is, the data of the PCS sublayer needs to be used as transmission data after the steps of block synchronization, rate compensation, transcoding, codeword identifier insertion, RS FEC encoding, and the like. On the other hand, the ethernet receiving side at the home terminal performs the following processing on data: shifting sliding codes are carried out on data received from a physical medium sub-layer, namely the received data are shifted according to bits until data matched with a Code Word Mark (CWM) are identified; and judging whether the code word identifiers are synchronous according to the CWM, automatically switching the FEC function of the local terminal according to whether the code word identifiers are synchronous, and finally determining the FEC frame boundary.

Fig. 3 is a forward error correction switching method provided in this embodiment, where when the home terminal starts an FEC function, an ethernet sending side obtains a data code stream composed of ethernet data packets from a PCS layer of the home terminal, and sequentially performs steps S200 to S205 on the ethernet data packets, that is, block synchronization, rate compensation, transcoding, codeword identifier insertion, RS FEC encoding, and other operations, and selects an a-channel input of the selector from 1-out-of-2, and then sends the data code stream to an opposite terminal through a PMA interface of the home terminal; when the home terminal does not start the FEC function, the data code stream acquired by the Ethernet transmitting side from the PCS sublayer of the home terminal is input from the B path of the 1-out-of-2 selector and then is directly transmitted to the opposite terminal through the PMA interface of the home terminal. Here, whether the data code stream is input from the a-path or the B-path of the 1-from-2 selector may be determined according to a fec _ align _ status signal output by the synchronous state machine, and if the data code stream is a fec _ align _ status valid signal, that is, fec _ align _ status < > true, the a-path is selected; if the signal is the fec _ align _ status invalid signal, that is, fec _ align _ status < ═ false, then the B-way is selected. The Ethernet receiving side executes step S206, namely code word identification synchronization detection, on the data code stream to be received from the physical media sub-layer, if the code word identification synchronization is determined, namely the opposite end starts the FEC of the same mode, then the steps S207 to S211 are executed in sequence, otherwise, only the step S211 is executed. The codeword identification synchronization detection is implemented by the synchronization state machine shown in fig. 4. The synchronous state machine comprises 6 modules, which are respectively:

the system comprises an initial module 1, a reset module, a link Signal quality difference (| Signal _ ok) module and a reset module, wherein the initial module 1 is used for triggering to jump to an initial state when receiving a module reset, a link Signal quality difference (| Signal _ ok) or a restart synchronous function Signal (restart _ lock);

the acquisition module 2 is configured to acquire a CWM BLOCK to be matched, where a codeword is composed of some specific fixed bytes and is finally encapsulated in the CWM BLOCK, and the acquisition module 2 specifically acquires the CWM BLOCK to be matched from the sliding code module 5;

the matching module 3 is configured to determine whether the CWM BLOCK is matched with the set CWM according to the CWM BLOCK provided by the obtaining module 2, if so, generate a correct matching (CWM _ Valid) signal to the counting module 4, otherwise, generate a sliding code signal including a matching failure (| CWM _ Valid) to the sliding code module 5, so as to instruct the sliding code module 5 to continue to slide code to search for the CWM BLOCK to be matched;

the counting module 4 is used for counting whether the set CWM BLOCK is matched with the detected CWM BLOCK twice continuously, and if the set CWM BLOCK is matched with the detected CWM BLOCK twice continuously, sending a successful matching message twice continuously to the control module 6; if the matching of the CWM BLOCK with the set CWM is not detected twice consecutively, a sliding code signal including the incomplete matching is sent to the sliding code module 5 to instruct the sliding code module 5 to continue sliding code search for the CWM BLOCK to be matched;

and the sliding code module 5 is configured to perform sliding code according to the received sliding code signal, and acquire a CWM BLOCK to be matched. Here, the sliding code module 5 bit-shifts the received data code stream until a matching CWM data is identified. For example, continuous bits with a set threshold size are selected from the data code stream as the CWM BLOCK to be matched from the current bit, and when the matching fails, continuous bits with a set threshold size are selected as the next CWM BLOCK to be matched from the next bit of the current bit. In addition, because the CWM is periodically sent by the peer device, after the first detection matching is completed, the position where the next CWM appears can be determined in a counting manner, and the corresponding CWM BLOCK to be matched is obtained;

and the control module 6 is configured to, when two consecutive matching success messages are received, consider that the FEC is synchronized, and output a valid signal, that is, FEC _ align _ status < true, where true indicates that the peer device also turns on the FEC function.

If the local terminal detects FEC synchronization, it means that a standard codeword identifier is inserted into data sent by the opposite terminal, and the synchronization state machine of the local terminal will generate a FEC _ align _ status valid signal, that is, FEC _ align _ status < (true), which controls the 1-from-2 selectors of the receiving side and the transmitting side of the local terminal, and selects the a channel; if the local end does not detect FEC synchronization, it indicates that a standard codeword identifier may not be inserted in data sent by the opposite end, and the opposite end does not start the FEC function, the synchronization state machine of the local end will generate a FEC _ align _ status invalidation signal, that is, FEC _ align _ status < ═ false, which controls the 1-out-of-2 selector of the receiving side and the transmitting side of the local end, and selects the B-path.

It should be noted that the forward error correction switching method provided in the embodiment of the present invention is applicable to ethernet interfaces such as 25G, 40G, 50G, 100G, and 200G, but not limited thereto. The receiver side detection not only relates to the case of e.g. 25G single channel (LANE), but also relates to the case of e.g. 100G multiple LANEs, for which the synchronization detection can be performed independently for each LANE according to the method of detecting codeword identification synchronization in fig. 4, and the FEC detection synchronization is determined only when each LANE is synchronized.

In summary, the forward error correction switching method provided in the embodiments of the present invention can effectively implement automatic identification and switching of forward error correction of the physical layer of the ethernet interface, that is, by detecting the corresponding codeword identifier at the receiving side, the local FEC function switching is quickly and automatically performed, so as to avoid a delay caused by manual intervention, and effectively solve the problem that service transmission quality is affected due to real-time FEC configuration in the network.

An embodiment of the present invention further provides a forward error correction switching apparatus, which is applied to a home terminal, and as shown in fig. 5, the apparatus includes:

a receiving module 10, configured to receive a data code stream sent by an opposite end;

the detection module 11 is configured to perform codeword identifier detection on the data code stream according to a set codeword identifier, and obtain a detection result of whether the set codeword identifier is synchronous;

and a switching module 12, configured to switch whether forward error correction is started at the home terminal according to the detection result.

In summary, in the apparatus for switching forward error correction provided in this embodiment, the detecting module 11 performs codeword identifier detection on a data code stream sent by an opposite end through a set codeword identifier, so as to detect whether the opposite end opens an FEC mode supported by the home end, and the switching module 12 performs automatic switching on whether forward error correction is opened by the home end according to a detection result, so that when the home end detects that the opposite end opens the FEC mode supported by the home end, the home end also automatically opens FEC, so as to ensure that the home end and the opposite end are successfully docked. Therefore, the problems of long operation time, high possibility of errors and the like in a mode of manually judging that the opposite end starts the FEC mode and then the home end starts the FEC are solved, packet loss is reduced, and therefore the service transmission quality is improved.

In an optional embodiment, the detection module 11 is specifically configured to:

determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current code block to be matched is matched with the set code word identification, determining the next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and when the next code block to be matched is detected to be matched with the set code word identification, determining that the set code word identification is synchronous.

Therefore, the code blocks to be matched are selected twice from the received data code stream to be matched with the set code word identifiers for matching, and the set code word identifiers are determined to be synchronous when the code blocks to be matched are matched twice, so that the detection accuracy is improved.

In an optional embodiment, the detection module 11 is specifically configured to:

selecting continuous bits with a set threshold size from a current data packet of the data code stream by taking the current bit as a starting point to serve as a current code block to be matched;

detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current module to be matched is determined not to be matched with the set code word identifier, selecting continuous bits with the set threshold size as updated current code blocks to be matched by taking the next bit of the current bit as a starting point, and returning to the step of detecting whether the current code blocks to be matched are matched with the set code word identifier.

Therefore, continuous bits with a set threshold size are selected as the current code block to be matched with the set code word identifier by taking the current bit as the starting point, the next bit of the current bit is continuously selected as the starting point when the code blocks are not matched with the set code word identifier, matching operation is carried out, and the code blocks to be matched are sequentially shifted to be selected until the matching detection of the current data packet and the set code word identifier is completed, so that the rapid matching is realized.

In an optional embodiment, the detection module 11 is specifically configured to:

determining a target data packet from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream;

and determining continuous bits with the same position relation from the target data packet as a next code block to be matched according to the position relation between the current code block to be matched and the current data packet.

Therefore, the code block to be matched can be quickly determined according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and whether the set code word identification is synchronous or not can be quickly detected.

In an optional embodiment, the detection module 11 is further configured to:

and when the code block to be matched next corresponds to the set code word identifier, determining that the set code word identifier is not synchronous, selecting continuous bits with a set threshold size as the updated current code block to be matched by taking the next bit of the last bit of the next code block to be matched in the target data packet as a starting point, and returning to the step of detecting whether the current code block to be matched is matched with the set code word identifier.

Therefore, the code word identification real-time detection is carried out on the data code stream through the set code word identification so as to ensure that whether the home terminal starts forward error correction is switched in time.

In an optional embodiment, the switching module 12 is specifically configured to:

when the set code word identification is determined to be synchronous, controlling the local terminal to start forward error correction;

and controlling the local terminal not to start forward error correction when the set code word identification is determined to be asynchronous.

In an optional embodiment, the apparatus further comprises: and the processing module 13 is configured to delete the set codeword identifier from the decoded data code stream according to the position relationship between the set codeword identifier and the data code stream.

Therefore, only the effective information required by the local terminal is reserved in the data code stream by deleting the code word identification in time, and the resource overhead of the local terminal can be saved.

An embodiment of the present invention provides a forward error correction switching apparatus, as shown in fig. 6, the apparatus includes: at least one processor 310 and a memory 311 for storing computer programs capable of running on the processor 310; the processor 310 illustrated in fig. 6 is not used to refer to the number of the processors 310 as one, but is only used to refer to the position relationship of the processor 310 relative to other devices, and in practical applications, the number of the processors 310 may be one or more; similarly, the memory 311 shown in fig. 6 is also used in the same sense, i.e. it is only used to refer to the position relationship of the memory 311 with respect to other devices, and in practical applications, the number of the memory 311 may be one or more.

Wherein, when the processor 310 is configured to run the computer program, the following steps are executed:

receiving a data code stream sent by an opposite terminal;

carrying out code word identification detection on the data code stream according to the set code word identification to obtain a detection result whether the set code word identification is synchronous or not;

and switching whether the home terminal starts forward error correction or not according to the detection result.

In an alternative embodiment, the processor 310 is further configured to execute the following steps when the computer program is executed:

determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current code block to be matched is matched with the set code word identification, determining the next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and when the next code block to be matched is detected to be matched with the set code word identification, determining that the set code word identification is synchronous.

In an alternative embodiment, the processor 310 is further configured to execute the following steps when the computer program is executed:

selecting continuous bits with a set threshold size from a current data packet of the data code stream by taking the current bit as a starting point to serve as a current code block to be matched;

detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current module to be matched is determined not to be matched with the set code word identifier, selecting continuous bits with the set threshold size as updated current code blocks to be matched by taking the next bit of the current bit as a starting point, and returning to the step of detecting whether the current code blocks to be matched are matched with the set code word identifier.

In an alternative embodiment, the processor 310 is further configured to execute the following steps when the computer program is executed:

determining a target data packet from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream;

and determining continuous bits with the same position relation from the target data packet as a next code block to be matched according to the position relation between the current code block to be matched and the current data packet.

In an alternative embodiment, the processor 310 is further configured to execute the following steps when the computer program is executed:

and when the code block to be matched next corresponds to the set code word identifier, determining that the set code word identifier is not synchronous, selecting continuous bits with a set threshold size as the updated current code block to be matched by taking the next bit of the last bit of the next code block to be matched in the target data packet as a starting point, and returning to the step of detecting whether the current code block to be matched is matched with the set code word identifier.

In an alternative embodiment, the processor 310 is further configured to execute the following steps when the computer program is executed:

when the set code word identification is determined to be synchronous, controlling the local terminal to start forward error correction;

and controlling the local terminal not to start forward error correction when the set code word identification is determined to be asynchronous.

In an alternative embodiment, the processor 310 is further configured to execute the following steps when the computer program is executed:

and deleting the set code word identification from the decoded data code stream according to the position relation between the set code word identification and the data code stream.

The device also includes: at least one network interface 312. The various components of the device are coupled together by a bus system 313. It will be appreciated that the bus system 313 is used to enable communications among the components connected. The bus system 313 includes a power bus, a control bus, and a status signal bus in addition to the data bus. For clarity of illustration, however, the various buses are labeled as bus system 313 in FIG. 6.

The memory 311 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 311 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.

The memory 311 in the embodiment of the present invention is used to store various types of data to support the operation of the apparatus. Examples of such data include: any computer program for operating on the device, such as operating systems and application programs; contact data; telephone book data; a message; a picture; video, etc. The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application programs may include various application programs such as a Media Player (Media Player), a Browser (Browser), etc. for implementing various application services. Here, the program that implements the method of the embodiment of the present invention may be included in an application program.

The embodiment further provides a computer storage medium, for example, comprising a memory 311 storing a computer program, which can be executed by the processor 310 in the apparatus to perform the steps of the method. The computer storage medium can be FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM; or may be a variety of devices including one or any combination of the above memories, such as a mobile phone, computer, tablet device, personal digital assistant, etc.

A computer storage medium having a computer program stored therein, the computer program, when executed by a processor, performing the steps of:

receiving a data code stream sent by an opposite terminal;

carrying out code word identification detection on the data code stream according to the set code word identification to obtain a detection result whether the set code word identification is synchronous or not;

and switching whether the home terminal starts forward error correction or not according to the detection result.

In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:

determining a current code block to be matched from the data code stream, and detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current code block to be matched is matched with the set code word identification, determining the next code block to be matched from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream, and when the next code block to be matched is detected to be matched with the set code word identification, determining that the set code word identification is synchronous.

In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:

selecting continuous bits with a set threshold size from a current data packet of the data code stream by taking the current bit as a starting point to serve as a current code block to be matched;

detecting whether the current code block to be matched is matched with a set code word identifier;

and when the current module to be matched is determined not to be matched with the set code word identifier, selecting continuous bits with the set threshold size as updated current code blocks to be matched by taking the next bit of the current bit as a starting point, and returning to the step of detecting whether the current code blocks to be matched are matched with the set code word identifier.

In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:

determining a target data packet from the data code stream according to the transmission speed of the data code stream and the code word identification sending frequency of the data code stream;

and determining continuous bits with the same position relation from the target data packet as a next code block to be matched according to the position relation between the current code block to be matched and the current data packet.

In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:

and when the code block to be matched next corresponds to the set code word identifier, determining that the set code word identifier is not synchronous, selecting continuous bits with a set threshold size as the updated current code block to be matched by taking the next bit of the last bit of the next code block to be matched in the target data packet as a starting point, and returning to the step of detecting whether the current code block to be matched is matched with the set code word identifier.

In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:

when the set code word identification is determined to be synchronous, controlling the local terminal to start forward error correction;

and controlling the local terminal not to start forward error correction when the set code word identification is determined to be asynchronous.

In an alternative embodiment, the computer program, when executed by the processor, further performs the steps of:

and deleting the set code word identification from the decoded data code stream according to the position relation between the set code word identification and the data code stream.

The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. The scope of the invention is to be determined by the scope of the appended claims.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:解码方法、设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类