CN106411773B - Flow shaping method in transmission of video based on token bucket and system - Google Patents
Flow shaping method in transmission of video based on token bucket and system Download PDFInfo
- Publication number
- CN106411773B CN106411773B CN201610764148.1A CN201610764148A CN106411773B CN 106411773 B CN106411773 B CN 106411773B CN 201610764148 A CN201610764148 A CN 201610764148A CN 106411773 B CN106411773 B CN 106411773B
- Authority
- CN
- China
- Prior art keywords
- token
- video
- token bucket
- message
- transmission
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/215—Flow control; Congestion control using token-bucket
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/22—Traffic shaping
- H04L47/225—Determination of shaping rate, e.g. using a moving window
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/23—Bit dropping
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/75—Media network packet handling
- H04L65/765—Media network packet handling intermediate
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses the flow shaping methods in a kind of transmission of video based on token bucket, are related to transmission of video technical field of data processing, include the following steps:S1 receives the data message of video source transmission, obtains video way and video code rate, and data message is stored in buffer queue;S2 fills token according to video way and video code rate computational token fill rate to token bucket;S3, judges whether the token number in token bucket is greater than or equal to the byte number of data message to be sent, if so, S4 is entered step, if it is not, entering step S5;S4 reads data message and is sent from buffer queue, and the token number in token bucket is reduced the corresponding numerical value of message byte number;S5 stops sending message, waits new token to be generated.The present invention adjusts token fill rate according to the video way and video code rate of data to be transmitted message, to data ductility limit speed and can cause serious loss of data.The invention also discloses the traffic shaping systems in a kind of transmission of video based on token bucket.
Description
Technical field
The present invention relates to transmission of video technical field of data processing, and in particular in a kind of transmission of video based on token bucket
Flow shaping method and system.
Background technology
Flow shaping method in currently used transmission of video is all realized by token bucket algorithm.Token bucket is calculated
The principle of method is to generate token with certain rate, and be filled into token bucket, after receiving data message, according to the order in token bucket
Board number controls the transmission of message.In current equipment and chip, the configuration range of token generation rate be it is changeless, no
Change with data flow, this produces a very large impact flow shaping effect.
When token generation rate is excessive, data flow is not acted on by any speed limit after arrival, and data flow is maximum
It is up to peak rate and flows to network;Meanwhile extra token is accumulated in bucket, the bursty traffic reached below can be more than
The flow rate and direction network of peak value, token bucket do not play the role of traffic shaping and limitation speed.
When token generation rate is too small, data flow can constantly exhaust token in token bucket, since token is not enough, portion
Divided data stream will overflow in data buffer storage queue, will produce loss of data phenomenon.
Invention content
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of transmission of video based on token bucket
In flow shaping method and system, shaping and speed limit can be carried out to data stream, also be avoided that and cause serious loss of data
Phenomenon.
To achieve the above objectives, the technical solution adopted by the present invention is that:A kind of stream in transmission of video based on token bucket
Shaping methods are measured, are included the following steps:
S1 receives the data message of video source transmission, obtains video way and video code rate, and data message is stored in phase
The buffer queue answered;
S2, according to video way and video code rate computational token fill rate, and with the token fill rate to token
Bucket filling token;
S3, judges whether the token number in token bucket is greater than or equal to the byte number of data message to be sent, if so, into
Step S4, if it is not, entering step S5;
S4 reads data message and is sent from buffer queue, and the token number in token bucket is reduced message byte number
Corresponding numerical value terminates;
S5 stops sending message, waits new token to be generated, terminates.
Based on the above technical solution, the video source is camera video source.
Based on the above technical solution, the token fill rate is calculated by the following formula:
Wherein Token is token fill rate, and n is to generate currently
The video source quantity of data message, i are video source serial number, and i is the positive integer from 1 to n, riFor the video code rate of video source, miFor
The video way of video source, k are correction factor, and p is the frequency for filling token.
Based on the above technical solution, k is directly proportional to token bucket depth.
Based on the above technical solution, the clock interval of p=(clock frequency * 8)/token bucket of filling.
Based on the above technical solution, when the token number in token bucket be less than data message to be sent byte number,
And when buffer queue has been expired, the data message subsequently to arrive is abandoned.
The invention also discloses the traffic shaping systems in a kind of transmission of video based on token bucket, including:
Data cache module, the data message for receiving video source transmission obtain video way and video code rate, and will
Data message is stored in corresponding buffer queue;
Token fills module, is used for according to video way and video code rate computational token fill rate, and with the token
Fill rate fills token to token bucket;
Shaping control module, when the token number in token bucket is greater than or equal to the byte number of data message to be sent, from
Data message is read in data buffer storage queue and is sent, and the token number in token bucket is reduced into the corresponding numerical value of message byte number;
When token number in token bucket is less than the byte number of data message to be sent, stops sending message, wait new token to be generated.
Based on the above technical solution, the token fill rate is calculated by the following formula:
Wherein Token is token fill rate, and n is to generate currently
Video source quantity used by data message, i are video source serial number, and i is the positive integer from 1 to n, riFor the video codes of video source
Rate, miFor the video way of video source, k is correction factor, and p is the frequency for filling token.
Based on the above technical solution, k is directly proportional to token bucket depth.
Based on the above technical solution, the clock interval of p=(clock frequency * 8)/token bucket of filling.
Compared with the prior art, the advantages of the present invention are as follows:
The present invention adjusts token fill rate according to the video way and video code rate of data to be transmitted message, in token bucket
In token number be greater than or equal to data message to be sent byte number when, from data buffer storage queue read data message it is concurrent
It send, the token number in token bucket is reduced into the corresponding numerical value of message byte number;Token number in token bucket is less than number to be sent
According to message byte number when, stop sending message, wait new token to be generated, to which shaping and speed limit can be carried out to data stream,
Serious loss of data phenomenon will not be caused simultaneously.
Description of the drawings
Fig. 1 is the flow chart of the flow shaping method in the transmission of video based on token bucket in the embodiment of the present invention;
Fig. 2 is the structure diagram of the traffic shaping system in the transmission of video based on token bucket in the embodiment of the present invention.
In figure:1- data cache modules, 2- tokens fill module, 3- shaping control modules.
Specific implementation mode
Invention is further described in detail with reference to the accompanying drawings and embodiments.
Shown in Figure 1, the embodiment of the present invention provides the flow shaping method in a kind of transmission of video based on token bucket,
Include the following steps:
S1 receives the data message of video source transmission, obtains video way and video code rate, and data message is stored in phase
The buffer queue answered;The video source is camera video source;
S2, according to video way and video code rate computational token fill rate, and with the token fill rate to token
Bucket filling token;The token fill rate is calculated by the following formula:
Wherein Token is token fill rate, and n is to generate currently
The video source quantity of data message, i are video source serial number, and i is the positive integer from 1 to n, riFor the video code rate of video source, miFor
The video way of video source, k are correction factor, and p is the frequency for filling token.K is directly proportional to token bucket depth.P=(clock frequencies
Rate * 8)/filling token bucket clock interval.
S3, judges whether the token number in token bucket is greater than or equal to the byte number of data message to be sent, if so, into
Step S4, if it is not, entering step S5;
S4 reads data message and is sent from buffer queue, and the token number in token bucket is reduced message byte number
Corresponding numerical value;
S5 stops sending message, waits new token to be generated.
The present invention adjusts token fill rate according to the video way and video code rate of data to be transmitted message, in token bucket
In token number be greater than or equal to data message to be sent byte number when, from data buffer storage queue read data message it is concurrent
It send, the token number in token bucket is reduced into the corresponding numerical value of message byte number;Token number in token bucket is less than number to be sent
According to message byte number when, stop sending message, wait new token to be generated, to which shaping and speed limit can be carried out to data stream,
Serious loss of data phenomenon will not be caused simultaneously.
When the token number in token bucket is less than the byte number of data message to be sent, and buffer queue has been expired, subsequently
The data message of arrival will be dropped.After the token number in token bucket is full, the token of spilling will be dropped.
Shown in Figure 2, the invention also discloses the traffic shaping system in a kind of transmission of video based on token bucket, packets
It includes:
Data cache module 1, the data message for receiving video source transmission obtain video way and video code rate, and
Data message is stored in corresponding buffer queue;
Token fills module 2, is used for according to video way and video code rate computational token fill rate, and with the token
Fill rate fills token to token bucket;
Shaping control module 3, when the token number in token bucket is greater than or equal to the byte number of data message to be sent, from
Data message is read in data buffer storage queue and is sent, and the token number in token bucket is reduced into the corresponding numerical value of message byte number;
When token number in token bucket is less than the byte number of data message to be sent, stops sending message, wait new token to be generated.
The token fill rate is calculated by the following formula:
Wherein Token is token fill rate, and n is to generate currently
Video source quantity used by data message, i are video source serial number, and i is the positive integer from 1 to n, riFor the video codes of video source
Rate, miFor the video way of video source, k is correction factor, and p is the frequency for filling token.K is directly proportional to token bucket depth.P=
The clock interval of token bucket of (clock frequency * 8)/filling.
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 the protection of the present invention
Within the scope of.The content not being described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.
Claims (8)
1. the flow shaping method in a kind of transmission of video based on token bucket, which is characterized in that include the following steps:
S1 receives the data message of video source transmission, obtains video way and video code rate, and data message is stored in accordingly
Buffer queue;
S2 is filled out according to video way and video code rate computational token fill rate, and with the token fill rate to token bucket
Fill token;The token fill rate is calculated by the following formula:
Wherein Token is token fill rate, and n is to generate current data
The video source quantity of message, i are video source serial number, and i is the positive integer from 1 to n, riFor the video code rate of video source, miFor video
The video way in source, k are correction factor, and p is the frequency for filling token;
S3, judges whether the token number in token bucket is greater than or equal to the byte number of data message to be sent, if so, entering step
S4, if it is not, entering step S5;
S4 reads data message and is sent from buffer queue, and the token number in token bucket is reduced message byte number and is corresponded to
Numerical value, terminate;
S5 stops sending message, waits new token to be generated, terminates.
2. the flow shaping method in a kind of transmission of video based on token bucket as described in claim 1, it is characterised in that:Institute
It is camera video source to state video source.
3. the flow shaping method in a kind of transmission of video based on token bucket as described in claim 1, it is characterised in that:k
It is directly proportional to token bucket depth.
4. the flow shaping method in a kind of transmission of video based on token bucket as described in claim 1, it is characterised in that:p
The clock interval of=(clock frequency * 8)/token bucket of filling.
5. the flow shaping method in a kind of transmission of video based on token bucket as described in claim 1, it is characterised in that:When
Token number in token bucket is less than the byte number of data message to be sent, and when buffer queue expire, what discarding subsequently arrived
Data message.
6. the traffic shaping system in a kind of transmission of video based on token bucket, which is characterized in that including:
Data cache module (1), the data message for receiving video source transmission obtain video way and video code rate, and will
Data message is stored in corresponding buffer queue;
Token fills module (2), for being filled out according to video way and video code rate computational token fill rate, and with the token
It fills rate and fills token to token bucket;The token fill rate is calculated by the following formula:
Wherein Token is token fill rate, and n is to generate current data
Video source quantity used by message, i are video source serial number, and i is the positive integer from 1 to n, riFor the video code rate of video source, mi
For the video way of video source, k is correction factor, and p is the frequency for filling token;
Shaping control module (3), when the token number in token bucket is greater than or equal to the byte number of data message to be sent, from number
According to reading data message in buffer queue and sending, the token number in token bucket is reduced into the corresponding numerical value of message byte number;
When token number in token bucket is less than the byte number of data message to be sent, stops sending message, wait new token to be generated.
7. the traffic shaping system in a kind of transmission of video based on token bucket as claimed in claim 6, it is characterised in that:k
It is directly proportional to token bucket depth.
8. the traffic shaping system in a kind of transmission of video based on token bucket as claimed in claim 6, it is characterised in that:p
The clock interval of=(clock frequency * 8)/token bucket of filling.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610764148.1A CN106411773B (en) | 2016-08-29 | 2016-08-29 | Flow shaping method in transmission of video based on token bucket and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610764148.1A CN106411773B (en) | 2016-08-29 | 2016-08-29 | Flow shaping method in transmission of video based on token bucket and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106411773A CN106411773A (en) | 2017-02-15 |
CN106411773B true CN106411773B (en) | 2018-10-23 |
Family
ID=58003840
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610764148.1A Active CN106411773B (en) | 2016-08-29 | 2016-08-29 | Flow shaping method in transmission of video based on token bucket and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106411773B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109428801A (en) * | 2017-08-23 | 2019-03-05 | 北京华为数字技术有限公司 | File transmitting method and device |
CN107635144A (en) * | 2017-10-25 | 2018-01-26 | 暴风集团股份有限公司 | Server output stream amount method for limiting speed, device, server and DNS systems |
CN109076024A (en) * | 2018-07-20 | 2018-12-21 | 威富通科技有限公司 | data control method and terminal device |
CN110572329B (en) * | 2019-07-08 | 2022-07-01 | 紫光云技术有限公司 | Network adaptive traffic shaping method and system |
CN112752307A (en) * | 2021-01-04 | 2021-05-04 | 欧普照明股份有限公司 | Control method, data processing apparatus, control system, and storage medium |
CN114124829A (en) * | 2021-09-26 | 2022-03-01 | 新华三技术有限公司 | Service forwarding control method and device and electronic equipment |
CN114745333B (en) * | 2022-03-03 | 2023-05-30 | 珠海高凌信息科技股份有限公司 | IMS system self-adaptive flow control method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101521813A (en) * | 2009-04-17 | 2009-09-02 | 杭州华三通信技术有限公司 | Method and device for processing media stream |
CN102014075A (en) * | 2010-12-21 | 2011-04-13 | 杭州华三通信技术有限公司 | Traffic policing method and device |
CN103326953A (en) * | 2013-03-28 | 2013-09-25 | 华为技术有限公司 | Flow limiting method and device based on token buckets |
WO2015149488A1 (en) * | 2014-04-03 | 2015-10-08 | 深圳市中兴微电子技术有限公司 | Method and apparatus for limiting rate by means of token bucket, and computer storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8289852B2 (en) * | 2009-02-18 | 2012-10-16 | Clearwire Ip Holdings Llc | Setting token bucket parameters for scheduling of air-interface resources |
-
2016
- 2016-08-29 CN CN201610764148.1A patent/CN106411773B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101521813A (en) * | 2009-04-17 | 2009-09-02 | 杭州华三通信技术有限公司 | Method and device for processing media stream |
CN102014075A (en) * | 2010-12-21 | 2011-04-13 | 杭州华三通信技术有限公司 | Traffic policing method and device |
CN103326953A (en) * | 2013-03-28 | 2013-09-25 | 华为技术有限公司 | Flow limiting method and device based on token buckets |
WO2015149488A1 (en) * | 2014-04-03 | 2015-10-08 | 深圳市中兴微电子技术有限公司 | Method and apparatus for limiting rate by means of token bucket, and computer storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106411773A (en) | 2017-02-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106411773B (en) | Flow shaping method in transmission of video based on token bucket and system | |
CN1297118C (en) | Bandwidth monitor and control equipment | |
CN108667739A (en) | Jamming control method, apparatus and system | |
CN109039936B (en) | Transmission rate control method, device, sending equipment and receiving equipment | |
CN107948103B (en) | Switch PFC control method and control system based on prediction | |
CN105763478A (en) | Token bucket algorithm-based satellite data ground transmission network flow control system | |
CN110445722B (en) | Congestion control method, device, equipment and storage medium | |
CN112995048B (en) | Blocking control and scheduling fusion method of data center network and terminal equipment | |
CN102811176B (en) | A kind of data flow control method and device | |
JP2007201965A (en) | Packet repeating apparatus having transmission control function | |
RU2009134729A (en) | DEVICE AND METHOD FOR FLOW CONTROL BASED ON SPEED LIMITATION FOR MSTP DEVICE | |
CN106954101A (en) | The frame losing control method that a kind of low latency real-time video Streaming Media is wirelessly transferred | |
CN102387076A (en) | Shaping-combined hierarchical queue scheduling method | |
CN109728927A (en) | Time delay optimization method, business scheduling method and storage medium | |
CN103209494A (en) | Real-time video business resource distribution method based on importance mark | |
US20230239248A1 (en) | Traffic shaping method and apparatus | |
CN103888372A (en) | Traffic shaping method and data processing equipment | |
CN1607767A (en) | Flow-control method based on network processor | |
JP5673321B2 (en) | Transmission device and interface card | |
CN107770082A (en) | A kind of transfer control method of task based access control discharge characteristic in data center network | |
CN109600320A (en) | Congestion processing method and equipment, data center network | |
CN111385219B (en) | Method for realizing high-performance high-precision software TCP speed limit by hardware interrupt | |
Zheng et al. | A novel low-latency scheduling approach of TSN for multi-link rate networking | |
JP4550567B2 (en) | Policer burst size automatic setting method | |
WO2016197810A1 (en) | Packet sending method and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |