Background technology
Scheduling realizes (the Quality of Service of QoS in network communicating system, service quality) key technology, the outbound port of nodes has maximum processing capability, when the inbound port flow of node is greater than outlet disposal ability, this node just occurs congested, and the congested result caused is packet loss.The network node ensured not providing QoS, usually FIFO (First In First Out is taked, first in first out) method temporal data bag, once cause FIFO completely due to congested, the packet so newly entering this node is dropped, and and what packet is indifferent to what abandon be, take tail drop mechanism (drop tail) to abandon the packet newly entered.In order to provide different service quality ratings to different business stream, propose QoS concept, nodes need identify different Business Streams, gives differential service.The method temporal data bag of many queues is taked in its interior joint, different Business Streams is stored in different queues, when node occurs congested, gives the service guarantees that Business Stream in individual queue is different, ensure as given video traffic low time delay, data service high bandwidth guarantee etc.And scheduling is exactly according to quality of service requirement from different business flow queue, selecting a queue out to serve, is the core technology realizing QoS.
When number of queues is larger, the bag long message in all queues of perception wanted by scheduler based on bag, from realization, larger difficulty will be faced, because store the bag long message of enormous quantity queue (tens even hundreds of K), will consume a large amount of storage resources, management is simultaneously upper will become complicated.In addition, in the application that the network bandwidth is very high, needs take very high frequency to carry out data dispatching bag by the scheduling based on bag, and hardware time order also faces the challenge.
Based on the scheduling of token (credit), it is another kind of scheduling strategy, different from based on the scheduling of wrapping, scheduler does not need perception bag long message, but regards fixed length bag as long for the bag in all queues, and each scheduling result is the token giving to send a fixed length bag, scheduler perception be the length of queue, queue length be greater than 0 queue request scheduling, and for queue length be less than 0 queue, scheduler does not give dispatcher meeting.Be adapted at the larger place of number of queues based on token scheduling to use, good quality of service guarantee can be provided equally.
But also there is drawback based on the dispatching technique of credit, particularly when the residue credit of queue 0 exhausts, scheduler could continue the credit distributing non-zero, as long as obviously queue 0 non-NULL, so this queue dispatched by scheduler always, other Low Priority Queuings are finally caused to can not get dispatcher meeting, simultaneously outlet bandwidth not speed limit, bandwidth waste.
In the flow control system of a credit base, the message number that transmitter side can send is subject to the quantitative limitation of credit number, receiver side can send credit to transmitter side, transmitter side can consume credit in units of flit, just can there is flit when there being credit in transmitter side, the credit at every turn sending flit corresponding just subtracts 1.Wherein, flit refers to the data cell of transmitting procedure, similar packet.
Summary of the invention
For this reason, need to provide a kind of flow control method based on token and device, solve the problem that available data dispatching effect is undesirable.
For achieving the above object, inventor provide a kind of flow control apparatus based on token, comprise transmitter side and receiver side, described transmitter side comprises scheduling unit, described receiver side comprises independent buffer unit and shared buffer memory unit, described scheduling unit is connected with independent buffer unit, shared buffer memory unit, described independent buffer unit includes the independent buffer memory token for marking independent buffer unit residual capacity, and described shared buffer memory unit includes the shared buffer memory token for marking shared buffer memory unit residual capacity;
Described receiver side is for sending independent buffer memory token to transmitter side, judge that whether the residual capacity of corresponding independent buffer unit is sufficient according to independent buffer memory token when described scheduling unit is for receiving the data of independent buffer memory type, send data to receiver side when abundance, receiver side stores data to corresponding independent buffer unit.
Optionally, described receiver side also for when independent buffer unit residual capacity is not enough, judges whether shared buffer memory unit residual capacity in addition, if also have shared buffer memory residual capacity, then send independent buffer memory token to transmitter side, receiver side is stored into shared buffer memory unit after receiving data.
Optionally, described receiver side is also for sending shared buffer memory token to transmitter side, described scheduling unit is used for when receiving independent buffer memory categorical data and independent buffer unit residual capacity is not enough, judge that whether the residual capacity of shared buffer memory unit is sufficient by shared buffer memory token, send data to shared buffer memory unit when abundance.
Optionally, described scheduling unit is also for preferentially sending the high data of token degree of priority.
And inventor also provides a kind of flow control method based on token, is applied to transmitter side and receiver side, described transmitter side has call unit, and described receiver side has independent buffer unit and shared buffer memory unit, it is characterized in that: comprise the steps:
Described receiver side sends the independent buffer memory token of the independent buffer unit residual capacity of mark to transmitter side,
When described scheduling unit receives the data of independent buffer memory type, judge that whether the residual capacity of corresponding independent buffer unit is sufficient, send data to receiver side when abundance according to independent buffer memory token, receiver side stores data to corresponding independent buffer unit.
Optionally, also comprise the steps:
Described receiver side, when independent buffer unit residual capacity is not enough, judges whether shared buffer memory unit residual capacity in addition,
If also have shared buffer memory residual capacity, then send independent buffer memory token to transmitter side,
Receiver side is stored into shared buffer memory unit after receiving data.
Optionally, also comprise the steps:
Described receiver side sends shared buffer memory token to transmitter side,
Described scheduling unit receive independent buffer memory categorical data and independent buffer unit residual capacity is not enough time,
Judge that whether the residual capacity of shared buffer memory unit is sufficient by shared buffer memory token, send data to shared buffer memory unit when abundance.
Optionally, also comprise the steps: that scheduling unit preferentially sends the high data of token degree of priority.
Be different from prior art, technique scheme realizes scheduling by token, simultaneously can by the data buffer storage of shared buffer memory unit realization when data congestion, avoid the loss of data, independent buffer unit can be multiple, then can store data to different independent buffer units according to different types of service.By share and independently buffer unit carry out separate management and support shared buffer memory token, to the equilibrium assignment of request channel, effectively can improve the real-time control in data traffic transmitting procedure and data transmission efficiency, in the system of growing network high-speed data interaction, this programme can effectively improve whole systematic function.
Embodiment
By describe in detail technical scheme technology contents, structural feature, realized object and effect, coordinate accompanying drawing to be explained in detail below in conjunction with specific embodiment.
Refer to Fig. 1, the present embodiment provides a kind of flow control apparatus based on token, comprise transmitter side and receiver side, described transmitter side comprises scheduling unit 110, described receiver side comprises independent buffer unit 130 and shared buffer memory unit 120, described scheduling unit 110 is connected with independent buffer unit 130, shared buffer memory unit 120, described independent buffer unit 130 includes the independent buffer memory token for marking independent buffer unit residual capacity, and described shared buffer memory unit 120 includes the shared buffer memory token for marking shared buffer memory unit residual capacity.
Receiver side is for sending independent buffer memory token to transmitter side, now scheduling unit 110 can receive this independent buffer memory token, judge that whether the residual capacity of corresponding independent buffer unit is sufficient according to independent buffer memory token when scheduling unit 110 is for receiving the data of independent buffer memory type, send data to receiver side when abundance, receiver side stores data to corresponding independent buffer unit.In the present embodiment, independent buffer unit can have multiple, for different independent buffer units to there being different type of service data, as having independent buffer unit 140 and independent buffer unit 150.Token can be the numeral of tag cache unit residual capacity size.The present invention, when dispatching, after scheduling unit 110 receives data, can be stored into corresponding independent buffer unit according to the type of data.Depositing independent buffer unit 130 as received data 101, receiving data 102,103 and depositing independent buffer unit 140, receiving data 104 and deposit independent buffer unit 150.After independent buffer unit is filled up by data, data can be deposited shared buffer memory unit, thus avoid the loss of data.The data of such separate traffic type have buffer unit to store separately, the data avoiding certain type of service buffer memory and cause other types of service cannot the situation of buffer memory always.
Be directed to shared buffer memory token, can adopt different management strategies, the present embodiment provides explicit token management mechanism and the token management mechanism of implicit expression.Explicit token management mechanism: receiver side token divides into independent buffer memory token that each passage retains and the shared buffer memory token that all kinds of protocol type is shared, the state of the notice transmitter side shared buffer memory that receiver side is explicit and independent buffer memory token, which passage is shared buffer memory part be distributed to by transmitter side uses.Then receiver side is also for sending shared buffer memory token to transmitter side, scheduling unit can receive shared buffer memory token, on above-described embodiment basis, receiver side also can receive independent buffer memory token, then scheduling unit is when receiving independent buffer memory categorical data and independent buffer unit residual capacity is not enough, judges that whether the residual capacity of shared buffer memory unit is sufficient by shared buffer memory token.Send data to shared buffer memory unit when the residual capacity of shared buffer memory unit is sufficient, after data arrival receiver side, receiver side needs the data judging shared buffer memory unit to belong to which passage on earth.In explicit token management mechanism, only have when just notifying transmitter side after receiver side release shared buffer memory unit.
Above-mentioned explicit token management mechanism is by transmitter side realization to the management of shared buffer memory token and judgement, and the token management mechanism of implicit expression is in the management of receiver side realization to shared buffer memory token.The token management mechanism of concrete implicit expression is: the token of receiver side sending area subchannel is to transmitter side, and the buffer memory of shared buffer memory part is managed voluntarily by receiver side.Receiver side sends independent buffer memory token to transmitter side, and transmitter side sends data accordingly, when certain passage of receiver side does not have buffer memory time, also can send the token of this passage when shared buffer memory unit also has buffer memory.After transmitter side receives token or can data be sent, but be buffered in shared buffer memory unit when being sent to receiver side, consumption be shared buffer memory token.This judges that token realizes at receiver side.Then receiver side is also for when independent buffer unit residual capacity is not enough, judges whether shared buffer memory unit residual capacity in addition, if also have shared buffer memory residual capacity, then sends independent buffer memory token to transmitter side.Transmitter side, after the data receiving independent buffer memory type, owing to receiving independent buffer memory token, then also can send data.Receiver side is stored into shared buffer memory unit after receiving data.
The explicit token management mechanism of above-described embodiment and the token management mechanism of implicit expression can realize in one apparatus simultaneously, how to use these two mechanism can according to the remaining amount of capacity of shared buffer memory unit simultaneously, if capacity is larger, be greater than preset value, then can adopt explicit, otherwise implicit expression can be adopted.The data that there is buffer unit can be consumed by rear class routine processes, then the residual capacity of buffer unit can become large, namely the token of receiver side is when the buffer unit residual capacity change of receiver side, and meeting one changes, and now needs to resend token carries out transmitter side token renewal to transmitter side.In certain embodiments, described scheduling unit is also for preferentially sending the high data of token degree of priority.Token degree of priority can determine according to the token size of the type of service of passage or passage, and the degree of priority as some type of service is relatively high, or the relatively large degree of priority of token is higher.
And inventor also provides a kind of flow control method based on token, as shown in Figure 2, be applied to transmitter side and receiver side, described transmitter side has call unit, described receiver side has independent buffer unit and shared buffer memory unit, it is characterized in that: comprise the steps:
Receiver side described in step S201 sends the independent buffer memory token of the independent buffer unit residual capacity of mark to transmitter side, when scheduling unit described in step S202 receives the data of independent buffer memory type, according to independent buffer memory token, step S203 judges that whether the residual capacity of corresponding independent buffer unit is sufficient, step S204 sends data to receiver side when abundance, and receiver side stores data to corresponding independent buffer unit.Wherein, independent buffer memory token can be the size of residual capacity, when the residual capacity of the independent buffer unit of certain type is zero, independent buffer memory token is also zero, now independent buffer unit is filled, and receiver side cannot receive data, and transmitter side does not send the type data.By the scheduling of this method, the data of each type of service can deposit the independent buffer unit of correspondence, when the data congestion of certain type of service, can not have influence on the buffer memory of other types of service.
Optionally, this method also comprises the steps: that step S205 receiver side is when independent buffer unit residual capacity is not enough, judge whether shared buffer memory unit residual capacity in addition, if also have shared buffer memory residual capacity in step S206, then send independent buffer memory token to transmitter side, after step S207 receiver side receives data, be stored into shared buffer memory unit.Namely receiver side is when some independent buffer unit residual capacity is zero, or non-vanishing independent buffer memory token can be sent, inform that transmitter side can receive the data of this type of service, but now data are not be stored into independent buffer unit after arriving receiver side, but are stored into shared buffer memory unit.As long as such transmitter side simply judges that the token of type of service has residual capacity can send out corresponding data.
In certain embodiments, as shown in Figure 3, in step S204, this method also comprises the steps: that step S305 receiver side sends shared buffer memory token to transmitter side, when step S306 scheduling unit receives independent buffer memory categorical data and independent buffer unit residual capacity is not enough, judge that whether the residual capacity of shared buffer memory unit is sufficient by shared buffer memory token, step S307 sends data to shared buffer memory unit when abundance.Realize the storage of transmitter side to shared buffer memory unit like this, after independent buffer unit is filled, data can be stored into shared buffer memory unit by transmitter side.
In order to ensure the scheduling of some data when data congestion, then this method also comprises: scheduling unit preferentially sends the high data of token degree of priority, and the data that namely scheduling unit priority scheduling token degree of priority is high, ensure the scheduling of these data.
It should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or terminal equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or terminal equipment.When not more restrictions, the key element limited by statement " comprising ... " or " comprising ... ", and be not precluded within process, method, article or the terminal equipment comprising described key element and also there is other key element.In addition, in this article, " be greater than ", " being less than ", " exceeding " etc. be interpreted as and do not comprise this number; " more than ", " below ", " within " etc. be interpreted as and comprise this number.
Those skilled in the art should understand, the various embodiments described above can be provided as method, device or computer program.These embodiments can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.The hardware that all or part of step in the method that the various embodiments described above relate to can carry out instruction relevant by program has come, described program can be stored in the storage medium that computer equipment can read, for performing all or part of step described in the various embodiments described above method.Described computer equipment, includes but not limited to: personal computer, server, all-purpose computer, special-purpose computer, the network equipment, embedded device, programmable device, intelligent mobile terminal, intelligent home device, wearable intelligent equipment, vehicle intelligent equipment etc.; Described storage medium, includes but not limited to: the storage of RAM, ROM, magnetic disc, tape, CD, flash memory, USB flash disk, portable hard drive, storage card, memory stick, the webserver, network cloud storage etc.
The various embodiments described above describe with reference to the flow chart of method, equipment (system) and computer program according to embodiment and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of computer equipment to produce a machine, making the instruction performed by the processor of computer equipment produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer equipment readable memory that works in a specific way of vectoring computer equipment, the instruction making to be stored in this computer equipment readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded on computer equipment, make to perform sequence of operations step on a computing device to produce computer implemented process, thus the instruction performed on a computing device is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Although be described the various embodiments described above; but those skilled in the art are once obtain the basic creative concept of cicada; then can make other change and amendment to these embodiments; so the foregoing is only embodiments of the invention; not thereby scope of patent protection of the present invention is limited; every utilize specification of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included within scope of patent protection of the present invention.