A kind of timestamp generation system and method based on token
Technical field
The present invention relates to Ethernet communication technology fields, and in particular to a kind of timestamp generation system and side based on token
Method.
Background technique
Requirement of the network equipment to time synchronization performance at present is higher and higher, using 1588v2 agreement as the time synchronization of representative
Scheme is all widely applied in many scenes, and the accuracy of generation time stamp directly determines the synchronousness of equipment
Energy.Way generally used now is the function of PTP data packet addition time stamp to be placed on hardware view to do, and be placed on distance as far as possible
Serial closer position interface (SerDes) of unstringing, so that " the timestamp reference point " that reduces in PTP data packet is passing through serially
The total delay passed through when " reference planes " and " timestamp record point " in interface of unstringing, improves time stamp accuracy.Although can be with
It is close, but can not infinite approach, therefore the problem of certainly exist compensation delay, and how effectively to calculate and compensate this section and prolong
When, become the key for improving timestamp precision.
Shown in FIG. 1 is a kind of basic structure of the network equipment (Dev001) processing timestamp, it is unstringed by serial mode
The basic units such as module (SerDes), physical layer coding module (Pcs) and timestamp processing module (Tpu) composition, specifically again can
It sends (Tx is sent to by timestamp processing module and is serially unstringed module) and reception to be divided into (Rx, timestamp processing module connects
Receive the data for module transmission of serially unstringing) two paths: where T1 and T2 respectively represents in PTP message " timestamp reference point "
The actual time of (Timestamp Point) input and output SerDes pin (namely " reference planes " Reference Plane);
" timestamp reference point " can be the SOP (the first bit of data packet first byte) in PTP data packet, and it is (leading to be also possible to SOF
First bit after code), it can also be other reference positions;T1 ' and T2 ' respectively represents " timestamp on the direction Rx and Tx
Reference point " passes through the precise time recorded when timestamp processing module by local high precision clock (Chronometer);Rx_
Latency and Tx_Latency respectively represents " timestamp reference point " input, exports the delay passed through to timestamp processing module;
Rx_Timestamp and Tx_Timestamp respectively represents the timestamp that the direction Rx and the direction Tx ultimately generate, and has following relationship:
The direction Tx: Tx_Timestamp=T2 '+Tx_Latency ≈ T2
The direction Rx: Rx_Timestamp=T1 '-Rx_Latency ≈ T1
" timestamp reference point " input, output to the delay that timestamp processing module is passed through mainly include three kinds of situations:
1) path delay
It is shown in Fig. 2 be one kind after the comprehensive direction Tx and the direction Rx serially unstring module and timestamp processing module it
Between path delay calculate structure, wherein Latency correspond to Fig. 1 in Rx_Latency and Tx_Latency, its practical packet
Include constant time lag and Variable delay two parts.For example, FIFO buffer structure bring delay fluctuation and Gearbox (gearbox) etc.
Bring delay fluctuation, they belong to Variable delay part.FIFO (First Input First Output) is a kind of advanced
The data buffer first gone out, the data being introduced into first are read from FIFO buffer, do not have exterior read-write address compared with RAM
Line, use is fairly simple, but can only be sequentially written in data, the reading data of sequence, cannot can be by as normal memory
Address wire determines to read or be written some specified address.
2) timestamp reference point locations are delayed
Shown in Fig. 3 is a kind of typical multiplexing structure that can bring Variable delay, and the channel of M physical layer coding module is multiple
Use N number of channel of module of serially unstringing, the value of M and N equal may may not also wait, and specific multiplexing relationship is with the mould that serially unstrings
Block operating mode is related.Since the position of " timestamp reference point " in the channel for serially unstringing module is uncertain, so
Variable multiplexing can be brought to be delayed.
Therefore, a kind of can accurately compensate by the data transmission between serial interface string module and timestamp processing module is needed
The delay in path generates the technical solution of " timestamp reference point " input, the High Precision Time Stamps for exporting serial interface string module.
Summary of the invention
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of, and the timestamp based on token generates
System and method can accurately compensate prolonging by the data transfer path between serial interface string module and timestamp processing module
When, improve timestamp precision.
To achieve the above objectives, the technical solution adopted by the present invention is that: a kind of timestamp based on token generates system, should
System includes serially unstring module, physical layer coding module and timestamp processing module, and module of serially unstringing and timestamp are handled
Module is communicated by physical layer coding module:
The module of serially unstringing is used for: will have been sent real-time in the form of the first token with received bit flow amount
Feed back to timestamp processing module;
The timestamp processing module is used for: in the form of the second token Real-time Feedback timestamp processing module sent and
Received bit flow amount calculates serially unstring module and timestamp processing mould according to the difference of the first token and the second token
The bit flow amount of delay between block;The interface rate for module of according to the bit flow amount of delay and serially unstringing calculates string
The delay for the data transfer path that row unstrings between module and timestamp processing module.
Based on the above technical solution, according to the difference of the first token and the second token calculate serially unstring module with
The detailed process of the bit flow amount of delay between timestamp processing module includes:
Create a token bucket;
Timestamp processing module serially unstring module send data when, timestamp processing module is filled out into the token bucket
The second token is filled, the first token is taken out from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is to the token bucket
The first token of middle filling, and the second token is taken out from the token bucket;
The delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module
Bit flow amount.
Based on the above technical solution, the timestamp processing module further includes smothing filtering submodule, is used for
Control the token uniform amount filled every time into the token bucket;Control the token quantity by taking out in the token bucket every time
Uniformly.
Based on the above technical solution, the timestamp processing module detects that the timestamp in PTP message refers to
When point, also according to the interface rate of module of serially unstringing, the position of the timestamp reference point detected, timestamp reference is calculated
The offset of point.
Based on the above technical solution, the data transmission serially unstringed between module and timestamp processing module
The calculation formula of the delay in path are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be the time
Stamp processing module receives the direction that module of serially unstringing sends data;Latency is serially unstring module and timestamp processing mould
Delay between block, Level are the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing,
Offset is the offset of timestamp reference point.
The timestamp generation method based on token that the invention also discloses a kind of, comprising the following steps:
Serially unstring module will send with received bit flow amount in the form of the first token Real-time Feedback to when
Between stab processing module;
Timestamp processing module Real-time Feedback timestamp processing module in the form of the second token sent with it is received
Bit flow amount is calculated according to the difference of the first token and the second token and is serially unstringed between module and timestamp processing module
The bit flow amount of delay;
Unstring according to the bit flow amount of the delay and serially interface rate of module of timestamp processing module calculates serially
The delay of data transfer path between module of unstringing and timestamp processing module.
Based on the above technical solution, according to the difference of the first token and the second token calculate serially unstring module with
The detailed process of the bit flow amount of delay between timestamp processing module includes:
Create a token bucket;
Timestamp processing module serially unstring module send data when, timestamp processing module is filled out into the token bucket
The second token is filled, the first token is taken out from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is to the token bucket
The first token of middle filling, and the second token is taken out from the token bucket;
The delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module
Bit flow amount.
Based on the above technical solution, the token that the timestamp processing module is filled into the token bucket every time
Uniform amount;Token uniform amount by being taken out in the token bucket every time.
Based on the above technical solution, the timestamp processing module detects that the timestamp in PTP message refers to
When point, also according to the interface rate of module of serially unstringing, the position of the timestamp reference point detected, timestamp reference is calculated
The offset of point.
Based on the above technical solution, the data transmission serially unstringed between module and timestamp processing module
The calculation formula of the delay in path are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be the time
Stamp processing module receives the direction that module of serially unstringing sends data;Latency is serially unstring module and timestamp processing mould
Delay between block, Level are the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing,
Offset is the offset of timestamp reference point.
Compared with the prior art, the advantages of the present invention are as follows:
Module of serially unstringing in the present invention is by the serial bit stream data amount sent and received in the form of the first token
Real-time Feedback is to timestamp processing module, timestamp processing module Real-time Feedback timestamp processing module in the form of the second token
Sent with received bit flow amount, calculated according to the difference of the first token and the second token and serially unstringed module and time
Stab the bit flow amount of the delay between processing module;The interface rate for module of according to the bit flow amount of delay and serially unstringing
Calculate the delay of the data transfer path serially to unstring between module and timestamp processing module.This programme is accurately compensated by going here and there
Row connects the delay of the data transfer path between string module and timestamp processing module, to improve timestamp precision.
The present invention calculates the time according to the interface rate for module of serially unstringing, the position of the timestamp reference point detected
The offset for stabbing reference point effectively overcomes uncertain bring in the position due to " timestamp reference point " in module of serially unstringing can
The multiplexing of change is delayed.
Detailed description of the invention
Fig. 1 is the basic structure schematic diagram that the network equipment (Dev001) handles timestamp in background technique;
Fig. 2 is timestamp delay computing structure model in background technique;
Fig. 3 is channel multiplexing structural model in background technique;
Fig. 4 is the structural schematic diagram of timestamp processing system in the embodiment of the present invention;
Fig. 5 is token bucket filling and extraction schematic illustration in the embodiment of the present invention;
Fig. 6 is timestamp detection, compensation and the typical structure generated in the embodiment of the present invention;
Fig. 7 is the offset calculation method in the embodiment of the present invention under the conditions of timestamp reference point a;
Fig. 8 is the offset calculation method in the embodiment of the present invention under the conditions of timestamp reference point b;
Fig. 9 is the offset calculation method in the embodiment of the present invention under the conditions of timestamp reference point c;
Figure 10 is the schematic illustration of smothing filtering submodule in the embodiment of the present invention;
Figure 11 is the flow diagram of timestamp processing method in the embodiment of the present invention.
Specific embodiment
Invention is further described in detail with reference to the accompanying drawings and embodiments.
Embodiment 1: the timestamp based on token generates system
Shown in Figure 4, the embodiment of the invention discloses a kind of, and the timestamp based on token generates system, which includes
Serially unstring module (SerDes), physical layer coding module (Pcs) and timestamp processing module (Tpu), module of serially unstringing and
Timestamp processing module is communicated by physical layer coding module:
The module of serially unstringing is used for: will have been sent real-time in the form of the first token with received bit flow amount
Feed back to timestamp processing module;
The timestamp processing module is used for: in the form of the second token Real-time Feedback timestamp processing module sent and
Received bit flow amount calculates serially unstring module and timestamp processing mould according to the difference of the first token and the second token
The bit flow amount of delay between block;The interface rate for module of according to the bit flow amount of delay and serially unstringing calculates string
The delay for the data transfer path that row unstrings between module and timestamp processing module.
When detecting the timestamp reference point in PTP message, this is recorded by local high precision clock (Chronometer)
When time, base timestamp when module of serially unstringing as the timestamp reference point corresponding data input and output uses this
Compensation of delay base timestamp, generate the input and output of timestamp reference point corresponding data serially unstring module when the final time
Stamp.
It is shown in Figure 5, serially unstring module and timestamp processing are calculated according to the difference of the first token and the second token
The detailed process of the bit flow amount of delay between module includes:
Create a token bucket;
Timestamp processing module serially unstring module send data when, timestamp processing module is filled out into the token bucket
The second token Tokens2 is filled, the first token Tokens1 is taken out from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is to the token bucket
The first token Tokens1 of middle filling, and the second token Tokens2 is taken out from the token bucket;
The delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module
Bit flow amount.
The interface rate for module of according to the bit flow amount of delay and serially unstringing, which calculates, serially to unstring module and time
Stab the calculation formula of the delay of the data transfer path between processing module are as follows:
Latency=Level/Speed;
Wherein, Latency is the delay serially unstringed between module and timestamp processing module, and Level is described first
The difference of token and the second token, Speed are the operating rate of module of serially unstringing.
The operating rate for module of serially unstringing determines the time that each token represents, such as: under 1Gbps rate, 1bit
Token just represents the 1ns time;Under 10Gbps rate, 1bit token just represents 0.1ns.Therefore, knowing module work of serially unstringing
Under conditions of making rate, the difference of the first token and the second token can be converted to specific delay time.
Embodiment 2: consider the offset of timestamp reference point
On the basis of embodiment 1, the offset for considering timestamp reference point, in the timestamp generation system based on token
Timestamp processing module when detecting the timestamp reference point in PTP message, also according to module of serially unstringing interface rate,
The position of the timestamp reference point detected calculates the offset of timestamp reference point.
Shown in fig. 6 is a kind of reality of the timestamp processing module in timestamp generation system in the present invention based on token
Existing structure: where Timestamp Point Detect is " timestamp reference point " detection unit, is handled for detection time stamp
Whether contain " timestamp reference point " in the Brick block of the interface of module.Here " timestamp reference point " can be PTP data
SOP (the first bit of data packet first byte) in packet, is also possible to SOF (the first bit after lead code), can also be
Other reference positions;Assuming that select SOF as " timestamp reference point ", then the subelement is after detecting SOF, it will
Offset Offset is calculated according to operating mode.Mode in Fig. 6 is a register, it saves channel multiplexing rule etc.
Information, offset Offset are calculated by migration algorithm combination configuration information by offset computation unit.Delay in Fig. 6 is mended
Repay subelement Compensation) for computing and compensating final Delay Estima-tion value, Term is a register in Fig. 6, it
Save the information such as the operating rate (Speed) for module of serially unstringing.
The calculation method of the offset of timestamp reference point shown in Fig. 7.Bricks represents physical layer coding module in figure
(Pcs) data bus interface between timestamp processing module (Tpu), it is assumed that contain p Brick block, each Brick block
Data bit width is w, and bx indicates the position where time stamp reference point;
PcsLane in Fig. 7 shares L, and the specific size of L is related to agreement, such as:
100G Ethernet requires to use 20 PcsLane,
40G Ethernet requires to use 4 PcsLane,
10G Ethernet requires to use 1 PcsLane,
The relationship of L and p can be summarized as follows three kinds:
A condition: L=n*p, (n >=1, L ≠ 1) is shown in Figure 7;
B condition: p=n*L, (n >=1, L=1) is shown in Figure 8;
C condition: p=n*L, (n >=1, L ≠ 1) is shown in Figure 9;
Fig. 7 is suitable for a condition, and coordinate system here has divided tetra- regions A/B/C/D, and Offset calculations of offset is as follows:
Offset=A-C=(A+D)-(C+D)=x*L-w*i;
As L=p, C=0, D=0, special circumstances in Offset=A=x*L, that is, Fig. 7 at this time.
The region interpretation of Fig. 7:
A: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
C: indicating in token bucket, but due to than exporting after bx, the data volume for needing therefrom to deduct;
Fig. 8 is suitable for b condition, and coordinate system here has also divided tetra- regions A/B/C/D, and bx indicates time stamp reference point institute
The position bit, Offset calculate it is as follows:
Offset=x+C+D=x+w*i
Due to L=1, so all data before bx should all be added in token bucket, one as link delay
Point.
The region interpretation of Fig. 8:
A: it is different with the region A meaning in condition a, because only the determination of some data is defeated before bx in A here
Out, it is assumed that time stamp reference point bx is in the position of Bricks [i], then just there was only x bit number before bx in Bricks [i]
It is counted according to needs;
C+D: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
Fig. 9 is suitable for c condition, and coordinate system here has divided six regions A/B/C/D/E/F, and bx still indicates that time stamp is joined
The position bit where examination point, since p is the integral multiple of L, so p can be cut into multiple L blocks;Offset calculates as follows:
Offset=A+C+D,
Wherein the calculating of A can refer to Fig. 7;
C+D=w*i;
So Offset=x*L+w*i;
The region interpretation of Fig. 9:
A: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
C+D: it indicates that determination exports before bx, but is not yet added to the data volume of token bucket;
B, it E, F: indicates to determine the data exported after bx, cannot count in token bucket.
In the case where the offset for considering timestamp reference point, the number between module of serially unstringing and timestamp processing module
According to the calculation formula of the delay of transmission path are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be the time
Stamp processing module receives the direction that module of serially unstringing sends data;Latency is serially unstring module and timestamp processing mould
Delay between block, Level are the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing,
Offset is the offset of timestamp reference point.
Embodiment 3: consider smothing filtering
On the basis of embodiment 1, consider smothing filtering, the timestamp processing in the timestamp generation system based on token
Module further includes smothing filtering submodule (Smooth in Fig. 4), is used to control the token filled every time into the token bucket
Uniform amount;Control the token uniform amount by taking out in the token bucket every time.
The specific method is as follows:
It is shown in Figure 10, using the thought of arithmetic average;Window is smothing filtering length of window, is counted for convenience
It calculates, length L is usually 2 integral number power, such as 32;ACC is accumulator, save in window the statistics of L nodal value and,
New and Old is the first order and afterbody node respectively;TokenIn is output, and TokenOut is output, and TokenOut is exactly L
The mean value of a node:
TokenOut=[Acc+ (New-Old)]/L
In order to reduce loss of significance caused by computation complexity and displacement, output result can only exist temporarily not divided by L
Take into account when final token bucket statistics relationship L is multiplied again, it may be assumed that
TokenOut=[Acc+ (New-Old)].
Embodiment 4: the timestamp generation method based on token
Shown in Figure 11, the timestamp generation method based on token that the embodiment of the invention discloses a kind of is used to go here and there
When capable module of unstringing is communicated with timestamp processing module by physical layer coding module, the timestamp reference in PTP message is generated
Point corresponding data input and output serially unstring module when timestamp, method includes the following steps:
Serially unstring module will send with received bit flow amount in the form of the first token Real-time Feedback to when
Between stab processing module;
Timestamp processing module Real-time Feedback timestamp processing module in the form of the second token sent with it is received
Bit flow amount is calculated according to the difference of the first token and the second token and is serially unstringed between module and timestamp processing module
The bit flow amount of delay;
Unstring according to the bit flow amount of the delay and serially interface rate of module of timestamp processing module calculates serially
The delay of data transfer path between module of unstringing and timestamp processing module.
When detecting the timestamp reference point in PTP message, this is recorded by local high precision clock (Chronometer)
When time, base timestamp when module of serially unstringing as the timestamp reference point corresponding data input and output uses this
Compensation of delay base timestamp, generate the input and output of timestamp reference point corresponding data serially unstring module when the final time
Stamp.
It is shown in Figure 5, serially unstring module and timestamp processing are calculated according to the difference of the first token and the second token
The detailed process of the bit flow amount of delay between module includes:
Create a token bucket;
Timestamp processing module serially unstring module send data when, timestamp processing module is filled out into the token bucket
The second token Tokens2 is filled, the first token Tokens1 is taken out from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is to the token bucket
The first token Tokens1 of middle filling, and the second token Tokens2 is taken out from the token bucket;
The delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module
Bit flow amount.
The interface rate for module of according to the bit flow amount of delay and serially unstringing, which calculates, serially to unstring module and time
Stab the calculation formula of the delay of the data transfer path between processing module are as follows:
Latency=Level/Speed;
Wherein, Latency is the delay serially unstringed between module and timestamp processing module, and Level is described first
The difference of token and the second token, Speed are the operating rate of module of serially unstringing.
Embodiment 5: consider the offset of timestamp reference point
On the basis of embodiment 4, the offset of timestamp reference point, the timestamp generation method based on token are considered
In, when timestamp processing module detects the timestamp reference point in PTP message, also according to the interface speed for module of serially unstringing
The position of rate, the timestamp reference point detected, calculates the offset of timestamp reference point.
The calculation method of the offset of timestamp reference point shown in Fig. 7.Bricks represents Bricks and represents physical layer in figure
Data bus interface between coding module (Pcs) and timestamp processing module (Tpu), it is assumed that contain p Brick block, often
A Brick block data bit width is w, and bx indicates the position where time stamp reference point;
PcsLane in Fig. 7 shares L, and the specific size of L is related to agreement, such as:
100G Ethernet requires to use 20 PcsLane,
40G Ethernet requires to use 4 PcsLane,
10G Ethernet requires to use 1 PcsLane,
The relationship of L and p can be summarized as follows:
A > L=n*p, (n >=1, L ≠ 1) is shown in Figure 7;
B > p=n*L, (n >=1, L=1) is shown in Figure 8;
C > p=n*L, (n >=1, L ≠ 1) is shown in Figure 9;
Fig. 7 is suitable for a condition, and coordinate system here has divided tetra- regions A/B/C/D, and Offset calculations of offset is as follows:
Offset=A-C=(A+D)-(C+D)=x*L-w*i;
As L=p, C=0, D=0, special circumstances in Offset=A=x*L, that is, Fig. 7 at this time.
The region interpretation of Fig. 7:
A: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
C: indicating in token bucket, but due to than exporting after bx, the data volume for needing therefrom to deduct;
Fig. 8 is suitable for b condition, and coordinate system here has also divided tetra- regions A/B/C/D, and bx indicates time stamp reference point institute
The position bit, Offset calculate it is as follows:
Offset=x+C+D=x+w*i
Due to L=1, so all data before bx should all be added in token bucket, one as link delay
Point.
The region interpretation of Fig. 8:
A: it is different with the region A meaning in condition a, because only the determination of some data is defeated before bx in A here
Out, it is assumed that time stamp reference point bx is in the position of Bricks [i], then just there was only x bit number before bx in Bricks [i]
It is counted according to needs;
C+D: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
Fig. 9 is suitable for c condition, and coordinate system here has divided six regions A/B/C/D/E/F, and bx still indicates that time stamp is joined
The position bit where examination point, since p is the integral multiple of L, so p can be cut into multiple L blocks;Offset calculates as follows:
Offset=A+C+D,
Wherein the calculating of A can refer to Fig. 7;
C+D=w*i;
So Offset=x*L+w*i;
The region interpretation of Fig. 9:
A: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
C+D: it indicates that determination exports before bx, but is not yet added to the data volume of token bucket;
B, it E, F: indicates that determination exports after bx, the data volume in token bucket cannot be counted on.
In the case where the offset for considering timestamp reference point, the number between module of serially unstringing and timestamp processing module
According to the calculation formula of the delay of transmission path are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be the time
Stamp processing module receives the direction that module of serially unstringing sends data;Latency is serially unstring module and timestamp processing mould
Delay between block, Level are the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing,
Offset is the offset of timestamp reference point.
Embodiment 6: consider smothing filtering
On the basis of embodiment 5, smothing filtering is considered, in the timestamp generation method based on token, timestamp processing
The token uniform amount that module is filled into the token bucket every time;It is equal by the token quantity taken out in the token bucket every time
It is even.
The specific method is as follows:
It is shown in Figure 10, using the thought of arithmetic average;Window is smothing filtering length of window, is counted for convenience
It calculates, length L is usually 2 integral number power, such as 32;ACC is accumulator, save in window the statistics of L nodal value and,
New and Old is the first order and afterbody node respectively;TokenIn is input, and TokenOut is output, and TokenOut is exactly L
The mean value of a node:
TokenOut=[Acc+ (New-Old)]/L
In order to reduce loss of significance caused by computation complexity and displacement, output result can only exist temporarily not divided by L
Take into account when final token bucket statistics relationship L is multiplied again, it may be assumed that
TokenOut=[Acc+ (New-Old)].
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from
Under the premise of the principle of the invention, several improvements and modifications can also be made, these improvements and modifications are also considered as protection of the invention
Within the scope of.The content being not described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.