[go: up one dir, main page]

CN111416630A - Coding and decoding method and system - Google Patents

Coding and decoding method and system Download PDF

Info

Publication number
CN111416630A
CN111416630A CN202010151134.9A CN202010151134A CN111416630A CN 111416630 A CN111416630 A CN 111416630A CN 202010151134 A CN202010151134 A CN 202010151134A CN 111416630 A CN111416630 A CN 111416630A
Authority
CN
China
Prior art keywords
data
data frame
frame
length
channel
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202010151134.9A
Other languages
Chinese (zh)
Inventor
饶清文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fisilink Microelectronics Technology Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fisilink Microelectronics Technology Co Ltd
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 Fiberhome Telecommunication Technologies Co Ltd, Wuhan Fisilink Microelectronics Technology Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202010151134.9A priority Critical patent/CN111416630A/en
Publication of CN111416630A publication Critical patent/CN111416630A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
    • H03M13/29Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes combining two or more codes or code structures, e.g. product codes, generalised product codes, concatenated codes, inner and outer codes
    • H03M13/2906Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes combining two or more codes or code structures, e.g. product codes, generalised product codes, concatenated codes, inner and outer codes using block codes

Landscapes

  • Physics & Mathematics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

本发明公开了一种编译码方法及系统,涉及通信技术领域,该方法包括以下步骤:建立多条独立的通道,且每一通道分别对应一缓存空间;各个通道接收数据帧并缓存至对应的缓存空间;按照预设的调度策略,一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译码;其中,数据帧的传输和编译码包括:读取一个缓存空间中的数据帧,传输至RS编译码器,完成该缓存空间中数据帧的编译码工作,获得编译码数据帧。本发明能够对多通道的数据进行编译码工作,满足现阶段多样的工作需求。

Figure 202010151134

The invention discloses a coding and decoding method and system, which relate to the technical field of communication. The method includes the following steps: establishing a plurality of independent channels, and each channel corresponds to a buffer space; each channel receives data frames and buffers them into corresponding Cache space; according to the preset scheduling strategy, the transmission and encoding and decoding of data frames in each buffer space are completed one buffer space at a time; wherein, the transmission and encoding and decoding of data frames include: reading a data frame in a buffer space, transmitting To the RS codec, the codec work of the data frame in the buffer space is completed, and the codec data frame is obtained. The present invention can perform encoding and decoding work on multi-channel data, so as to meet various work requirements at the present stage.

Figure 202010151134

Description

一种编译码方法及系统A coding and decoding method and system

技术领域technical field

本发明涉及通信技术领域,具体涉及一种编译码方法及系统。The present invention relates to the field of communication technologies, in particular to a coding and decoding method and system.

背景技术Background technique

随着5G承载网的带宽容量越来越大,FlexE、FlexO以及OTUk的业务种类和接入路数越来越多,各种业务的传输,都需要有FEC的支持,才能保证其可靠传输。As the bandwidth capacity of the 5G bearer network increases, FlexE, FlexO, and OTUk have more and more service types and access channels. The transmission of various services requires the support of FEC to ensure reliable transmission.

在相关技术中,承载FEC广泛的应用了RS码,然而,RS编译算法的复杂性较高,实现电路逻辑规模较大,如果每路业务使用一个编译码器,将会使得整体的电路逻辑规模太大,芯片流片的成本太高,所以,单路的RS编译码器已经不能满足应用的需求,需要有一种支持多路业务并行接入的RS编译码器。In the related art, the RS code is widely used to carry FEC. However, the complexity of the RS coding algorithm is high, and the scale of the circuit logic is large. If each service uses one codec, the overall circuit logic scale will be reduced. If it is too large, the cost of chip tape-out is too high. Therefore, the single-channel RS codec can no longer meet the application requirements, and an RS codec that supports parallel access of multiple services is required.

但是,RS码是一种分组码,一个码字是一个完整不可分割的整体。各路业务的速率又各不相同,所以其复用方法有其必然的特殊性,另外,RS编译码作为承载网节点处理流程的一个中间环节,数据从其入口到出口在某些场合要求时延固定,要求输出数据包络保持均匀,故而,现阶段尚无法提供支持多路业务并行接入的RS编译码方案。However, the RS code is a block code, and a codeword is a complete and indivisible whole. The rate of each service is different, so the multiplexing method has its own particularity. In addition, RS encoding and decoding is an intermediate link in the processing flow of the bearer network node, and the data from its entry to the exit is required in some occasions. The delay is fixed, and the output data envelope is required to be kept uniform. Therefore, the RS coding and decoding scheme that supports parallel access of multiple services cannot be provided at this stage.

因此,急需一种新的编译码方法,用以解决上述问题。Therefore, a new encoding and decoding method is urgently needed to solve the above problems.

发明内容SUMMARY OF THE INVENTION

针对现有技术中存在的缺陷,本发明的目的在于提供一种编译码方法及系统,能够对多通道的数据进行编译码工作,满足现阶段多样的工作需求。In view of the defects existing in the prior art, the purpose of the present invention is to provide a method and system for encoding and decoding, which can perform encoding and decoding work on multi-channel data and meet various work requirements at the present stage.

为达到以上目的,本发明采取的技术方案是:In order to achieve the above purpose, the technical scheme adopted in the present invention is:

第一方面,本发明公开一种编译码方法,所述方法包括以下步骤:In a first aspect, the present invention discloses a coding and decoding method, which comprises the following steps:

建立多条独立的通道,且每一通道分别对应一缓存空间;Establish multiple independent channels, and each channel corresponds to a buffer space;

各个所述通道接收数据帧并缓存至对应的缓存空间;Each of the channels receives the data frame and buffers it into the corresponding buffer space;

按照预设的调度策略,一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译码;其中,数据帧的传输和编译码包括:According to the preset scheduling policy, the transmission and encoding and decoding of data frames in each buffer space are completed one buffer space at a time; wherein, the transmission and encoding and decoding of data frames include:

读取一个所述缓存空间中的数据帧,传输至RS编译码器,完成该缓存空间中数据帧的编译码工作,获得编译码数据帧。A data frame in the buffer space is read, and transmitted to the RS codec, the encoding and decoding work of the data frame in the buffer space is completed, and the encoding and decoding data frame is obtained.

在上述技术方案的基础上,所述调度策略包括以下步骤:On the basis of the above technical solution, the scheduling strategy includes the following steps:

轮询各所述缓存空间的可读地址数量,定位可读地址最大且大于1码字长度的所述通道,授权对应的所述通道获取下一次读操作权限。The number of readable addresses in each of the cache spaces is polled, the channel with the largest readable address and a length greater than 1 codeword is located, and the corresponding channel is authorized to obtain the next read operation permission.

在上述技术方案的基础上,在各个所述通道接收数据帧并缓存至对应的缓存空间之前,所述方法还包括数据整形流程,所述数据整理流程包括以下步骤:On the basis of the above technical solution, before each of the channels receives the data frames and buffers them in the corresponding buffer space, the method further includes a data shaping process, and the data sorting process includes the following steps:

将所述数据帧的数据长度与预设的标准数据长度进行比较;comparing the data length of the data frame with a preset standard data length;

当所述数据帧的数据长度与所述标准数据长度一致时,所述数据帧正常传输;When the data length of the data frame is consistent with the standard data length, the data frame is normally transmitted;

当所述数据帧的数据长度大于与所述标准数据长度时,仅传输所述数据帧符合所述标准数据长度的部分;When the data length of the data frame is greater than the standard data length, only the part of the data frame that conforms to the standard data length is transmitted;

当所述数据帧的数据长度小于与所述标准数据长度时,根据预设的补偿规则,将所述数据帧的数据长度调整至所述标准数据长度,传输调整后的所述数据帧。When the data length of the data frame is smaller than the standard data length, according to a preset compensation rule, the data length of the data frame is adjusted to the standard data length, and the adjusted data frame is transmitted.

在上述技术方案的基础上,当所述数据帧的数据长度大于与所述标准数据长度时,仅传输所述数据帧符合所述标准数据长度的部分,并检测帧起始指示信号,当出现所述帧起始指示信号时,将下一个数据帧的数据长度与预设的标准数据长度进行比较。On the basis of the above technical solution, when the data length of the data frame is greater than the standard data length, only the part of the data frame that conforms to the standard data length is transmitted, and the frame start indication signal is detected. When the frame start indication signal is used, the data length of the next data frame is compared with the preset standard data length.

在上述技术方案的基础上,当所述数据帧的数据长度小于与所述标准数据长度时,根据预设的补偿规则,删除获取的帧起始指示信号,并将所述数据帧的数据长度调整至所述标准数据长度,传输调整后的所述数据帧。On the basis of the above technical solution, when the data length of the data frame is smaller than the standard data length, according to a preset compensation rule, the acquired frame start indication signal is deleted, and the data length of the data frame is Adjust to the standard data length, and transmit the adjusted data frame.

在上述技术方案的基础上,所述方法还包括以下步骤:On the basis of the above technical solution, the method further comprises the following steps:

对所述缓存空间内的所述数据帧进行第一延时处理。A first delay processing is performed on the data frame in the buffer space.

在上述技术方案的基础上,将所述编译码数据帧对应传输至对应的输出通道之前,所述方法还包括数据补偿流程,所述数据补偿流程包括以下步骤:On the basis of the above technical solution, before correspondingly transmitting the encoded and decoded data frame to the corresponding output channel, the method further includes a data compensation process, and the data compensation process includes the following steps:

获取所述编译码数据帧在所述第一延时处理时的第一延时值,记作T1;Obtain the first delay value of the encoded and decoded data frame during the first delay processing, and denote it as T1;

获取所述编译码数据帧对应的所述数据帧在开始存入所述缓存空间以及所述编译码数据帧传入对应的所述输出通道的传输延时值,记作T2;Obtain the data frame corresponding to the encoded and decoded data frame and store it in the buffer space at the beginning and the transmission delay value of the output channel corresponding to the incoming of the encoded and decoded data frame, denoted as T2;

计算所述编译码数据帧对应的所述传入通道的固有延时值,记作T3,T3=T2-T1;Calculate the inherent delay value of the incoming channel corresponding to the encoded and decoded data frame, and denote it as T3, where T3=T2-T1;

根据所述编译码数据帧对应的所述固有延时值进行延时补偿。Delay compensation is performed according to the inherent delay value corresponding to the encoded and decoded data frame.

第二方面,本发明还公开一种编译码系统,所述系统包括:In a second aspect, the present invention also discloses a coding and decoding system, the system comprising:

通道配置单元,其用于建立多条独立的通道,且每一通道分别对应一缓存空间;a channel configuration unit, which is used to establish a plurality of independent channels, and each channel corresponds to a buffer space;

数据接收单元,其用于控制各个所述通道接收数据帧并缓存至对应的缓存空间;a data receiving unit, which is used to control each of the channels to receive data frames and buffer them into corresponding buffer spaces;

数据编译码单元,其用于按照预设的调度策略,一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译码,其中,数据帧的传输和编译码包括:A data encoding and decoding unit, which is used for completing the transmission and encoding and decoding of data frames in each buffer space one buffer space at a time according to a preset scheduling strategy, wherein the transmission and encoding and decoding of data frames include:

读取一个所述缓存空间中的数据帧,传输至RS编译码器,完成该缓存空间中数据帧的编译码工作,获得编译码数据帧。A data frame in the buffer space is read, and transmitted to the RS codec, the encoding and decoding work of the data frame in the buffer space is completed, and the encoding and decoding data frame is obtained.

在上述技术方案的基础上,轮询各所述缓存空间的可读地址数量,定位可读地址最大且大于1码字长度的所述通道,授权对应的所述通道获取下一次读操作权限。Based on the above technical solutions, poll the number of readable addresses in each of the cache spaces, locate the channel with the largest readable address and a length greater than 1 codeword, and authorize the corresponding channel to obtain the next read operation permission.

在上述技术方案的基础上,所述系统还包括数据预处理单元,其用于在所述数据接收单元接收数据接收单元数据帧之前,对各所述数据帧进行数据整形;On the basis of the above technical solution, the system further includes a data preprocessing unit, which is configured to perform data shaping on each of the data frames before the data receiving unit receives the data frames of the data receiving unit;

所述数据预处理单元,其具体用于将所述数据帧的数据长度与预设的标准数据长度进行比较;the data preprocessing unit, which is specifically configured to compare the data length of the data frame with a preset standard data length;

所述数据预处理单元,其具体用于当所述数据帧的数据长度与所述标准数据长度一致时,所述数据帧正常传输;the data preprocessing unit, which is specifically configured to transmit the data frame normally when the data length of the data frame is consistent with the standard data length;

所述数据预处理单元,其具体用于当所述数据帧的数据长度大于与所述标准数据长度时,仅传输所述数据帧符合所述标准数据长度的部分;the data preprocessing unit, which is specifically configured to transmit only the part of the data frame that conforms to the standard data length when the data length of the data frame is greater than the standard data length;

所述数据预处理单元,其具体用于当所述数据帧的数据长度小于与所述标准数据长度时,根据预设的补偿规则,将所述数据帧的数据长度调整至所述标准数据长度,传输调整后的所述数据帧。The data preprocessing unit is specifically configured to adjust the data length of the data frame to the standard data length according to a preset compensation rule when the data length of the data frame is smaller than the standard data length , and transmit the adjusted data frame.

与现有技术相比,本发明的优点在于:Compared with the prior art, the advantages of the present invention are:

(1)本发明通过预设相互独立的通道,分别从不同来源获取数据帧,并分批次对多个通道中的数据帧进行编译码,从而实现多通道的编译码工作,满足多样的工作需求。(1) The present invention obtains data frames from different sources by presetting mutually independent channels, and encodes and decodes the data frames in multiple channels in batches, thereby realizing multi-channel encoding and decoding work and satisfying various tasks. need.

(2)本发明使得输出的数据包络与输入的数据包络保持了一致,具有一样的均匀性,避免对下游模块的缓存造成不利冲击。(2) The present invention keeps the output data envelope consistent with the input data envelope and has the same uniformity, avoiding adverse impact on the cache of downstream modules.

(3)本发明预设的调度策略,一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译码,避免出现带宽浪费,有效控制缓存空间的占用率。(3) The preset scheduling strategy of the present invention completes the transmission and encoding and decoding of data frames in each buffer space one buffer space at a time, avoiding bandwidth waste and effectively controlling the occupancy rate of the buffer space.

(5)本发明中,数据的输入以及输出的延时情况可控,便于工作人员进行调控,满足多样的工作需求。(5) In the present invention, the input and output delays of data are controllable, which is convenient for staff to adjust and control, and meets various work requirements.

附图说明Description of drawings

图1为本发明实施例一中编译码方法的步骤流程图;FIG. 1 is a flowchart of steps of a coding and decoding method in Embodiment 1 of the present invention;

图2为本发明实施例一中编译码方法中数据整理流程的步骤流程图;2 is a flow chart of the steps of the data sorting process in the encoding and decoding method in the first embodiment of the present invention;

图3为本发明实施例一中编译码方法中数据补偿流程的步骤流程图;3 is a flow chart of the steps of the data compensation process in the encoding and decoding method in Embodiment 1 of the present invention;

图4为本发明实施例一中编译码方法中支持4通道OTU4/OTU2接入的RS(255,239)编译码的步骤流程图;4 is a flowchart of steps of RS (255, 239) encoding and decoding supporting 4-channel OTU4/OTU2 access in the encoding and decoding method according to Embodiment 1 of the present invention;

图5为本发明实施例一中编译码方法中4通道RS(255,239)码调度器模块的内部处理流程图;Fig. 5 is the internal processing flow chart of the 4-channel RS (255, 239) code scheduler module in the encoding and decoding method in Embodiment 1 of the present invention;

图6为本发明实施例二中编译码系统的结构框图;6 is a structural block diagram of a coding and decoding system in Embodiment 2 of the present invention;

图中:1、通道配置单元;2、数据接收单元;3、数据编译码单元;4、数据预处理单元;5、时延补偿单元。In the figure: 1. Channel configuration unit; 2. Data receiving unit; 3. Data coding and decoding unit; 4. Data preprocessing unit; 5. Time delay compensation unit.

具体实施方式Detailed ways

以下结合附图对本发明的实施例作进一步详细说明。The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

本发明实施例提供一种编译码方法及系统,能够对多通道的数据进行编译码工作,满足现阶段多样的工作需求。Embodiments of the present invention provide a method and system for encoding and decoding, which can perform encoding and decoding work on multi-channel data and meet various work requirements at the present stage.

为达到上述技术效果,本申请的总体思路如下:In order to achieve the above-mentioned technical effect, the general idea of the application is as follows:

一种编译码方法,该方法包括以下步骤:A coding and decoding method, the method comprises the following steps:

S1、建立多条独立的通道,且每一通道分别对应一缓存空间;S1. Establish multiple independent channels, and each channel corresponds to a buffer space;

S2、各个通道接收数据帧并缓存至对应的缓存空间;S2, each channel receives the data frame and buffers it to the corresponding buffer space;

S3、按照预设的调度策略,一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译码;S3. According to the preset scheduling strategy, the data frame transmission and encoding and decoding in each buffer space are completed one buffer space at a time;

其中,数据帧的传输和编译码包括:Among them, the transmission and encoding and decoding of the data frame include:

读取一个缓存空间中的数据帧,传输至RS编译码器,完成该缓存空间中数据帧的编译码,获得编译码数据帧。A data frame in a buffer space is read, and transmitted to the RS codec to complete the encoding and decoding of the data frame in the buffer space to obtain the encoded and decoded data frame.

以下结合附图对本发明的实施例作进一步详细说明。The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

实施例1Example 1

参见图1至5所示,本发明实施例1提供一种编译码方法,该方法包括以下步骤:Referring to FIGS. 1 to 5, Embodiment 1 of the present invention provides a method for encoding and decoding, and the method includes the following steps:

S1、建立多条独立的通道,且每一通道分别对应一缓存空间;S1. Establish multiple independent channels, and each channel corresponds to a buffer space;

S2、各个通道接收数据帧并缓存至对应的缓存空间;S2, each channel receives the data frame and buffers it to the corresponding buffer space;

S3、按照预设的调度策略,一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译码;S3. According to the preset scheduling strategy, the data frame transmission and encoding and decoding in each buffer space are completed one buffer space at a time;

其中,数据帧的传输和编译码包括:Among them, the transmission and encoding and decoding of the data frame include:

读取一个缓存空间中的数据帧,传输至RS编译码器,完成该缓存空间中数据帧的编译码工作,获得编译码数据帧。A data frame in a buffer space is read, and transmitted to the RS codec to complete the encoding and decoding of the data frame in the buffer space, and the encoded and decoded data frame is obtained.

本发明实施例中,首先会建立多个相互独立的通道,各通道分别用于接收不同发送端传来的数据,而每一个通道分别对应有一个缓存空间,即各通道分别配置有其专属的缓存空间;In the embodiment of the present invention, a plurality of independent channels are first established, each channel is used to receive data from different senders, and each channel corresponds to a buffer space, that is, each channel is configured with its own dedicated cache space;

进而,各通道接收传输来的数据帧,并将各自接收到的数据帧存储至各自对应的缓存空间中;Further, each channel receives the transmitted data frame, and stores the respectively received data frame in the corresponding buffer space;

最后,开始进行数据编译码工作,按照预先设置的调度策略,每次从一个缓存空间中获取一个数据帧进行传输和编译码,其中,数据帧的传输和编译码包括:Finally, start the data encoding and decoding work. According to the preset scheduling policy, each time a data frame is obtained from a buffer space for transmission and encoding and decoding. The transmission and encoding and decoding of the data frame include:

读取一个缓存空间中的数据帧,传输至RS编译码器,完成该缓存空间中数据帧的编译码工作,获得编译码数据帧。A data frame in a buffer space is read, and transmitted to the RS codec to complete the encoding and decoding of the data frame in the buffer space, and the encoded and decoded data frame is obtained.

另外,需要说明的是,在一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译码,由于是每次从一个缓存空间中获取一个数据帧进行传输和编译码,故而本次获取的数据帧和下一次获取的数据帧,可以来自同一个缓存空间,也可以来自不同的缓存空间,而编译码工作,则是在多次提取和编译码后,当各缓存空间的数据均被读取完毕时才会结束。In addition, it should be noted that the transmission and encoding and decoding of data frames in each buffer space are completed one buffer space at a time. Since one data frame is acquired from one buffer space for transmission and encoding and decoding at a time, the obtained data The data frame and the next acquired data frame can come from the same cache space or from different cache spaces, and the encoding and decoding work is that after multiple extractions and encoding and decoding, when the data in each cache space is read. It will end when it is finished.

本发明实施例,通过预设相互独立的通道,分别从不同来源获取数据帧,并分批次对多个通道中的数据帧进行编译码,从而实现多通道的编译码工作,满足多样的工作需求。In the embodiment of the present invention, by presetting mutually independent channels, data frames are obtained from different sources respectively, and data frames in multiple channels are encoded and decoded in batches, thereby realizing multi-channel encoding and decoding work and satisfying various tasks. need.

需要说明的是,编译码工作主要有RS编译码器进行,RS编译码器的处理带宽必须大于各通道的带宽之和,否则如果各通道的带宽大于RS编译码器的处理带宽,会造成数据丢失。It should be noted that the coding and decoding work is mainly performed by the RS codec. The processing bandwidth of the RS codec must be greater than the sum of the bandwidths of each channel. Otherwise, if the bandwidth of each channel is greater than the processing bandwidth of the RS codec, data will be lost. lost.

本发明实施例中的另一种实施方式中,调度策略包括以下步骤:In another implementation manner in the embodiment of the present invention, the scheduling policy includes the following steps:

轮询各缓存空间的可读地址数量,定位可读地址最大且大于1码字长度的通道,授权对应的通道获取下一次读操作权限。Poll the number of readable addresses in each buffer space, locate the channel with the largest readable address and a length greater than 1 codeword, and authorize the corresponding channel to obtain the next read operation permission.

具体操作时,一次读操作会从一个通道刚好持续读出一个RS码字的长度,因为RS码是分组码,一个码字是一个相关联的整体,如果编译码不连续处理,中间运算状态的暂存处理则会太过复杂。In the specific operation, a read operation will continuously read the length of one RS codeword from one channel, because the RS code is a block code, and a codeword is an associated whole. If the encoding and decoding are not processed continuously, the intermediate operation state Staging processing would be too complicated.

另外,这种以码字为基本单位的调度方法,还会带来额外的好处:因一次读操作持续多拍,可以使得该调度策略中判断下一次权限分配的操作可以在多拍完成,有利于数字电路的高速实现;In addition, this scheduling method with codewords as the basic unit will also bring additional benefits: because a read operation continues for multiple shots, the scheduling strategy for judging the next permission allocation operation can be completed in multiple shots. It is beneficial to the high-speed realization of digital circuits;

该调度策略具体为,在一次读操作期间,比较各通道的缓存空间的可读地址数量,可读地址最大并且大于一个码字长度的通道,获得下一次读操作的权限,或者所有通道均不满足授权条件,进入空闲状态。The scheduling policy is specifically: during a read operation, compare the number of readable addresses in the cache space of each channel, and the channel with the largest readable address and greater than a codeword length obtains the permission for the next read operation, or all channels are not When the authorization conditions are met, it enters the idle state.

本发明实施例中的调度策略带来的好处:1、由于是把下一次调度的权限分配给各通道中缓存空间的可读地址数量最大的那个通道,而不是按各通道的速率固定比例分配权限,所以可以保证各通道的缓存空间的水线保持均衡,而不会出现因某个通道数据包络的均匀性波动而造成该通道的缓存空间的水线暴涨甚至溢出的异常现象;2、由于下一次调度的权限分配在前一次调度期间已经完成,所以前一次调度的读操作和下一次调度的读操作之间可以没有间隔,不会造成带宽浪费;The advantages brought by the scheduling policy in the embodiment of the present invention: 1. Because the authority for the next scheduling is allocated to the channel with the largest number of readable addresses in the buffer space in each channel, instead of a fixed ratio of the rate of each channel Therefore, it can ensure that the waterline of the buffer space of each channel is kept balanced, and there will be no abnormal phenomenon that the waterline of the buffer space of the channel will skyrocket or even overflow due to the uniform fluctuation of the data envelope of a channel; 2. Since the permission allocation for the next scheduling has been completed during the previous scheduling period, there can be no gap between the read operation scheduled for the previous time and the read operation scheduled for the next time, and bandwidth will not be wasted;

其中,需要说明的是,水线是用于表示该缓存空间内部存储数据的总大小的度量。It should be noted that the waterline is a measure used to represent the total size of data stored in the cache space.

本发明实施例中的另一种实施方式中,在各个通道接收数据帧并缓存至对应的缓存空间之前,方法还包括数据整形流程,该数据整理流程包括以下步骤:In another implementation in the embodiment of the present invention, before each channel receives the data frame and buffers it in the corresponding buffer space, the method further includes a data shaping process, and the data sorting process includes the following steps:

A1、将数据帧的数据长度与预设的标准数据长度进行比较;A1. Compare the data length of the data frame with the preset standard data length;

A2、当数据帧的数据长度与标准数据长度一致时,数据帧正常传输;A2. When the data length of the data frame is consistent with the standard data length, the data frame is transmitted normally;

A3、当数据帧的数据长度大于与标准数据长度时,仅传输数据帧符合标准数据长度的部分;A3. When the data length of the data frame is greater than the standard data length, only the part of the data frame that conforms to the standard data length is transmitted;

A4、当数据帧的数据长度小于与标准数据长度时,根据预设的补偿规则,将数据帧的数据长度调整至标准数据长度,传输调整后的数据帧。A4. When the data length of the data frame is smaller than the standard data length, according to the preset compensation rule, the data length of the data frame is adjusted to the standard data length, and the adjusted data frame is transmitted.

具体的,当数据帧的数据长度大于与标准数据长度时,仅传输数据帧符合标准数据长度的部分,不传输数据帧超出标准数据长度的部分,并检测帧起始指示信号,当出现帧起始指示信号时,将下一个数据帧的数据长度与预设的标准数据长度进行比较;Specifically, when the data length of the data frame is greater than the standard data length, only the part of the data frame that meets the standard data length is transmitted, and the part of the data frame that exceeds the standard data length is not transmitted, and the frame start indicator signal is detected. When starting the signal, compare the data length of the next data frame with the preset standard data length;

当数据帧的数据长度小于与标准数据长度时,根据预设的补偿规则,删除获取的帧起始指示信号,并将数据帧的数据长度调整至标准数据长度,传输调整后的数据帧;When the data length of the data frame is less than the standard data length, according to the preset compensation rule, delete the acquired frame start indication signal, adjust the data length of the data frame to the standard data length, and transmit the adjusted data frame;

其中,预设的补偿规则可以是在不影响数据帧中功能性数据的前提下,使得数据帧的长度符合标准数据长度。The preset compensation rule may be such that the length of the data frame conforms to the standard data length without affecting the functional data in the data frame.

在具体实施中,进行数据整形流程时,具体操作方法为:先定义一个整形状态机,而该整形状态机有3个状态:正常,截短,补偿,正常状态下的数据帧原样输出,截短状态下的数据帧不输出,补偿状态下的数据帧也原样输出。In the specific implementation, when performing the data shaping process, the specific operation method is: first define a shaping state machine, and the shaping state machine has three states: normal, truncated, compensated, the data frame in the normal state is output as it is, and the truncated state machine is The data frame in the short state is not output, and the data frame in the compensation state is also output as it is.

其中,初始化状态为截短状态,直到接收到帧起始指示信号有效为止,则表示该数据帧进入正常状态,若在正常状态下,持续计算接收到的数据拍数,当理论上应该出现帧起始指示信号的位置,实际也出现了,则继续保持正常状态,否则进入截短状态,如果在正常状态下,理论上不应该出现帧起始指示信号的位置,实际却出现了帧起始指示信号,即表示接收到的数据帧的帧长小于理论值,则输出时先清除这个帧起始指示有效信号,然后再进入补偿状态,直到帧长到达理论值,则在理论上应出现帧起始有效指示的位置补充一个有效信号;Among them, the initialization state is the truncated state, until the frame start indication signal is received to be valid, it means that the data frame enters the normal state. If in the normal state, the number of received data beats is continuously calculated, when theoretically the frame should appear If the position of the start indication signal actually appears, it will continue to maintain the normal state, otherwise it will enter the truncated state. If it is in the normal state, the position of the frame start indication signal should not appear in theory, but the frame start actually appears. Indication signal, which means that the frame length of the received data frame is less than the theoretical value, then the frame start indication valid signal is cleared first when outputting, and then the compensation state is entered, until the frame length reaches the theoretical value, then theoretically the frame should appear. The position of the starting valid indication is supplemented with a valid signal;

数据整形流程的结果是输出的帧始终是标准间隔的帧,避免后续步骤因异常帧进入异常状态。The result of the data shaping process is that the output frame is always a frame with a standard interval, which prevents the subsequent steps from entering an abnormal state due to abnormal frames.

本发明实施例中的另一种实施方式中,该方法还包括以下步骤:In another implementation manner in the embodiment of the present invention, the method further comprises the following steps:

对缓存空间内的数据帧进行第一延时处理;Perform the first delay processing on the data frame in the buffer space;

具体的,是根据工作需求,对各缓存空间内的数据帧进行延时。Specifically, the data frames in each buffer space are delayed according to work requirements.

在具体实施时,第一延时处理的具体操作方法为:先对数据有效指示信号进行打拍,打拍的最大拍数为可配置的最大延时拍数,这样可供选择的输出信号可以是从延时1拍到可配置的最大延时拍数之间的任意一个,实际输出时选择实际配置值对应的延时拍数即可。In the specific implementation, the specific operation method of the first delay processing is as follows: firstly, the data valid indication signal is tapped, and the maximum number of taps is the configurable maximum number of delay beats, so that the optional output signal can be It is any one between the delay 1 beat and the configurable maximum delay beats. When actually outputting, select the delay beats corresponding to the actual configuration value.

延时的最小配置值,应该大于各通道的数据帧从接收到编译,再到输出所需的最大时长,否则会造成功能异常。通过进行第一延时处理,能够实现每个数据帧经过本发明实施例中用于编译码的多通道多速率RS编译码器的延时是个固定值,另外还能使得输出的数据包络与输入的数据包络保持了一致,具有一样的均匀性,避免对下游模块的缓存造成不利冲击。The minimum configuration value of the delay should be greater than the maximum time required for the data frame of each channel from receiving, compiling, and then outputting, otherwise it will cause abnormal functions. By performing the first delay processing, it can be realized that the delay of each data frame passing through the multi-channel and multi-rate RS codec used for encoding and decoding in the embodiment of the present invention is a fixed value, and in addition, the output data envelope can be The input data envelope remains consistent and has the same uniformity, avoiding adverse impact on the cache of downstream modules.

本发明实施例中的另一种实施方式中,在将编译码数据帧对应传输至对应的输出通道之前,该方法还包括数据补偿流程,数据补偿流程包括以下步骤:In another implementation manner in the embodiment of the present invention, before correspondingly transmitting the encoded and decoded data frame to the corresponding output channel, the method further includes a data compensation process, and the data compensation process includes the following steps:

B1、获取编译码数据帧在第一延时处理时的第一延时值,记作T1;B1. Obtain the first delay value of the encoded and decoded data frame during the first delay processing, and denote it as T1;

B2、获取编译码数据帧对应的数据帧在开始存入缓存空间以及编译码数据帧传入对应的输出通道的传输延时值,记作T2;B2. Obtain the data frame corresponding to the encoded and decoded data frame and store it in the buffer space at the beginning and the transmission delay value of the encoded and decoded data frame transmitted to the corresponding output channel, denoted as T2;

B3、计算编译码数据帧对应的传入通道的固有延时值,记作T3,T3=T2-T1;B3. Calculate the inherent delay value of the incoming channel corresponding to the encoded and decoded data frame, denoted as T3, T3=T2-T1;

B4、根据编译码数据帧对应的固有延时值进行延时补偿。B4. Perform delay compensation according to the inherent delay value corresponding to the encoded and decoded data frame.

需要说明的是,在实际操作时,会向各通道对应分配一补偿缓存空间,各通道的数据帧在进行编译码后,会在对应的补充缓存空间进行数据补偿流程。It should be noted that, in actual operation, a compensation buffer space will be allocated to each channel, and after the data frame of each channel is encoded and decoded, a data compensation process will be performed in the corresponding supplementary buffer space.

本发明实施例中,将各通道的编译码数据帧写入补偿缓存空间。由于前面操作步骤的原因,编译码数据帧到达补偿缓存空间的延时是个不确定的值。为了使得每个数据经过本发明实施例的多通道多速率RS编译码器的延时是个固定值,需要编译码数据帧在输出之前先在补偿缓存空间中等待一段时间,以补偿延时的差值;In the embodiment of the present invention, the encoded and decoded data frames of each channel are written into the compensation buffer space. Due to the previous operation steps, the delay for the encoded and decoded data frames to reach the compensation buffer space is an indeterminate value. In order to make the delay of each data passing through the multi-channel multi-rate RS codec of the embodiment of the present invention to be a fixed value, it is necessary to wait for a period of time in the compensation buffer space before outputting the encoded data frame to compensate for the difference in delay value;

进而,待数据补偿流程结束后,从补偿缓存空间将经过数据补偿流程处理的编译码数据帧输出。Furthermore, after the data compensation process ends, the encoded and decoded data frames processed by the data compensation process are output from the compensation buffer space.

在此,针对本发明实施例中提及的方法,给出一种具体的实施例,以应用于光传输网OTU2和OTU4的4通道RS(255,239)为例进行阐述,但需要声明的是,本发明同时适用于其它FlexE、FlexO等使用RS码的场合。Here, for the method mentioned in the embodiment of the present invention, a specific embodiment is given, and the 4-channel RS (255, 239) applied to the optical transmission network OTU2 and OTU4 is used as an example to illustrate, but it needs to be declared Yes, the present invention is also applicable to other occasions such as FlexE and FlexO that use RS codes.

参考图4是本发明实施例支持4通道OTU4/OTU2接入的RS(255,239)编译码流程图,包括4个OTU帧整形模块,4个缓存空间模块,1个4通道数据有效指示信号延时模块,1个4通道RS(255,239)码调度模块,1个RS(255,239)编译码模块,1个4通道数据分发模块,4个补偿FIFO模块。其中:4 is a flowchart of RS (255, 239) encoding and decoding supporting 4-channel OTU4/OTU2 access according to an embodiment of the present invention, including 4 OTU frame shaping modules, 4 buffer space modules, and 1 4-channel data valid indication signal Delay module, 1 4-channel RS (255, 239) code scheduling module, 1 RS (255, 239) codec module, 1 4-channel data distribution module, 4 compensation FIFO modules. in:

4个OTU帧整形模块,用于对4路OTU4/OTU2业务进行数据整理流程,使其帧间隔始终是个标准值。这里整形模块的4路接入均支持10G带宽的OTU2业务和100G带宽的OTU4业务;4 OTU frame shaping modules are used to organize data for 4 OTU4/OTU2 services, so that the frame interval is always a standard value. The 4 channels of the shaping module here all support OTU2 services with 10G bandwidth and OTU4 services with 100G bandwidth;

4个缓存空间模块,用于缓存4路OTU4/OTU2数据业务;4 buffer space modules for buffering 4-way OTU4/OTU2 data services;

4通道数据有效指示信号延时模块,用于对数据有效指示信号延时一个可配置的固定时长;The 4-channel data valid indication signal delay module is used to delay the data valid indication signal for a configurable fixed period of time;

4通道RS(255,239)码调度器模块,用于从缓存空间中读出RS(255,239)码字,输出到RS(255,239)编译码模块;4-channel RS (255, 239) code scheduler module, used to read out RS (255, 239) code words from the buffer space, and output to the RS (255, 239) code and decoding module;

高速高并行度RS(255,239)编译码器模块,这里的高速指的是数字逻辑综合时序的最高工作时钟频率很高,高并行度指的是编码或者译码的并行度,一个时钟节拍要求处理多个RS码元,例如数据位宽为320bit时,一个时钟节拍就需要处理320/8=40个RS(255,239)码元,工作时钟频率和并行度共同确定了编译码器的最大处理带宽;High-speed and high-parallel RS (255,239) codec module, where high-speed refers to the highest operating clock frequency of digital logic synthesis timing, high parallelism refers to the parallelism of encoding or decoding, and one clock beat requires processing For multiple RS symbols, for example, when the data bit width is 320 bits, one clock beat needs to process 320/8=40 RS (255,239) symbols, and the working clock frequency and parallelism jointly determine the maximum processing bandwidth of the codec;

4通道数据分发模块,用于根据与数据同步的数据通道编号,将数据分发到各通道;4-channel data distribution module, used to distribute data to each channel according to the data channel number synchronized with the data;

4个补偿缓存空间,每个通道对应一个补偿缓存空间,用于补偿数据从本发明的装置入口到补偿缓存空间之间的延时和配置的数据从本发明的装置入口到出口的固定延时之间的差值,补偿后数据从本发明的装置入口到出口的之间的延时就是一个固定值,另外由于补偿缓存空间的读使能来自于数据有效指示信号延时模块的输出,所以它与输入数据具有同样的包络,也具有一致的均匀性。4 compensation buffer spaces, each channel corresponds to one compensation buffer space, used to compensate the delay between the entry of the device of the present invention to the compensation buffer space and the fixed delay of the configured data from the entry to the exit of the device of the present invention The difference between the data is a fixed value after compensation, and the delay between the entrance and the exit of the device of the present invention is a fixed value. In addition, since the read enable of the compensation buffer space comes from the output of the data valid indication signal delay module, so It has the same envelope as the input data and also has consistent uniformity.

如图4所示是支持4通道OTU4/OTU2业务接入的RS(255,239)编译码装置的具体实施步骤:As shown in Figure 4, the specific implementation steps of the RS (255,239) encoding and decoding device supporting 4-channel OTU4/OTU2 service access:

C1、4个OTU帧整形器分别对4路接入的OTU4/OTU2业务进行整形;C1 and 4 OTU frame shapers respectively shape the OTU4/OTU2 services of 4 channels of access;

C2、4个缓存空间分别对整形后的4路OTU4/OTU2业务数据进行缓存;C2 and 4 cache spaces respectively cache the shaped 4-way OTU4/OTU2 service data;

C3、4通道数据有效指示信号延时模块对4路OTU4/OTU2业务数据的包络进行延时;C3, 4-channel data valid indication signal delay module delays the envelope of 4-channel OTU4/OTU2 service data;

C4、4通道RS(255,239)码调度器模块从缓存空间中读出RS(255,239)码字,输出到RS(255,239)编译码模块;C4, the 4-channel RS (255, 239) code scheduler module reads the RS (255, 239) code word from the buffer space, and outputs it to the RS (255, 239) encoding and decoding module;

C5、高速高并行度RS(255,239)编码器或译码器模块对来自4个通道的业务数据串行处理,进行RS(255,239)编译码;C5. The high-speed and high-parallel RS (255, 239) encoder or decoder module serially processes the service data from 4 channels, and performs RS (255, 239) encoding and decoding;

C6、4通道数据分发模块将将数据分发到并行的各通道;C6, 4-channel data distribution module will distribute data to parallel channels;

C7、将步骤C6中输出的4各通道数据写入各对应的补偿缓存空间模块中;C7, write the 4 channel data output in step C6 into each corresponding compensation buffer space module;

C8、利用步骤C3中输出的延时后的各通道包络作为读使能,从4个补偿缓存空间模块中读出数据,并输出。C8. Use the delayed envelopes of each channel output in step C3 as a read enable, read data from the four compensation buffer space modules, and output them.

上述步骤中,步骤C4中的4通道RS(255,239)码调度器模块,其内部处理流程如图5所示:In the above steps, the internal processing flow of the 4-channel RS (255, 239) code scheduler module in step C4 is shown in Figure 5:

步骤D1、初始化,调度进入空闲状态;Step D1, initialization, scheduling to enter an idle state;

步骤D2、轮询0~3各通道,当某个通道缓存空间的可读地址数量大于一个RS(255,239)码字长度时,该通道获得调度授权,进入调度状态;Step D2, polling each channel 0 to 3, when the number of readable addresses in the buffer space of a channel is greater than the length of an RS (255, 239) codeword, the channel obtains scheduling authorization and enters the scheduling state;

步骤D3、调度进行期间,判断0~3号各通道的缓存空间的可读地址数量,找出其中最大并且大于一个RS(255,239)码字长度的通道,授权其为下一次调度的对象,若无符合条件的授权对象,则转到步骤D1。Step D3: During the scheduling process, determine the number of readable addresses in the buffer space of channels 0 to 3, find the channel with the largest and greater than one RS (255, 239) codeword length, and authorize it to be the object of the next scheduling , if there is no qualified authorization object, go to step D1.

本发明实施例中OTU4/OTU2的帧结构中,OTUk帧均具有相同的帧结构,共由4行和4080列构成,单位是1个RS(255,239)码元,也就是8bit,In the frame structure of OTU4/OTU2 in the embodiment of the present invention, the OTUk frame has the same frame structure, and is composed of 4 rows and 4080 columns in total, and the unit is 1 RS (255, 239) symbol, that is, 8 bits,

每行由16个交织的RS(255,239)码字构成,其中1到3824列为信息位,第3825到4080列为校验位。Each row consists of 16 interleaved RS (255, 239) codewords, of which 1 to 3824 are information bits and 3825 to 4080 are check bits.

基于同一发明构思,本申请提供了实施例一对应的编译码系统的实施例,详见实施例二Based on the same inventive concept, the present application provides an embodiment of a coding and decoding system corresponding to Embodiment 1, and details are detailed in Embodiment 2

实施例二Embodiment 2

参见图6所示,本发明实施例提供一种编译码系统,该系统包括:Referring to FIG. 6, an embodiment of the present invention provides a coding and decoding system, and the system includes:

通道配置单元1,其用于建立多条独立的通道,且每一通道分别对应一缓存空间;A channel configuration unit 1, which is used to establish a plurality of independent channels, and each channel corresponds to a buffer space;

数据接收单元2,其用于控制各个通道接收数据帧并缓存至对应的缓存空间;Data receiving unit 2, which is used to control each channel to receive data frames and buffer them into corresponding buffer spaces;

数据编译码单元3,其用于按照预设的调度策略,一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译码,其中,数据帧的传输和编译码包括:A data encoding and decoding unit 3, which is used to complete the transmission and encoding and decoding of data frames in each buffer space one buffer space at a time according to a preset scheduling strategy, wherein the transmission and encoding and decoding of data frames include:

读取一个缓存空间中的数据帧,传输至RS编译码器,完成该缓存空间中数据帧的编译码工作,获得编译码数据帧。A data frame in a buffer space is read, and transmitted to the RS codec to complete the encoding and decoding work of the data frame in the buffer space, and the encoded and decoded data frame is obtained.

本发明实施例中,首先会建立多个相互独立的通道,各通道分别用于接收不同发送端传来的数据,而每一个通道分别对应有一个缓存空间,即各通道分别配置有其专属的缓存空间;In the embodiment of the present invention, a plurality of independent channels are first established, each channel is used to receive data from different senders, and each channel corresponds to a buffer space, that is, each channel is configured with its own dedicated cache space;

进而,各通道接收传输来的数据帧,并将各自接收到的数据帧存储至各自对应的缓存空间中;Further, each channel receives the transmitted data frame, and stores the respectively received data frame in the corresponding buffer space;

最后,开始进行数据编译码工作,按照预先设置的调度策略,每次从一个缓存空间中获取一个数据帧进行传输和编译码,其中,数据帧的传输和编译码包括:Finally, start the data encoding and decoding work. According to the preset scheduling policy, each time a data frame is obtained from a buffer space for transmission and encoding and decoding. The transmission and encoding and decoding of the data frame include:

读取一个缓存空间中的数据帧,传输至RS编译码器,完成该缓存空间中数据帧的编译码工作,获得编译码数据帧。A data frame in a buffer space is read, and transmitted to the RS codec to complete the encoding and decoding of the data frame in the buffer space, and the encoded and decoded data frame is obtained.

另外,需要说明的是,在一次一个缓存空间地完成各个缓存空间中数据帧的传输和编译,由于是每次从一个缓存空间中获取一个数据帧进行传输和编译,故而本次获取的数据帧和下一次获取的数据帧,可以来自同一个缓存空间,也可以来自不同的缓存空间,而编译工作,则是在多次提取和编译后,当各缓存空间的数据均被读取完璧时才会结束。In addition, it should be noted that the transmission and compilation of data frames in each buffer space are completed one buffer space at a time. Since one data frame is obtained from one buffer space for transmission and compilation at a time, the data frame obtained this time is The data frame obtained next time can come from the same cache space or from different cache spaces, and the compilation work is done after multiple extractions and compilations, when the data in each cache space has been read completely. will end.

本发明实施例,通过预设相互独立的通道,分别从不同来源获取数据帧,并分批次对多个通道中的数据帧进行编译,从而实现多通道的编译码工作,满足多样的工作需求。In the embodiment of the present invention, data frames are obtained from different sources by presetting mutually independent channels, and the data frames in multiple channels are compiled in batches, thereby realizing multi-channel encoding and decoding work and satisfying various work requirements. .

需要说明的是,编译码工作主要有RS编译码器进行,RS编译码器的处理带宽必须大于各通道的带宽之和,否则如果各通道的带宽大于RS编译码器的处理带宽,会造成数据丢失。It should be noted that the coding and decoding work is mainly performed by the RS codec. The processing bandwidth of the RS codec must be greater than the sum of the bandwidths of each channel. Otherwise, if the bandwidth of each channel is greater than the processing bandwidth of the RS codec, data will be lost. lost.

本发明实施例中的另一种实施方式中,该调度策略包括以下步骤:In another implementation manner in the embodiment of the present invention, the scheduling strategy includes the following steps:

轮询各缓存空间的可读地址数量,定位可读地址最大且大于1码字长度的通道,授权对应的通道获取下一次读操作权限。Poll the number of readable addresses in each buffer space, locate the channel with the largest readable address and a length greater than 1 codeword, and authorize the corresponding channel to obtain the next read operation permission.

具体操作时,一次读操作会从一个通道刚好持续读出一个RS码字的长度,因为RS码是分组码,一个码字是一个相关联的整体,如果编译码不连续处理,中间运算状态的暂存处理则会太过复杂。In the specific operation, a read operation will continuously read the length of one RS codeword from one channel, because the RS code is a block code, and a codeword is an associated whole. If the encoding and decoding are not processed continuously, the intermediate operation state Staging processing would be too complicated.

另外,这种以码字为基本单位的调度方法,还会带来额外的好处:因一次读操作持续多拍,可以使得该调度策略中判断下一次权限分配的操作可以在多拍完成,有利于数字电路的高速实现;In addition, this scheduling method with codewords as the basic unit will also bring additional benefits: because a read operation continues for multiple shots, the scheduling strategy for judging the next permission allocation operation can be completed in multiple shots. Conducive to the high-speed realization of digital circuits;

该调度策略具体为,在一次读操作期间,比较各通道的缓存空间的可读地址数量,可读地址最大并且大于一个码字长度的通道,获得下一次读操作的权限,或者所有通道均不满足授权条件,进入空闲状态。The scheduling policy is specifically: during a read operation, compare the number of readable addresses in the cache space of each channel, and the channel with the largest readable address and greater than a codeword length obtains the permission for the next read operation, or all channels are not When the authorization conditions are met, it enters the idle state.

本发明实施例中的另一种实施方式中,该系统还包括数据预处理单元4,其用于在数据接收单元接收数据接收单元数据帧之前,对各数据帧进行数据整形;In another implementation manner in the embodiment of the present invention, the system further includes a data preprocessing unit 4, which is configured to perform data shaping on each data frame before the data receiving unit receives the data frame of the data receiving unit;

数据预处理单元4,其具体用于将数据帧的数据长度与预设的标准数据长度进行比较;Data preprocessing unit 4, which is specifically used to compare the data length of the data frame with the preset standard data length;

数据预处理单元4,其具体用于当数据帧的数据长度与标准数据长度一致时,数据帧正常传输;Data preprocessing unit 4, which is specifically used for normal transmission of the data frame when the data length of the data frame is consistent with the standard data length;

数据预处理单元4,其具体用于当数据帧的数据长度大于与标准数据长度时,传输数据帧符合标准数据长度的部分,不传输数据帧超过标准数据长度的部分,进而,将下一个数据帧的数据长度与预设的标准数据长度进行比较;The data preprocessing unit 4 is specifically used to transmit the part of the data frame that meets the standard data length when the data length of the data frame is greater than the standard data length, and does not transmit the part of the data frame that exceeds the standard data length, and then, the next data The data length of the frame is compared with the preset standard data length;

数据预处理单元4,其具体用于当数据帧的数据长度小于与标准数据长度时,根据预设的补偿规则,将数据帧的数据长度调整至标准数据长度,传输调整后的数据帧;Data preprocessing unit 4, which is specifically used to adjust the data length of the data frame to the standard data length according to the preset compensation rule when the data length of the data frame is less than the standard data length, and transmit the adjusted data frame;

其中,预设的补偿规则可以是在不影响数据帧中功能性数据的前提下,使得数据帧的长度符合标准数据长度。The preset compensation rule may be such that the length of the data frame conforms to the standard data length without affecting the functional data in the data frame.

本发明实施例中的另一种实施方式中,该系统还包括时延补偿单元5,其用于进行数据补偿流程;In another implementation manner in the embodiment of the present invention, the system further includes a time delay compensation unit 5, which is used for performing a data compensation process;

时延补偿单元5用于获取编译码数据帧在第一延时处理时的第一延时值,记作T1;The delay compensation unit 5 is used to obtain the first delay value of the encoded and decoded data frame during the first delay processing, which is denoted as T1;

时延补偿单元5还用于获取编译码数据帧对应的数据帧在开始存入缓存空间以及编译码数据帧传入对应的输出通道的传输延时值,记作T2;The delay compensation unit 5 is also used to obtain the transmission delay value of the data frame corresponding to the encoded and decoded data frame, which is stored in the buffer space at the beginning and the encoded and decoded data frame is passed into the corresponding output channel, which is denoted as T2;

时延补偿单元5还用于计算编译码数据帧对应的传入通道的固有延时值,记作T3,T3=T2-T1;The delay compensation unit 5 is also used to calculate the inherent delay value of the incoming channel corresponding to the encoded and decoded data frame, denoted as T3, T3=T2-T1;

时延补偿单元5还用于根据编译码数据帧对应的固有延时值进行延时补偿。The delay compensation unit 5 is further configured to perform delay compensation according to the inherent delay value corresponding to the encoded and decoded data frame.

基于同一发明构思,本申请提供了实施例一对应的存储介质的实施例,详见实施例三Based on the same inventive concept, the present application provides an embodiment of the storage medium corresponding to Embodiment 1. For details, please refer to Embodiment 3

实施例三Embodiment 3

本发明第三实施例提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现第一实施例中的所有方法步骤或部分方法步骤。A third embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements all or part of the method steps in the first embodiment.

本发明实现上述第一实施例中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,计算机程序包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质可以包括:能够携带计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,R andom Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。The present invention realizes all or part of the flow in the above-mentioned first embodiment, and can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor , the steps of each of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable media may be appropriately increased or decreased as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to the legislation and patent practice, the computer-readable media does not include Electrical carrier signals and telecommunication signals.

基于同一发明构思,本申请提供了实施例一对应的设备的实施例,详见实施例四Based on the same inventive concept, the present application provides an embodiment of the device corresponding to the first embodiment. For details, please refer to the fourth embodiment.

实施例四Embodiment 4

本发明第四实施例还提供一种设备,包括存储器和处理器,存储器上储存有在处理器上运行的计算机程序,处理器执行计算机程序时实现第一实施例中的所有方法步骤或部分方法步骤。A fourth embodiment of the present invention also provides a device, including a memory and a processor, the memory stores a computer program running on the processor, and when the processor executes the computer program, all the method steps or part of the method in the first embodiment are implemented step.

所称处理器可以是中央处理单元(Central Processing Unit,CP U),还可以是其他通用处理器、数字信号处理器(Digital Signal Proc essor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,处理器是计算机装置的控制中心,利用各种接口和线路连接整个计算机装置的各个部分。The so-called processor may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC) , Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.

存储器可用于存储计算机程序和/或模块,处理器通过运行或执行存储在存储器内的计算机程序和/或模块,以及调用存储在存储器内的数据,实现计算机装置的各种功能。存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、视频数据等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart MediaCard,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory can be used to store computer programs and/or modules, and the processor implements various functions of the computer device by running or executing the computer programs and/or modules stored in the memory and calling data stored in the memory. The memory can mainly include a stored program area and a stored data area, wherein the stored program area can store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required for at least one function; The use of created data (such as audio data, video data, etc.) and so on. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, internal memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、服务器或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, server or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.

本发明是参照根据本发明实施例的方法、设备(系统)、服务器和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), servers and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims (10)

1. A method of coding and decoding, the method comprising the steps of:
establishing a plurality of independent channels, wherein each channel corresponds to a cache space;
each channel receives a data frame and caches the data frame to a corresponding cache space;
according to a preset scheduling strategy, completing the transmission and coding of data frames in each buffer space one buffer space at a time; wherein, the transmission and coding and decoding of the data frame comprises:
and reading a data frame in the cache space, transmitting the data frame to an RS codec, finishing the coding and decoding work of the data frame in the cache space, and obtaining a coded data frame.
2. The method of claim 1, wherein the scheduling policy comprises the steps of:
polling the number of the readable addresses in each cache space, positioning the channel with the maximum readable address and the length larger than 1 code word, and authorizing the corresponding channel to obtain the next read operation permission.
3. The method of claim 1, wherein before each of the lanes receives the data frame and buffers it to the corresponding buffer space, the method further comprises a data shaping process, the data grooming process comprising the steps of:
comparing the data length of the data frame with a preset standard data length;
when the data length of the data frame is consistent with the standard data length, the data frame is normally transmitted;
when the data length of the data frame is larger than the standard data length, only transmitting the part of the data frame conforming to the standard data length;
and when the data length of the data frame is smaller than the standard data length, adjusting the data length of the data frame to the standard data length according to a preset compensation rule, and transmitting the adjusted data frame.
4. The method of claim 3, wherein:
and when the data length of the data frame is greater than the standard data length, only transmitting the part of the data frame conforming to the standard data length, detecting a frame start indicating signal, and when the frame start indicating signal appears, comparing the data length of the next data frame with the preset standard data length.
5. The method of claim 3, wherein:
and when the data length of the data frame is smaller than the standard data length, deleting the acquired frame start indication signal according to a preset compensation rule, adjusting the data length of the data frame to the standard data length, and transmitting the adjusted data frame.
6. The method of claim 1, further comprising the steps of:
and carrying out first time delay processing on the data frame in the buffer space.
7. The method of claim 6, wherein prior to transmitting said compiled code data frames to a corresponding output channel, said method further comprises a data compensation process, said data compensation process comprising the steps of:
acquiring a first delay value of the compiled code data frame during the first delay processing, and recording the first delay value as T1;
acquiring a transmission delay value of the data frame corresponding to the compiled code data frame, which is stored in the cache space at the beginning and is transmitted into the corresponding output channel by the compiled code data frame, and recording the transmission delay value as T2;
calculating an inherent delay value of the incoming channel corresponding to the compiled code data frame, and recording the inherent delay value as T3, wherein T3 is T2-T1;
and performing delay compensation according to the inherent delay value corresponding to the coding and decoding data frame.
8. A coding system, the system comprising:
the channel configuration unit is used for establishing a plurality of independent channels, and each channel corresponds to a cache space;
the data receiving unit is used for controlling each channel to receive the data frame and buffer the data frame to the corresponding buffer space;
a data coding and decoding unit, configured to complete transmission and coding and decoding of data frames in each buffer space one buffer space at a time according to a preset scheduling policy, where the transmission and coding and decoding of the data frames include:
and reading a data frame in the cache space, transmitting the data frame to an RS codec, finishing the coding and decoding work of the data frame in the cache space, and obtaining a coded data frame.
9. The system of claim 8, wherein the scheduling policy comprises the steps of:
polling the number of the readable addresses in each cache space, positioning the channel with the maximum readable address and the length larger than 1 code word, and authorizing the corresponding channel to obtain the next read operation permission.
10. The system of claim 8, further comprising a data pre-processing unit for data shaping each data frame prior to the data receiving unit receiving the data frame;
the data preprocessing unit is specifically configured to compare the data length of the data frame with a preset standard data length;
the data preprocessing unit is specifically configured to, when the data length of the data frame is consistent with the standard data length, normally transmit the data frame;
the data preprocessing unit is specifically configured to transmit only a portion of the data frame that conforms to the standard data length when the data length of the data frame is greater than the standard data length;
the data preprocessing unit is specifically configured to, when the data length of the data frame is smaller than the standard data length, adjust the data length of the data frame to the standard data length according to a preset compensation rule, and transmit the adjusted data frame.
CN202010151134.9A 2020-03-05 2020-03-05 Coding and decoding method and system Pending CN111416630A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010151134.9A CN111416630A (en) 2020-03-05 2020-03-05 Coding and decoding method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010151134.9A CN111416630A (en) 2020-03-05 2020-03-05 Coding and decoding method and system

Publications (1)

Publication Number Publication Date
CN111416630A true CN111416630A (en) 2020-07-14

Family

ID=71494139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010151134.9A Pending CN111416630A (en) 2020-03-05 2020-03-05 Coding and decoding method and system

Country Status (1)

Country Link
CN (1) CN111416630A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115941792A (en) * 2022-11-30 2023-04-07 苏州异格技术有限公司 Method and device for processing data block of flexible Ethernet and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5043982A (en) * 1989-05-24 1991-08-27 At&T Bell Laboratories Multichannel multipoint network using time-division multiplexing incorporating a time offset for propagation delay
US6160846A (en) * 1995-10-25 2000-12-12 Sarnoff Corporation Apparatus and method for optimizing the rate control in a coding system
US20070110087A1 (en) * 2005-11-14 2007-05-17 Abel Francois G Method and system to reduce interconnect latency
CN1968036A (en) * 2006-05-31 2007-05-23 华为技术有限公司 A forward correcting decoding device and control method
CN101146091A (en) * 2007-09-05 2008-03-19 中兴通讯股份有限公司 Multi-channel data output method and system
CN101436917A (en) * 2007-11-12 2009-05-20 华为技术有限公司 Method and apparatus for encoding and decoding data
US20090180494A1 (en) * 2008-01-16 2009-07-16 Ren Xingen James System and Method for Converting Multichannel Time Division Multiplexed Data into Packets
CN102546109A (en) * 2011-12-28 2012-07-04 北京格林伟迪科技有限公司 RS (Reed-Solomon) decoding device and method for 10G Ethernet Passive Optical Network (EPON)
CN105812062A (en) * 2016-03-04 2016-07-27 烽火通信科技股份有限公司 MLD interface adapting method and system of optical transport network
CN106936447A (en) * 2017-01-12 2017-07-07 西南电子技术研究所(中国电子科技集团公司第十研究所) The method of multichannel time division multiplex folding coding
CN108235413A (en) * 2016-12-22 2018-06-29 Macom连接解决有限公司 The power optimization mechanism of framer handled by the frame alignment for serializing multiple channels

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5043982A (en) * 1989-05-24 1991-08-27 At&T Bell Laboratories Multichannel multipoint network using time-division multiplexing incorporating a time offset for propagation delay
US6160846A (en) * 1995-10-25 2000-12-12 Sarnoff Corporation Apparatus and method for optimizing the rate control in a coding system
US20070110087A1 (en) * 2005-11-14 2007-05-17 Abel Francois G Method and system to reduce interconnect latency
CN1968036A (en) * 2006-05-31 2007-05-23 华为技术有限公司 A forward correcting decoding device and control method
CN101146091A (en) * 2007-09-05 2008-03-19 中兴通讯股份有限公司 Multi-channel data output method and system
CN101436917A (en) * 2007-11-12 2009-05-20 华为技术有限公司 Method and apparatus for encoding and decoding data
US20090180494A1 (en) * 2008-01-16 2009-07-16 Ren Xingen James System and Method for Converting Multichannel Time Division Multiplexed Data into Packets
CN102546109A (en) * 2011-12-28 2012-07-04 北京格林伟迪科技有限公司 RS (Reed-Solomon) decoding device and method for 10G Ethernet Passive Optical Network (EPON)
CN105812062A (en) * 2016-03-04 2016-07-27 烽火通信科技股份有限公司 MLD interface adapting method and system of optical transport network
CN108235413A (en) * 2016-12-22 2018-06-29 Macom连接解决有限公司 The power optimization mechanism of framer handled by the frame alignment for serializing multiple channels
CN106936447A (en) * 2017-01-12 2017-07-07 西南电子技术研究所(中国电子科技集团公司第十研究所) The method of multichannel time division multiplex folding coding

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
IEEE: "《IEEE Drafts Standards for Telecommunications and information exchange between systems--Local and metropolitan area networks--Specific requirements Part 3: Carrier Sense 》", 《IEEE》 *
MAODE MA, LISHON LIU AND TEE HIANG CHENG: "《Adaptive scheduling for differentiated services in the ethernet passive optical networks》", 《THE NINTH INTERNATIONAL CONFERENCE ONOMMUNICATIONS SYSTEMS》 *
李西聪: "《10G-EPON系统FEC算法的研究与FPGA设计实现》", 《10G-EPON系统FEC算法的研究与FPGA设计实现》 *
李雪松,傅珂,韩仲祥编著: "《接入网技术与设计应用 第2版》", 31 January 2015 *
符锐,孙强,刘燕: "《EPON中一种改进的动态带宽分配算法的设计》", 《光通信技术》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115941792A (en) * 2022-11-30 2023-04-07 苏州异格技术有限公司 Method and device for processing data block of flexible Ethernet and storage medium
CN115941792B (en) * 2022-11-30 2024-02-02 苏州异格技术有限公司 Method and device for processing data blocks of flexible Ethernet and storage medium

Similar Documents

Publication Publication Date Title
US6490250B1 (en) Elementary stream multiplexer
CN108495164B (en) Audio and video synchronization processing method and device, computer device and storage medium
US12223207B2 (en) Memory component having internal read-modify-write operation
CN111107641B (en) FlexE service processing method and device and electronic equipment
US7796061B2 (en) Distributed decoding device using multi-core processor and method for the same
EP0935199B1 (en) Memory control unit and memory control method and medium containing program for realizing the same
US20170083262A1 (en) System and method for controlling memory frequency using feed-forward compression statistics
CN113596549B (en) Audio and video synchronization method and device based on different reference clocks and computer equipment
CN111416630A (en) Coding and decoding method and system
Koivula et al. Performance evaluation of Kvazaar HEVC intra encoder on Xeon Phi many-core processor
CN112114615B (en) Cross-clock domain data synchronization circuit, method and equipment
US6510248B1 (en) Run-length decoder with error concealment capability
US9761232B2 (en) Multi-decoding method and multi-decoder for performing same
US11166021B2 (en) Methods and apparatuses for coding and decoding mode information and electronic device
WO2018076672A1 (en) Method and apparatus for accessing optical transmission network service and computer storage medium
CN116993635A (en) Image fusion method, device, equipment and computer readable storage medium
CN114518917A (en) Algorithm module scheduling method, algorithm module scheduling device and readable storage medium
TWI620947B (en) Parallel processing method for parallel schematic software front-end decoder of high-rate satellite data and software architecture thereof
KR20220160306A (en) Fast soft decision decoding method and apparatus for linear codes using successive partial syndrome search
US7028120B2 (en) Apparatus and method for reducing LDRQ input pin count of a low pin count host using serially coupled peripheral devices
KR20110122412A (en) Multi-threaded video decoder and decoding method
CN104735384A (en) Method and device for distributing memory of coding channels
GB2302634A (en) Cyclic redundancy coder
US20050165737A1 (en) Information processing apparatus
US6618446B1 (en) Apparatus and method of data reconstruction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200714

RJ01 Rejection of invention patent application after publication