WO2012065425A1 - Data stream framing method and apparatus - Google Patents

Data stream framing method and apparatus Download PDF

Info

Publication number
WO2012065425A1
WO2012065425A1 PCT/CN2011/075059 CN2011075059W WO2012065425A1 WO 2012065425 A1 WO2012065425 A1 WO 2012065425A1 CN 2011075059 W CN2011075059 W CN 2011075059W WO 2012065425 A1 WO2012065425 A1 WO 2012065425A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
data
data stream
framing
state
Prior art date
Application number
PCT/CN2011/075059
Other languages
French (fr)
Chinese (zh)
Inventor
孙巨揆
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012065425A1 publication Critical patent/WO2012065425A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0602Systems characterised by the synchronising information used

Definitions

  • the present invention relates to the field of communications, and in particular to a data stream framing method and apparatus.
  • a bearer network plays a role in the telecommunications network. It directs each service information flow from the source end to the destination end according to the requirements of the service layer, due to the explosion of IP services and other packet-based data transmission services transmitted over the network. Growth, the demand for transmission capacity is increasing rapidly.
  • An optical transport network based on OTN (Optical Transport Network) has emerged to meet the requirement of transmitting a large amount of business capacity. In the course of its development, since the transmitted traffic capacity is much larger than before, higher requirements are placed on the hardware and programmable logic resources in terms of high-speed interfaces and processing capabilities.
  • the signals are transmitted serially, and the electrical layer processing usually deals with parallel data streams. This requires first framing the received signal by detecting the frame header of the traffic stream. , byte alignment of business flow data, and then further processing such as business mapping, scheduling, and overhead management. Due to the increasing service capacity of OTN transmission, more parallel signals are usually processed in the programmable logic processing, that is, the method of increasing the bit width to handle more services, correspondingly causing programmable logic resources. The increase, and this increase usually rises several times, it will cause a lot of resource pressure on the programmable logic device, and will also bring great cost pressure to the design.
  • a primary object of the present invention is to provide a data stream framing method and apparatus for solving at least the above-mentioned problems of resource pressure and cost pressure caused by increasing programmable logic resources.
  • a data stream framing method comprising: bit shifting an input data stream that is not detected in a complete optical transport network data frame period; The data stream of the header; determining whether the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct; if yes, entering a fixed frame state, and performing frame processing on the shifted data stream .
  • the framing processing of the shifted data stream includes: first outputting a frame header indication of the data frame in the shifted data stream; and performing data in the data frame corresponding to the frame header indication and the frame header indication Frame boundary alignment processing.
  • the method further comprises: if the determination result is no, continuing to bit shift the input data stream until the data frame header and the data frame period of at least two consecutive data frames are correct.
  • the method further comprises: if the frame of the normal normal data frame is greater than or equal to 5 frames in the frame-fixing state, maintaining the frame-fixing state and performing the frame-fixing process; if the consecutive normal data frame frame header is smaller than 5 frames, then go to the frame out of sync state.
  • the method further comprises: when the frame is out of synchronization, the timer is started to count the duration of the frame out-of-synchronization state; if the duration is equal to or greater than 3 milliseconds, the frame is lost to the lost state.
  • the method further comprises: searching for a data frame frame header in the shifted data stream in a frame loss state; if the correct data frame frame header is continuously found, and the data frame period is correct, and the duration is greater than or Equal to 3 milliseconds, then go to the fixed frame state; otherwise, keep the frame lost state, and continue bit shifting and frame boundary alignment on the data stream.
  • a data stream framing apparatus including: a shift control module, configured to perform bit shifting on an input data stream, the data stream being a data frame in a complete optical transport network The data stream of the data frame header is not detected in the period; the framing module is configured to determine whether the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct; if yes, enter The frame state, the framed processing of the shifted data stream.
  • the framing module comprises: a data aligning module, configured to output a frame header indication of the data frame in the shifted data stream after the framing module enters the framing state; and the frame header indication and the frame header indication The data in the corresponding data frame is frame boundary alignment processing.
  • the framing module is further configured to continue bit shifting the input data stream if the determination result is no until at least two consecutive data frames have the correct data frame header and data frame period.
  • the apparatus further includes: a first determining module, configured to maintain a framing state and perform framing processing if a continuous normal data frame frame header is greater than or equal to 5 frames in a framed state; If the normal data frame frame header is less than 5 frames, the frame is lost to the frame out-of-synchronization state; the second determining module is configured to start the timer to count the duration of the frame out-of-synchronization state when the frame is out of synchronization state; When the time is equal to or greater than 3 milliseconds, the frame is lost to the frame loss state; the third determination module is set to be in the frame loss state.
  • a first determining module configured to maintain a framing state and perform framing processing if a continuous normal data frame frame header is greater than or equal to 5 frames in a framed state. If the normal data frame frame header is less than 5 frames, the frame is lost to the frame out-of-synchronization state; the second determining module is configured to start the timer to count the duration of the frame out-of
  • the data frame header in the shifted data stream is searched; if the correct data frame header is continuously found, and the data frame period is correct, and the duration is greater than or equal to 3 milliseconds, the frame is transferred to the fixed frame state; Otherwise, the frame loss state is maintained and the data stream continues to be bit shifted and frame boundary aligned.
  • the input data stream is bit shifted.
  • each alignment is designed with a set for framing and Data-aligned programmable logic, but in fact once the system is stable, the data is aligned in only one way, except for the set of programmable logic used to determine the frame, the remaining programmable logic blocks are redundant, and
  • the Bit shift control mechanism By designing the Bit shift control mechanism, the present invention can ensure that a set of programmable logic modules for framing is used to traverse all the alignment modes, thereby saving programmable logic resources and solving the prior art problem of increasing programmable logic resources.
  • FIG. 1 is a flow chart showing the steps of a data stream framing method according to a first embodiment of the present invention
  • FIG. 2 is a schematic diagram showing bit shift of a data stream according to an embodiment of the present invention
  • FIG. 4 is a flow chart of steps of a data stream framing method according to Embodiment 3 of the present invention
  • FIG. 5 is a flowchart of a method according to Embodiment 4 of the present invention
  • FIG. 6 is a schematic structural diagram of a data stream framing apparatus according to Embodiment 5 of the present invention
  • FIG. 7 is a state transition of a framing module in the data stream framing apparatus shown in FIG. Figure. BEST MODE FOR CARRYING OUT THE INVENTION
  • BEST MODE FOR CARRYING OUT THE INVENTION BEST MODE FOR CARRYING OUT THE INVENTION
  • Step S102 bit shifting an input data stream;
  • the input data stream is in a frame out-of-synchronization state, and the data stream of the data frame frame header is not detected in a complete optical transport network data frame period.
  • the system does not detect the data frame header of the input data stream in a complete optical transport network data frame period, determines that the input data stream is in a frame out-of-synchronization state, and performs bit (bit) on the data stream.
  • Shift as shown in Figure 2.
  • Step S104 determining whether the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct; if yes, executing step S106; if not, returning to step S102. If the system detects that the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct, it is considered that the frame processing can be performed; otherwise, other processing is performed, such as continuing to bit shift the data stream. Or, a person skilled in the art can appropriately process the data stream by referring to the method in the related art. Step S106: If the result of the determination is YES, the framing state is entered, and the shifted data stream is subjected to framing processing.
  • the data stream bit shifting mechanism is used, when the data frame frame in the input data stream is out of step, and the data frame frame header is not detected in a complete OTN period, the input data stream is Perform bit shifting.
  • the invention can ensure that a set of programmable logic modules for framing is used to traverse all the alignment modes by designing a bit shift control mechanism, thereby saving programmable logic resources and solving the prior art.
  • the problem of resource pressure and cost pressure caused by increasing programmable logic resources Under the background condition of large-capacity transmission, the contradiction between programmable logic and linear growth of service capacity is alleviated, which saves the effect of programmable logic resources and design cost.
  • Step S302 Perform a bit shift on the input unaligned data stream.
  • the unaligned data is in the frame out-of-synchronization state, and the data stream of the data frame header is not detected in a complete optical transport network data frame period.
  • the bit shift for the unaligned data stream can be as shown in Figure 2.
  • Step S304 Detecting a frame header byte and a frame period of the data frame in the shifted data stream;
  • Step 4 S308: If a normal frame header byte is detected for at least 2 consecutive frames and the frame period is correct, the frame state is transferred to the framing process.
  • Step S402 Perform a bit shift on the input unaligned data stream. Bit. In this step, the unaligned data is in the frame out-of-synchronization state, and the data stream of the data frame header is not detected in a complete optical transport network data frame period.
  • the bit shift for the unaligned data stream can be as shown in Figure 2.
  • Step S404 If the normal frame header byte is not detected in the frame header position for at least 2 consecutive frames, and the frame out-of-synchronization indication signal output is still available, the frame-fixing process cannot be entered, and the frame out-of-synchronization state is continued, and the output frame is out of synchronization. If yes, go to step S402; otherwise, go to step S406 to enter the framing state. If within a frame period of an OTN, a normal frame header byte cannot be detected for 2 consecutive frames and the frame period is correct, the framing process cannot be entered, and bit shifting is continued; if two consecutive frames detect a normal frame header If the byte and the frame period are correct, step S406 is executed to enter the framing state.
  • Step 4 S406: If a normal frame header byte is detected for at least 2 consecutive frames and the frame period is correct, then the framing state is entered.
  • Step S408 In the framing state, if the consecutive abnormal frame header bytes are less than 5 frames, the framing state is maintained; if the consecutive abnormal frame header bytes are greater than or equal to 5 frames, then the frame is lost. Go to step S402. By determining whether consecutive abnormal header bytes are less than 5 frames, the stability of the fixed frame state is maintained.
  • Step S410 In the framed state, the data in the shifted data stream is aligned, and the frame header indication of the data frame is output in advance (priority).
  • Step S412 Then, the data frame frame header is aligned with the data in the data frame corresponding to the frame header to complete the entire framing process.
  • the register resource occupied by the input data delay is reduced by the method of outputting the frame header in advance.
  • the data processing will have several cycles of delay to get the frame header of the data frame.
  • the traditional framing method is to delay the input data by some period to align with the frame header indication, which is relatively simple to process.
  • the data delay register will occupy more programmable logic resources. If the bit width is wider, the logical resource occupancy of this part is also large.
  • FIG. 5 is a block diagram showing a structure of a data stream framing apparatus according to Embodiment 4 of the present invention, including: a shift control module 502 configured to perform bit shifting on an input data stream, where the data stream is The data stream of the data frame header is not detected in a complete optical transport network data frame period; the framing module 504 is configured to determine whether the data frame header of at least two consecutive data frames in the shifted data stream is The data frame period is correct; if yes, the frame state is entered, and the shifted data stream is framed.
  • a shift control module 502 configured to perform bit shifting on an input data stream, where the data stream is The data stream of the data frame header is not detected in a complete optical transport network data frame period
  • the framing module 504 is configured to determine whether the data frame header of at least two consecutive data frames in the shifted data stream is The data frame period is correct; if yes, the frame state is entered, and the shifted data stream is framed.
  • the framing module 504 includes: a data aligning module 5042, configured to output a frame header indication of the data frame in the shifted data stream after the framing module 504 enters the framing state;
  • the frame header indicates that the data in the corresponding data frame is frame boundary alignment processing.
  • the framing module 504 is further configured to continue to bit shift the input data stream until the data frame header and the data frame period of at least two consecutive data frames are correct, if the determination result is no.
  • the data stream framing apparatus of this embodiment further includes: a first determining module, configured to maintain a framing state if a continuous normal data frame frame header is greater than or equal to 5 frames in a fixed frame state Fixed frame processing; if the consecutive normal data frame frame header is less than 5 frames, then the frame is out of synchronization state; the second determination module is set to start the timer to the frame out of synchronization state when the frame is out of synchronization The duration is timed; if the duration is equal to or greater than 3 milliseconds, the frame is lost to the frame loss state; the third determining module is configured to find the data frame frame header in the shifted data stream in the frame loss state; Find the correct data frame header, and the data frame period is correct, and the duration is greater than or equal to 3 milliseconds, then go to the fixed frame state; otherwise, keep the frame lost state, and continue bit shifting and frame boundary on the data stream Align.
  • a first determining module configured to maintain a framing state if a continuous normal data
  • FIG. 6 a schematic diagram of a data stream framing apparatus according to a fifth embodiment of the present invention is shown, including: a shift control module 602, a framing module 604, wherein the framing module 604 includes a data alignment module 6042.
  • the towel, shift control module 602 is configured to perform bit shift control on the high speed data stream. In the state of frame out of synchronization, if the frame header is not detected after a complete OTN frame period, the module Control the input data to make a bit shift, and then detect the data frame header; if the data frame header can be detected, then the Bit shift is not caused.
  • the framing module 604 is configured to perform framing processing on the shifted input data, and the function is relatively complicated, and its state transition relationship is as shown in FIG. 7. After the system is reset, it is in the frame out-of-synchronization state; after the bit shift processing is performed on the input data stream, if the frame header module 604 detects the normal frame header byte for two consecutive frames and the frame period is correct, the frame state is transferred to the fixed frame state; If the consecutive correct frame header bytes are less than 2 frames, the frame out-of-synchronization state is maintained, the shift control module 602 of the restart system performs bit shifting of the data stream, and the frame boundary alignment module (not shown) performs frame boundaries. Align.
  • the framing module 604 can start a timer to time the frame out-of-synchronization state duration (or start a counter to count), and if the frame is out of synchronization for 3 ms, the frame is lost. .
  • the frame loss state the frame header flag byte is searched. If the normal frame header byte is found continuously, and the frame period is also correct, and the duration is greater than or equal to 3 ms, then the transfer is performed.
  • the frame state is maintained; otherwise, the frame loss state is maintained, and the shift control module 602 of the system is restarted to perform bit shifting of the data stream, and the frame boundary alignment module of the system performs frame boundary alignment of the data frame in the data stream.
  • the framing module 604 keeps the framing state if the consecutive abnormal frame header bytes are less than 5 frames in the framing state; if the consecutive abnormal frame header bytes are greater than or equal to 5 frames, the entangled frame is out of step status.
  • the data alignment module 6042 is configured to, after the framing module 604 enters the framing state, align the input data stream to the low-speed parallel data stream, and ensure that the frame header is placed at the upper bit of the output data, ie: output first a frame header indication of the data frame in the shifted data stream; and then performing frame boundary alignment processing on the data in the data frame corresponding to the frame header indication and the frame header indication.
  • the shift control module 602 shifts a bit of the input unaligned data stream and then outputs the data stream to the framing module 604; if the framing module 604 does not enter the framing process during an OTN frame period, If there is still a frame out-of-synchronization indication signal output, the frame out-of-synchronization state is maintained, the output frame out-of-synchronization indication is continued, and the data stream bit shift is continued using the shift control module 602. Otherwise, if the frame-fixing module 604 detects the normal 2 consecutive frames.
  • the frame header byte is correct and the frame period is correct, it is transferred to the fixed frame state; in the fixed frame state, if the consecutive abnormal frame header bytes are less than 5 frames, the fixed frame state is maintained; if consecutive abnormal frame header words are continued If the node is greater than or equal to 5 frames, the frame is out of synchronization.
  • the data alignment module 6042 performs alignment processing on the input data, and associates the output data with the output frame header, that is, in the framed state, in advance
  • the frame header is output, and then aligned with the bit shifted data to complete the entire framing process.
  • (1) a shift control module is designed.
  • the traditional framing process has no shift control module.
  • each alignment design Due to the lack of bit shift feedback control mechanism, for the input unaligned data stream, each alignment design has a set of framing and data alignment logic, but in fact once The system works stably, and the data is aligned only in one way. Except for the logic that is determining the frame, the remaining logic modules are redundant. In this embodiment, a set of fixed frames can be guaranteed by designing a bit shift control mechanism. Modules traverse all alignments to save logic resources. (2) In the embodiment, the method of outputting the frame header in advance reduces the register resources occupied by the input data delay. In the process of framing, there will be several cycles of delay in data processing to get the frame header of the data.
  • the traditional framing method is to delay the input data by some period to align with the frame header indication, which is relatively simple to process.
  • the data delay register will occupy some logic resources. If the bit width is wider, the logical resource occupancy of this part is also large.
  • the method of outputting the frame header in advance after the frame is used, the delay register of the input data is minimized, and the occupation of the logic resources is reduced.
  • the present invention achieves framing of high speed data streams by using a small amount of programmable logic resources. Compared with the prior art, the logic resources are greatly reduced. Taking Altera's Stratix4GX180K as an example, it saves about 75% of the programmable logic resources compared with the conventional design, and saves the design cost.
  • the specific saving logic resources are shown in Table 1. Table 1
  • the present invention proposes a data stream framing method and device, which can effectively save programmable logic resources and adopt a new scheme. After that, it can save 75% of the logic resources, and the savings in design cost are also obvious.
  • the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The present invention discloses a data stream framing method and apparatus. The data stream framing method includes: performing bit-shifting on the input data stream, wherein the data frame header of the data stream is not detected in a complete optical transport network data frame period; judging whether the data frame headers and the data frame periods of at least two continual data frames are correct in the shifted data stream; if they are correct, entering the framing state, and performing framing processing on the shifted data stream. In the background of the large capacity transmission, applying the present invention avoids that the needed programmable logic resources linearly increase with the enlargement of service capacity, and reduces the programmable logic resources and the design cost.

Description

数据流定帧方法^置 技术领域 本发明涉及通信领域, 具体而言, 涉及一种数据流定帧方法及装置。 背景技术 承载网在电信网络中起承上启下的作用, 它按照业务层的要求把每个业务 信息流从源端引导到目的端,由于在网络上传送的 IP业务和其他基于包传送数 据业务的爆炸式增长, 对传输容量的要求在不断迅猛增加。 基于 OTN ( Optical Transport Network, 光传送网) 的光传送网应运而生, 满足了传送海量增长的 业务容量的要求。 在其发展过程中, 由于所传送的业务容量比以前大很多, 所 以在高速接口和处理能力上对于硬件和可编程逻辑资源相应的都提出了更高 的要求。 通常在高速领域中, 信号都是串行传输的, 而电层处理过程通常处理的是 并行数据流, 这就需要首先对接收到的信号做定帧处理, 通过检测业务流的帧 头字节, 将业务流数据做字节对齐, 然后再做进一步的业务映射、 调度和开销 管理等处理。 由于 OTN传送的业务容量越来越大, 在可编程逻辑处理中通常釆用更多 的并行信号来处理, 也就是增加位宽的方法来处理更多的业务, 相应的会造成 可编程逻辑资源的增加, 而这种增加通常是成几倍上涨的, 它会对可编程逻辑 器件造成很大的资源压力, 也会对设计造成很大的成本压力。 发明内容 本发明的主要目的在于提供一种数据流定帧方法及装置, 以至少解决上述 的因增加可编程逻辑资源而造成的资源压力和成本压力的问题。 根据本发明的一个方面, 提供了一种数据流定帧方法, 包括: 对输入的数 据流进行比特移位, 该数据流为在一个完整的光传送网数据帧周期内未检测到 数据帧帧头的数据流; 判断移位后的数据流中是否至少连续二个数据帧的数据 帧帧头和数据帧周期正确; 若是, 则进入定帧状态, 对移位后的数据流进行定 帧处理。 优选地, 对移位后的数据流进行定帧处理包括: 先输出移位后的数据流中 的数据帧的帧头指示; 对帧头指示和该帧头指示对应的数据帧中的数据做帧边 界对齐处理。 优选地, 该方法还包括: 若判断结果为否, 则继续对输入的数据流进行比 特移位, 直至至少有连续二个数据帧的数据帧帧头和数据帧周期正确。 优选地, 该方法还包括: 在定帧状态下, 若连续的正常的数据帧帧头大于 或等于 5帧, 则保持定帧状态, 进行定帧处理; 若连续的正常的数据帧帧头小 于 5帧, 则转入帧失步状态。 优选地, 该方法还包括: 在转入帧失步状态时, 启动计时器对帧失步状态 的持续时间进行计时; 若持续时间等于或大于 3毫秒, 则转入帧丢失状态。 优选地, 该方法还包括: 在帧丢失状态下, 查找移位后的数据流中的数据 帧帧头; 若连续查找到正确的数据帧帧头, 且数据帧周期正确, 且持续时间大 于或等于 3毫秒, 则转入定帧状态; 否则, 保持帧丢失状态, 并对数据流继续 进行比特移位和帧边界对齐。 根据本发明的另一方面, 提供了一种数据流定帧装置, 包括: 移位控制模 块, 用于对输入的数据流进行比特移位, 该数据流为在一个完整的光传送网数 据帧周期内未检测到数据帧帧头的数据流; 定帧模块, 用于判断移位后的数据 流中是否至少连续二个数据帧的数据帧帧头和数据帧周期正确; 若是, 则进入 定帧状态, 对移位后的数据流进行定帧处理。 优选地, 定帧模块包括: 数据对齐模块, 设置为在定帧模块进入定帧状态 后, 先输出移位后的数据流中的数据帧的帧头指示; 对帧头指示和该帧头指示 对应的数据帧中的数据作帧边界对齐处理。 优选地, 定帧模块还设置为若判断结果为否, 则继续对输入的数据流进行 比特移位, 直至至少有连续二个数据帧的数据帧帧头和数据帧周期正确。 优选地, 该装置还包括: 第一判定模块, 设置为在定帧状态下, 若连续的 正常的数据帧帧头大于或等于 5帧, 则保持定帧状态, 进行定帧处理; 若连续 的正常的数据帧帧头小于 5帧, 则转入帧失步状态; 第二判定模块, 设置为在 转入帧失步状态时, 启动计时器对帧失步状态的持续时间进行计时; 若持续时 间等于或大于 3毫秒, 则转入帧丢失状态; 第三判定模块, 设置为在帧丢失状 态下,查找移位后的数据流中的数据帧帧头;若连续查找到正确的数据帧帧头, 且数据帧周期正确, 且持续时间大于或等于 3毫秒, 则转入定帧状态; 否则, 保持帧丢失状态, 并对数据流继续进行比特移位和帧边界对齐。 通过本发明, 釆用当输入的数据流中的数据帧帧失步, 且在一个完整的 OTN周期内都检测不到数据帧帧头时, 对该输入的数据流进行比特移位。 与现 有技术相比, 现有技术在进行数据定帧时, 由于缺乏比特 Bit移位反馈控制机 制, 对于输入的未对齐的数据流, 每一种对齐方式都设计了一套用于定帧和数 据对齐的可编程逻辑, 而实际上一旦系统工作稳定, 数据只按照一种方式来对 齐, 除了用于正确定帧的那套可编程逻辑,其余的可编程逻辑模块都是冗余的, 而本发明通过设计 Bit移位控制机制就可以保证用一套用于定帧的可编程逻辑 模块来遍历所有的对齐方式, 从而节省了可编程逻辑资源, 解决了现有技术因 增加可编程逻辑资源而造成的资源压力和成本压力的问题, 进而达到了在大容 量传输的背景条件下, 緩解可编程逻辑随着业务容量线性增长的矛盾, 节约了 可编程逻辑资源和设计成本的效果。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不 当限定。 在附图中: 图 1是根据本发明实施例一的一种数据流定帧方法的步骤流程图; 图 2是根据本发明实施例的数据流比特移位的示意图; 图 3是根据本发明实施例二的一种数据流定帧方法的步骤流程图; 图 4是根据本发明实施例三的一种数据流定帧方法的步骤流程图; 图 5是根据本发明实施例四的一种数据流定帧装置的结构框图; 图 6是根据本发明实施例五的一种数据流定帧装置的结构示意图; 图 7是图 6所示数据流定帧装置中的定帧模块的状态转移图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不 冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 参照图 1 , 示出了才艮据本发明实施例一的一种数据流定帧方法的步骤流程 图, 包括以下步 4聚: 步骤 S 102: 对输入的数据流进行比特移位; 其中, 所述输入的数据流为处于帧失步状态, 在一个完整的光传送网数据 帧周期内未检测到数据帧帧头的数据流。 本步骤中, 系统在一个完整的光传送网数据帧周期内未检测到输入的数据 流的数据帧帧头, 确定该输入的数据流处于帧失步状态, 对该数据流进行比特 ( Bit ) 移位, 如图 2所示。 步骤 S 104:判断移位后的数据流中是否至少连续二个数据帧的数据帧帧头 和数据帧周期正确; 若是, 则执行步骤 S 106; 若否, 则返回步骤 S 102。 若系统检测到移位后的数据流中至少连续二个数据帧的数据帧帧头和数 据帧周期正确, 则认为可以进行定帧处理, 否则, 进行其它处理, 如继续对数 据流进行比特移位, 或者, 本领域技术人员可以参照相关技术中的方法, 对数 据流故适当处理。 步骤 S 106: 若判断结果为是, 则进入定帧状态, 对移位后的数据流进行定 帧处理。 相关技术中, 在进行数据定帧时, 缺乏比特移位反馈控制机制, 对于输入 的未对齐的数据流, 每一种对齐方式都设计了一套用于定帧和数据对齐的可编 程逻辑, 而一旦系统工作稳定, 数据只按照一种方式来对齐, 除了用于正确定 帧的那套可编程逻辑, 其余的可编程逻辑模块都是冗余的。 通过本发明, 釆用 数据流比特移位机制, 当输入的数据流中的数据帧帧失步, 且在一个完整的 OTN周期内都检测不到数据帧帧头时, 对该输入的数据流进行比特移位。 与相 关技术相比, 本发明通过设计比特移位控制机制就可以保证用一套用于定帧的 可编程逻辑模块来遍历所有的对齐方式, 从而节省了可编程逻辑资源, 解决了 现有技术因增加可编程逻辑资源而造成的资源压力和成本压力的问题, 进而达 到了在大容量传输的背景条件下, 緩解可编程逻辑随着业务容量线性增长的矛 盾, 节约了可编程逻辑资源和设计成本的效果。 参照图 3 , 示出了才艮据本发明实施例二的一种数据流定帧方法的步骤流程 图, 包括以下步 4聚: 步骤 S302: 对输入的未对齐数据流做一个比特位的移位; 本步骤中, 未对齐数据即为处于帧失步状态, 在一个完整的光传送网数据 帧周期内未检测到数据帧帧头的数据流。 对未对齐数据流的比特移位可以如图 2所示。 步骤 S304: 检测移位后的数据流中的数据帧的帧头字节和帧周期; 步骤 S306: 判断在一个 OTN的帧周期内, 是否能够至少连续 2帧检测到 正常的帧头字节并且帧周期正确, 若是, 则执行步骤 S308; 否则, 保持帧失步 状态, 输出帧失步指示, 继续执行步骤 S302; 如果未能够至少连续 2帧在帧头位置检测到正常的帧头字节, 仍然有帧失 步指示信号输出, 则不能进入定帧过程, 继续保持帧失步状态, 输出帧失步指 示, 执行步骤 S302; 否则, 执行步骤 S308, 进入定帧状态。 步 4聚 S308: 若至少连续 2帧检测到了正常的帧头字节并且帧周期正确, 则 转入定帧状态, 进行定帧处理。 参照图 4 , 示出了才艮据本发明实施例三的一种数据流定帧方法的步骤流程 图, 包括以下步 4聚: 步骤 S402: 对输入的未对齐数据流做一个比特位的移位。 本步骤中, 未对齐数据即为处于帧失步状态, 在一个完整的光传送网数据 帧周期内未检测到数据帧帧头的数据流。 对未对齐数据流的比特移位可以如图 2所示。 步骤 S404: 如果未能够至少连续 2帧在帧头位置检测到正常的帧头字节, 仍然有帧失步指示信号输出, 则不能进入定帧过程, 继续保持帧失步状态, 输 出帧失步指示, 执行步骤 S402; 否则, 执行步骤 S406, 进入定帧状态。 如果在一个 OTN的帧周期内, 未能够连续 2帧检测到正常的帧头字节并 且帧周期正确, 则不能进入定帧过程, 继续进行比特移位; 若连续 2帧检测到 正常的帧头字节并且帧周期正确, 则执行步骤 S406, 进入定帧状态。 步 4聚 S406: 若至少连续 2帧检测到了正常的帧头字节并且帧周期正确, 则 转入定帧状态。 步骤 S408: 在定帧状态下, 若连续的非正常的帧头字节小于 5帧, 则保持 定帧状态; 若连续的非正常帧头字节大于等于 5帧, 则转入帧失步状态, 转步 骤 S402。 通过判断连续的非正常的帧头字节是否小于 5帧,以保持定帧状态的稳定。 步骤 S410: 在定帧状态下, 对移位后的数据流中的数据做对齐处理, 提前 (优先) 将数据帧的帧头指示输出。 步骤 S412: 然后, 将数据帧帧头与该帧头对应的数据帧中的数据进行对齐 处理, 完成整个定帧过程。 本实施例通过提前输出帧头的方法, 减少了输入数据延迟所占用的寄存器 资源。 在定帧过程中, 数据处理都会有几个周期的延迟, 才能得到数据帧的帧 头, 传统的定帧方法, 是将输入数据也延迟一些周期来和帧头指示对齐, 这样 处理起来比较简单, 但是数据的延迟寄存器会占用较多的可编程逻辑资源, 如 果位宽比较宽, 那么这部分的逻辑资源占用也是很大的。 通过本实施例, 釆用 定帧后帧头提前输出的方法, 将输入数据的延时寄存器减到最少, 有效减少了 可编程逻辑资源的占用。 参照图 5 ,示出了根据本发明实施例四的一种数据流定帧装置的结构框图, 包括: 移位控制模块 502 , 设置为对输入的数据流进行比特移位, 所述数据流为 在一个完整的光传送网数据帧周期内未检测到数据帧帧头的数据流; 定帧模块 504, 设置为判断移位后的数据流中是否至少连续二个数据帧的数据帧帧头和 数据帧周期正确; 若是, 则进入定帧状态, 对移位后的数据流进行定帧处理。 优选的, 定帧模块 504包括: 数据对齐模块 5042 , 设置为在定帧模块 504 进入定帧状态后, 先输出移位后的数据流中的数据帧的帧头指示; 对帧头指示 和该帧头指示对应的数据帧中的数据作帧边界对齐处理。 优选的, 定帧模块 504还设置为若判断结果为否, 则继续对输入的数据流 进行比特移位, 直至至少有连续二个数据帧的数据帧帧头和数据帧周期正确。 优选的, 本实施例的数据流定帧装置还包括: 第一判定模块, 设置为在定 帧状态下, 若连续的正常的数据帧帧头大于或等于 5帧, 则保持定帧状态, 进 行定帧处理; 若连续的正常的数据帧帧头小于 5帧, 则转入帧失步状态; 第二 判定模块, 设置为在转入帧失步状态时, 启动计时器对帧失步状态的持续时间 进行计时; 若持续时间等于或大于 3毫秒, 则转入帧丢失状态; 第三判定模块, 设置为在帧丢失状态下, 查找移位后的数据流中的数据帧帧头; 若连续查找到 正确的数据帧帧头, 且数据帧周期正确, 且持续时间大于或等于 3毫秒, 则转 入定帧状态; 否则, 保持帧丢失状态, 并对数据流继续进行比特移位和帧边界 对齐。 参照图 6 , 示出了根据本发明实施例五的一种数据流定帧装置的结构示意 图, 包括: 移位控制模块 602、 定帧模块 604 , 其中定帧模块 604 中包括数据 对齐模块 6042。 其巾, 移位控制模块 602 , 设置为对高速数据流进行比特 (Bit ) 移位控制, 在帧 失步的状态下, 如果间隔一个完整的 OTN 帧周期都检测不到帧头, 那么该模 块控制输入的数据做一个 Bit的移位, 再检测数据帧头; 如果能检测到数据帧 头, 那么就不故 Bit移位。 定帧模块 604 , 设置为对移位后的输入数据做定帧处理, 功能相对复杂, 它的状态转移关系如图 7所示。 系统复位后, 处于帧失步状态; 在输入数据流进行了比特移位处理后, 定 帧模块 604若连续 2帧检测到了正常的帧头字节并且帧周期正确, 则转入定帧 状态; 若连续正确的帧头字节小于 2帧, 则保持帧失步状态, 重新启动系统的 移位控制模块 602进行数据流比特移位, 和帧边界对齐模块 (图中未示出)进 行帧边界对齐。 在帧失步状态下, 定帧模块 604可以启动一个计时器对帧失步状态持续时 间进行计时(或者, 启动一个计数器进行计数), 若连续 3ms处于帧失步状态, 则转入帧丢失状态。 在帧丢失状态下, 进行帧头标志字节的查找, 若连续找到 了正常的帧头字节, 同时帧周期也正确, 并且持续时间大于等于 3ms, 则转入 定帧状态; 否则, 保持帧丢失状态, 并重新启动系统的移位控制模块 602进行 数据流的比特移位, 和系统的帧边界对齐模块进行数据流中数据帧的帧边界对 齐。 定帧模块 604在定帧状态下, 若连续的非正常的帧头字节小于 5帧, 则保 持定帧状态; 若连续的非正常帧头字节大于等于 5帧, 则转入帧失步状态。 数据对齐模块 6042 , 设置为在定帧模块 604进入定帧状态后, 将输入的数 据流对齐到低速的并行数据流,并且保证帧头放在输出数据的高位 Bit (比特), 即: 先输出所述移位后的数据流中的数据帧的帧头指示; 然后对帧头指示和该 帧头指示对应的数据帧中的数据作帧边界对齐处理。 例如, 移位控制模块 602对输入的未对齐数据流故一个 Bit的移位, 然后 将数据流输出到定帧模块 604;如果定帧模块 604在一个 OTN的帧周期内没有 进入定帧过程, 仍然有帧失步指示信号输出, 则保持帧失步状态, 输出帧失步 指示,继续使用移位控制模块 602进行数据流比特移位, 否则,若定帧模块 604 连续 2帧检测到了正常的帧头字节并且帧周期正确, 则转入定帧状态; 在定帧 状态下, 若连续的非正常的帧头字节小于 5帧, 则保持定帧状态; 若连续的非 正常帧头字节大于等于 5帧, 则转入帧失步状态; 在定帧状态下, 数据对齐模 块 6042 对输入数据做对齐处理, 将输出数据与输出帧头对应起来, 即: 在定 帧状态下, 提前将帧头指示输出, 然后与 Bit移位后的数据做对齐, 完成整个 定帧过程。 本实施例中, ( 1 )设计了移位控制模块。 传统的定帧处理没有移位控制模 块, 由于缺乏比特移位反馈控制机制, 对于输入的未对齐的数据流, 每一种对 齐方式都设计了一套定帧和数据对齐逻辑, 而实际上一旦系统工作稳定, 数据 只按照一种方式来对齐, 除了正确定帧的那套逻辑, 其余的逻辑模块都是冗余 的, 本实施例通过设计比特移位控制机制就可以保证用一套定帧模块来遍历所 有的对齐方式, 从而节省逻辑资源。 (2 ) 本实施例通过提前输出帧头的方法, 减少了输入数据延迟所占用的寄存器资源。 在定帧过程中, 做数据处理都会有 几个周期的延迟, 才能得到数据的帧头, 传统的定帧方法, 是将输入数据也延 迟一些周期来和帧头指示对齐, 这样处理起来比较简单, 但是数据的延迟寄存 器会占用一些逻辑资源, 如果位宽比较宽, 那么这部分的逻辑资源占用也是很 大的。 本实施例釆用定帧后帧头提前输出的方法, 将输入数据的延时寄存器减 到最少, 减少了逻辑资源的占用。 本发明通过用很少量的可编程逻辑资源来实现高速数据流的定帧。 与现有 技术相比, 大大减少了逻辑资源, 以 Altera的 Stratix4GX180K为例, 比传统设 计节约大概 75%的可编程逻辑资源, 节省了设计成本, 具体节省逻辑资源情况 见表 1。 表 1 The present invention relates to the field of communications, and in particular to a data stream framing method and apparatus. BACKGROUND OF THE INVENTION A bearer network plays a role in the telecommunications network. It directs each service information flow from the source end to the destination end according to the requirements of the service layer, due to the explosion of IP services and other packet-based data transmission services transmitted over the network. Growth, the demand for transmission capacity is increasing rapidly. An optical transport network based on OTN (Optical Transport Network) has emerged to meet the requirement of transmitting a large amount of business capacity. In the course of its development, since the transmitted traffic capacity is much larger than before, higher requirements are placed on the hardware and programmable logic resources in terms of high-speed interfaces and processing capabilities. Usually in the high-speed domain, the signals are transmitted serially, and the electrical layer processing usually deals with parallel data streams. This requires first framing the received signal by detecting the frame header of the traffic stream. , byte alignment of business flow data, and then further processing such as business mapping, scheduling, and overhead management. Due to the increasing service capacity of OTN transmission, more parallel signals are usually processed in the programmable logic processing, that is, the method of increasing the bit width to handle more services, correspondingly causing programmable logic resources. The increase, and this increase usually rises several times, it will cause a lot of resource pressure on the programmable logic device, and will also bring great cost pressure to the design. SUMMARY OF THE INVENTION A primary object of the present invention is to provide a data stream framing method and apparatus for solving at least the above-mentioned problems of resource pressure and cost pressure caused by increasing programmable logic resources. According to an aspect of the present invention, a data stream framing method is provided, comprising: bit shifting an input data stream that is not detected in a complete optical transport network data frame period; The data stream of the header; determining whether the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct; if yes, entering a fixed frame state, and performing frame processing on the shifted data stream . Preferably, the framing processing of the shifted data stream includes: first outputting a frame header indication of the data frame in the shifted data stream; and performing data in the data frame corresponding to the frame header indication and the frame header indication Frame boundary alignment processing. Preferably, the method further comprises: if the determination result is no, continuing to bit shift the input data stream until the data frame header and the data frame period of at least two consecutive data frames are correct. Preferably, the method further comprises: if the frame of the normal normal data frame is greater than or equal to 5 frames in the frame-fixing state, maintaining the frame-fixing state and performing the frame-fixing process; if the consecutive normal data frame frame header is smaller than 5 frames, then go to the frame out of sync state. Preferably, the method further comprises: when the frame is out of synchronization, the timer is started to count the duration of the frame out-of-synchronization state; if the duration is equal to or greater than 3 milliseconds, the frame is lost to the lost state. Preferably, the method further comprises: searching for a data frame frame header in the shifted data stream in a frame loss state; if the correct data frame frame header is continuously found, and the data frame period is correct, and the duration is greater than or Equal to 3 milliseconds, then go to the fixed frame state; otherwise, keep the frame lost state, and continue bit shifting and frame boundary alignment on the data stream. According to another aspect of the present invention, a data stream framing apparatus is provided, including: a shift control module, configured to perform bit shifting on an input data stream, the data stream being a data frame in a complete optical transport network The data stream of the data frame header is not detected in the period; the framing module is configured to determine whether the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct; if yes, enter The frame state, the framed processing of the shifted data stream. Preferably, the framing module comprises: a data aligning module, configured to output a frame header indication of the data frame in the shifted data stream after the framing module enters the framing state; and the frame header indication and the frame header indication The data in the corresponding data frame is frame boundary alignment processing. Preferably, the framing module is further configured to continue bit shifting the input data stream if the determination result is no until at least two consecutive data frames have the correct data frame header and data frame period. Preferably, the apparatus further includes: a first determining module, configured to maintain a framing state and perform framing processing if a continuous normal data frame frame header is greater than or equal to 5 frames in a framed state; If the normal data frame frame header is less than 5 frames, the frame is lost to the frame out-of-synchronization state; the second determining module is configured to start the timer to count the duration of the frame out-of-synchronization state when the frame is out of synchronization state; When the time is equal to or greater than 3 milliseconds, the frame is lost to the frame loss state; the third determination module is set to be in the frame loss state. In the state, the data frame header in the shifted data stream is searched; if the correct data frame header is continuously found, and the data frame period is correct, and the duration is greater than or equal to 3 milliseconds, the frame is transferred to the fixed frame state; Otherwise, the frame loss state is maintained and the data stream continues to be bit shifted and frame boundary aligned. With the present invention, when the data frame frame in the input data stream is out of step and the data frame frame header is not detected within a complete OTN period, the input data stream is bit shifted. Compared with the prior art, in the prior art, when data framing is performed, due to the lack of bit bit shift feedback control mechanism, for the input unaligned data stream, each alignment is designed with a set for framing and Data-aligned programmable logic, but in fact once the system is stable, the data is aligned in only one way, except for the set of programmable logic used to determine the frame, the remaining programmable logic blocks are redundant, and By designing the Bit shift control mechanism, the present invention can ensure that a set of programmable logic modules for framing is used to traverse all the alignment modes, thereby saving programmable logic resources and solving the prior art problem of increasing programmable logic resources. The problem of resource pressure and cost pressure has caused the contradiction between programmable logic and linear growth of service capacity under the background of large-capacity transmission, saving the effect of programmable logic resources and design cost. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are set to illustrate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a flow chart showing the steps of a data stream framing method according to a first embodiment of the present invention; FIG. 2 is a schematic diagram showing bit shift of a data stream according to an embodiment of the present invention; FIG. 4 is a flow chart of steps of a data stream framing method according to Embodiment 3 of the present invention; FIG. 5 is a flowchart of a method according to Embodiment 4 of the present invention; FIG. 6 is a schematic structural diagram of a data stream framing apparatus according to Embodiment 5 of the present invention; FIG. 7 is a state transition of a framing module in the data stream framing apparatus shown in FIG. Figure. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. Referring to FIG. 1, a flow chart of a data stream framing method according to a first embodiment of the present invention is shown, which includes the following steps: Step S102: bit shifting an input data stream; The input data stream is in a frame out-of-synchronization state, and the data stream of the data frame frame header is not detected in a complete optical transport network data frame period. In this step, the system does not detect the data frame header of the input data stream in a complete optical transport network data frame period, determines that the input data stream is in a frame out-of-synchronization state, and performs bit (bit) on the data stream. Shift, as shown in Figure 2. Step S104: determining whether the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct; if yes, executing step S106; if not, returning to step S102. If the system detects that the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct, it is considered that the frame processing can be performed; otherwise, other processing is performed, such as continuing to bit shift the data stream. Or, a person skilled in the art can appropriately process the data stream by referring to the method in the related art. Step S106: If the result of the determination is YES, the framing state is entered, and the shifted data stream is subjected to framing processing. In the related art, when data framing is performed, a bit shift feedback control mechanism is lacking, and for the input unaligned data stream, each alignment design a set of programmable logic for framing and data alignment, and Once the system is stable, the data is aligned in only one way, except for the set of programmable logic used to determine the frame, and the remaining programmable logic blocks are redundant. By the present invention, the data stream bit shifting mechanism is used, when the data frame frame in the input data stream is out of step, and the data frame frame header is not detected in a complete OTN period, the input data stream is Perform bit shifting. Compared with the related art, the invention can ensure that a set of programmable logic modules for framing is used to traverse all the alignment modes by designing a bit shift control mechanism, thereby saving programmable logic resources and solving the prior art. The problem of resource pressure and cost pressure caused by increasing programmable logic resources Under the background condition of large-capacity transmission, the contradiction between programmable logic and linear growth of service capacity is alleviated, which saves the effect of programmable logic resources and design cost. Referring to FIG. 3, a flow chart of a data stream framing method according to a second embodiment of the present invention is shown, which includes the following steps: Step S302: Perform a bit shift on the input unaligned data stream. Bit; In this step, the unaligned data is in the frame out-of-synchronization state, and the data stream of the data frame header is not detected in a complete optical transport network data frame period. The bit shift for the unaligned data stream can be as shown in Figure 2. Step S304: Detecting a frame header byte and a frame period of the data frame in the shifted data stream; Step S306: determining whether a normal frame header byte can be detected for at least two consecutive frames in an OTN frame period and The frame period is correct, if yes, step S308 is performed; otherwise, the frame out-of-synchronization state is maintained, the frame out-of-synchronization indication is output, and step S302 is continued; if the normal frame header byte is not detected in the frame header position for at least 2 consecutive frames, If there is still a frame out-of-synchronization indication signal output, the frame-ending process cannot be entered, the frame out-of-synchronization state is continued, the frame out-of-synchronization indication is output, and step S302 is performed; otherwise, step S308 is performed to enter the frame-fixing state. Step 4: S308: If a normal frame header byte is detected for at least 2 consecutive frames and the frame period is correct, the frame state is transferred to the framing process. Referring to FIG. 4, a flow chart of a data stream framing method according to a third embodiment of the present invention is shown, which includes the following steps: Step S402: Perform a bit shift on the input unaligned data stream. Bit. In this step, the unaligned data is in the frame out-of-synchronization state, and the data stream of the data frame header is not detected in a complete optical transport network data frame period. The bit shift for the unaligned data stream can be as shown in Figure 2. Step S404: If the normal frame header byte is not detected in the frame header position for at least 2 consecutive frames, and the frame out-of-synchronization indication signal output is still available, the frame-fixing process cannot be entered, and the frame out-of-synchronization state is continued, and the output frame is out of synchronization. If yes, go to step S402; otherwise, go to step S406 to enter the framing state. If within a frame period of an OTN, a normal frame header byte cannot be detected for 2 consecutive frames and the frame period is correct, the framing process cannot be entered, and bit shifting is continued; if two consecutive frames detect a normal frame header If the byte and the frame period are correct, step S406 is executed to enter the framing state. Step 4: S406: If a normal frame header byte is detected for at least 2 consecutive frames and the frame period is correct, then the framing state is entered. Step S408: In the framing state, if the consecutive abnormal frame header bytes are less than 5 frames, the framing state is maintained; if the consecutive abnormal frame header bytes are greater than or equal to 5 frames, then the frame is lost. Go to step S402. By determining whether consecutive abnormal header bytes are less than 5 frames, the stability of the fixed frame state is maintained. Step S410: In the framed state, the data in the shifted data stream is aligned, and the frame header indication of the data frame is output in advance (priority). Step S412: Then, the data frame frame header is aligned with the data in the data frame corresponding to the frame header to complete the entire framing process. In this embodiment, the register resource occupied by the input data delay is reduced by the method of outputting the frame header in advance. In the process of framing, the data processing will have several cycles of delay to get the frame header of the data frame. The traditional framing method is to delay the input data by some period to align with the frame header indication, which is relatively simple to process. However, the data delay register will occupy more programmable logic resources. If the bit width is wider, the logical resource occupancy of this part is also large. In this embodiment, the method of outputting the frame header in advance after the frame is used to minimize the delay register of the input data, thereby effectively reducing the occupation of the programmable logic resources. 5 is a block diagram showing a structure of a data stream framing apparatus according to Embodiment 4 of the present invention, including: a shift control module 502 configured to perform bit shifting on an input data stream, where the data stream is The data stream of the data frame header is not detected in a complete optical transport network data frame period; the framing module 504 is configured to determine whether the data frame header of at least two consecutive data frames in the shifted data stream is The data frame period is correct; if yes, the frame state is entered, and the shifted data stream is framed. Preferably, the framing module 504 includes: a data aligning module 5042, configured to output a frame header indication of the data frame in the shifted data stream after the framing module 504 enters the framing state; The frame header indicates that the data in the corresponding data frame is frame boundary alignment processing. Preferably, the framing module 504 is further configured to continue to bit shift the input data stream until the data frame header and the data frame period of at least two consecutive data frames are correct, if the determination result is no. Preferably, the data stream framing apparatus of this embodiment further includes: a first determining module, configured to maintain a framing state if a continuous normal data frame frame header is greater than or equal to 5 frames in a fixed frame state Fixed frame processing; if the consecutive normal data frame frame header is less than 5 frames, then the frame is out of synchronization state; the second determination module is set to start the timer to the frame out of synchronization state when the frame is out of synchronization The duration is timed; if the duration is equal to or greater than 3 milliseconds, the frame is lost to the frame loss state; the third determining module is configured to find the data frame frame header in the shifted data stream in the frame loss state; Find the correct data frame header, and the data frame period is correct, and the duration is greater than or equal to 3 milliseconds, then go to the fixed frame state; otherwise, keep the frame lost state, and continue bit shifting and frame boundary on the data stream Align. Referring to FIG. 6, a schematic diagram of a data stream framing apparatus according to a fifth embodiment of the present invention is shown, including: a shift control module 602, a framing module 604, wherein the framing module 604 includes a data alignment module 6042. The towel, shift control module 602 is configured to perform bit shift control on the high speed data stream. In the state of frame out of synchronization, if the frame header is not detected after a complete OTN frame period, the module Control the input data to make a bit shift, and then detect the data frame header; if the data frame header can be detected, then the Bit shift is not caused. The framing module 604 is configured to perform framing processing on the shifted input data, and the function is relatively complicated, and its state transition relationship is as shown in FIG. 7. After the system is reset, it is in the frame out-of-synchronization state; after the bit shift processing is performed on the input data stream, if the frame header module 604 detects the normal frame header byte for two consecutive frames and the frame period is correct, the frame state is transferred to the fixed frame state; If the consecutive correct frame header bytes are less than 2 frames, the frame out-of-synchronization state is maintained, the shift control module 602 of the restart system performs bit shifting of the data stream, and the frame boundary alignment module (not shown) performs frame boundaries. Align. In the frame out-of-synchronization state, the framing module 604 can start a timer to time the frame out-of-synchronization state duration (or start a counter to count), and if the frame is out of synchronization for 3 ms, the frame is lost. . In the frame loss state, the frame header flag byte is searched. If the normal frame header byte is found continuously, and the frame period is also correct, and the duration is greater than or equal to 3 ms, then the transfer is performed. The frame state is maintained; otherwise, the frame loss state is maintained, and the shift control module 602 of the system is restarted to perform bit shifting of the data stream, and the frame boundary alignment module of the system performs frame boundary alignment of the data frame in the data stream. The framing module 604 keeps the framing state if the consecutive abnormal frame header bytes are less than 5 frames in the framing state; if the consecutive abnormal frame header bytes are greater than or equal to 5 frames, the entangled frame is out of step status. The data alignment module 6042 is configured to, after the framing module 604 enters the framing state, align the input data stream to the low-speed parallel data stream, and ensure that the frame header is placed at the upper bit of the output data, ie: output first a frame header indication of the data frame in the shifted data stream; and then performing frame boundary alignment processing on the data in the data frame corresponding to the frame header indication and the frame header indication. For example, the shift control module 602 shifts a bit of the input unaligned data stream and then outputs the data stream to the framing module 604; if the framing module 604 does not enter the framing process during an OTN frame period, If there is still a frame out-of-synchronization indication signal output, the frame out-of-synchronization state is maintained, the output frame out-of-synchronization indication is continued, and the data stream bit shift is continued using the shift control module 602. Otherwise, if the frame-fixing module 604 detects the normal 2 consecutive frames. If the frame header byte is correct and the frame period is correct, it is transferred to the fixed frame state; in the fixed frame state, if the consecutive abnormal frame header bytes are less than 5 frames, the fixed frame state is maintained; if consecutive abnormal frame header words are continued If the node is greater than or equal to 5 frames, the frame is out of synchronization. In the framed state, the data alignment module 6042 performs alignment processing on the input data, and associates the output data with the output frame header, that is, in the framed state, in advance The frame header is output, and then aligned with the bit shifted data to complete the entire framing process. In this embodiment, (1) a shift control module is designed. The traditional framing process has no shift control module. Due to the lack of bit shift feedback control mechanism, for the input unaligned data stream, each alignment design has a set of framing and data alignment logic, but in fact once The system works stably, and the data is aligned only in one way. Except for the logic that is determining the frame, the remaining logic modules are redundant. In this embodiment, a set of fixed frames can be guaranteed by designing a bit shift control mechanism. Modules traverse all alignments to save logic resources. (2) In the embodiment, the method of outputting the frame header in advance reduces the register resources occupied by the input data delay. In the process of framing, there will be several cycles of delay in data processing to get the frame header of the data. The traditional framing method is to delay the input data by some period to align with the frame header indication, which is relatively simple to process. However, the data delay register will occupy some logic resources. If the bit width is wider, the logical resource occupancy of this part is also large. In this embodiment, the method of outputting the frame header in advance after the frame is used, the delay register of the input data is minimized, and the occupation of the logic resources is reduced. The present invention achieves framing of high speed data streams by using a small amount of programmable logic resources. Compared with the prior art, the logic resources are greatly reduced. Taking Altera's Stratix4GX180K as an example, it saves about 75% of the programmable logic resources compared with the conventional design, and saves the design cost. The specific saving logic resources are shown in Table 1. Table 1
Figure imgf000011_0001
Figure imgf000011_0001
通过表 1可见, 为了解决业务容量增大后对可编程逻辑处理造成的资源压 力, 本发明提出了一种数据流定帧方法及装置, 可以有效地节约可编程逻辑资 源, 釆用新的方案后可以节约 75%的逻辑资源, 而且, 对于设计成本的节约也 艮明显。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以 用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多 个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码 来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 并且在某些 情况下, 可以以不同于此处的顺序执行所示出或描述的步骤, 或者将它们分别 制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作成单个集成电 路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领 域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的 ^"神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之 内。  It can be seen from Table 1 that in order to solve the resource pressure caused by the programmable logic processing after the increase of the service capacity, the present invention proposes a data stream framing method and device, which can effectively save programmable logic resources and adopt a new scheme. After that, it can save 75% of the logic resources, and the savings in design cost are also obvious. Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software. The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 书 一种数据流定帧方法, 包括: Claims A data stream framing method, including:
对输入的数据流进行比特移位, 所述数据流为在一个完整的光传送 网数据帧周期内未检测到数据帧帧头的数据流;  Performing bit shifting on the input data stream, the data stream being a data stream in which no data frame header is detected within a complete optical transport network data frame period;
判断所述移位后的数据流中是否至少连续二个数据帧的数据帧帧头 和数据帧周期正确;  Determining whether the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct;
若是, 则进入定帧状态, 对所述移位后的数据流进行定帧处理。 根据权利要求 1所述的方法, 其中, 对所述移位后的数据流进行定帧处 理包括:  If yes, the framing state is entered, and the shifted data stream is subjected to framing processing. The method according to claim 1, wherein the framing processing of the shifted data stream comprises:
先输出所述移位后的数据流中的数据帧的帧头指示;  First outputting a frame header indication of the data frame in the shifted data stream;
对所述帧头指示和该帧头指示对应的数据帧中的数据做帧边界对齐 处理。 根据权利要求 1所述的方法, 其中, 所述方法还包括:  Performing frame boundary alignment processing on the data in the data frame corresponding to the frame header indication and the frame header indication. The method according to claim 1, wherein the method further comprises:
若判断结果为否, 则继续对所述输入的数据流进行比特移位, 直至 至少有连续二个数据帧的数据帧帧头和数据帧周期正确。 根据权利要求 1、 2或 3所述的方法, 其中, 所述方法还包括:  If the result of the determination is no, the bit stream of the input data stream is continuously shifted until the data frame header and the data frame period of at least two consecutive data frames are correct. The method according to claim 1, 2 or 3, wherein the method further comprises:
在所述定帧状态下, 若连续的正常的数据帧帧头大于或等于 5帧, 则保持所述定帧状态, 进行所述定帧处理; 若连续的正常的数据帧帧头 小于 5帧, 则转入帧失步状态。 根据权利要求 4所述的方法, 其中, 所述方法还包括:  In the framing state, if the consecutive normal data frame frame header is greater than or equal to 5 frames, the framing state is maintained, and the framing process is performed; if consecutive normal data frame frame headers are less than 5 frames , then go to the frame out of sync state. The method according to claim 4, wherein the method further comprises:
在转入所述帧失步状态时, 启动计时器对所述帧失步状态的持续时 间进行计时;  When transitioning to the frame out-of-synchronization state, the start timer counts the duration of the frame out-of-synchronization state;
若所述持续时间等于或大于 3毫秒, 则转入帧丢失状态。 根据权利要求 5所述的方法, 其中, 所述方法还包括:  If the duration is equal to or greater than 3 milliseconds, the frame is lost. The method according to claim 5, wherein the method further comprises:
在所述帧丢失状态下, 查找所述移位后的数据流中的数据帧帧头; 若连续查找到正确的所述数据帧帧头, 且所述数据帧周期正确, 且 持续时间大于或等于 3毫秒, 则转入所述定帧状态; 否则, 保持所述帧 丢失状态, 并对所述数据流继续进行所述比特移位和帧边界对齐。 Searching, in the frame loss state, a data frame header in the shifted data stream; If the correct data frame header is continuously found, and the data frame period is correct, and the duration is greater than or equal to 3 milliseconds, then the frame state is transferred; otherwise, the frame loss state is maintained, and The data stream continues with the bit shift and frame boundary alignment.
7. 一种数据流定帧装置, 包括: 7. A data stream framing apparatus comprising:
移位控制模块, 设置为对输入的数据流进行比特移位, 所述数据流 为在一个完整的光传送网数据帧周期内未检测到数据帧帧头的数据流; 定帧模块, 设置为判断所述移位后的数据流中是否至少连续二个数 据帧的数据帧帧头和数据帧周期正确; 若是, 则进入定帧状态, 对所述 移位后的数据流进行定帧处理。  a shift control module configured to perform bit shifting on the input data stream, wherein the data stream is a data stream in which no data frame header is detected in a complete optical transport network data frame period; the framing module is set to Determining whether the data frame header and the data frame period of at least two consecutive data frames in the shifted data stream are correct; if yes, entering a framing state, and performing framing processing on the shifted data stream.
8. 根据权利要求 7所述的装置, 其中, 所述定帧模块包括: 8. The apparatus according to claim 7, wherein the framing module comprises:
数据对齐模块, 设置为在所述定帧模块进入定帧状态后, 先输出所 述移位后的数据流中的数据帧的帧头指示; 对所述帧头指示和该帧头指 示对应的数据帧中的数据作帧边界对齐处理。  a data alignment module, configured to: after the framing module enters a framing state, output a frame header indication of the data frame in the shifted data stream; and the frame header indication corresponding to the frame header indication The data in the data frame is frame boundary aligned.
9. 根据权利要求 7所述的装置, 其中, 所述定帧模块还设置为若判断结果 为否, 则继续对所述输入的数据流进行比特移位, 直至至少有连续二个 数据帧的数据帧帧头和数据帧周期正确。 9. The apparatus according to claim 7, wherein the framing module is further configured to: if the determination result is no, continue to bit shift the input data stream until at least two consecutive data frames The data frame header and data frame period are correct.
10. 居权利要求 7、 8或 9所述的装置, 其中, 所述装置还包括: 10. The device of claim 7, 8 or 9, wherein the device further comprises:
第一判定模块, 设置为在所述定帧状态下, 若连续的正常的数据帧 帧头大于或等于 5帧, 则保持所述定帧状态, 进行所述定帧处理; 若连 续的正常的数据帧帧头小于 5帧, 则转入帧失步状态;  a first determining module, configured to: if the consecutive normal data frame headers are greater than or equal to 5 frames in the fixed frame state, maintaining the fixed frame state, performing the framing processing; if continuous normal If the data frame frame header is less than 5 frames, it is transferred to the frame out-of-synchronization state;
第二判定模块, 设置为在转入所述帧失步状态时, 启动计时器对所 述帧失步状态的持续时间进行计时;若所述持续时间等于或大于 3毫秒, 则转入帧丢失状态;  a second determining module, configured to: when the frame is out of step, the start timer counts the duration of the frame out-of-synchronization state; if the duration is equal to or greater than 3 milliseconds, the transferred frame is lost State
第三判定模块, 设置为在所述帧丢失状态下, 查找所述移位后的数 据流中的数据帧帧头; 若连续查找到正确的所述数据帧帧头, 且所述数 据帧周期正确, 且持续时间大于或等于 3毫秒, 则转入所述定帧状态; 否则, 保持所述帧丢失状态, 并对所述数据流继续进行所述比特移位和 帧边界对齐。  a third determining module, configured to: in the frame lost state, search for a data frame frame header in the shifted data stream; if the correct data frame frame header is continuously found, and the data frame period If it is correct, and the duration is greater than or equal to 3 milliseconds, then the frame state is transferred; otherwise, the frame loss state is maintained, and the bit shift and frame boundary alignment are continued for the data stream.
PCT/CN2011/075059 2010-11-17 2011-05-31 Data stream framing method and apparatus WO2012065425A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010548154.6 2010-11-17
CN201010548154.6A CN101990140B (en) 2010-11-17 2010-11-17 Method and device for framing data stream

Publications (1)

Publication Number Publication Date
WO2012065425A1 true WO2012065425A1 (en) 2012-05-24

Family

ID=43746435

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/075059 WO2012065425A1 (en) 2010-11-17 2011-05-31 Data stream framing method and apparatus

Country Status (2)

Country Link
CN (1) CN101990140B (en)
WO (1) WO2012065425A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112838892A (en) * 2019-11-25 2021-05-25 北京天诚同创电气有限公司 Testing device and method for Ethernet MAC data communication optical module

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101990140B (en) * 2010-11-17 2015-06-10 中兴通讯股份有限公司 Method and device for framing data stream
CN102088645B (en) * 2011-01-25 2014-07-16 中兴通讯股份有限公司 Signal data mode matching method and system and framer
CN102209009B (en) * 2011-05-25 2017-02-08 中兴通讯股份有限公司 Framing method and device of dynamic rate data service
CN104734810A (en) * 2012-06-07 2015-06-24 飞天诚信科技股份有限公司 Method and device for processing transmission data
CN106301663A (en) * 2015-05-21 2017-01-04 中兴通讯股份有限公司 A kind of method and device of preamble detecting
CN104935393B (en) * 2015-06-02 2018-01-09 瑞斯康达科技发展股份有限公司 A kind of frame synchornization method and device
CN105763204A (en) * 2016-02-17 2016-07-13 湖南北云科技有限公司 Convolutional coding real-time decoding device and method
CN114401078B (en) * 2022-01-14 2023-10-31 上海工程技术大学 Method for detecting frame head of image data frame

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141238A (en) * 2007-09-13 2008-03-12 中兴通讯股份有限公司 Superframe frame synchronization method and device
CN101605012A (en) * 2009-07-02 2009-12-16 中兴通讯股份有限公司南京分公司 A kind of method and device of realizing the frame header of synchronous digital system location
CN101990140A (en) * 2010-11-17 2011-03-23 中兴通讯股份有限公司 Method and device for framing data stream

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1328861C (en) * 2003-12-31 2007-07-25 中兴通讯股份有限公司 Digital interface circuit in light synchronous digit transmission system and its data demultiplexing method
US7924938B2 (en) * 2007-09-24 2011-04-12 Wally Haas Context-sensitive overhead processor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141238A (en) * 2007-09-13 2008-03-12 中兴通讯股份有限公司 Superframe frame synchronization method and device
CN101605012A (en) * 2009-07-02 2009-12-16 中兴通讯股份有限公司南京分公司 A kind of method and device of realizing the frame header of synchronous digital system location
CN101990140A (en) * 2010-11-17 2011-03-23 中兴通讯股份有限公司 Method and device for framing data stream

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112838892A (en) * 2019-11-25 2021-05-25 北京天诚同创电气有限公司 Testing device and method for Ethernet MAC data communication optical module

Also Published As

Publication number Publication date
CN101990140B (en) 2015-06-10
CN101990140A (en) 2011-03-23

Similar Documents

Publication Publication Date Title
WO2012065425A1 (en) Data stream framing method and apparatus
WO2019128467A1 (en) Flexible ethernet (flexe)-based service flow transmission method and apparatus
US7860011B2 (en) Method and system for fault resilience in networks with Audio/Video Bridging aware Shortest Path Bridging
US8914662B2 (en) Implementing transparent clock by correcting time information carried in data using residence time information
US11843452B2 (en) Clock synchronization method and apparatus
JP2020519098A (en) Link group configuration method and device
TW201138364A (en) Method and system for management based end-to-end sleep limitation in an energy efficient ethernet network
WO2021109705A1 (en) Flexible ethernet group management method and device, and computer-readable storage medium
WO2012088962A1 (en) Method and system for automatically discovering oduflex bandwidth lossless adjustment capability
CN102377678B (en) Data transmission and processing method and device
JP4652314B2 (en) Ether OAM switch device
WO2017117955A1 (en) Route synchronizing method, device and communication system
WO2020129219A1 (en) Network device, network system, network method, and network program
WO2009062351A1 (en) Method for stacking system merging
KR101163146B1 (en) Residential Ethernet Switching Apparatus For Switching Based Sub Frame
WO2015024477A1 (en) Routing update method and device
JP5788308B2 (en) Alignment circuit and receiving device
WO2009118610A1 (en) Network device of high-precision synchronization type, network system, and frame transfer method
JP2009206696A (en) Transmission system
WO2012071838A1 (en) Multi-link clock recovery method and apparatus
JP2010510734A (en) Data transmission method and system in time division multiplexing mode
WO2012088956A1 (en) Route flooding method, device and node of oduflex lossless adjustment capability
CA3081109C (en) Clock synchronization method and apparatus
WO2013097365A1 (en) Method and network device for converging master clock sources
JP5448201B2 (en) Transmission control circuit and transmission control method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11841548

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11841548

Country of ref document: EP

Kind code of ref document: A1