Traffic shaper token updating system and method for time-sensitive network

文档序号:1834622 发布日期:2021-11-12 浏览:18次 中文

阅读说明:本技术 一种时间敏感网络的流量整形器令牌更新系统及方法 (Traffic shaper token updating system and method for time-sensitive network ) 是由 何运锋 于 2021-07-01 设计创作,主要内容包括:本发明提供一种时间敏感网络的流量整形器令牌更新系统及方法,包括:针对非空队列,在报文被调度时对关联的流量整形器进行令牌更新,并在调度完成后为空队列时将对应的所述令牌桶的令牌数量配置为非正值,随后加入空队列池,以及在数据队列为非空队列且令牌数量为负值时生成循环更新信号;针对各空队列,在有新的报文到达时对关联的流量整形器进行令牌更新;根据循环更新信号处理得到更新级别,并将流量整形器放入更新级别对应的更新池,以按照循环更新频率对令牌桶进行令牌更新;在各令牌桶进行令牌更新的过程中,检测到流量整形器的令牌桶处于有效状态时,将流量整形器移出更新池以参与调度。有益效果是降低时延,可以支持大量的流量整形器。(The invention provides a system and a method for updating a token of a flow shaper of a time-sensitive network, wherein the method comprises the following steps: for a non-empty queue, updating tokens of a related flow shaper when a message is scheduled, configuring the number of the tokens of a corresponding token bucket to be a non-positive value when the message is an empty queue after the scheduling is finished, then adding the token bucket into an empty queue pool, and generating a cycle updating signal when a data queue is a non-empty queue and the number of the tokens is a negative value; for each empty queue, updating a token of the associated flow shaper when a new message arrives; processing according to the cyclic updating signal to obtain an updating level, and putting the flow shaper into an updating pool corresponding to the updating level so as to update the token of the token bucket according to the cyclic updating frequency; and in the process of updating the token of each token bucket, when the token bucket of the traffic shaper is detected to be in a valid state, moving the traffic shaper out of an update pool to participate in scheduling. The method has the advantages of reducing time delay and supporting a large number of flow shapers.)

1. A traffic shaper token updating system of a time sensitive network is characterized in that a plurality of traffic shapers are configured in advance, each traffic shaper is associated with a data queue and performs traffic shaping on the data queue through a token bucket; the traffic shaper token update system comprises:

a first updating module, configured to, for a non-empty queue in each data queue, perform token updating on the token bucket of the associated traffic shaper when a packet in the data queue is scheduled, configure the number of tokens of the corresponding token bucket to a non-positive value when the data queue is an empty queue after scheduling is completed, then add the data queue to an empty queue pool, and generate a cyclic update signal when the data queue is a non-empty queue after scheduling is completed and the number of tokens of the token bucket after updating is a negative value;

a second updating module, connected to the empty queue pool, configured to update, for each empty queue, a token of the token bucket of the associated traffic shaper when a new packet arrives;

a circular update pool comprising a plurality of update pools having different update levels, each of the update pools further having a circular update frequency positively correlated with the update level;

a third updating module, respectively connected to the first updating module and the cyclic updating pool, configured to obtain the updating level of the corresponding traffic shaper according to the cyclic updating signal processing, and place the traffic shaper into the updating pool corresponding to the updating level, so as to perform token updating on the token bucket according to the cyclic updating frequency;

and a fourth updating module, connected to the cyclic update pool, configured to, when detecting that the number of tokens of the token bucket corresponding to the traffic shaper is a non-negative value in a process of updating tokens in each token bucket, move the traffic shaper out of the update pool to participate in scheduling.

2. The traffic shaper token updating system of claim 1, wherein each of the update pools represents the update level by a preconfigured standard time, and wherein the smaller the standard time, the higher the update level and thus the higher the cyclic update frequency.

3. The traffic shaper token update system of claim 2, wherein the third update module comprises:

the processing unit is used for processing according to the cycle updating signal, the token quantity of the token bucket and a pre-configured token generation rate to obtain expected time when the token quantity is accumulated to zero;

a matching unit, connected to the processing unit, for comparing the expected time with each of the standard times, and using the update level corresponding to the standard time that is greater than the expected time and closest to the expected time as the update level of the traffic shaper;

and the updating unit is connected with the matching unit and used for putting the traffic shaper into the updating pool corresponding to the updating level so as to update the token bucket according to the cyclic updating frequency.

4. The traffic shaper token update system of claim 3, wherein the expected time is a time difference between an expected time at which the number of tokens accumulates to zero and a current time;

the matching unit compares the expected time with each standard time respectively in the change process of the expected time and continuously outputs a comparison result, and an adjusting signal is output when the comparison result indicates that the update level of the traffic shaper is changed;

and the updating unit adjusts the updating pool where the flow shaper is located according to the adjusting signal.

5. The traffic shaper token updating system of claim 1, further comprising a bandwidth borrowing update module coupled to the third update module, each of the traffic shapers configured with a borrowing status flag bit and each of the traffic shapers having a different priority; the bandwidth borrowing update module comprises:

the storage unit is used for storing a priority queue, and in the priority queue, the flow shapers are sequentially arranged according to the priority from high to low;

a first configuration unit, configured to configure the corresponding borrowing status flag bit to a first value when the data queue associated with the traffic shaper is an empty queue, and to configure the corresponding borrowing status flag bit to a second value when the data queue associated with the traffic shaper is a non-empty queue;

a second configuration unit, respectively connected to the storage unit and the first configuration unit, for binding, for each of the traffic shapers, the two traffic shapers when the borrowing status flag bit of the traffic shaper with the higher priority adjacent to the traffic shaper in the priority queue is the first value, and then unbinding the two traffic shapers when the borrowing status flag bit of the traffic shaper with the higher priority is the second value;

when the two traffic shapers are bound, the third updating module puts the bound two traffic shapers as a whole into the corresponding updating pool for token updating.

6. A traffic shaper token updating method for a time-sensitive network, applied to the traffic shaper token updating system according to any of claims 1 to 5, wherein a round robin update pool is configured in the traffic shaper token updating system, the round robin update pool comprises a plurality of update pools with different update levels, and each update pool further has a round robin update frequency positively correlated to the update level;

the traffic shaper token updating method comprises:

step S1, the traffic shaper token updating system updates, for a non-empty queue in each data queue, a token of the token bucket of the associated traffic shaper when a packet in the data queue is scheduled, and determines whether the data queue is an empty queue after the scheduling is completed:

if yes, configuring the token number of the corresponding token bucket to be a non-positive value, then adding the data queue into an empty queue pool, and then turning to step S2;

if not, go to step S3;

step S2, the traffic shaper token updating system performs token updating on the token bucket of the associated traffic shaper when a new packet arrives for each empty queue, and then returns to step S1;

step S3, the traffic shaper token updating system determines whether the updated token number of the token bucket is a negative value:

if not, returning to the step S1;

if yes, generating a cyclic update signal, and then turning to step S4;

step S4, the traffic shaper token updating system processes the cyclic update signal to obtain the update level of the corresponding traffic shaper, and places the traffic shaper into the update pool corresponding to the update level, so as to perform token update on the token bucket according to the cyclic update frequency;

step S5, in the process of token updating for each token bucket, when detecting that the number of tokens of the token bucket corresponding to the traffic shaper in each update pool is a non-negative value, the traffic shaper token updating system moves the traffic shaper out of the update pool to participate in scheduling.

7. The traffic shaper token updating method according to claim 6, wherein each of the update pools represents the update level by a pre-configured standard time, and the smaller the standard time, the higher the update level and thus the higher the cyclic update frequency.

8. The traffic shaper token updating method of claim 7, wherein the step S4 comprises:

step S41, the traffic shaper token updating system processes the cyclic update signal, the token number of the token bucket, and a pre-configured token generation rate to obtain an expected time when the token number is accumulated to zero;

step S42, the traffic shaper token updating system compares the expected time with each of the standard times, and uses the update level corresponding to the standard time that is greater than the expected time and closest to the expected time as the update level of the traffic shaper;

step S43, the token update system puts the traffic shaper into the update pool corresponding to the update level, so as to perform token update on the token bucket according to the cyclic update frequency.

9. The traffic shaper token updating method according to claim 8, wherein the expected time is a time difference between an expected time at which the number of tokens is accumulated to zero and a current time;

in step S42, the traffic shaper token updating system compares the expected time with each of the standard times during the change of the expected time and continuously outputs a comparison result, and outputs an adjustment signal when the comparison result indicates that the update level of the traffic shaper is changed;

in step S43, the traffic shaper token updating system adjusts the update pool where the traffic shaper is located according to the adjustment signal.

10. The traffic shaper token updating method according to claim 6, further comprising a bandwidth borrowing updating procedure, wherein each traffic shaper is configured with a borrowing status flag bit, each traffic shaper has a different priority, and each traffic shaper is arranged in order of priority from high to low to form a priority queue;

the bandwidth borrowing update procedure includes:

configuring the corresponding borrow status flag bit to a first value when the data queue associated with the traffic shaper is an empty queue and to a second value when the data queue associated with the traffic shaper is a non-empty queue;

for each of the traffic shapers, binding both of the traffic shapers when the borrow status flag bit of its neighboring traffic shaper with the higher priority is the first value, and then unbinding both of the traffic shapers when the borrow status flag bit of the traffic shaper with the higher priority is the second value;

when the two traffic shapers are bound in step S4, the traffic shaper token updating system puts the bound two traffic shapers as a whole into the corresponding update pool for token updating.

Technical Field

The invention relates to the technical field of data communication networks, in particular to a system and a method for updating a token of a flow shaper of a time-sensitive network.

Background

Time Sensitive Networking (TSN) refers to a set of protocol standards being developed by the TSN task group in the IEEE802.1 working group. The TSN originally originated from the application requirements in the audio video field, and the IEEE TSN working group continued the AVB work, and the working group focused on studying deterministic data transmission mechanisms, further reducing the delay in ethernet networks, and transmitting data more stably and safely. Networks that transmit audio and video information need to comply with strict latency and jitter requirements. The TSN network can well support the bandwidth and real-time requirements of images and audio.

The important 802.1Qav standard in TSN requires a mechanism of token shaping (CBS) to achieve end-to-end deterministic latency. 802.1Qav defines a credit-based hardware traffic shaper that is implemented based on the token bucket principle, where upon arrival of a message, it is first determined whether the number of tokens in the token bucket is valid, scheduling is allowed when the number of tokens is valid, and the message is blocked when the number of tokens is not valid. In the prior art, a plurality of traffic shapers operate simultaneously, and the number of the traffic shapers is often thousands. In order to improve efficiency and save resources, a special module performs centralized processing on all traffic shapers, and the conventional method for the token generation part adopts a circular updating mechanism. Under this round robin update mechanism, assuming that the update rate of each token bucket is 1.5M, about 3G (1.5M × 1K × 2) read and write operations are required for one thousand traffic shapers per second, which is very demanding for the system and is usually implemented in parallel by multiple sets of hardware. If the number of SHAPER increases to a certain amount, the number of reads and writes per second may be an order of magnitude larger. Since the number of reads and writes per second of the system is limited, there is a serious system bottleneck.

Disclosure of Invention

Aiming at the problems in the prior art, the invention provides a traffic shaper token updating system of a time-sensitive network, which is characterized in that a plurality of traffic shapers are configured in advance, each traffic shaper is associated with a data queue and carries out traffic shaping on the data queue through a token bucket; the traffic shaper token update system comprises:

a first updating module, configured to, for a non-empty queue in each data queue, perform token updating on the token bucket of the associated traffic shaper when a packet in the data queue is scheduled, configure the number of tokens of the corresponding token bucket to a non-positive value when the data queue is an empty queue after scheduling is completed, then add the data queue to an empty queue pool, and generate a cyclic update signal when the data queue is a non-empty queue after scheduling is completed and the number of tokens of the token bucket after updating is a negative value;

a second updating module, connected to the empty queue pool, configured to update, for each empty queue, a token of the token bucket of the associated traffic shaper when a new packet arrives;

a circular update pool comprising a plurality of update pools having different update levels, each of the update pools further having a circular update frequency positively correlated with the update level;

a third updating module, respectively connected to the first updating module and the cyclic updating pool, configured to obtain the updating level of the corresponding traffic shaper according to the cyclic updating signal processing, and place the traffic shaper into the updating pool corresponding to the updating level, so as to perform token updating on the token bucket according to the cyclic updating frequency;

and a fourth updating module, connected to the cyclic update pool, configured to, when detecting that the number of tokens of the token bucket corresponding to the traffic shaper is a non-negative value in a process of updating tokens in each token bucket, move the traffic shaper out of the update pool to participate in scheduling.

Preferably, each of the update pools represents the update level by a preset standard time, and the smaller the standard time, the higher the update level and thus the higher the cyclic update frequency.

Preferably, the third updating module includes:

the processing unit is used for processing according to the cycle updating signal, the token quantity of the token bucket and a pre-configured token generation rate to obtain expected time when the token quantity is accumulated to zero;

a matching unit, connected to the processing unit, for comparing the expected time with each of the standard times, and using the update level corresponding to the standard time that is greater than the expected time and closest to the expected time as the update level of the traffic shaper;

and the updating unit is connected with the matching unit and used for putting the traffic shaper into the updating pool corresponding to the updating level so as to update the token bucket according to the cyclic updating frequency.

Preferably, the expected time is a time difference between an expected time when the number of tokens is accumulated to zero and the current time;

the matching unit compares the expected time with each standard time respectively in the change process of the expected time and continuously outputs a comparison result, and an adjusting signal is output when the comparison result indicates that the update level of the traffic shaper is changed;

and the updating unit adjusts the updating pool where the flow shaper is located according to the adjusting signal.

Preferably, the system further comprises a bandwidth borrowing updating module connected to the third updating module, each traffic shaper is configured with a borrowing status flag bit and each traffic shaper has a different priority; the bandwidth borrowing update module comprises:

the storage unit is used for storing a priority queue, and in the priority queue, the flow shapers are sequentially arranged according to the priority from high to low;

a first configuration unit, configured to configure the corresponding borrowing status flag bit to a first value when the data queue associated with the traffic shaper is an empty queue, and to configure the corresponding borrowing status flag bit to a second value when the data queue associated with the traffic shaper is a non-empty queue;

a second configuration unit, respectively connected to the storage unit and the first configuration unit, for binding, for each of the traffic shapers, the two traffic shapers when the borrowing status flag bit of the traffic shaper with the higher priority adjacent to the traffic shaper in the priority queue is the first value, and then unbinding the two traffic shapers when the borrowing status flag bit of the traffic shaper with the higher priority is the second value;

when the two traffic shapers are bound, the third updating module puts the bound two traffic shapers as a whole into the corresponding updating pool for token updating.

The invention also provides a traffic shaper token updating method of the time-sensitive network, which is applied to the traffic shaper token updating system, wherein a cycle updating pool is configured in the traffic shaper token updating system, the cycle updating pool comprises a plurality of updating pools with different updating levels, and each updating pool also has a cycle updating frequency positively correlated with the updating level;

the traffic shaper token updating method comprises:

step S1, the traffic shaper token updating system updates, for a non-empty queue in each data queue, a token of the token bucket of the associated traffic shaper when a packet in the data queue is scheduled, and determines whether the data queue is an empty queue after the scheduling is completed:

if yes, configuring the token number of the corresponding token bucket to be a non-positive value, then adding the data queue into an empty queue pool, and then turning to step S2;

if not, go to step S3;

step S2, the traffic shaper token updating system performs token updating on the token bucket of the associated traffic shaper when a new packet arrives for each empty queue, and then returns to step S1;

step S3, the traffic shaper token updating system determines whether the updated token number of the token bucket is a negative value:

if not, returning to the step S1;

if yes, generating a cyclic update signal, and then turning to step S4;

step S4, the traffic shaper token updating system processes the cyclic update signal to obtain the update level of the corresponding traffic shaper, and places the traffic shaper into the update pool corresponding to the update level, so as to perform token update on the token bucket according to the cyclic update frequency;

step S5, in the process of token updating for each token bucket, when detecting that the number of tokens of the token bucket corresponding to the traffic shaper in each update pool is a non-negative value, the traffic shaper token updating system moves the traffic shaper out of the update pool to participate in scheduling.

Preferably, each of the update pools represents the update level by a preset standard time, and the smaller the standard time, the higher the update level and thus the higher the cyclic update frequency.

Preferably, the step S4 includes:

step S41, the traffic shaper token updating system processes the cyclic update signal, the token number of the token bucket, and a pre-configured token generation rate to obtain an expected time when the token number is accumulated to zero;

step S42, the traffic shaper token updating system compares the expected time with each of the standard times, and uses the update level corresponding to the standard time that is greater than the expected time and closest to the expected time as the update level of the traffic shaper;

step S43, the token update system puts the traffic shaper into the update pool corresponding to the update level, so as to perform token update on the token bucket according to the cyclic update frequency.

Preferably, the expected time is a time difference between an expected time when the number of tokens is accumulated to zero and the current time;

in step S42, the traffic shaper token updating system compares the expected time with each of the standard times during the change of the expected time and continuously outputs a comparison result, and outputs an adjustment signal when the comparison result indicates that the update level of the traffic shaper is changed;

in step S43, the traffic shaper token updating system adjusts the update pool where the traffic shaper is located according to the adjustment signal.

Preferably, before the step S4 is executed, a bandwidth borrowing update process is further included, each traffic shaper is configured with a borrowing status flag, each traffic shaper has a different priority, and each traffic shaper is sequentially arranged according to the priority from high to low to form a priority queue;

the bandwidth borrowing update procedure includes:

configuring the corresponding borrow status flag bit to a first value when the data queue associated with the traffic shaper is an empty queue and to a second value when the data queue associated with the traffic shaper is a non-empty queue;

for each of the traffic shapers, binding both of the traffic shapers when the borrow status flag bit of its neighboring traffic shaper with the higher priority is the first value, and then unbinding both of the traffic shapers when the borrow status flag bit of the traffic shaper with the higher priority is the second value;

when the two traffic shapers are bound in step S4, the traffic shaper token updating system puts the bound two traffic shapers as a whole into the corresponding update pool for token updating.

The technical scheme has the following advantages or beneficial effects:

1) dividing the data queue into an empty queue and a non-empty queue, wherein the empty queue does not participate in cyclic updating, and the number of read-write operations for updating the token is effectively reduced; the non-empty queue is updated during scheduling and is circularly updated when the corresponding token bucket is invalid, and an update pool with corresponding circular update frequency is configured according to expected time, so that the time delay is reduced while the read-write operation frequency is further reduced;

2) the empty queue triggers token updating when a new message arrives, and the non-empty queue performs cyclic updating when the token bucket is invalid, namely a packet-driven updating mechanism is adopted to be combined with an improved cyclic updating mechanism, so that the token updating is separated from the number of the flow shapers, and a large number of flow shapers can work simultaneously;

3) because the 802.1Qav creatibased shape defines that the state of the data queue needs to be considered when the traffic shaper is updated, the scheme is naturally friendly to the realization of 802.1Qav, and simultaneously, the bandwidth borrowing is easy to realize.

Drawings

Fig. 1 is a schematic structural diagram of a traffic shaper token updating system of a time-sensitive network according to a preferred embodiment of the present invention;

fig. 2 is a flowchart illustrating a method for updating a token of a traffic shaper for a time-sensitive network according to a preferred embodiment of the present invention;

fig. 3 is a flow chart illustrating a flow of a traffic shaper token updating system performing token updating on a traffic shaper according to a cyclic update signal in accordance with a preferred embodiment of the present invention.

Detailed Description

The invention is described in detail below with reference to the figures and specific embodiments. The present invention is not limited to the embodiment, and other embodiments may be included in the scope of the present invention as long as the gist of the present invention is satisfied.

In a preferred embodiment of the present invention, based on the above problems in the prior art, there is provided a traffic shaper token updating system for a time-sensitive network, which pre-configures a plurality of traffic shapers, each of which is associated with a data queue and performs traffic shaping on the data queue through a token bucket; the traffic shaper token updating system comprises:

a first updating module 1, configured to update tokens of token buckets of associated traffic shapers when a packet in a data queue is scheduled, configure the number of tokens of a corresponding token bucket to a non-positive value when the data queue is an empty queue after scheduling is completed, then add the data queue into an empty queue pool 2, and generate a cyclic update signal when the data queue is a non-empty queue after scheduling is completed and the number of tokens of the token bucket after updating is a negative value;

the second updating module 3 is connected with the empty queue pool 2 and is used for updating tokens of the token bucket of the associated flow shaper when a new message arrives for each empty queue;

a circular update pool 4 comprising a plurality of update pools 41 having different update levels, and each update pool 41 further having a circular update frequency positively correlated with the update level;

the third updating module 5 is respectively connected with the first updating module 1 and the cyclic updating pool 4, and is used for processing the cyclic updating signal to obtain the updating level of the corresponding traffic shaper, and putting the traffic shaper into the updating pool 41 corresponding to the updating level so as to update the token of the token bucket according to the cyclic updating frequency;

and the fourth updating module 6 is connected with the cyclic updating pool 4, and is configured to move the traffic shaper out of the updating pool to participate in scheduling when detecting that the number of tokens of the token bucket corresponding to the traffic shaper is a non-negative value in the process of updating the tokens by each token bucket.

As a preferred embodiment, the token updating system of the traffic shaper of the present invention may be configured in a switch or an intelligent network card as required, so as to implement egress traffic rate adjustment of the switch or the intelligent network card. The traffic shaper performs traffic shaping on the data queue by using a token bucket principle, wherein the token bucket principle can comprise a token generation part and a token consumption part, and the token generation part and the token consumption part work in parallel and independently. For the token generation part, tokens are added into a token bucket at a pre-configured token generation rate, and the bucket overflows when full; for the token consumption part, when a message comes in, the state of a token bucket is directly seen, if the number of tokens in the token bucket is a non-negative number, the token bucket is in an effective state, at the moment, the message can pass through, after the message passes through, the number of tokens corresponding to the length of the message is subtracted from the token bucket, if the number of tokens in the token bucket is a negative number, the token bucket is in an ineffective state, the message is blocked, and the number of tokens waiting in the token bucket is accumulated into a non-negative number.

In the conventional token updating mechanism, for example, one thousand traffic shapers are used, and when the conventional cyclic updating mechanism is used, because the cyclic access manner is used for updating, the computation amount is linearly related to the number of the traffic shapers, that is, the computation amount linearly increases with the increase of the number of the traffic shapers, and it is difficult to realize simultaneous operation of a large number of traffic shapers. When the token bucket of one or more traffic shapers is valid, the token bucket cannot be scheduled because the token bucket is not updated to the traffic shaper, that is, there is a time delay, and in order to reduce the time delay, the update rate needs to be increased as much as possible.

Based on the above technical problem, in this embodiment, an empty queue triggers token updating when a new packet arrives, and a non-empty queue performs cyclic updating when a token bucket is invalid, that is, a packet-driven updating mechanism is adopted in combination with an improved cyclic updating mechanism to transfer a speed bottleneck of traffic shaper updating to a port service rate, so that token updating is separated from the number of traffic shapers, and a large number of traffic shapers can be supported to work simultaneously.

The packet-driven updating mechanism triggers token updating for a data packet, specifically, when a data queue is an empty queue, no packet in the data queue needs to be scheduled, at this time, a flow shaper associated with the data queue is not updated circularly, the number of read-write operations for token updating can be reduced to a great extent, and when a new packet arrives in the empty queue, the packet contains at least one data packet, and then a token bucket of the flow shaper corresponding to the empty queue is triggered to update the token immediately. Further, when the data queue is an empty queue, according to the requirements of the 802.1Qav standard, before adding the empty queue into the empty queue pool, the method further includes configuring the number of tokens of the corresponding token bucket to be non-positive values, preferably, when the number of tokens of the token bucket is a positive value, clearing the number of tokens, and when the number of tokens of the token bucket is a negative value, keeping the number of tokens unchanged.

Triggering token updating on a token bucket of a corresponding flow shaper when a data queue is a non-empty queue and a message in the non-empty queue is scheduled, wherein if the data queue only comprises one message, the data queue is an empty queue after the message is scheduled, and at the moment, no matter which state the token bucket after token updating is in, the flow shaper associated with the empty queue is not subjected to cyclic updating; if the data queue includes more than one message, after the message is scheduled, the data queue is still a non-empty queue, and at this time, the state of the updated token bucket is checked, preferably, the state of the token bucket is confirmed by obtaining the number of tokens in the token bucket, and when the number of tokens is a negative value, the token bucket is indicated to be in an invalid state, even if there is a message in the data queue, the message cannot pass through the traffic shaper, at this time, the message can participate in scheduling again by waiting for the number of tokens in the token bucket of the traffic shaper to become a non-negative value, and at this time, the traffic shaper can be placed in the circular update pool 4 to update the tokens.

The cyclic update mechanism in the cyclic update pool 4 is a time-driven update mechanism, and the cyclic update mechanism in the cyclic update pool 4 is not affected whether a message arrives or not. To further reduce the amount of system data computation, a plurality of update pools 41 are configured in the circular update pool 4. Because the token generation rate of the token bucket is fixed, the expected time for the token bucket of the traffic shaper to recover the valid state can be obtained according to the current token number of the token bucket and the token generation rate, and based on this, different cycle update frequencies can be correspondingly configured to further reduce the data calculation amount. In this embodiment, each update pool may be divided into a plurality of update levels according to the urgency of the update time, and the shorter the expected time is, the more urgent the update time is, at this time, the update pool is placed into the update pool of the higher level for token update, and the update pool of the higher update level has a higher cyclic update frequency, in other words, the update pool of the higher update level configures more overhead.

Further, in the process of updating the token in the cyclic update pool 4, when it is detected that the token bucket corresponding to the traffic shaper is in an effective state, it indicates that the number of tokens of the token bucket in the traffic shaper can meet the requirement of passing a message, in other words, the data queue corresponding to the traffic shaper is qualified to participate in scheduling, and at this time, the traffic shaper is moved out of the update pool, thereby effectively reducing the delay.

In the preferred embodiment of the present invention, each update pool 41 represents the update level by a pre-configured standard time, and the smaller the standard time, the higher the update level and the higher the cycle update frequency.

In a preferred embodiment of the present invention, the third updating module 5 includes:

the processing unit 51 is configured to process to obtain an expected time when the number of tokens is accumulated to zero according to the cyclic update signal, the number of tokens in the token bucket, and a pre-configured token generation rate;

a matching unit 52, connected to the processing unit 51, for comparing the expected time with each standard time, and using the update level corresponding to the standard time which is greater than the expected time and closest to the expected time as the update level of the traffic shaper;

and the updating unit 53 is connected to the matching unit 52, and is configured to put the traffic shaper into an update pool corresponding to the update level, so as to perform token updating on the token bucket according to the cyclic update frequency.

Specifically, in this embodiment, three update pools are taken as an example, where the standard time corresponding to the first update pool may be 30 seconds, the standard time corresponding to the second update pool may be 60 seconds, and the standard time corresponding to the third update pool may be 80 seconds, so that the update level of the corresponding first update pool is higher than the update level of the second update pool, and the update level of the second update pool is higher than the update level of the third update pool. And if the expected time is 50 seconds, putting the traffic shaper into a second updating pool for updating.

In the preferred embodiment of the present invention, the expected time is a time difference between an expected time when the number of tokens is accumulated to zero and the current time;

the matching unit 52 compares the expected time with each standard time respectively in the change process of the expected time and continuously outputs a comparison result, and outputs an adjusting signal when the comparison result indicates that the update level of the traffic shaper is changed;

the update unit 53 adjusts the update pool in which the traffic shaper is located according to the adjustment signal.

Specifically, in this embodiment, the expected time is a time difference between an expected time at which the number of tokens is accumulated to zero and a current time, and as time goes on, the expected time is in a constantly changing process, taking the current time as a starting point, and taking the expected time as 50 seconds as an example, during initial configuration, the traffic shaper is placed in the second update pool for updating, and after 21 seconds, the expected time is changed to 29 seconds, and at this time, the traffic shaper needs to be placed in the first update pool for updating. Preferably, the first update pool is configured with the highest cyclic update frequency, so that it can be detected in time that the token bucket of the traffic shaper in the first update pool becomes a valid state, and then the traffic shaper is triggered to remove the update pool to participate in scheduling.

As a preferred embodiment, since the update level of the traffic shaper is a real-time adjustment process, it is possible to obtain the time when the token bucket of the traffic shaper becomes an active state in time only by performing a query operation on the first update pool, and it is not necessary to perform a query operation on all update pools, thereby further reducing the data volume and further reducing the system overhead. The number of the first update pools may be configured according to requirements, and is not limited herein, and may be one or two.

In the preferred embodiment of the present invention, the system further comprises a bandwidth borrowing update module 7 connected to the third update module 5, each traffic shaper is configured with a borrowing status flag bit and each traffic shaper has different priorities; the bandwidth borrowing module 7 includes:

the storage unit 71 is configured to store a priority queue, where in the priority queue, the traffic shapers are sequentially arranged according to the priority from high to low;

a first configuration unit 72, configured to configure the corresponding borrowing status flag bit to a first value when the data queue associated with the traffic shaper is an empty queue, and to configure the corresponding borrowing status flag bit to a second value when the data queue associated with the traffic shaper is a non-empty queue;

a second configuration unit 73, respectively connected to the storage unit 71 and the first configuration unit 72, for binding, for each traffic shaper, the two traffic shapers when the borrowing status flag bit of the traffic shaper with higher priority adjacent to the traffic shaper in the priority queue is a first value, and then unbinding the two traffic shapers when the borrowing status flag bit of the traffic shaper with higher priority is a second value;

when the two traffic shapers are bound, the third updating module 5 puts the bound two traffic shapers as a whole into the corresponding updating pool for token updating.

Specifically, in the scenario of supporting bandwidth borrowing, in the present embodiment, for each traffic shaper, a borrowing status flag bit is added to indicate whether the traffic shaper is in a traffic idle state. Preferably, the first value is 1, and the second value is 0. Taking three traffic shapers as an example, wherein the priorities of the first traffic shaper, the second traffic shaper and the third traffic shaper are sequentially decreased, if the borrowing status flag bit of the first traffic shaper is 1, it indicates that the data queue corresponding to the first traffic shaper is an empty queue, at this time, the second traffic shaper may borrow the transmission bandwidth of the first traffic shaper, if the transmission bandwidth of the first traffic shaper is 1M, and if the transmission bandwidth of the second traffic shaper is 2M, then the data queue corresponding to the second traffic shaper may be transmitted using the transmission bandwidth of 3M after the bandwidth is borrowed. Similarly, when the borrow status flag bit of the second traffic shaper is 1, the third traffic shaper may borrow the transmission bandwidth of the second traffic shaper.

Further, when updating the token in the bandwidth borrowing scenario, as described above, the first traffic shaper and the second traffic shaper are updated and used as a whole, and when the first traffic shaper is in the borrowing state, a new packet arrives in a corresponding empty queue, as a preferred embodiment, the borrowing state flag bit of the first traffic shaper may be configured as a first value, and after the currently borrowed transmission task is completed, the independence of the first traffic shaper may be recovered; as another preferred embodiment, the currently borrowed transmission task may be interrupted, and the transmission of the borrowed transmission task may be resumed after the transmission of the own data queue is completed.

In summary, it can be seen that, due to the definition of the 802.1Qav credit based sharer, the state of the data queue needs to be considered when the traffic shaper updates, and the technical solution originally distinguishes the update pool according to the queue state when the token update is performed. Therefore, the technical scheme is very suitable for realizing 802.1Qav, namely the technical scheme is naturally friendly to realizing 802.1 Qav. Furthermore, when a token updating mechanism combining packet driving and cyclic updating is used, support for bandwidth borrowing can be realized only by adding simple logic, and the scheme is simple to realize.

The invention also provides a traffic shaper token updating method of the time-sensitive network, which is applied to the traffic shaper token updating system, wherein a cycle updating pool is configured in the traffic shaper token updating system, the cycle updating pool comprises a plurality of updating pools with different updating levels, and each updating pool also has a cycle updating frequency positively correlated with the updating level;

as shown in fig. 2, the traffic shaper token updating method includes:

step S1, the traffic shaper token updating system updates the token of the token bucket of the associated traffic shaper when a packet in the data queue is scheduled, and determines whether the data queue after the scheduling is empty:

if yes, the token quantity of the corresponding token bucket is configured to be a non-positive value, then the data queue is added into an empty queue pool, and then the step S2 is turned to;

if not, go to step S3;

step S2, the traffic shaper token updating system updates the token bucket of the associated traffic shaper when a new message arrives for each empty queue, and then returns to step S1;

step S3, the traffic shaper token update system determines whether the token number of the updated token bucket is a negative value:

if not, returning to the step S1;

if yes, generating a cyclic update signal, and then turning to step S4;

step S4, the traffic shaper token updating system processes according to the cycle updating signal to obtain the updating level of the corresponding traffic shaper, and puts the traffic shaper into the updating pool corresponding to the updating level to update the token of the token bucket according to the cycle updating frequency;

step S5, the traffic shaper token updating system moves the traffic shaper out of the update pool to participate in scheduling when detecting that the number of tokens of the token bucket corresponding to the traffic shaper in each update pool is a non-negative value in the process of token updating of each token bucket.

In a preferred embodiment of the present invention, each update pool represents the update level by a pre-configured standard time, and the smaller the standard time, the higher the update level and the higher the cyclic update frequency.

In a preferred embodiment of the present invention, as shown in fig. 3, step S4 includes:

step S41, the flow shaper token updating system processes to obtain an expected time when the token quantity is accumulated to zero according to the cycle updating signal, the token quantity of the token bucket and a pre-configured token generation rate;

step S42, the traffic shaper token updating system compares the expected time with each standard time, and takes the update level corresponding to the standard time that is greater than the expected time and closest to the expected time as the update level of the traffic shaper;

and step S43, the token updating system puts the traffic shaper into an update pool corresponding to the update level so as to update the token bucket according to the cyclic update frequency.

In the preferred embodiment of the present invention, the expected time is a time difference between an expected time when the number of tokens is accumulated to zero and the current time;

in step S42, the traffic shaper token updating system compares the expected time with each standard time respectively during the change of the expected time and continuously outputs a comparison result, and outputs an adjustment signal when the comparison result indicates that the update level of the traffic shaper changes;

in step S43, the traffic shaper token update system adjusts the update pool in which the traffic shaper is located according to the adjustment signal.

In a preferred embodiment of the present invention, before performing step S4, a bandwidth borrowing update process is further included, each traffic shaper is configured with a borrowing status flag, each traffic shaper has a different priority, and each traffic shaper is sequentially arranged according to the priority from high to low to form a priority queue;

the bandwidth borrowing update procedure includes:

configuring the corresponding borrow status flag bit to a first value when the data queue associated with the traffic shaper is an empty queue, and configuring the corresponding borrow status flag bit to a second value when the data queue associated with the traffic shaper is a non-empty queue;

for each traffic shaper, binding the two traffic shapers when the borrowing state flag bit of the adjacent traffic shaper with higher priority in the priority queue is a first value, and then unbinding the two traffic shapers when the borrowing state flag bit of the traffic shaper with higher priority is a second value;

when the two traffic shapers are bound in step S4, the traffic shaper token updating system puts the bound two traffic shapers as a whole into the corresponding update pool for token updating.

While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:时间敏感网络门控列表实现方法及门控列表条目生成方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!