WO2023045625A1 - Code block transmission method and apparatus, and storage medium - Google Patents

Code block transmission method and apparatus, and storage medium Download PDF

Info

Publication number
WO2023045625A1
WO2023045625A1 PCT/CN2022/112712 CN2022112712W WO2023045625A1 WO 2023045625 A1 WO2023045625 A1 WO 2023045625A1 CN 2022112712 W CN2022112712 W CN 2022112712W WO 2023045625 A1 WO2023045625 A1 WO 2023045625A1
Authority
WO
WIPO (PCT)
Prior art keywords
code block
counter
nth
client
counting
Prior art date
Application number
PCT/CN2022/112712
Other languages
French (fr)
Chinese (zh)
Inventor
单哲
龚源泉
龚海东
Original Assignee
苏州盛科通信股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州盛科通信股份有限公司 filed Critical 苏州盛科通信股份有限公司
Publication of WO2023045625A1 publication Critical patent/WO2023045625A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/28Timers or timing mechanisms used in protocols

Definitions

  • the present application relates to the technical field of network communication, and in particular to a code block transmission method, device and storage medium.
  • Flexible Ethernet (FlexEthernet, referred to as FlexE) technology is based on Ethernet (Ethernet) technology, developed to meet the needs of high-speed transmission, flexible bandwidth configuration and other requirements.
  • the code block interval is different .
  • the code block interval requirement for transmitting BAS code blocks is 16K frames, or 32K, 64K, 128K, 256K, 512K frames under the bandwidth of the FlexE Client (Flexible Ethernet client) to which it belongs.
  • the interval between sending and receiving (K is 1024), and other types of OAM frames are also sent and received based on this interval unit, or with a time unit of 1 second.
  • the bandwidth of each FlexE Client may be different, even if the code block is transmitted at the same code block interval, the FlexE Client transmission with different bandwidth
  • the time interval of the code blocks is 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.
  • Embodiments of the present application provide a code block transmission method, device, and storage medium.
  • a code block transmission method comprising:
  • 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;
  • 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;
  • the counting flag corresponding to the mth counter in the register is the preset value
  • the corresponding client sends the code block, where the value of m is less than or equal to N.
  • 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.
  • 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:
  • An integer part of the quotient is determined as a count threshold of the nth counter.
  • the method also includes:
  • 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;
  • the counting threshold of the nth counter is: determined according to the code block interval of the first type of code block;
  • 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.
  • 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;
  • setting the counting flag position corresponding to the nth counter in the register as a preset value also includes:
  • 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.
  • the method also includes:
  • 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.
  • a code block transmission device comprising:
  • the determination module is configured 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 client with different bandwidths to transmit code blocks; wherein, the client with different bandwidths The counters corresponding to the terminals are different;
  • the setting module is configured 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, The value of n is less than or equal to N, where N is the number of clients;
  • a scanning module configured to scan the register
  • the transmission module is configured to receive the code block sent by the client corresponding to the mth counter or send the code block to the The client corresponding to the mth counter sends the code block, where the value of m is less than or equal to N.
  • an electronic device 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.
  • 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.
  • 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.
  • 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
  • Figure 1a is a schematic flow diagram of a design scheme using multiple timers
  • Figure 1b is a schematic flow diagram of a design scheme using a timer
  • FIG. 2 is a schematic flowchart of a code block transmission method provided in an embodiment of the present application
  • FIG. 3 is another schematic flowchart of a code block transmission method provided in an embodiment of the present application.
  • FIG. 4 is another schematic flowchart of a code block transmission method provided by an embodiment of the present application.
  • 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.
  • Figure 5b is the pseudo-code logic of the method of using the timer counter register provided by the embodiment of the present application:
  • 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
  • Figure 5d is a flow chart of the timer-triggered BAS overtime processing mechanism provided by the embodiment of the present application.
  • 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.
  • FIG. 6 is a schematic structural diagram of a code block transmission device provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the time intervals for different types of OAM code blocks are different.
  • 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/512K block (data frame), the data frame adopts 66bit/64bit (binary digit, bit, the smallest unit of measurement information), that is, the actual effective data of each frame is 8Byte (byte).
  • APS code block the code block used for protection switching
  • three APS code blocks need to be sent consecutively with the same code block interval as the BAS code block.
  • 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.
  • Flexible Ethernet defines the bandwidth of its FlexE Client with 5G as the minimum unit, which can be combined, and the maximum capability 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 It is different. For example, if 16K frames are used as the block interval for transmitting BAS code blocks, the time interval for transmitting BAS code blocks between FlexE Client with 25G bandwidth and FlexE Client with 50G bandwidth is different.
  • 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.
  • the main frequency of the chip is 500MHz (Mega Hertz, frequency unit, megahertz)
  • a 1ms millisecond, millisecond timer
  • Add 1 operation when the counter reaches 500M/1000/1, that is, 500000, it means that it reaches 1ms, and a certain operation will be performed at this time.
  • 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.
  • Figure 1b is a schematic flow diagram 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.
  • 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, the device can be implemented in the form of software and/or hardware, and can be deployed in a switching chip supporting FlexE OAM, 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, referred to as FPGA) chip, or NP (Network Processor, network processor), etc., can be adjusted according to the actual situation.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • NP Network Processor, network processor
  • an embodiment of the present application provides a code block transmission method, which may include:
  • 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.
  • 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.
  • the activated counter may be a counter corresponding to the client that needs to perform code block transmission between the current devices.
  • the client can be a flexible Ethernet client FlexE Client, and under its own bandwidth, send or receive OAM code blocks according to the code block interval required by the OAM standard.
  • the bandwidth of multiple clients can be Some of them may be the same, or they may all be different.
  • 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 that is set to count clock pulses is a count register
  • the count threshold that is set to record counters to clock pulses is a configuration register. More specifically, the first count field of the count register is used to record the current count of clock pulses. Counting value, the first configuration field of the configuration register is used to record the counting threshold of clock pulses.
  • 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.
  • 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.
  • the register may use the binary bits in the bitmap data structure as the counting flag bits corresponding to the counter.
  • 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.
  • the bit representing the counter is set in the register to a preset value indicating reaching the counting threshold.
  • the registers may be scanned repeatedly
  • 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.
  • 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;
  • 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.
  • 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.
  • the mth counter is received
  • 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 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.
  • the bandwidth of the client is negatively correlated with the time interval at which the client transmits code blocks.
  • 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.
  • 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 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.
  • 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.
  • the method may further include:
  • 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 .
  • the code block is transmitted at a code block interval of 16K data frames, and its transmission time interval is 19065.018ns.
  • 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.
  • 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.
  • the code block interval of the first type of code blocks may be recorded as the first code block interval
  • the code block interval of the second type of code blocks may be recorded as the second code block interval
  • the first code block interval may be 16K data frames
  • 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.
  • 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.
  • the counting threshold of the nth counter is determined according to the code block interval of the first type of code block, including:
  • 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.
  • step S111 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.
  • 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:
  • 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.
  • 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
  • the counting threshold of the nth counter is determined according to the code block interval of the first type of code block
  • 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
  • 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.
  • the time interval may be a second-level time as an interval unit
  • the code block interval may be a data frame number as an interval unit.
  • the third type of code block can be a CV code block that is transmitted in seconds or minutes
  • 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.
  • the time interval for the nth client to transmit the first type of code block can be determined in the following manner:
  • the code block interval at which the nth client transmits the first type of code block determines that the nth client transmits the first type of code block time interval.
  • the count flag position corresponding to the n counter in the register is a preset value, and may also include:
  • the count value of the nth counter is continuous for q
  • the counting threshold of the nth counter it indicates that the nth client has reached the time interval for transmitting the third type of code block
  • 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 type of code block to the nth client, so that clients with different bandwidths can transmit the third type of code block according to the code block transmission standard, and the time accuracy of code block transmission can be guaranteed.
  • 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.
  • the timer may be a timer to which the register belongs, that is, a second-level timer.
  • 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.
  • the method may also include:
  • 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.
  • the preset consecutive times can be set according to the actual application, for example, it is set to 3, that is, if the code block sent by the client corresponding to the m-th counter is not received for 3 consecutive times, a timeout alarm is generated.
  • the 16K data frame is used as the code block interval of each FlexE Client transmission code block.
  • 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 FlexE Client 16K data frame, and counterFracCfg is used to configure the configuration value of the fractional part of each pulse update.
  • the trigger register is set as FlexEOamTxScanBitmap, and this register holds a field, which is updateEnBitmap (data update bitmap).
  • 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.
  • Figure 5b is the pseudo code logic of the usage method of the timer counter register.
  • the time interval for the code block to be transmitted with 16K data frames as the code block interval is 19065.018ns
  • DsFlexEOamTxScanCfg.countertThrd can be configured as 595
  • DsFlexEOamTxScanCfg.counterFracCfg is about 0.C8H.
  • the required time interval can be achieved.
  • 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.
  • the time trigger condition can be used for timing processing of the second-level timer to trigger subsequent operations.
  • 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.
  • the second-level timer can use an 8ns fixed polling timer to process the follow-up processing of the FlexE Client corresponding to a bit in FlexEOamTxScanBitmap.updateEnBitmap that is 1 every 8ns.
  • 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.
  • BasPeriodCounter can be added to the BAS Period Counter (basic code block overtime counter) module of the function processing module, which is used to configure multiples of 16K.
  • BasPeriodCounter basic code block overtime counter
  • the current FlexE Client needs to be configured as a code of 64K frames. block interval, configure the count value to 4.
  • BasPeriodCounter 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.
  • the previously calculated 16K frame time interval corresponding to the current FlexE Client bandwidth is calculated to a multiple of 1 second.
  • the time interval is 19065.018ns, then the multiple value of 1 second can be configured as 52452, and the decimal processing can be omitted under the premise of allowing a certain error.
  • the processing flow is similar to BasPeriodCounter. When OneSecPeriodCounter decreases to 0, it means that the 1-second time interval is triggered.
  • CV code block generation rate needs to be set to 1 second, then configure the initial value of CVPeriodCounter (connectivity verification code block period count) to 1, and by analogy, if it needs to be set to 10 seconds, then configure the initial value of CVPeriodCounter to 10. 1 minute , set it to 60.
  • CVPeriodCounter connectivity verification code block period count
  • CVPeriodCounter connectivity verification code block period count
  • FIG. 5d is a schematic diagram of a timer-triggered BAS timeout processing mechanism provided by an embodiment of the present application
  • FIG. 5e is a flow chart of a timeout count update processing mechanism in the receiving direction.
  • BasExpiredCount basic code block timeout counter
  • BasExpiredCount is used to configure the preset consecutive times for timeout alarms. When BasExpiredCount is reduced to 0, it is considered that a timeout occurs. Trigger an alert.
  • BasExpiredCount will be updated to the pre-configured preset consecutive times.
  • this application uses two-level timers, and only two timers are needed.
  • By cascading the two-level timers, while ensuring the transmission time accuracy of the FlexE OAM (Flexible Ethernet Operation, Management and Maintenance) frame Fully consider the resource saving and feasibility of chip design, and meet the time interval requirements required by the standard.
  • a set of processing procedures can be used for the time interval processing of different FlexE OAM frame types, which can support various time intervals required by the standard and has strong scalability.
  • an embodiment of the present application provides a code block transmission device, which may include:
  • the determination module 601 is configured 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 blocks transmitted by the clients of different bandwidths; wherein, the counters corresponding to different bandwidth clients are different ;
  • the setting module 602 is configured to set the counting 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, the value of n is less than Or equal to N, where N is the number of clients;
  • the scanning module 603 is configured as a scanning register
  • 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.
  • the terminal sends a code block, where the value of m is less than or equal to N.
  • the scanning module is specifically configured to:
  • 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.
  • the determining module is specifically configured to:
  • the integer part of the quotient is determined as the count threshold of the nth counter.
  • the determining module is further configured to:
  • 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:
  • the first setting unit is configured to set the counting flag position corresponding to the first type code block of the nth counter in the register as a preset value whenever the counting value of the nth counter reaches the counting threshold of the nth counter ;
  • the second setting unit is set to when the counting value of the nth counter reaches the counting threshold value of the nth counter for P consecutive times, the counting flag position corresponding to the second type code block of the nth counter in the register is set as a preset set value.
  • 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:
  • the setup module also includes:
  • the third setting unit is set to when the counting 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 as a preset set value.
  • the device also includes:
  • the alarm module is set 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 continuously reaches The number of count thresholds for the mth counter.
  • the code block transmission device 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.
  • 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 are described in the present application.
  • FIG. 7 shows a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
  • the electronic device 700 shown in FIG. 7 includes: at least one processor 701 , a memory 702 , and at least one network interface 703 .
  • Various components in the electronic device 700 are coupled together through a bus system 704 .
  • the bus system 704 is configured to implement connection communication between these components.
  • the bus system 704 also includes a power bus, a control bus and a status signal bus.
  • the various buses are labeled as bus system 704 in FIG. 7 .
  • the memory 702 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories.
  • the memory 702 in the embodiment of the present application is configured to store various types of data to support the operation of the electronic device 700 .
  • Examples of these data include: any computer program for operating on the electronic device 700, such as an executable program, and the program for implementing the method in the embodiment of the present application may be included in the executable program.
  • 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.
  • 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.
  • the 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) Only 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 , CD, or CD-ROM (Compact Disc Read-Only Memory); magnetic surface storage can be disk storage or tape storage.
  • the volatile memory may be random access memory (RAM, Random Access Memory), which is used as an external cache.
  • RAM random access memory
  • RAM Random Access Memory
  • 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 ).
  • SRAM Static Random Access Memory
  • SSRAM Synchronous Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • SDRAM Synchronous Dynamic Random Access Memory
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of units is only a logical function division.
  • 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.
  • 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.
  • 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.
  • 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.

Landscapes

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

Abstract

The present application discloses a code block transmission method and apparatus, and a storage medium. The code block transmission method comprises: determining a counting threshold of a counter that counts clock pulses according to the period of the clock pulses, the bandwidth of a client and the intervals of code blocks transmitted by clients having different bandwidths, where the clients having different bandwidths correspond to different counters; when the counting value of the n-th counter reaches the counting threshold of the n-th counter, a counting flag corresponding to the n-th counter in a register is set to a preset value, where the value of n is less than or equal to N, and N is the number of clients; scanning the register; and when the scanned counting flag corresponding to the m-th counter in the register has the preset value, receiving the code block sent by the client corresponding to the m-th counter or sending the code block to the client corresponding to the m-th counter, where the value of m is less than or equal to N. The present application can conserve chip resources and is feasible, and meets the time interval required by a code block transmission standard.

Description

码块传输方法、装置和存储介质Code block transmission method, device and storage medium
本申请要求于2021年09月23日提交中国专利局、申请号为202111113008.5、发明名称“码块传输方法、装置和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111113008.5 and the title of the invention "code block transmission method, device and storage medium" submitted to the China Patent Office on September 23, 2021, the entire contents of which are incorporated by reference in this application middle.
技术领域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(以太网)技术基础上,为满足高速传送、带宽配置灵活等需求而发展的技术。Flexible Ethernet (FlexEthernet, referred to as FlexE) technology is based on Ethernet (Ethernet) technology, developed to meet the needs of high-speed transmission, flexible bandwidth configuration and other requirements.
在灵活以太网中,根据OAM(Operation,Administration and Maintenance,操作、管理和维护)的相关标准要求,按照灵活以太网OAM的相关标准要求,针对不同类型的OAM码块,码块间隔是不同的。例如,传输BAS码块(Basic基础码块)的码块间隔要求是在所属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, for different types of OAM code blocks, the code block interval is different . For example, the code block interval requirement for transmitting BAS code blocks (Basic basic code blocks) is 16K frames, or 32K, 64K, 128K, 256K, 512K frames under the bandwidth of the FlexE Client (Flexible Ethernet client) to which it belongs. The interval between sending and receiving (K is 1024), and other types of OAM frames are also sent and received based on this interval unit, or with a time unit of 1 second.
由于可支持带宽的5G(Giga bps(bit per second),速率单位)粒度的灵活性,每个FlexE Client的带宽都可能不同,即便是按照同一码块间隔传输码块,不同带宽的FlexE Client传输码块的时间间隔也是不同的。如果使用多个定时器分别实现不同带宽的客户端达到码块传输标准需要的时间间隔,则会导致芯片资源浪费,如果使用一个定时器实现不同带宽的客户端达到码块传输标准需要的时间间隔,则可能很难实现。Due to the flexibility of 5G (Giga bps (bit per second), rate unit) granularity that can support bandwidth, the bandwidth of each FlexE Client may be different, even if the code block is transmitted at the same code block interval, the FlexE Client transmission with different bandwidth The time interval of the code blocks is 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:
确定模块,被设置为根据时钟脉冲的周期、客户端的带宽以及不同带宽所述客户端传输码块的码块间隔,确定计数器对所述时钟脉冲进行计数的计数阈值;其中,不同带宽所述客户端对应的计数器不同;The determination module is configured 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 client with different bandwidths to transmit code blocks; wherein, the client with different bandwidths The counters corresponding to the terminals are different;
设置模块,被设置为在第n个所述计数器的计数值达到第n个所述计数器的计数阈值时,将寄存器内与第n个所述计数器对应的计数标志位置为预设值;其中,n的取值小于或等于N,所述N为所述客户端的个数;The setting module is configured 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, The value of n 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 mth counter or send the code block to the The client corresponding to the mth counter 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为本申请实施例提供的定时计数器寄存器的使用方法伪代码逻辑:Figure 5b is the pseudo-code logic of the method of using 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/512K block(数据帧),数据帧采用66bit/64bit(binary digit,比特,量度信息的最小单位)编码,即每个帧实际有效数据为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/512K block (data frame), the data frame adopts 66bit/64bit (binary digit, bit, the smallest unit of measurement information), that is, the actual effective data of each frame is 8Byte (byte). 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 consecutively with 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带宽的灵活性,灵活以太网定义了其FlexE Client的带宽以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 FlexE Client with 5G as the minimum unit, which can be combined, and the maximum capability 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 It is different. For example, if 16K frames are used as the block interval for transmitting BAS code blocks, the time interval for transmitting BAS code blocks between FlexE Client with 25G bandwidth and FlexE Client with 50G bandwidth is different.
一般定时器的实现方法为:按照芯片的主频做分频配置,以主频为最小单位,更新计数器,通过配置计数器到达的门限值来触发某个操作流程,从而实现定时的功能。举例来说,假设芯片主频为500MHz(Mega Hertz,频率单位,兆赫兹),若要配置出1ms(millisecond,毫秒)的定时器,则需要设计一个计数器,每次主频刷新时,计数器进行加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 500MHz (Mega Hertz, frequency unit, megahertz), if you want to configure a 1ms (millisecond, millisecond) timer, you need to design a counter. Add 1 operation, when the counter reaches 500M/1000/1, that is, 500000, it means that it reaches 1ms, and a certain operation will be performed at this time.
面对可支持带宽的5G粒度的灵活性以及OAM相关标准要求,为实现不同带宽FlexE Client的码块传输,从设计角度一般可以有两种方案。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 FlexE Client 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为使用一个定时器的设计方案的流程示意图,使用一个定时器,所有不同带宽的时间单位都从这个定时器上产生, 在一个定时器上,通过配置不同的定时计数器的累加寄存器及不同的阈值,达到不同时间间隔的功能。但由于FlexE Client带宽的多样性,如某个FlexE Client需支持55G带宽,则按16K帧的时间间隔计算为:64bit*16K/55G=19065.018ns(nanosecond,纳秒),另一个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 diagram 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 FlexE Client 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 (nanosecond, nanosecond), another FlexE Client needs to support 105G, it is calculated according to the time interval of 16K frames 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 before using this method to configure different The timing counter to achieve the purpose of using a 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 specified time, the chip cannot complete the operations that need to be done after the timer reaches the threshold, such as sending FlexE OAM code blocks. Therefore, this plan is not feasible.
有鉴于此,本申请实施例提供了一种码块传输方法,该方法在充分考虑芯片资源节约和可行性的同时,能够保证码块传输的时间精度,达到码块传输标准需要的时间间隔需求。该方法可以由码块传输装置执行,该装置可以采用软件和/或硬件的方式实现,并可部署在支持FlexE OAM的交换芯片中,该芯片可以是特定用途集成电路(Application Specific Integrated Circuit,简称为ASIC)芯片,或现场可编程门阵列(Field Programmable Gata Array,简称为FPGA)芯片,或NP(Network Processor,网络处理器)等,可以根据实际情况进行相应的调整。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, the device can be implemented in the form of software and/or hardware, and can be deployed in a switching chip supporting FlexE OAM, 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, referred to as FPGA) chip, or NP (Network Processor, network processor), etc., can be adjusted 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 the client that needs to perform code block transmission between the current devices.
其中,客户端可以是灵活以太网客户端FlexE Client,并在其所属带宽下,按照OAM标准要求的码块间隔发送或接收OAM码块,这里,客户端有多个,多个客户端的带宽可以部分相同,也可以均不相同。Wherein, the client can be a flexible Ethernet client FlexE Client, and under its own bandwidth, send or receive OAM code blocks according to the code block interval required by the OAM standard. 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 that is set to count clock pulses is a count register, and the count threshold that is set to record counters to clock pulses is a configuration register. More specifically, the first count field of the count register is used to record the current count of clock pulses. Counting value, 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 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 a preset value, and 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 type of code block to the nth client, so that clients with different bandwidths can transmit the third type of 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 consecutive times can be set according to the actual application, for example, it is set to 3, that is, if the code block sent by the client corresponding to the m-th counter is not received for 3 consecutive times, 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 FlexE Client 16K data frame, and counterFracCfg is used to configure the configuration value of the fractional part of each pulse update.
在第二级定时器中,设置触发寄存器为FlexEOamTxScanBitmap,该寄存器保存一个字段,为updateEnBitmap(数据更新比特位图)。该字段可以是一个bitmap类型,即其中的每个bit代表一个FlexE Client,当为1时,表示当前FlexE Client的16K帧时间间隔已经达到。In the second-level timer, the trigger register is set as FlexEOamTxScanBitmap, and this register holds a field, which is updateEnBitmap (data update bitmap). 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 follow-up processing of the FlexE Client corresponding to a bit in 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帧的码 块间隔触发。Optionally, a counting register, called BasPeriodCounter, can be added to the BAS Period Counter (basic code block overtime counter) module of the function processing module, which is used to configure multiples of 16K. For example, the current FlexE Client needs to be configured as a code of 64K frames. block interval, configure the count value to 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.
可选地,其他需要以秒级速率进行发送的帧,则按照之前计算的对应当前FlexE Client带宽的16K帧时间间隔,计算到1秒的倍数值,如以55G带宽为例,对应16K帧的时间间隔是19065.018ns,则1秒的倍数值可配置为52452,在允许一定误差的前提下,可省略小数处理。这里即可配置OneSecPeriodCounter(1秒周期计数值)为52452,处理流程与BasPeriodCounter类似,当OneSecPeriodCounter减为0时,表示1秒时间间隔被触发。Optionally, for other frames that need to be sent at a second-level rate, the previously calculated 16K frame time interval corresponding to the current FlexE Client bandwidth is calculated to a multiple of 1 second. For example, taking the 55G bandwidth as an example, the corresponding 16K frame time interval The time interval is 19065.018ns, then the multiple value of 1 second can be configured as 52452, and the decimal processing can be omitted under the premise of allowing a certain error. Here you can configure OneSecPeriodCounter (1-second period count value) to 52452. The processing flow is similar to BasPeriodCounter. When OneSecPeriodCounter decreases 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帧使用类似逻辑进行处理。Optionally, similar processing is performed for different OAM frames that require second-level time intervals, 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 (connectivity verification code block period count) to 1, and by analogy, if it needs to be set to 10 seconds, then configure the initial value of CVPeriodCounter to 10. 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 BasExpiredCount (basic code block timeout counter) minus 1 operation is triggered at a time interval of 16K frames. BasExpiredCount is used to configure the preset consecutive times for timeout alarms. When BasExpiredCount is reduced to 0, it is considered that a timeout occurs. Trigger an alert. 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. Through the timing decrement of the timer and the refresh processing of the receiving direction, the timeout alarm mechanism can be realized.
综上,本申请使用两级定时器,且只需要两个定时器,通过两级的定时器级联,在保证FlexE OAM(灵活以太网操作、管理和维护)帧的发送时间精度的同时,充分考虑芯片设计的资源节约和可行性,达到标准需要的时间间隔需求。同时,基于两级定时器,可以针对不同的FlexE OAM 帧类型的时间间隔处理,使用一套处理流程,可支持标准要求的各种时间间隔,具有较强的扩展性。In summary, this application uses two-level timers, and only two timers are needed. By cascading the two-level timers, while ensuring the transmission time accuracy of the FlexE OAM (Flexible Ethernet Operation, Management and Maintenance) frame, Fully consider the resource saving and feasibility of chip design, and meet the time interval requirements required by the standard. At the same time, based on the two-level timer, a set of processing procedures can be used for the time interval processing of different FlexE OAM frame types, which can support various time intervals required by the standard and has strong scalability.
需要说明的是,本申请虽然是针对FlexE OAM的灵活带宽所带来的基于两级定时器的码块传输方法。但该思想可用于芯片级处理类似的基于两级定时器的码块传输需求中,不仅限于应用在FlexE OAM这一单一场景下。It should be noted that although this application is aimed at the code block transmission method based on the two-level timer brought by the flexible bandwidth of 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 determination module 601 is configured 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 blocks transmitted by the clients of different bandwidths; wherein, the counters corresponding to different bandwidth clients are different ;
设置模块602,被设置为在第n个计数器的计数值达到第n个计数器的计数阈值时,将寄存器内与第n个计数器对应的计数标志位置为预设值;其中,n的取值小于或等于N,N为客户端的个数;The setting module 602 is configured to set the counting 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, the value of n is less than Or equal to N, where N is the number of clients;
扫描模块603,被设置为扫描寄存器;The scanning module 603 is configured as a scanning register;
传输模块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. The terminal sends a code block, where the value of m is less than or equal to N.
在一个实施例中,扫描模块具体被设置为:In one embodiment, the scanning module is specifically configured to:
在定时器的定时周期内扫描寄存器,其中,定时器的定时周期小于或等于时钟脉冲的周期。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 determining module is specifically configured to:
根据第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 further configured to:
当商存在小数部分时,记录商的小数部分;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 configured to set the counting flag position corresponding to the first type code block of the nth counter in the register as a preset value whenever the counting value of the nth counter reaches the counting threshold of the nth counter ;
第二设置单元,被设置为在第n个计数器的计数值连续P次达到第n个计数器的计数阈值时,将寄存器内与第n个计数器的第二类码块对应的计数标志位置为预设值。The second setting unit is set to when the counting value of the nth counter reaches the counting threshold value of the nth counter for P consecutive times, the counting flag position corresponding to the second type code block of the nth counter in the register is set as a preset set 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 that 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 set to when the counting 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 as a preset set value.
在一个实施例中,装置还包括:In one embodiment, the device also includes:
告警模块,被设置为若预设连续次数均未接收到第m个计数器对应的 客户端发送的码块,则生成超时告警;其中,预设连续次数为:第m个计数器的计数值连续达到第m个计数器的计数阈值的次数。The alarm module is set 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 continuously reaches The number of count thresholds for the mth counter.
需要说明的是:上述实施例提供的码块传输装置在执行码块传输方法时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将装置的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的码块传输装置与码块传输方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。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 electronic device 700 shown in FIG. 7 includes: at least one processor 701 , a memory 702 , and at least one network interface 703 . Various components in the electronic device 700 are coupled together through a bus system 704 . It can be appreciated that the bus system 704 is configured to implement connection communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus and a status signal bus. However, for clarity of illustration, the various buses are labeled as bus system 704 in FIG. 7 .
可以理解,存储器702可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。It can be understood that the memory 702 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories.
本申请实施例中的存储器702被设置为存储各种类型的数据以支持电子装置700的操作。这些数据的示例包括:用于在电子装置700上操作的任何计算机程序,如可执行程序,实现本申请实施例方法的程序可以包含在可执行程序中。The memory 702 in the embodiment of the present application is configured to store various types of data to support the operation of the electronic device 700 . Examples of these data include: any computer program for operating on the electronic device 700, such as an executable program, and the program for implementing the method in the embodiment of the present application may be included in the executable program.
本申请实施例还提供一种计算机可读存储介质,存储介质上存储有计算机程序,计算机程序被处理器执行时,实现本申请实施例任一所述的码块传输方法中的步骤。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 Only Memory)、可编程只读存储器(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 Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic 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. Among them, the 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) Only 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 , CD, or CD-ROM (Compact Disc Read-Only Memory); magnetic surface storage can be disk storage or 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)

  1. 一种码块传输方法,所述方法包括:A code block transmission method, 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.
  2. 根据权利要求1所述的方法,其中,所述扫描所述寄存器,包括:The method according to claim 1, wherein said scanning said register comprises:
    在定时器的定时周期内扫描所述寄存器,其中,所述定时器的定时周期小于或等于所述时钟脉冲的周期。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.
  3. 根据权利要求1所述的方法,其中,所述根据时钟脉冲的周期、客户端的带宽以及不同带宽所述客户端传输码块的码块间隔,确定计数器对所述时钟脉冲进行计数的计数阈值,包括:The method according to claim 1, wherein, 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, determine the counting threshold for the counter to count the clock pulses, include:
    根据第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.
  4. 根据权利要求3所述的方法,其中,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    当所述商存在小数部分时,记录所述商的小数部分;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.
  5. 根据权利要求1至4任一所述的方法,其中,The method according to any one of claims 1 to 4, wherein,
    所述码块包括:第一类码块和第二类码块,其中,所述第二类码块的码块间隔为所述第一类码块的码块间隔的P倍,所述P为大于或等于2的正整数;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 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.
  6. 根据权利要求5所述的方法,其中,所述码块还包括第三类码块,其中,第n个所述客户端传输所述第三类码块的时间间隔为第n个所述客户端传输所述第一类码块的时间间隔的q倍,所述时间间隔的间隔单位与所述码块间隔的间隔单位不同,所述q为大于或等于2的正整数;The method according to claim 5, wherein 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 the nth client The terminal transmits q times the time interval of 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 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 count flag position corresponding to the nth counter in the register as a preset value, further comprising:
    在第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.
  7. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    若预设连续次数均未接收到第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.
  8. 一种码块传输装置,所述装置包括:A code block transmission device, the device comprising:
    确定模块,被设置为根据时钟脉冲的周期、客户端的带宽以及不同带宽所述客户端传输码块的码块间隔,确定计数器对所述时钟脉冲进行计数的计数阈值;其中,不同带宽所述客户端对应的计数器不同;The determination module is configured 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 client with different bandwidths to transmit code blocks; wherein, the client with different bandwidths The counters corresponding to the terminals are different;
    设置模块,被设置为在第n个所述计数器的计数值达到第n个所述计数器的计数阈值时,将寄存器内与第n个所述计数器对应的计数标志位置为预设值;其中,n的取值小于或等于N,所述N为所述客户端的个数;The setting module is configured 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, The value of n 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 mth counter or send the code block to the The client corresponding to the mth counter sends the code block, where the value of m is less than or equal to N.
  9. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至7任一项中所述的码块传输方法。An electronic device, comprising 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 block described in any one of claims 1 to 7 transfer method.
  10. 一种计算机可读存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至7任一项中所述的码块传输方法。A computer-readable storage medium, wherein 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 claims 1 to 7 when running.
PCT/CN2022/112712 2021-09-23 2022-08-16 Code block transmission method and apparatus, and storage medium WO2023045625A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111113008.5 2021-09-23
CN202111113008.5A CN115883689A (en) 2021-09-23 2021-09-23 Code block transmission method, device and storage medium

Publications (1)

Publication Number Publication Date
WO2023045625A1 true WO2023045625A1 (en) 2023-03-30

Family

ID=85720027

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/112712 WO2023045625A1 (en) 2021-09-23 2022-08-16 Code block transmission method and apparatus, and storage medium

Country Status (2)

Country Link
CN (1) CN115883689A (en)
WO (1) WO2023045625A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170171163A1 (en) * 2015-12-11 2017-06-15 Ciena Corporation Flexible ethernet encryption systems and methods
US20190342022A1 (en) * 2017-01-22 2019-11-07 Huawei Technologies Co., Ltd. Service transmission method, network device, and network system
US20200412469A1 (en) * 2018-03-01 2020-12-31 Zte Corporation Method, device and apparatus for determining time information
US20210091871A1 (en) * 2017-12-22 2021-03-25 Telefonaktiebolaget Lm Ericsson (Publ) Methods and Apparatus for Configuring a Flex Ethernet Node
CN112866138A (en) * 2019-11-26 2021-05-28 华为技术有限公司 Resource allocation method, device and equipment
CN113141620A (en) * 2020-01-20 2021-07-20 烽火通信科技股份有限公司 Flexe service processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170171163A1 (en) * 2015-12-11 2017-06-15 Ciena Corporation Flexible ethernet encryption systems and methods
US20190342022A1 (en) * 2017-01-22 2019-11-07 Huawei Technologies Co., Ltd. Service transmission method, network device, and network system
US20210091871A1 (en) * 2017-12-22 2021-03-25 Telefonaktiebolaget Lm Ericsson (Publ) Methods and Apparatus for Configuring a Flex Ethernet Node
US20200412469A1 (en) * 2018-03-01 2020-12-31 Zte Corporation Method, device and apparatus for determining time information
CN112866138A (en) * 2019-11-26 2021-05-28 华为技术有限公司 Resource allocation method, device and equipment
CN113141620A (en) * 2020-01-20 2021-07-20 烽火通信科技股份有限公司 Flexe service processing method and device

Also Published As

Publication number Publication date
CN115883689A (en) 2023-03-31

Similar Documents

Publication Publication Date Title
US6173340B1 (en) Server controller for storing and retrieving sequences of video screens forwarded by a server host computer
US11050501B2 (en) Performing PHY-level hardware timestamping and time synchronization in cost-sensitive environments
CN105340221A (en) Methods, apparatuses, and systems for retrieving data from a wireless local area network (WLAN) access point
US20160006526A1 (en) Systems and methods of network clock comparison
EP3386152B1 (en) Method, device and system for realizing heartbeat mechanism
EP3675398B1 (en) Check code processing method, electronic device, and storage medium
US5995570A (en) Recovering a clock signal in a multimedia network using time stamps
HUT67196A (en) Communication apparatus and method for transferring data from a source to one (or) more receivers
WO2015184890A1 (en) Packet loss measurement method and apparatus
US20040228284A1 (en) System and method for measuring data network quality
CN108924195A (en) A kind of unidirectional heartbeat mechanism implementation method, device, equipment and system
WO2023045574A1 (en) Consensus in consortium blockchain
WO2023045625A1 (en) Code block transmission method and apparatus, and storage medium
CN112448926B (en) Processing method and system for in-band operation, management and maintenance (IOAM)
US8804770B2 (en) Communications system and related method for reducing continuity check message (CCM) bursts in connectivity fault management (CFM) maintenance association (MA)
JP5051583B2 (en) System and method for synchronizing a data processing network
CN103490995B (en) File transmitting method and device
US20220255789A1 (en) Method and apparatus for subscribing to event streams
CN112134639B (en) OAM message sending method, device, computer medium and electronic equipment
EP4044033A1 (en) Method and apparatus for acquiring data
WO2020147717A1 (en) Method for configuring monitoring event, and communication device, and communication system
JP2001144753A (en) Packet exchanging device, clock signal controller for packet exchanging device and method for controlling clock signal
CN112929191B (en) Service monitoring method, system, related equipment and device
CN101257459A (en) Data packet processing method and device
WO2020091949A1 (en) Performance-guaranteed channel access control for security alarm and image sensors

Legal Events

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

Ref document number: 22871683

Country of ref document: EP

Kind code of ref document: A1