CN115883689A - Code block transmission method, device and storage medium - Google Patents
Code block transmission method, device and storage medium Download PDFInfo
- Publication number
- CN115883689A CN115883689A CN202111113008.5A CN202111113008A CN115883689A CN 115883689 A CN115883689 A CN 115883689A CN 202111113008 A CN202111113008 A CN 202111113008A CN 115883689 A CN115883689 A CN 115883689A
- Authority
- CN
- China
- Prior art keywords
- code block
- counter
- nth
- value
- count
- 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.)
- Granted
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 71
- 238000000034 method Methods 0.000 title claims abstract description 65
- 230000015654 memory Effects 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 13
- 230000000875 corresponding effect Effects 0.000 description 80
- 238000012545 processing Methods 0.000 description 21
- 230000008569 process Effects 0.000 description 11
- 238000013461 design Methods 0.000 description 10
- 230000001360 synchronised effect Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 230000005291 magnetic effect Effects 0.000 description 7
- 230000001960 triggered effect Effects 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000003068 static effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 230000005294 ferromagnetic effect Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/28—Timers or timing mechanisms used in protocols
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
Description
技术领域technical field
本申请涉及网络通信技术领域,尤其涉及一种码块传输方法、装置和存储介质。The present application relates to the technical field of network communication, and in particular to a code block transmission method, device and storage medium.
背景技术Background technique
灵活以太网(Flex Ethernet,简称FlexE)技术是在Ethernet技术基础上,为满足高速传送、带宽配置灵活等需求而发展的技术。The Flexible Ethernet (Flex Ethernet, FlexE for short) technology is developed on the basis of the Ethernet technology to meet requirements such as high-speed transmission and flexible bandwidth configuration.
在灵活以太网中,根据OAM(Operation,Administration and Maintenance,操作、管理和维护)的相关标准要求,按照灵活以太网OAM的相关标准要求,针对不同类型的OAM码块,码块间隔是不同的。例如,传输BAS码块的码块间隔要求是在所属FlexE Client(灵活以太网客户端)的带宽下,按照16K个帧,或32K、64K、128K、256K,512K个帧的间隔发送和接收(K为1024),其他类型OAM帧也是基于此间隔单位,或以1秒为时间单位进行发送和接收。In flexible Ethernet, according to the relevant standard requirements of OAM (Operation, Administration and Maintenance, operation, management and maintenance), according to the relevant standard requirements of flexible Ethernet OAM, the code block intervals are different for different types of OAM code blocks . For example, the code block interval requirement for transmitting BAS code blocks is to send and receive at intervals of 16K frames, or 32K, 64K, 128K, 256K, and 512K frames under the bandwidth of the FlexE Client (flexible Ethernet client) to which it belongs ( K is 1024), and other types of OAM frames are also sent and received based on this interval unit, or with 1 second as a time unit.
由于可支持带宽的5G粒度的灵活性,每个FlexE Client的带宽都可能不同,即便是按照同一码块间隔传输码块,不同带宽的FlexE Client传输码块的时间间隔也是不同的。如果使用多个定时器分别实现不同带宽的客户端达到码块传输标准需要的时间间隔,则会导致芯片资源浪费,如果使用一个定时器实现不同带宽的客户端达到码块传输标准需要的时间间隔,则可能很难实现。Due to the flexibility of the 5G granularity that can support bandwidth, the bandwidth of each FlexE Client may be different. Even if the code blocks are transmitted at the same code block interval, the time intervals for FlexE Clients with different bandwidths to transmit code blocks are also different. If multiple timers are used to realize the time interval required for clients of different bandwidths to reach the code block transmission standard, it will lead to waste of chip resources. If one timer is used to realize the time interval required for clients of different bandwidths to reach the code block transmission standard , it may be difficult to achieve.
发明内容Contents of the invention
本申请实施例提供一种码块传输方法、装置和存储介质。Embodiments of the present application provide a code block transmission method, device, and storage medium.
本申请的技术方案是这样实现的:The technical scheme of the present application is realized like this:
第一方面,提供了一种码块传输方法,所述方法包括:In a first aspect, a code block transmission method is provided, the method comprising:
根据时钟脉冲的周期、客户端的带宽以及不同带宽所述客户端传输码块的码块间隔,确定计数器对所述时钟脉冲进行计数的计数阈值;其中,不同带宽所述客户端对应的计数器不同;According to the period of the clock pulse, the bandwidth of the client, and the code block interval of the client transmitting the code block with different bandwidths, determine the counting threshold for the counter to count the clock pulses; wherein, the counters corresponding to the clients with different bandwidths are different;
在第n个所述计数器的计数值达到第n个所述计数器的计数阈值时,将寄存器内与第n个所述计数器对应的计数标志位置为预设值;其中,n的取值小于或等于N,所述N为所述客户端的个数;When the count value of the nth counter reaches the counting threshold of the nth counter, the counting flag position corresponding to the nth counter in the register is set to a preset value; wherein, the value of n is less than or Equal to N, where N is the number of clients;
扫描所述寄存器;scan the register;
当扫描到所述寄存器内与第m个所述计数器对应的计数标志位为所述预设值时,接收第m个所述计数器对应的客户端发送的码块或者向第m个所述计数器对应的所述客户端发送所述码块,其中,m的取值小于或等于N。When it is scanned that the counting flag corresponding to the mth counter in the register is the preset value, receive the code block sent by the client corresponding to the mth counter or send a message to the mth counter The corresponding client sends the code block, where the value of m is less than or equal to N.
上述技术方案中,所述扫描所述寄存器,包括:In the above technical solution, the scanning of the register includes:
在定时器的定时周期内扫描所述寄存器,其中,所述定时器的定时周期小于或等于所述时钟脉冲的周期。The register is scanned within a timing period of a timer, wherein the timing period of the timer is less than or equal to a period of the clock pulse.
上述技术方案中,所述根据时钟脉冲的周期、客户端的带宽以及不同带宽所述客户端传输码块的码块间隔,确定计数器对所述时钟脉冲进行计数的计数阈值,包括:In the above technical solution, the determination of the counting threshold for the counter to count the clock pulses according to the period of the clock pulse, the bandwidth of the client, and the code block interval of the client transmitting code blocks with different bandwidths includes:
根据第n个所述客户端的带宽、所述码块间隔及所述码块间隔内每一帧包含的比特数,确定传输所述码块的时间间隔;Determine the time interval for transmitting the code block according to the bandwidth of the nth client, the code block interval, and the number of bits contained in each frame in the code block interval;
确定所述时间间隔与所述时钟脉冲的周期之间的商;determining a quotient between the time interval and the period of the clock pulse;
将所述商的整数部分确定为第n个所述计数器的计数阈值。An integer part of the quotient is determined as a count threshold of the nth counter.
上述技术方案中,所述方法还包括:In the above technical solution, the method also includes:
当所述商存在小数部分时,记录所述商的小数部分;When the quotient has a decimal part, record the decimal part of the quotient;
当小数部分与s的乘积大于或等于1时,确定第n个所述计数器本次计数的最大值为所述计数阈值加1,其中,s为第n个所述计数器连续从0计数到所述计数阈值的本次计数的计数轮次。When the product of the fractional part and s is greater than or equal to 1, determine that the maximum value of the count of the nth counter this time is the count threshold plus 1, where s is the nth counter that counts continuously from 0 to all The counting round of this counting that is the above counting threshold.
上述技术方案中,所述码块包括:第一类码块和第二类码块,其中,所述第二类码块的码块间隔为所述第一类码块的码块间隔的P倍,所述P为大于或等于2的正整数;In the above technical solution, the code blocks include: a first type of code block and a second type of code block, wherein the code block interval of the second type of code block is P of the code block interval of the first type of code block times, the P is a positive integer greater than or equal to 2;
第n个所述计数器的计数阈值为:根据所述第一类码块的码块间隔确定的;The counting threshold of the nth counter is: determined according to the code block interval of the first type of code block;
所述在第n个所述计数器的计数值达到第n个所述计数器的计数阈值时,将寄存器内与第n个所述计数器对应的计数标志位置为预设值,包括:When the count value of the nth counter reaches the counting threshold of the nth counter, setting the count flag position corresponding to the nth counter in the register as a preset value, including:
每当第n个所述计数器的计数值达到第n个所述计数器的计数阈值时,将所述寄存器内与第n个所述计数器的所述第一类码块对应的计数标志位置为所述预设值;和/或,Whenever the count value of the nth counter reaches the counting threshold of the nth counter, set the count flag position corresponding to the first type code block of the nth counter in the register to the the above preset values; and/or,
在第n个所述计数器的计数值连续P次达到第n个所述计数器的计数阈值时,将所述寄存器内与第n个所述计数器的第二类码块对应的计数标志位置为所述预设值。When the count value of the nth counter reaches the counting threshold of the nth counter continuously for P times, the counting flag position corresponding to the second type code block of the nth counter in the register is set to the the default value mentioned above.
上述技术方案中,所述码块还包括第三类码块,其中,第n个所述客户端传输所述第三类码块的时间间隔为第n个所述客户端传输所述第一类码块的时间间隔的q倍,所述时间间隔的间隔单位与所述码块间隔的间隔单位不同,所述q为大于或等于2的正整数;In the above technical solution, the code blocks further include a third type of code block, wherein the time interval for the nth client to transmit the third type of code block is that the nth client transmits the first q times the time interval of the class code block, the interval unit of the time interval is different from the interval unit of the code block interval, and the q is a positive integer greater than or equal to 2;
所述在第n个所述计数器的计数值达到第n个所述计数器的计数阈值时,将寄存器内与第n个所述计数器对应的计数标志位置为预设值还包括:When the count value of the nth counter reaches the counting threshold of the nth counter, setting the counting flag position corresponding to the nth counter in the register as a preset value also includes:
在第n个所述计数器的计数值连续q次达到第n个所述计数器的计数阈值时,将所述寄存器内与第n个所述计数器的第三类码块对应的计数标志位置为所述预设值。When the count value of the nth counter reaches the counting threshold of the nth counter for q consecutive times, the counting flag position corresponding to the third type code block of the nth counter in the register is set to the the default value mentioned above.
上述技术方案中,所述方法还包括:In the above technical solution, the method also includes:
若预设连续次数均未接收到第m个所述计数器对应的客户端发送的码块,则生成超时告警;其中,所述预设连续次数为:第m个所述计数器的计数值连续达到第m个所述计数器的计数阈值的次数。If the code block sent by the client corresponding to the mth counter is not received for the preset consecutive times, a timeout alarm is generated; wherein, the preset consecutive times are: the count value of the mth counter reaches consecutively The number of count thresholds for the mth counter.
第二方面,提供了一种码块传输装置,所述装置包括:In a second aspect, a code block transmission device is provided, the device comprising:
确定模块,用于根据时钟脉冲的周期、客户端的带宽以及不同带宽所述客户端传输码块的码块间隔,确定计数器对所述时钟脉冲进行计数的计数阈值;其中,不同带宽所述客户端对应的计数器不同;A determining module, configured to determine a counting threshold for the counter to count the clock pulses according to the period of the clock pulse, the bandwidth of the client, and the code block interval of the client with different bandwidths to transmit code blocks; wherein, the client with different bandwidths The corresponding counters are different;
设置模块,用于在第n个所述计数器的计数值达到第n个所述计数器的计数阈值时,将寄存器内与第n个所述计数器对应的计数标志位置为预设值;其中,n的取值小于或等于N,所述N为所述客户端的个数;The setting module is used to set the count flag position corresponding to the nth counter in the register as a preset value when the count value of the nth counter reaches the counting threshold of the nth counter; wherein, n The value of is less than or equal to N, where N is the number of clients;
扫描模块,用于扫描所述寄存器;a scanning module, configured to scan the register;
传输模块,用于当扫描到所述寄存器内与第m个所述计数器对应的计数标志位为所述预设值时,接收第m个所述计数器对应的客户端发送的码块或者向第m个所述计数器对应的所述客户端发送所述码块,其中,m的取值小于或等于N。The transmission module is configured to receive the code block sent by the client corresponding to the m-th counter or send the code block to the m-th counter when the counting flag corresponding to the m-th counter in the register is scanned to be the preset value. The client corresponding to the m counters sends the code block, where the value of m is less than or equal to N.
第三方面,提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行第一方面任一项所述的码块传输方法。In a third aspect, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the code described in any one of the first aspect. block transfer method.
第四方面,提供了一种计算机可读存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行第一方面任一项所述的码块传输方法。In a fourth aspect, a computer-readable storage medium is provided, and a computer program is stored in the storage medium, wherein the computer program is configured to execute the code block transmission method described in any one of the first aspect when running.
本申请提供的技术方案中,由于计数器对时钟脉冲进行计数的计数阈值,是根据时钟脉冲的周期、客户端的带宽以及不同带宽客户端传输码块的码块间隔确定的,不同带宽客户端对应的计数器不同,这样,与使用多个定时器分别实现不同带宽的客户端达到码块传输标准需要的时间间隔相比较而言,本申请不同带宽客户端对应的计数器共用同一时钟脉冲进行计数,相当于对不同带宽客户端仅使用一个定时器实现脉冲计数,这样能够极大地节省芯片资源;另外,由于不需要将同一个主频/分频脉冲信号作为不同时间间隔的最小公约数,因此无需受限于脉冲信号的大小,只需确定不同带宽的客户端对应的计数器度对时钟脉冲进行计数的计数阈值,这样更具有可行性;此外,通过在第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器对应的计数标志位置为预设值,扫描寄存器,当扫描到寄存器内与第m个计数器对应的计数标志位为预设值时,接收第m个计数器对应的客户端发送的码块或者向第m个计数器对应的客户端发送码块,其中,m的取值小于或等于N,由此在充分考虑芯片资源节约和可行性的同时,能够保证码块传输的时间精度,达到码块传输标准需要的时间间隔需求。In the technical solution provided by this application, since the counting threshold for the counter to count the clock pulses is determined according to the period of the clock pulse, the bandwidth of the client, and the interval between code blocks transmitted by clients with different bandwidths, the corresponding The counters are different. In this way, compared with the time interval required for clients with different bandwidths to reach the code block transmission standard using multiple timers, the counters corresponding to different bandwidth clients in this application share the same clock pulse for counting, which is equivalent to For different bandwidth clients, only one timer is used to realize pulse counting, which can greatly save chip resources; in addition, since the same main frequency/frequency division pulse signal does not need to be used as the least common divisor of different time intervals, there is no need to be limited Due to the size of the pulse signal, it is more feasible to determine the counting threshold of the counters corresponding to the clients with different bandwidths to count the clock pulses; in addition, by the count value of the nth counter reaching the nth counter When counting the threshold, set the counting flag position corresponding to the nth counter in the register as the preset value, scan the register, and when the counting flag bit corresponding to the mth counter in the register is scanned as the preset value, receive the mth counter The code block sent by the client corresponding to the counter or the code block sent to the client corresponding to the mth counter, where the value of m is less than or equal to N, thus fully considering chip resource conservation and feasibility, it can be guaranteed The time accuracy of the code block transmission meets the time interval requirements required by the code block transmission standard.
附图说明Description of drawings
图1a为使用多个定时器的设计方案的流程示意图;Figure 1a is a schematic flow diagram of a design scheme using multiple timers;
图1b为使用一个定时器的设计方案的流程示意图;Figure 1b is a schematic flow diagram of a design scheme using a timer;
图2为本申请实施例提供的码块传输方法的一个流程示意图;FIG. 2 is a schematic flowchart of a code block transmission method provided in an embodiment of the present application;
图3为本申请实施例提供的码块传输方法的另一个流程示意图;FIG. 3 is another schematic flowchart of a code block transmission method provided in an embodiment of the present application;
图4为本申请实施例提供的码块传输方法的又一个流程示意图;FIG. 4 is another schematic flowchart of a code block transmission method provided by an embodiment of the present application;
图5a为本申请实施例提供的码块传输方法中两级定时器的框架示意图;FIG. 5a is a schematic diagram of a two-level timer framework in the code block transmission method provided by the embodiment of the present application;
图5b为本申请实施例提供的定时计数器寄存器的使用方法伪代码逻辑;Fig. 5b is the pseudo-code logic of the usage method of the timer counter register provided by the embodiment of the present application;
图5c为本申请实施例提供的基于两级定时器的码块传输方法的流程图;FIG. 5c is a flow chart of a code block transmission method based on a two-stage timer provided in an embodiment of the present application;
图5d为本申请实施例提供的定时器触发的BAS超时处理机制的流程图;Figure 5d is a flow chart of the timer-triggered BAS overtime processing mechanism provided by the embodiment of the present application;
图5e为本申请实施例提供的接收方向上超时计数更新处理机制的流程图;FIG. 5e is a flow chart of the timeout count update processing mechanism in the receiving direction provided by the embodiment of the present application;
图6为本申请实施例提供的码块传输装置的一个结构示意图;FIG. 6 is a schematic structural diagram of a code block transmission device provided by an embodiment of the present application;
图7为本申请实施例提供的电子装置的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案和优点更加清楚明白,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。In order to make the purpose, technical solutions and advantages of the application clearer, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application. In the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined arbitrarily with each other. The steps shown in the flowcharts of the figures may be performed in a computer system, such as a set of computer-executable instructions. Also, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.
需要说明的是,除非上下文明确要求,否则整个说明书和权利要求书中的“包括”、“包含”等类似词语应当解释为包含的含义而不是排他或穷举的含义;也就是说,是“包括但不限于”的含义。It should be noted that, unless the context clearly requires, the words "include", "include" and other similar words in the entire specification and claims should be interpreted as an inclusive meaning rather than an exclusive or exhaustive meaning; that is, " including but not limited to ".
此外,在本申请的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本申请的描述中,除非另有说明,“多个”的含义是两个或两个以上。In addition, in the description of the present application, it should be understood that the terms "first", "second" and so on are only used for descriptive purposes, and should not be understood as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, "plurality" means two or more.
按照灵活以太网OAM的相关标准要求,针对不同类型的OAM码块,其时间间隔是不同的。对于BAS码块(Basic基础码块),该码块功能是定时监测所属FlexE Client(灵活以太网客户端)的基础码块,传输该码块的码块间隔要求是16K/32K/64K/128K/256K/512Kblock(数据帧),数据帧采用66bit/64bit编码,即每个帧实际有效数据为8Byte。对于APS码块(用于保护切换的码块),在检测到链路故障时,需要以与BAS码块相同的码块间隔连续发送三个APS码块。对于其他码块,例如CV码块(连通性验证码块)、1DM码块(单向时延码块)、2DMM码块(双向时延测量码块)、2DMR(双向时延响应码块)、CS码块(客户信号指示码块),均是以1秒、10秒或1分钟为时间单位。According to the relevant standard requirements of the flexible Ethernet OAM, the time intervals for different types of OAM code blocks are different. For the BAS code block (Basic basic code block), the function of this code block is to regularly monitor the basic code block of the FlexE Client (flexible Ethernet client), and the code block interval for transmitting this code block is required to be 16K/32K/64K/128K /256K/512Kblock (data frame), the data frame adopts 66bit/64bit encoding, that is, the actual effective data of each frame is 8Byte. For the APS code block (the code block used for protection switching), when a link failure is detected, three APS code blocks need to be sent continuously at the same code block interval as the BAS code block. For other code blocks, such as CV code block (connectivity verification code block), 1DM code block (one-way delay code block), 2DMM code block (two-way delay measurement code block), 2DMR (two-way delay response code block) , CS code block (customer signal indication code block), all take 1 second, 10 seconds or 1 minute as the time unit.
由于灵活以太网的FlexE Client带宽的灵活性,灵活以太网定义了其FlexEClient的带宽以5G为最小单位,可进行组合,最大按芯片支持的能力,如400G或800G。简单举例,可支持25G、或50G、或105G、或195G,诸如此类的以5G为单位的带宽组合,因此,不同带宽的FlexE Client传输码块的码块间隔相同时,其传输码块的时间间隔是不同的,比如以16k帧作为传输BAS码块的码块间隔,25G带宽的FlexE Client与50G带宽的FlexE Client传输BAS码块的时间间隔不同。Due to the flexibility of the FlexE Client bandwidth of Flexible Ethernet, Flexible Ethernet defines the bandwidth of its FlexEClient with 5G as the smallest unit, which can be combined, and the maximum capacity supported by the chip, such as 400G or 800G. For a simple example, it can support 25G, or 50G, or 105G, or 195G, and so on. Bandwidth combinations in units of 5G. Therefore, when the code block intervals of the FlexE Client transmission code blocks of different bandwidths are the same, the time interval of the transmission code blocks For example, if 16k frames are used as the block interval for transmitting BAS code blocks, the time interval for the FlexE Client with 25G bandwidth to transmit BAS code blocks is different from that for FlexE Client with 50G bandwidth.
一般定时器的实现方法为:按照芯片的主频做分频配置,以主频为最小单位,更新计数器,通过配置计数器到达的门限值来触发某个操作流程,从而实现定时的功能。举例来说,假设芯片主频为500M,若要配置出1ms的定时器,则需要设计一个计数器,每次主频刷新时,计数器进行加1操作,当计数器到达500M/1000/1,即500000时,则表示达到1ms的时间,此时会执行某个操作。The implementation method of the general timer is: do frequency division configuration according to the main frequency of the chip, take the main frequency as the minimum unit, update the counter, and trigger a certain operation process by configuring the threshold value reached by the counter, so as to realize the timing function. For example, assuming that the main frequency of the chip is 500M, if you want to configure a 1ms timer, you need to design a counter. Every time the main frequency is refreshed, the counter will be incremented by 1. When the counter reaches 500M/1000/1, that is, 500000 When , it means that the time reaches 1ms, and a certain operation will be performed at this time.
面对可支持带宽的5G粒度的灵活性以及OAM相关标准要求,为实现不同带宽FlexEClient的码块传输,从设计角度一般可以有两种方案。Facing the flexibility of 5G granularity that can support bandwidth and the requirements of OAM-related standards, in order to realize the code block transmission of FlexEClient with different bandwidths, there are generally two schemes from the design point of view.
方案一:如图1a所示,图1a为使用多个定时器的设计方案的流程示意图,由于每个FlexE Client的带宽都可能不同,计数器的阈值配置没有一定的计算关系,需要针对每个FlexE Client分别设计一个定时器,定时器时间可按不同带宽进行设置。这样虽然解决了定时器的问题,但需要使用大量的定时器,对芯片资源是较大的浪费。Solution 1: As shown in Figure 1a, Figure 1a is a flow diagram of the design scheme using multiple timers. Since the bandwidth of each FlexE Client may be different, the threshold configuration of the counter has no certain calculation relationship, and it needs to be specific to each FlexE Client. The client designs a timer respectively, and the timer time can be set according to different bandwidths. Although this solves the problem of timers, it needs to use a large number of timers, which is a big waste of chip resources.
方案二:如图1b所示,图1b为使用一个定时器的设计方案的流程示意图,使用一个定时器,所有不同带宽的时间单位都从这个定时器上产生,在一个定时器上,通过配置不同的定时计数器的累加寄存器及不同的阈值,达到不同时间间隔的功能。但由于FlexEClient带宽的多样性,如某个FlexE Client需支持55G带宽,则按16K帧的时间间隔计算为:64bit*16K/55G=19065.018ns,另一个FlexE Client需支持105G,则按16K帧的时间间隔计算为64bit*16K/105G=9986.438ns,使用同一个主频/分频脉冲信号,即需要找到两者时间间隔的最小公约数,才可以使用该方法配置不同的定时计数器来达到使用一个定时器的目的。并且,随着5G为单位的带宽粒度,考虑所有带宽的16K帧的时间间隔的最小公约数极有可能需要达到1ns等级或小于1ns,而即使芯片主频可以满足1ns的脉冲粒度,但在1ns的时间内,芯片无法完成定时器达到阈值后需要做的操作,如发送FlexE OAM码块。因此,这个方案没有可行性。Solution 2: As shown in Figure 1b, Figure 1b is a schematic flow chart of the design scheme using a timer. Using a timer, all time units with different bandwidths are generated from this timer. On a timer, by configuring Different accumulation registers of timing counters and different thresholds can achieve the functions of different time intervals. However, due to the diversity of FlexEClient bandwidth, if a FlexE Client needs to support 55G bandwidth, it is calculated according to the time interval of 16K frames: 64bit*16K/55G=19065.018ns, another FlexE Client needs to support 105G, then it is calculated according to the time interval of 16K frames The time interval is calculated as 64bit*16K/105G=9986.438ns, using the same main frequency/frequency division pulse signal, that is, it is necessary to find the least common divisor of the time interval between the two, and then this method can be used to configure different timing counters to achieve the use of one purpose of the timer. And, with the bandwidth granularity of 5G, it is very likely that the least common divisor of the time interval of 16K frames of all bandwidths needs to reach the level of 1ns or less than 1ns, and even if the main frequency of the chip can meet the pulse granularity of 1ns, but in 1ns Within the time, the chip cannot complete the operations that need to be done after the timer reaches the threshold, such as sending the FlexE OAM code block. Therefore, this plan is not feasible.
有鉴于此,本申请实施例提供了一种码块传输方法,该方法在充分考虑芯片资源节约和可行性的同时,能够保证码块传输的时间精度,达到码块传输标准需要的时间间隔需求。该方法可以由码块传输装置执行,该装置可以采用软件和/或硬件的方式实现,并可部署在支持FlexE OAM的交换芯片中,该芯片可以是特定用途集成电路(ApplicationSpecific Integrated Circuit,简称为ASIC)芯片,或现场可编程门阵列(FieldProgrammable Gata Array,简称为FPGA)芯片,或NP等,可以根据实际情况进行相应的调整。In view of this, the embodiment of the present application provides a code block transmission method, which can ensure the time accuracy of code block transmission and meet the time interval requirements required by the code block transmission standard while fully considering chip resource saving and feasibility. . The method can be executed by a code block transmission device, which can be implemented in the form of software and/or hardware, and can be deployed in a switch chip supporting FlexE OAM, and the chip can be an Application Specific Integrated Circuit (Application Specific Integrated Circuit, referred to as ASIC) chip, or Field Programmable Gate Array (Field Programmable Gata Array, FPGA for short) chip, or NP, etc., can be adjusted accordingly according to the actual situation.
参见图2所示,本申请实施例提供一种码块传输方法,该方法可以包括:Referring to Figure 2, an embodiment of the present application provides a code block transmission method, which may include:
S11、根据时钟脉冲的周期、客户端的带宽以及不同带宽客户端传输码块的码块间隔,确定计数器对时钟脉冲进行计数的计数阈值;其中,不同带宽客户端对应的计数器不同。S11. Determine the counting threshold for the counter to count the clock pulses according to the period of the clock pulse, the bandwidth of the client, and the code block interval of the code block transmitted by the client with different bandwidths; wherein, the counters corresponding to different bandwidth clients are different.
其中,时钟脉冲可以是交换芯片产生的主频分频出的一个时间脉冲信号,每产生一个时钟脉冲,启动的计数器的计数均会增加一。这里,时钟脉冲的周期可以根据实际需要设定,优先地,时钟脉冲的周期设置为32ns。这里,启动的计数器可以为需要与当前设备之间进行码块传输带的客户端对应的计数器。Wherein, the clock pulse may be a time pulse signal obtained by frequency-dividing the main frequency generated by the switch chip, and each time a clock pulse is generated, the count of the activated counter will increase by one. Here, the period of the clock pulse can be set according to actual needs, preferably, the period of the clock pulse is set to 32 ns. Here, the activated counter may be a counter corresponding to a client that needs to perform code block transmission between current devices.
其中,客户端可以是灵活以太网客户端FlexE Client,并在其所属带宽下,按照OAM标准要求的码块间隔发送或接收OAM码块,这里,客户端有多个,多个客户端的带宽可以部分相同,也可以均不相同。Among them, the client can be a flexible Ethernet client FlexE Client, and under its own bandwidth, according to the code block interval required by the OAM standard to send or receive OAM code blocks, here, there are multiple clients, and the bandwidth of multiple clients can be Some of them may be the same, or they may all be different.
其中,码块间隔可以是码块传输标准要求的指定数量的数据帧。例如,传输码块的码块间隔为16k数据帧时,即表示每间隔16k数据帧传输一个码块,其中,数据帧采用66bit/64bit编码,每个帧实际有效数据为8Byte。Wherein, the code block interval may be a specified number of data frames required by the code block transmission standard. For example, when the code block interval of the transmission code block is 16k data frames, it means that a code block is transmitted every 16k data frames, in which the data frame adopts 66bit/64bit encoding, and the actual effective data of each frame is 8Byte.
其中用于对时钟脉冲进行计数的计数器为计数寄存器,用于记录计数器对时钟脉冲的计数阈值为配置寄存器,更为具体地,计数寄存器的第一计数字段用于记录当前对时钟脉冲的计数值,配置寄存器的第一配置字段用于记录对时钟脉冲的计数阈值。The counter used to count the clock pulses is a count register, which is used to record the counting threshold of the counter to the clock pulse as a configuration register. More specifically, the first count field of the count register is used to record the current count value of the clock pulse , the first configuration field of the configuration register is used to record the counting threshold of clock pulses.
可以理解的是,在相同的码块间隔下,不同带宽客户端对应的计数器对时钟脉冲进行计数的计数阈值不同。It can be understood that, under the same code block interval, counters corresponding to different bandwidth clients have different counting thresholds for counting clock pulses.
S12、在第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器对应的计数标志位置为预设值;其中,n的取值小于或等于N,N为客户端的个数。S12. When the counting value of the nth counter reaches the counting threshold of the nth counter, set the counting flag position corresponding to the nth counter in the register as a preset value; wherein, the value of n is less than or equal to N, N is the number of clients.
其中,当第n个客户端对应的第n个计数器的计数值达到第n个计数器的计数阈值时,第n个计数器的计数值清零,并触发寄存器内的与第n个计数器对应的计数标志位置为预设值。其中,计数器在寄存器内对应的计数标志位,采用不同的值表示该计数器的计数值是否达到计数阈值。Among them, when the counting value of the nth counter corresponding to the nth client reaches the counting threshold of the nth counter, the counting value of the nth counter is cleared, and the counting corresponding to the nth counter in the register is triggered The logo position is the default value. Wherein, the corresponding counting flag bit of the counter in the register adopts different values to indicate whether the counting value of the counter reaches the counting threshold.
在具体实施时,寄存器可以采用位图数据结构中的二进制位作为与计数器对应的计数标志位。这里,位图数据结构是指采用比特位图(bitmap)类型的字段的数据结构,字段中的每个比特(bit)代表一个计数器(或者该计数器对应的客户端),每个比特采用0表示计数器的计数值未达到计数阈值、采用1表示计数器的计数值达到计数阈值;或者,采用0表示计数器的计数值达到计数阈值、采用1表示计数器的计数值未达到计数阈值。During specific implementation, the register may use the binary bits in the bitmap data structure as the counting flag bits corresponding to the counter. Here, the bitmap data structure refers to a data structure using a bitmap type field, each bit in the field represents a counter (or the client corresponding to the counter), and each bit is represented by 0 The count value of the counter does not reach the count threshold, and 1 is used to indicate that the count value of the counter reaches the count threshold; or, 0 is used to indicate that the count value of the counter has reached the count threshold, and 1 is used to indicate that the count value of the counter has not reached the count threshold.
当某一个计数器的计数值达到该计数器的计数阈值时,则在寄存器内将代表该计数器的比特置为指示达到计数阈值的预设值。When the counting value of a certain counter reaches the counting threshold of the counter, the bit representing the counter is set in the register to a preset value indicating reaching the counting threshold.
S13、扫描寄存器。S13. Scanning registers.
在一个实施例中,可以反复循环扫描寄存器;In one embodiment, the registers may be scanned repeatedly;
在另一个实施例中,具体地,可以按照定时器的定时周期,对寄存器内的不同计数器对应的计数标志位进行扫描,每扫描到一个计数标志位时,确定该计数标识位的值是否为预设值。In another embodiment, specifically, according to the timing period of the timer, the counting flags corresponding to different counters in the register can be scanned, and when a counting flag is scanned, it is determined whether the value of the counting flag is default value.
S14、当扫描到寄存器内与第m个计数器对应的计数标志位为预设值时,接收第m个计数器对应的客户端发送的码块或者向第m个计数器对应的客户端发送码块,其中,m的取值小于或等于N。S14. When it is scanned that the counting flag corresponding to the mth counter in the register is a preset value, receive the code block sent by the client corresponding to the mth counter or send the code block to the client corresponding to the mth counter, Wherein, the value of m is less than or equal to N.
在一个示例中,码块传输装置位于作为接收端的交换芯片内,当扫描到寄存器内与第m个计数器对应的计数标志位为预设值时,表示:到达了接收第m个计数器对应的客户端发送的码块的时间间隔,此时,码块传输装置接收第m个计数器对应的客户端发送的码块;In one example, the code block transmission device is located in the exchange chip as the receiving end, and when the count flag bit corresponding to the m-th counter in the register is scanned to be a preset value, it means: the client corresponding to the m-th counter has been received The time interval of the code blocks sent by the end, at this time, the code block transmission device receives the code blocks sent by the client corresponding to the mth counter;
在另一个示例中,码块传输装置位于作为发送端的交换芯片内,当扫描到寄存器内与第m个计数器对应的计数标志位为预设值时,表示:到达了向第m个计数器对应的客户端发送码块的时间间隔,此时,码块传输装置向第m个计数器对应的客户端发送码块。In another example, the code block transmission device is located in the switching chip as the sending end, and when the count flag bit corresponding to the m-th counter in the register is scanned to be a preset value, it means: the counter corresponding to the m-th counter has been reached The time interval for the client to send the code block. At this time, the code block transmission device sends the code block to the client corresponding to the mth counter.
本申请实施例在码块传输时,由于计数器对时钟脉冲进行计数的计数阈值,是根据时钟脉冲的周期、客户端的带宽以及不同带宽客户端传输码块的码块间隔确定的,不同带宽客户端对应的计数器不同,这样,与使用多个定时器分别实现不同带宽的客户端达到码块传输标准需要的时间间隔相比较而言,本申请不同带宽客户端对应的计数器共用同一时钟脉冲进行计数,相当于对不同带宽客户端仅使用一个定时器实现脉冲计数,能够极大地节省芯片资源;另外,由于不需要将同一个主频/分频脉冲信号作为不同时间间隔的最小公约数,因此无需受限于脉冲信号的大小,只需确定不同带宽的客户端对应的计数器度对时钟脉冲进行计数的计数阈值,这样更具有可行性;此外,通过在第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器对应的计数标志位置为预设值,扫描寄存器,当扫描到寄存器内与第m个计数器对应的计数标志位为预设值时,接收第m个计数器对应的客户端发送的码块或者向第m个计数器对应的客户端发送码块,其中,m的取值小于或等于N,由此在充分考虑芯片资源节约和可行性的同时,能够保证码块传输的时间精度,达到码块传输标准需要的时间间隔需求。In the embodiment of the present application, when the code block is transmitted, since the counting threshold for the counter to count the clock pulses is determined according to the cycle of the clock pulse, the bandwidth of the client, and the code block interval for different bandwidth clients to transmit code blocks, different bandwidth clients The corresponding counters are different. In this way, compared with the time interval required for clients with different bandwidths to reach the code block transmission standard by using multiple timers, the counters corresponding to clients with different bandwidths in this application share the same clock pulse for counting. It is equivalent to using only one timer to realize pulse counting for different bandwidth clients, which can greatly save chip resources; in addition, since the same main frequency/frequency division pulse signal does not need to be used as the least common divisor of different time intervals, there is no need to be affected by Limited to the size of the pulse signal, it is only necessary to determine the counting threshold of the counters corresponding to the clients of different bandwidths to count the clock pulses, which is more feasible; in addition, through the count value of the nth counter to reach the nth counter When the counting threshold is set, the counting flag position corresponding to the nth counter in the register is set as the preset value, and the register is scanned. When the counting flag bit corresponding to the mth counter in the register is scanned to be the preset value, the mth counter is received The code block sent by the client corresponding to the counter or the code block sent to the client corresponding to the m-th counter, wherein the value of m is less than or equal to N, thus fully considering the resource saving and feasibility of the chip. Ensure the time accuracy of code block transmission and meet the time interval requirements required by code block transmission standards.
在一个实施例中,如图3所示,上述步骤S11中,根据时钟脉冲的周期、客户端的带宽以及不同带宽客户端传输码块的码块间隔,确定计数器对时钟脉冲进行计数的计数阈值,可以包括:In one embodiment, as shown in FIG. 3, in the above step S11, the counting threshold for the counter to count the clock pulses is determined according to the cycle of the clock pulses, the bandwidth of the client, and the code block intervals of the code blocks transmitted by clients with different bandwidths, Can include:
S111、根据第n个客户端的带宽、码块间隔及码块间隔内每一帧包含的比特数,确定传输码块的时间间隔。S111. Determine a time interval for transmitting code blocks according to the bandwidth of the nth client, the code block interval, and the number of bits included in each frame in the code block interval.
其中,客户端的带宽与该客户端传输码块的时间间隔呈负相关。Wherein, the bandwidth of the client is negatively correlated with the time interval at which the client transmits code blocks.
具体地,确定码块间隔与码块包含的比特数的乘积,将乘积与第n个客户端的带宽之间的商作为第n个客户端传输码块的时间间隔。Specifically, the product of the code block interval and the number of bits contained in the code block is determined, and the quotient between the product and the bandwidth of the nth client is taken as the time interval for the nth client to transmit the code block.
例如,以码块为BAS码块为例,假设第n个客户端的带宽为55G,传输BAS码块的码块间隔为16K个帧,每一帧包含的比特数为64bit,则第n个客户传输码块的时间间隔计算为:64bit*16K/55G=19065.018ns。For example, taking the code block as a BAS code block as an example, assuming that the bandwidth of the nth client is 55G, the code block interval for transmitting BAS code blocks is 16K frames, and the number of bits contained in each frame is 64 bits, then the nth client The time interval for transmitting code blocks is calculated as: 64bit*16K/55G=19065.018ns.
S112、确定时间间隔与时钟脉冲的周期之间的商。S112. Determine the quotient between the time interval and the period of the clock pulse.
这里,时间间隔与时钟脉冲的周期之间的商,可以理解为时钟脉冲在该时间间隔内的脉冲数,脉冲数可以为非整数值。Here, the quotient between the time interval and the period of the clock pulse can be understood as the number of pulses of the clock pulse within the time interval, and the number of pulses can be a non-integer value.
S113、将商的整数部分确定为第n个计数器的计数阈值。S113. Determine the integer part of the quotient as the counting threshold of the nth counter.
具体地,第n个计数器的配置寄存器保存有第一配置字段和第二配置字段。第一配置字段用于配置第n个计数器的计数阈值,即第n个客户端传输码块的时间间隔与时钟脉冲的周期之间的商的整数部分;第二配置字段用于配置第n个计数器的小数计数部分的配置值。Specifically, the configuration register of the nth counter stores a first configuration field and a second configuration field. The first configuration field is used to configure the counting threshold of the nth counter, that is, the integer part of the quotient between the time interval of the nth client transmitting the code block and the period of the clock pulse; the second configuration field is used to configure the nth counter The configuration value for the fractional count portion of the counter.
在一个实施例中,如图4所示,基于图3,方法还可以包括:In one embodiment, as shown in Figure 4, based on Figure 3, the method may further include:
S114、当商存在小数部分时,记录商的小数部分。S114. When the quotient has a decimal part, record the decimal part of the quotient.
具体地,针对第n个客户端传输码块的时间间隔,可以将该时间间隔与时钟脉冲的周期之间的商的小数部分作为第n个计数器的小数计数部分的配置值,配置到配置寄存器内的第二配置字段中。Specifically, for the time interval for the nth client to transmit the code block, the fractional part of the quotient between the time interval and the period of the clock pulse can be used as the configuration value of the fractional count part of the nth counter and configured in the configuration register in the second configuration field within the .
示例性地,假设第n个客户端的带宽为55G,码块以16K数据帧为码块间隔进行传输,其传输时间间隔为19065.018ns,对于脉冲周期为32ns的时间脉冲,则需要的脉冲数为:19065.018/32=595.782,为达到更精确的时间间隔,除了在配置寄存器内的第一配置字段中,将脉冲数的整数部分595作为第n个计数器的计数阈值的配置值之外,还可以在配置寄存器内的第二配置字段中,将脉冲数的小数部分0.782作为第n个计数器的小数计数部分的配置值。Exemplarily, assuming that the bandwidth of the nth client is 55G, the code block is transmitted at a code block interval of 16K data frames, and its transmission time interval is 19065.018ns. For a time pulse with a pulse period of 32ns, the required number of pulses is : 19065.018/32=595.782, in order to achieve a more precise time interval, in addition to using the integer part 595 of the pulse number as the configuration value of the counting threshold of the nth counter in the first configuration field in the configuration register, you can also In the second configuration field in the configuration register, the fractional part of the pulse number 0.782 is used as the configuration value of the fractional counting part of the nth counter.
S115、当小数部分与s的乘积大于或等于1时,确定第n个计数器本次计数的最大值为计数阈值加1,其中,s为第n个计数器连续从0计数到计数阈值的本次计数的计数轮次。S115. When the product of the fractional part and s is greater than or equal to 1, determine that the maximum value of the current count of the nth counter is the counting threshold plus 1, where s is the current count of the nth counter continuously counting from 0 to the counting threshold The counting rounds to count.
具体地,当小数部分与s的乘积大于或等于1时,将该乘积的值记录到第n个计数器内的计数寄存器的第二计数字段中,第n个计数器内的计数寄存器的第一计数字段用于记录第n个计数器当前对时钟脉冲的计数值。Specifically, when the product of the fractional part and s is greater than or equal to 1, the value of the product is recorded in the second counting field of the counting register in the nth counter, and the first counting of the counting register in the nth counter The field is used to record the current counting value of the clock pulse by the nth counter.
本实施例中,通过对第n个计数器连续从0计数到计数阈值的本次计数的计数轮次,与时钟脉冲在第n个客户端传输码块的时间间隔内的脉冲数的小数部分进行乘积运算,并在乘积运算结果大于或等于1时,确定第n计数器本次计数的最大值为计数阈值加1,由此不但能够使得小数部分的计数处理在多个脉冲周期中进行近似平均化,而且有利于进一步提高码块传输的时间精度。In this embodiment, by counting the counting rounds of the nth counter continuously from 0 to the counting threshold, and counting the fractional part of the number of clock pulses in the time interval of the nth client transmitting the code block Product operation, and when the result of the product operation is greater than or equal to 1, determine the maximum value of the current count of the nth counter as the count threshold plus 1, which not only enables the counting process of the fractional part to be approximately averaged in multiple pulse periods , and it is beneficial to further improve the time precision of code block transmission.
在一个实施例中,码块包括:第一类码块和第二类码块,其中,第二类码块的码块间隔为第一类码块的码块间隔的P倍,P为大于或等于2的正整数;第n个计数器的计数阈值为:根据第一类码块的码块间隔确定的。In one embodiment, the code blocks include: a first type of code block and a second type of code block, wherein the interval between the code blocks of the second type of code block is P times the interval between the code blocks of the first type of code block, and P is greater than or a positive integer equal to 2; the counting threshold of the nth counter is determined according to the code block interval of the first type of code block.
这里,为了便于描述,可以将第一类码块的码块间隔记为第一码块间隔,将第二类码块的码块间隔记为第二码块间隔。这里,第一码块间隔可以是16k数据帧,第二码块间隔可以是32k数据帧、64K数据帧、128K数据帧、256K数据帧或者512K数据帧,但本申请实施例并不限于此。Here, for the convenience of description, the code block interval of the first type of code blocks may be recorded as the first code block interval, and the code block interval of the second type of code blocks may be recorded as the second code block interval. Here, the first code block interval may be 16k data frames, and the second code block interval may be 32k data frames, 64K data frames, 128K data frames, 256K data frames or 512K data frames, but this embodiment of the application is not limited thereto.
第一码块间隔可为对应客户端支持的最小码块间隔,第二码块间隔为最小码块间隔的P倍。The first code block interval may be the minimum code block interval supported by the corresponding client, and the second code block interval may be P times the minimum code block interval.
其中,根据第一类码块的码块间隔确定第n个计数器的计数阈值,包括:Wherein, the counting threshold of the nth counter is determined according to the code block interval of the first type of code block, including:
根据时钟脉冲的周期、第n个客户端的带宽以及第一类码块的码块间隔,确定第n个计数器对时钟脉冲进行计数的计数阈值。According to the period of the clock pulse, the bandwidth of the nth client, and the code block interval of the first type of code block, determine the counting threshold for the nth counter to count the clock pulses.
具体地,该步骤实现过程可以参照上述实施例中的步骤S111至步骤S113,此处不再赘述。Specifically, for the implementation process of this step, reference may be made to step S111 to step S113 in the above embodiment, which will not be repeated here.
上述步骤S12中,在第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器对应的计数标志位置为预设值,可以包括步骤S121和步骤S122中的至少一个:In the above step S12, when the count value of the n counter reaches the count threshold of the n counter, the count flag position corresponding to the n counter in the register is set as a preset value, which may include steps S121 and S122. at least one:
S121、每当第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器的第一类码块对应的计数标志位置为预设值。S121. Whenever the counting value of the nth counter reaches the counting threshold of the nth counter, set the counting flag position in the register corresponding to the first type code block of the nth counter as a preset value.
本实施例中,由于第n个计数器的计数阈值是根据第一类码块的码块间隔确定的,当第n个计数器的计数值达到第n个计数器的计数阈值时,表明第n个计数器对应的第n个客户端达到了传输第一类码块的码块间隔,通过对寄存器内与第n个计数器的第一类码块对应的计数标志位置为预设值,这样,扫描寄存器的过程中,将会扫描到寄存器内与第n个计数器的第一类码块对应的计数标志位置为预设值,以接收第n个客户端发送的第一类码块或者向第n个客户端发送第一类码块,从而实现不同带宽客户端能够按照码块传输标准进行传输第一类码块,且能够保证码块传输的时间精度。In this embodiment, since the counting threshold of the nth counter is determined according to the code block interval of the first type of code block, when the counting value of the nth counter reaches the counting threshold of the nth counter, it indicates that the nth counter The corresponding nth client has reached the code block interval for transmitting the first type of code block, by setting the count flag position corresponding to the first type of code block of the nth counter in the register as a preset value, so that the scan register During the process, it will be scanned that the counting mark position corresponding to the first type of code block of the nth counter in the register is the preset value, so as to receive the first type of code block sent by the nth client or send a message to the nth client The terminal sends the first type of code block, so that clients with different bandwidths can transmit the first type of code block according to the code block transmission standard, and the time accuracy of the code block transmission can be guaranteed.
S122、在第n个计数器的计数值连续P次达到第n个计数器的计数阈值时,将寄存器内与第n个计数器的第二类码块对应的计数标志位置为预设值。S122. When the counting value of the nth counter reaches the counting threshold of the nth counter for P consecutive times, set the counting flag position in the register corresponding to the second type code block of the nth counter as a preset value.
本实施例中,由于第二类码块的码块间隔为第一类码块的码块间隔的P倍,同时由于第n个计数器的计数阈值是根据第一类码块的码块间隔确定的,那么在第n个计数器的计数值连续P次达到第n个计数器的计数阈值时,表明第n个计数器对应的第n个客户端达到了传输第二类码块的码块间隔,通过对寄存器内与第n个计数器的第二类码块对应的计数标志位置为预设值,这样,扫描寄存器的过程中,将会扫描到寄存器内与第n个计数器的第二类码块对应的计数标志位置为预设值,以接收第n个客户端发送的第二类码块或者向第n个客户端发送第二类码块,从而实现不同带宽客户端能够按照码块传输标准进行传输第二类码块,且能够保证码块传输的时间精度。在一个实施例中,码块还包括第三类码块,其中,第n个客户端传输第三类码块的时间间隔为第n个客户端传输第一类码块的时间间隔的q倍,时间间隔的间隔单位与码块间隔的间隔单位不同,q为大于或等于2的正整数。In this embodiment, because the code block interval of the second type of code block is P times of the code block interval of the first type of code block, and because the counting threshold of the nth counter is determined according to the code block interval of the first type of code block , then when the counting value of the nth counter reaches the counting threshold of the nth counter for P consecutive times, it indicates that the nth client corresponding to the nth counter has reached the code block interval for transmitting the second type of code block, through The counting flag position corresponding to the second type code block of the nth counter in the register is a preset value, so that in the process of scanning the register, it will be scanned to correspond to the second type code block of the nth counter in the register The position of the counting flag is a preset value to receive the second type of code block sent by the nth client or send the second type of code block to the nth client, so that clients with different bandwidths can perform code block transmission according to the code block transmission standard The code block of the second type is transmitted, and the time accuracy of the code block transmission can be guaranteed. In one embodiment, the code block further includes a third type of code block, wherein the time interval for the nth client to transmit the third type of code block is q times the time interval for the nth client to transmit the first type of code block , the interval unit of the time interval is different from that of the code block interval, and q is a positive integer greater than or equal to 2.
这里,时间间隔可以以秒级时间为间隔单位,码块间隔是以数据帧数量为间隔单位。作为示例,第三类码块可以是按照秒级时间或分钟级时间进行传输的CV码块,第一类码块可以是以16k数据帧为码块间隔进行传输的BAS码块、APS码块等,但本申请实施例并不限于此。Here, the time interval may be a second-level time as an interval unit, and the code block interval may be a data frame number as an interval unit. As an example, the third type of code block can be a CV code block that is transmitted in seconds or minutes, and the first type of code block can be a BAS code block or an APS code block that is transmitted at a 16k data frame interval. etc., but the embodiment of the present application is not limited thereto.
其中,第n个客户端传输第一类码块的时间间隔,可以采用如下方式确定:Among them, the time interval for the nth client to transmit the first type of code block can be determined in the following manner:
根据第n个客户端的带宽、第n个客户端传输第一类码块的码块间隔及码块间隔内每一帧码块包含的比特数,确定第n个客户端传输第一类码块的时间间隔。According to the bandwidth of the nth client, the code block interval at which the nth client transmits the first type of code block, and the number of bits contained in each frame code block within the code block interval, determine that the nth client transmits the first type of code block time interval.
上述步骤S12中,在第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器对应的计数标志位置为预设值,还可以包括:In the above step S12, when the counting value of the nth counter reaches the counting threshold of the nth counter, setting the counting flag position corresponding to the nth counter in the register as a preset value may also include:
S123、在第n个计数器的计数值连续q次达到第n个计数器的计数阈值时,将寄存器内与第n个计数器的第三类码块对应的计数标志位置为预设值。S123. When the counting value of the nth counter reaches the counting threshold of the nth counter for q consecutive times, set the counting flag position in the register corresponding to the third type code block of the nth counter as a preset value.
本实施例中,由于第n个客户端传输第三类码块的时间间隔为第n个客户端传输第一类码块的时间间隔的q倍,那么在第n个计数器的计数值连续q次达到第n个计数器的计数阈值时,表明第n个客户端达到了传输第三类码块的时间间隔,通过对寄存器内与第n个计数器的第三类码块对应的计数标志位置为预设值,这样,扫描寄存器的过程中,将会扫描到寄存器内与第n个计数器的第三类码块对应的计数标志位置为预设值,以接收第n个客户端发送的第三类码块或者向第n个客户端发送第三类码块,从而实现不同带宽客户端能够按照码块传输标准进行传输第三类码块,且能够保证码块传输的时间精度。In this embodiment, since the time interval for the nth client to transmit the third type of code block is q times the time interval for the nth client to transmit the first type of code block, the count value of the nth counter is continuous for q When the counting threshold of the nth counter is reached for the first time, it indicates that the nth client has reached the time interval for transmitting the third type of code block, and the position of the count flag corresponding to the third type of code block of the nth counter in the register is In this way, in the process of scanning the register, the counting flag position corresponding to the third type code block of the nth counter in the register will be scanned as the preset value, so as to receive the third code block sent by the nth client Class code block or send the third class code block to the nth client, so that clients with different bandwidths can transmit the third class code block according to the code block transmission standard, and the time accuracy of code block transmission can be guaranteed.
在一个实施例中,上述步骤S13中,扫描寄存器,可以包括:In one embodiment, in the above step S13, scanning the register may include:
在定时器的定时周期内扫描寄存器,其中,定时器的定时周期小于或等于时钟脉冲的周期。The register is scanned within a timing period of the timer, wherein the timing period of the timer is less than or equal to the period of the clock pulse.
其中,定时器可以是寄存器所属的定时器,即第二级定时器。Wherein, the timer may be a timer to which the register belongs, that is, a second-level timer.
其中,定时器的定时周期为一个可调整的数值,可以在芯片设计允许范围内进行调整,尽可能地以较小的定时周期进行扫描寄存器,可以理解的是,定时器的定时周期越小,越能提高码块传输时间精度,优选地,将定时器的定时周期设定为8ns。Among them, the timing period of the timer is an adjustable value, which can be adjusted within the allowable range of the chip design, and scan the register with a smaller timing period as much as possible. It can be understood that the smaller the timing period of the timer, The more the code block transmission time accuracy can be improved, preferably, the timing period of the timer is set to 8 ns.
在一个实施例中,方法还可以包括:In one embodiment, the method may also include:
若预设连续次数均未接收到第m个计数器对应的客户端发送的码块,则生成超时告警;其中,预设连续次数为:第m个计数器的计数值连续达到第m个计数器的计数阈值的次数。If the code block sent by the client corresponding to the m-th counter is not received for the preset consecutive times, a timeout alarm will be generated; where the preset consecutive times are: the count value of the m-th counter reaches the count of the m-th counter continuously Threshold times.
其中,预设连续次数可以根据实际应用进行设定,例如设定为3,即:连续3次未接收到第m个计数器对应的客户端发送的码块,生成超时告警。Wherein, the preset number of consecutive times can be set according to the actual application, for example, it is set to 3, that is, the code block sent by the client corresponding to the m-th counter is not received for 3 consecutive times, and a timeout alarm is generated.
需要说明的是,未接收到第m个计数器对应的客户端发送的码块的连续次数低于预设连续次数时,不会生成超时告警。It should be noted that when the number of consecutive code blocks sent by the client corresponding to the m-th counter is not received is lower than the preset consecutive number of times, a timeout alarm will not be generated.
接下来,结合图5a至图5e对本申请实施例提供的码块传输方法进行说明。Next, the code block transmission method provided by the embodiment of the present application will be described with reference to FIG. 5a to FIG. 5e.
以总共支持800G的FlexE Client为例,5G带宽为最小带宽粒度时,最多有800/5(G)=160个FlexE Client,设定芯片主频分频出的时钟脉冲信号的周期为32ns,以16K数据帧作为每个FlexE Client传输码块的码块间隔。Take the FlexE Client that supports 800G in total as an example. When the 5G bandwidth is the minimum bandwidth granularity, there are at most 800/5(G)=160 FlexE Clients. The 16K data frame is used as the code block interval of each FlexE Client transmission code block.
如图5a,在第一级定时器中,对每个FlexE Client分别设置一个计数器,每一计数器内均包括计数寄存器和配置寄存器,计数寄存器为DsFlexEOamTxScanCounter,该计数寄存器保存两个字段:counter和counterFrac,counter用于保存当前的定时器计数的整数部分,counterFrac用于保存当前的定时器计数的小数部分。配置寄存器为DsFlexEOamTxScanCfg,该配置寄存器保存两个字段:countertThrd和counterFracCfg,countertThrd用于配置针对所属FlexE Client 16K数据帧的计数阈值,counterFracCfg用于配置每次脉冲更新的小数部分的配置值。As shown in Figure 5a, in the first-level timer, a counter is set for each FlexE Client, and each counter includes a counting register and a configuration register. The counting register is DsFlexEOamTxScanCounter, and the counting register holds two fields: counter and counterFrac , counter is used to save the integer part of the current timer count, and counterFrac is used to save the fractional part of the current timer count. The configuration register is DsFlexEOamTxScanCfg, which saves two fields: counterThrd and counterFracCfg, counterThrd is used to configure the counting threshold for the
在第二级定时器中,设置触发寄存器为FlexEOamTxScanBitmap,该寄存器保存一个字段,为updateEnBitmap。该字段可以是一个bitmap类型,即其中的每个bit代表一个FlexE Client,当为1时,表示当前FlexE Client的16K帧时间间隔已经达到。In the second-level timer, set the trigger register as FlexEOamTxScanBitmap, which holds a field named updateEnBitmap. This field can be a bitmap type, that is, each bit in it represents a FlexE Client, and when it is 1, it means that the 16K frame time interval of the current FlexE Client has been reached.
图5b为定时计数器寄存器的使用方法伪代码逻辑。考虑到以32ns时间脉冲为固定脉冲,对于不同带宽一般不能达到整除,以55G带宽为例,按前述实施例中的计算,码块以16K数据帧作为码块间隔进行传输的时间间隔为19065.018ns,对于32ns的时间脉冲,则需要19065.018/32=595.782,为达到精确的时间间隔,可配置DsFlexEOamTxScanCfg.countertThrd为595,DsFlexEOamTxScanCfg.counterFracCfg约为0.C8H。按照图5b的伪代码逻辑,可以达到需要的时间间隔。特别地,考虑到专用交换芯片一般不支持小数操作,使用这里的伪代码逻辑,每次达到countertThrd时,小数计数部分做增加操作,当小数部分进位时,则下一次满足条件的阈值需增加1,即DsFlexEOamTxScanCounter.counterFrac[8]为1,从而将小数的计数处理在多个周期中进行近似平均化。Figure 5b is the pseudo code logic of the usage method of the timer counter register. Considering that the 32ns time pulse is used as a fixed pulse, it is generally not divisible for different bandwidths. Taking the 55G bandwidth as an example, according to the calculation in the previous embodiment, the time interval for the code block to be transmitted with 16K data frames as the code block interval is 19065.018ns , for a time pulse of 32ns, 19065.018/32=595.782 is required. To achieve a precise time interval, DsFlexEOamTxScanCfg.countertThrd can be configured as 595, and DsFlexEOamTxScanCfg.counterFracCfg is about 0.C8H. According to the pseudo-code logic in Fig. 5b, the required time interval can be achieved. In particular, considering that special-purpose switching chips generally do not support decimal operations, using the pseudo-code logic here, every time counterThrd is reached, the decimal counting part is incremented, and when the decimal part is carried, the threshold for meeting the condition next time needs to be increased by 1 , that is, DsFlexEOamTxScanCounter.counterFrac[8] is 1, so that the decimal counting process is approximately averaged in multiple cycles.
当第n个计数器的计数值达到第n个计数器的计数阈值时,设置FlexEOamTxScanBitmap.updateEnBitmap中第n个计数器对应的FlexE Client的bit为1,表示第n个计数器对应的FlexE Client已到达16K帧的时间触发条件,可进行第二级定时器定时处理,触发后续操作。When the count value of the nth counter reaches the counting threshold of the nth counter, set the bit of the FlexE Client corresponding to the nth counter in FlexEOamTxScanBitmap.updateEnBitmap to 1, indicating that the FlexE Client corresponding to the nth counter has reached the 16K frame The time trigger condition can be used for timing processing of the second-level timer to trigger subsequent operations.
需要说明的是,DsFlexEOamTxScanCounter,DsFlexEOamTxScanCfg寄存器均需针对每个FlexE Client保存相关counter及配置,以达到不同带宽速率的FlexE Client可以有不同的时间间隔配置。It should be noted that the DsFlexEOamTxScanCounter and DsFlexEOamTxScanCfg registers need to save relevant counters and configurations for each FlexE Client, so that FlexE Clients with different bandwidth rates can have different time interval configurations.
第二级定时器可以采用8ns固定轮询定时器,每8ns处理FlexEOamTxScanBitmap.updateEnBitmap中的一个bit为1对应的FlexE Client的后续处理。这里8ns是一个可调整的数值,在芯片设计允许范围内可做调整,尽可能的以较小的轮询时间进行后续处理。The second-level timer can use an 8ns fixed polling timer to process the subsequent processing of the FlexE Client corresponding to a bit in the FlexEOamTxScanBitmap.updateEnBitmap that is 1 every 8ns. Here 8ns is an adjustable value, which can be adjusted within the allowable range of the chip design, and the follow-up processing should be performed with a smaller polling time as much as possible.
如图5c,基于第一级定时器和第二级定时器的定时处理,当处理逻辑进行到功能处理模块时,即意味着到达了当前FlexE Client对应带宽的16K数据帧的时间间隔。其他码块间隔均可从该16K数据帧的码块间隔进行倍数处理得到。如传输BAS码块需要支持16K/32K/64K/128K/256K/512K的码块间隔。As shown in Figure 5c, based on the timing processing of the first-level timer and the second-level timer, when the processing logic proceeds to the function processing module, it means that the time interval of the 16K data frame corresponding to the bandwidth of the current FlexE Client has been reached. Other code block intervals can be obtained from multiple processing of the code block interval of the 16K data frame. For example, the transmission of BAS code blocks needs to support the code block interval of 16K/32K/64K/128K/256K/512K.
进一步地,可以在功能处理模块的BAS Period Counter模块中增加一个计数寄存器,称为BasPeriodCounter,用于配置16K的倍数,例如,当前FlexE Client需要配置为64K帧的码块间隔,则将该计数值配置为4。当BasPeriodCounter不为0时,则不做处理,等待下一轮16K帧的码块间隔触发;当BasPeriodCounter减为0时,触发BAS帧的发送,并设置BasPeriodCounter为初始值4,等待下一轮16K帧的码块间隔触发。Further, a counting register can be added in the BAS Period Counter module of the function processing module, called BasPeriodCounter, which is used to configure multiples of 16K. For example, if the current FlexE Client needs to be configured as a code block interval of 64K frames, the count value The configuration is 4. When BasPeriodCounter is not 0, do not process, wait for the next round of 16K frame code block interval trigger; when BasPeriodCounter is reduced to 0, trigger the sending of BAS frame, and set BasPeriodCounter to the initial value 4, wait for the next round of 16K Trigger on the code block interval of the frame.
进一步地,其他需要以秒级速率进行发送的帧,则按照之前计算的对应当前FlexEClient带宽的16K帧时间间隔,计算到1秒的倍数值,如以55G带宽为例,对应16K帧的时间间隔是19065.018ns,则1秒的倍数值可配置为52452,在允许一定误差的前提下,可省略小数处理。这里即可配置OneSecPeriodCounter为52452,处理流程与BasPeriodCounter类似,当OneSecPeriodCounter减为0时,表示1秒时间间隔被触发。Furthermore, for other frames that need to be sent at a second-level rate, the previously calculated 16K frame time interval corresponding to the current FlexEClient bandwidth is calculated to a multiple of 1 second. For example, taking 55G bandwidth as an example, the time interval corresponding to 16K frames If it is 19065.018ns, the multiple value of 1 second can be configured as 52452. Under the premise of allowing a certain error, decimal processing can be omitted. Here you can configure OneSecPeriodCounter to 52452. The processing flow is similar to BasPeriodCounter. When OneSecPeriodCounter is reduced to 0, it means that the 1-second time interval is triggered.
再进一步地,针对不同的需要秒级的时间间隔的OAM帧做类似处理,这里以CV码块举例。如CV码块发生速率需设置为1秒,则配置CVPeriodCounter初始值为1,可类推的,若需设置为10秒,则配置CVPeriodCounter初始值为10。1分钟,则设置为60。后续使用类似逻辑,当CVPeriodCounter为0时,则触发发送CV帧,且恢复CVPeriodCounter为初始值。其他秒级的OAM帧使用类似逻辑进行处理。Furthermore, similar processing is performed for different OAM frames that require a second-level time interval, and a CV code block is used as an example here. If the CV code block generation rate needs to be set to 1 second, then configure the initial value of CVPeriodCounter to be 1. By analogy, if it needs to be set to 10 seconds, then configure the initial value of CVPeriodCounter to be 10. For 1 minute, set it to 60. Use similar logic later, when CVPeriodCounter is 0, trigger sending CV frame, and restore CVPeriodCounter to the initial value. Other second-level OAM frames are processed using similar logic.
图5d为本申请实施例提供的定时器触发的BAS超时处理机制的示意图,图5e为接收方向上超时计数更新处理机制的流程图。如图5d所示,以16K帧时间间隔,触发BasExpiredCount减1操作,BasExpiredCount用于配置用于超时告警的预设连续次数,当BasExpiredCount减为0时,认为出现超时,触发告警。同时,如图5e所示,在接收方向上,当接收到BAS时,会更新BasExpiredCount为预配置的预设连续次数,举例,如需要认为连续3个16K帧间隔周期未收到BAS为超时,则配置这个预配置预设连续次数为3。通过定时器定时递减以及接收方向刷新处理,可以实现超时告警机制。FIG. 5d is a schematic diagram of a timer-triggered BAS timeout processing mechanism provided by an embodiment of the present application, and FIG. 5e is a flow chart of a timeout count update processing mechanism in the receiving direction. As shown in Figure 5d, the operation of decrementing BasExpiredCount by 1 is triggered at 16K frame time intervals. BasExpiredCount is used to configure the preset consecutive times for timeout alarms. When BasExpiredCount is reduced to 0, it is considered that there is a timeout and an alarm is triggered. At the same time, as shown in Figure 5e, in the receiving direction, when BAS is received, BasExpiredCount will be updated to the pre-configured preset consecutive times. For example, if it is necessary to consider that BAS has not been received for three consecutive 16K frame interval periods, it is timed out. Then configure this pre-configured default number of consecutive times to be 3. The timeout alarm mechanism can be realized through the timing decrement of the timer and the refresh processing of the receiving direction.
综上,本申请使用两级定时器,且只需要两个定时器,通过两级的定时器级联,在保证FlexE OAM帧的发送时间精度的同时,充分考虑芯片设计的资源节约和可行性,达到标准需要的时间间隔需求。同时,基于两级定时器,可以针对不同的FlexE OAM帧类型的时间间隔处理,使用一套处理流程,可支持标准要求的各种时间间隔,具有较强的扩展性。In summary, this application uses two-level timers, and only two timers are needed. Through the cascading of two-level timers, while ensuring the transmission time accuracy of FlexE OAM frames, the resource saving and feasibility of chip design are fully considered. , the time interval required to meet the standard. At the same time, based on the two-level timer, it can process the time intervals of different FlexE OAM frame types, using a set of processing procedures, which can support various time intervals required by the standard, and has strong scalability.
需要说明的是,本申请虽然是针对FlexE OAM的灵活带宽所带来的基于两级定时器的码块传输方法。但该思想可用于芯片级处理类似的基于两级定时器的码块传输需求中,不仅限于应用在FlexE OAM这一单一场景下。It should be noted that this application is aimed at the code block transmission method based on the two-level timer brought by the flexible bandwidth of the FlexE OAM. However, this idea can be used in the chip-level processing of similar code block transmission requirements based on two-level timers, and is not limited to the single scenario of FlexE OAM.
如图6所示,本申请实施例提供一种码块传输装置,该装置可以包括:As shown in Figure 6, an embodiment of the present application provides a code block transmission device, which may include:
确定模块601,用于根据时钟脉冲的周期、客户端的带宽以及不同带宽客户端传输码块的码块间隔,确定计数器对时钟脉冲进行计数的计数阈值;其中,不同带宽客户端对应的计数器不同;The determining module 601 is used to determine the counting threshold for the counter to count the clock pulses according to the period of the clock pulse, the bandwidth of the client, and the code block interval of the code block transmitted by the client with different bandwidths; wherein, the counters corresponding to different bandwidth clients are different;
设置模块602,用于在第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器对应的计数标志位置为预设值;其中,n的取值小于或等于N,N为客户端的个数;Setting module 602, for when the counting value of the nth counter reaches the counting threshold of the nth counter, the counting flag position corresponding to the nth counter in the register is a preset value; wherein, the value of n is less than or Equal to N, N is the number of clients;
扫描模块603,用于扫描寄存器;A scanning module 603, configured to scan registers;
传输模块604,用于当扫描到寄存器内与第m个计数器对应的计数标志位为预设值时,接收第m个计数器对应的客户端发送的码块或者向第m个计数器对应的客户端发送码块,其中,m的取值小于或等于N。The transmission module 604 is configured to receive the code block sent by the client corresponding to the m-th counter or send the code block to the client corresponding to the m-th counter when the counting flag bit corresponding to the m-th counter in the register is scanned to be a preset value A code block is sent, where the value of m is less than or equal to N.
在一个实施例中,扫描模块具体用于:In one embodiment, the scanning module is specifically used for:
在定时器的定时周期内扫描寄存器,其中,定时器的定时周期小于或等于时钟脉冲的周期。The register is scanned within a timing period of the timer, wherein the timing period of the timer is less than or equal to the period of the clock pulse.
在一个实施例中,确定模块具体用于:In one embodiment, the determination module is specifically used for:
根据第n个客户端的带宽、码块间隔及码块间隔内每一帧包含的比特数,确定传输码块的时间间隔;Determine the time interval for transmitting code blocks according to the bandwidth of the nth client, the code block interval, and the number of bits contained in each frame in the code block interval;
确定时间间隔与时钟脉冲的周期之间的商;Determine the quotient between the time interval and the period of the clock pulse;
将商的整数部分确定为第n个计数器的计数阈值。The integer part of the quotient is determined as the count threshold of the nth counter.
在一个实施例中,确定模块具体还用于:In one embodiment, the determining module is also specifically used for:
当商存在小数部分时,记录商的小数部分;When the quotient has a decimal part, record the decimal part of the quotient;
当小数部分与s的乘积大于或等于1时,确定第n个计数器本次计数的最大值为计数阈值加1,其中,s为第n个计数器连续从0计数到计数阈值的本次计数的计数轮次。When the product of the fractional part and s is greater than or equal to 1, determine that the maximum value of the current count of the nth counter is the count threshold plus 1, where s is the current count of the nth counter that counts continuously from 0 to the count threshold Count rounds.
在一个实施例中,码块包括:第一类码块和第二类码块,其中,第二类码块的码块间隔为第一类码块的码块间隔的P倍,P为大于或等于2的正整数;第n个计数器的计数阈值为:根据第一类码块的码块间隔确定的;In one embodiment, the code blocks include: a first type of code block and a second type of code block, wherein the interval between the code blocks of the second type of code block is P times the interval between the code blocks of the first type of code block, and P is greater than or a positive integer equal to 2; the counting threshold of the nth counter is: determined according to the code block interval of the first type of code block;
设置模块包括:Setup modules include:
第一设置单元,用于每当第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器的第一类码块对应的计数标志位置为预设值;The first setting unit is used for whenever the count value of the nth counter reaches the counting threshold of the nth counter, the counting flag position corresponding to the first type code block of the nth counter in the register is a preset value;
第二设置单元,用于在第n个计数器的计数值连续P次达到第n个计数器的计数阈值时,将寄存器内与第n个计数器的第二类码块对应的计数标志位置为预设值。The second setting unit is used to set the counting flag position corresponding to the second type code block of the nth counter in the register as preset when the counting value of the nth counter reaches the counting threshold of the nth counter for P consecutive times value.
在一个实施例中,码块还包括第三类码块,其中,第n个客户端传输第三类码块的时间间隔为第n个客户端传输第一类码块的时间间隔的q倍,时间间隔的间隔单位与码块间隔的间隔单位不同,q为大于或等于2的正整数;In one embodiment, the code block further includes a third type of code block, wherein the time interval for the nth client to transmit the third type of code block is q times the time interval for the nth client to transmit the first type of code block , the interval unit of the time interval is different from the interval unit of the code block interval, and q is a positive integer greater than or equal to 2;
设置模块还包括:The setup module also includes:
第三设置单元,用于在第n个计数器的计数值连续q次达到第n个计数器的计数阈值时,将寄存器内与第n个计数器的第三类码块对应的计数标志位置为预设值。The third setting unit is used to set the counting flag position corresponding to the third type code block of the nth counter in the register as preset when the counting value of the nth counter reaches the counting threshold of the nth counter for q consecutive times value.
在一个实施例中,装置还包括:In one embodiment, the device also includes:
告警模块,用于若预设连续次数均未接收到第m个计数器对应的客户端发送的码块,则生成超时告警;其中,预设连续次数为:第m个计数器的计数值连续达到第m个计数器的计数阈值的次数。The alarm module is used to generate a timeout alarm if the code block sent by the client corresponding to the m-th counter is not received for the preset consecutive times; wherein, the preset consecutive times are: the count value of the m-th counter reaches the th The number of count thresholds for m counters.
需要说明的是:上述实施例提供的码块传输装置在执行码块传输方法时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的码块传输装置与码块传输方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the code block transmission device provided by the above-mentioned embodiments executes the code block transmission method, the division of the above-mentioned program modules is used as an example for illustration. In practical applications, the above-mentioned processing can be assigned to different programs according to needs. Module completion means that the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the code block transmission device and the code block transmission method embodiment provided by the above embodiment belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment, and will not be repeated here.
本申请实施例还提供一种电子装置,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中:处理器执行计算机程序时实现本申请实施例任一所述的码块传输方法的步骤。An embodiment of the present application also provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein: when the processor executes the computer program, any one of the embodiments described in the present application is implemented. The steps of the code block transmission method.
图7给出了本申请实施例的电子装置的硬件结构示意图,图7所示的电子装置700包括:至少一个处理器701、存储器702、至少一个网络接口703。电子装置700中的各个组件通过总线系统704耦合在一起。可理解,总线系统704用于实现这些组件之间的连接通信。总线系统704除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图7中将各种总线都标为总线系统704。FIG. 7 shows a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. The
可以理解,存储器702可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。It can be understood that the
本申请实施例中的存储器702用于存储各种类型的数据以支持电子装置700的操作。这些数据的示例包括:用于在电子装置700上操作的任何计算机程序,如可执行程序,实现本申请实施例方法的程序可以包含在可执行程序中。The
本申请实施例还提供一种计算机可读存储介质,存储介质上存储有计算机程序,计算机程序被处理器执行时,实现本申请实施例任一所述的码块传输方法中的步骤。The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the code block transmission method described in any one of the embodiments of the present application are implemented.
需要说明的是,本申请实施例的存储介质可以由任何类型的易失性或非易失性存储设备、或者它们的组合来实现。其中,非易失性存储器可以是只读存储器(ROM,Read OnlyMemory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,Ferromagnetic Random Access Memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random AccessMemory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,SynchronousDynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本申请实施例描述的存储介质旨在包括但不限于这些和任意其它适合类型的存储器。It should be noted that the storage medium in the embodiment of the present application may be implemented by any type of volatile or non-volatile storage device, or a combination thereof. Wherein, non-volatile memory can be read-only memory (ROM, Read Only Memory), programmable read-only memory (PROM, Programmable Read-Only Memory), erasable programmable read-only memory (EPROM, Erasable Programmable Read-Only Memory) Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, Ferromagnetic Random Access Memory), Flash Memory (Flash Memory), Magnetic Surface Memory, Optical disc, or compact disc read-only memory (CD-ROM, Compact Disc Read-Only Memory); magnetic surface storage can be magnetic disk storage or magnetic tape storage. The volatile memory may be random access memory (RAM, Random Access Memory), which is used as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM, Static Random Access Memory), Synchronous Static Random Access Memory (SSRAM, Synchronous Static Random Access Memory), Dynamic Random Access Memory Memory (DRAM, Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM, Synchronous Dynamic Random Access Memory), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous Link Dynamic Random Access Memory (SLDRAM, SyncLink Dynamic Random Access Memory), Direct Memory Bus Random Access Memory (DRRAM, Direct Rambus Random Access Memory) . The storage medium described in the embodiments of the present application is intended to include but not limited to these and any other suitable types of storage.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units; Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can be used as a single unit, or two or more units can be integrated into one unit; the above-mentioned integration The unit can be realized in the form of hardware or in the form of hardware plus software functional unit.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the Including the steps of the foregoing method embodiments; and the foregoing storage medium includes: a removable storage device, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, etc. A medium on which program code can be stored.
或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台电子装置(可以是个人计算机、服务器、或者网络设备等)执行本申请各个实施例方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated units of the present application are realized in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for Make an electronic device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the methods in the various embodiments of the present application. The aforementioned storage medium includes: various media capable of storing program codes such as removable storage devices, ROM, RAM, magnetic disks or optical disks.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in several method embodiments provided in this application can be combined arbitrarily to obtain new method embodiments under the condition of no conflict.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in several product embodiments provided in this application can be combined arbitrarily without conflict to obtain new product embodiments.
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above is only the specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application, and should cover Within the protection scope of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims (10)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111113008.5A CN115883689B (en) | 2021-09-23 | 2021-09-23 | Code block transmission method, device and storage medium |
| PCT/CN2022/112712 WO2023045625A1 (en) | 2021-09-23 | 2022-08-16 | Code block transmission method and apparatus, and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111113008.5A CN115883689B (en) | 2021-09-23 | 2021-09-23 | Code block transmission method, device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115883689A true CN115883689A (en) | 2023-03-31 |
| CN115883689B CN115883689B (en) | 2025-02-07 |
Family
ID=85720027
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111113008.5A Active CN115883689B (en) | 2021-09-23 | 2021-09-23 | Code block transmission method, device and storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115883689B (en) |
| WO (1) | WO2023045625A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9876865B1 (en) * | 2016-09-21 | 2018-01-23 | Ciena Corporation | Efficient prioritized restoration of services in a control plane-based optical network |
| CN109314673A (en) * | 2017-04-24 | 2019-02-05 | 华为技术有限公司 | A kind of customer service transmission method and device |
| CN109391461A (en) * | 2017-08-11 | 2019-02-26 | 华为技术有限公司 | The method and apparatus of transparent transmission service frequency |
| WO2019085809A1 (en) * | 2017-10-31 | 2019-05-09 | 华为技术有限公司 | Method, relevant device and system for acquiring a target transmission path |
| CN112787917A (en) * | 2019-11-11 | 2021-05-11 | 中兴通讯股份有限公司 | Protection method, end node, protection group network and storage medium for flexible Ethernet |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10193688B2 (en) * | 2015-12-11 | 2019-01-29 | Ciena Corporation | Flexible Ethernet encryption systems and methods |
| CN108347317B (en) * | 2017-01-22 | 2020-11-10 | 华为技术有限公司 | A service transmission method, network device and network system |
| CN111727589B (en) * | 2017-12-22 | 2022-05-27 | 瑞典爱立信有限公司 | Method and apparatus for configuring a Flex Ethernet node |
| CN110224775B (en) * | 2018-03-01 | 2021-10-29 | 中兴通讯股份有限公司 | Method, device and equipment for determining time information |
| CN112866138A (en) * | 2019-11-26 | 2021-05-28 | 华为技术有限公司 | Resource allocation method, device and equipment |
| CN113141620B (en) * | 2020-01-20 | 2022-04-15 | 烽火通信科技股份有限公司 | Flexe service processing method and device |
-
2021
- 2021-09-23 CN CN202111113008.5A patent/CN115883689B/en active Active
-
2022
- 2022-08-16 WO PCT/CN2022/112712 patent/WO2023045625A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9876865B1 (en) * | 2016-09-21 | 2018-01-23 | Ciena Corporation | Efficient prioritized restoration of services in a control plane-based optical network |
| CN109314673A (en) * | 2017-04-24 | 2019-02-05 | 华为技术有限公司 | A kind of customer service transmission method and device |
| CN109391461A (en) * | 2017-08-11 | 2019-02-26 | 华为技术有限公司 | The method and apparatus of transparent transmission service frequency |
| WO2019085809A1 (en) * | 2017-10-31 | 2019-05-09 | 华为技术有限公司 | Method, relevant device and system for acquiring a target transmission path |
| CN112787917A (en) * | 2019-11-11 | 2021-05-11 | 中兴通讯股份有限公司 | Protection method, end node, protection group network and storage medium for flexible Ethernet |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2023045625A1 (en) | 2023-03-30 |
| CN115883689B (en) | 2025-02-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107391271B (en) | Message queue system-based delayed task triggering method and device | |
| EP3675398B1 (en) | Check code processing method, electronic device, and storage medium | |
| US20160006526A1 (en) | Systems and methods of network clock comparison | |
| US20180288503A1 (en) | Profiles for collecting telemetry data | |
| JP2018536226A (en) | Data transmission method and apparatus | |
| HUT67196A (en) | Communication apparatus and method for transferring data from a source to one (or) more receivers | |
| CN112954045B (en) | Data transmission method, device, medium and electronic equipment in node | |
| US5995570A (en) | Recovering a clock signal in a multimedia network using time stamps | |
| CN108924195A (en) | A kind of unidirectional heartbeat mechanism implementation method, device, equipment and system | |
| US20170272190A1 (en) | Time synchronization method and apparatus for network devices and time synchronization server | |
| CN119325698A (en) | Allocating messages using guaranteed or synchronized delivery times | |
| CN110505157B (en) | Classification scheduling method and device adaptive to time-triggered network | |
| CN115883689A (en) | Code block transmission method, device and storage medium | |
| US12052666B2 (en) | Signal processing method and apparatus, and device with time-domain position for monitoring power-saving signal | |
| CN109167736B (en) | High-uniformity data packet sending method and device | |
| CN115396059B (en) | A time synchronization method and device | |
| CN112073987A (en) | State monitoring method, device, equipment and storage medium | |
| JP2001144753A (en) | Packet exchanging device, clock signal controller for packet exchanging device and method for controlling clock signal | |
| WO2017122324A1 (en) | Wireless communication system, termination device, node device, wireless communication method and wireless communication program | |
| CN116192769B (en) | Network data transmission method and device | |
| EP3874481A1 (en) | Performance-guaranteed channel access control for security alarm and image sensors | |
| CN105072366B (en) | A kind of generation method and device of video data table | |
| US12063287B1 (en) | Methods, systems, and computer readable media for determining an internal time of a time-sensitive networking (TSN) network card | |
| WO2016082425A1 (en) | Memory detecting method and network processor | |
| CN114868354B (en) | Time synchronization method and equipment |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |