CN109756429A - Bandwidth allocation methods and equipment - Google Patents

Bandwidth allocation methods and equipment Download PDF

Info

Publication number
CN109756429A
CN109756429A CN201711078855.6A CN201711078855A CN109756429A CN 109756429 A CN109756429 A CN 109756429A CN 201711078855 A CN201711078855 A CN 201711078855A CN 109756429 A CN109756429 A CN 109756429A
Authority
CN
China
Prior art keywords
transmission channel
bandwidth
data
transmission
inactive
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.)
Granted
Application number
CN201711078855.6A
Other languages
Chinese (zh)
Other versions
CN109756429B (en
Inventor
宋卓
李靖轩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201711078855.6A priority Critical patent/CN109756429B/en
Publication of CN109756429A publication Critical patent/CN109756429A/en
Application granted granted Critical
Publication of CN109756429B publication Critical patent/CN109756429B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application provides a kind of bandwidth allocation schemes, in the program when current transmission channel needs to transmit data, detect the active state of other transmission channels, and inactive transmission channel is determined from other transmission channels, then the bandwidth share of the inactive transmission channel is recycled, it is added in globally available bandwidth, and from from the globally available bandwidth, is the current transmission channel bandwidth allocation quota.Wherein, inactive transmission channel refers to the transmission channel that data transmission was not carried out in preset duration, when any one transmission channel needs to transmit data, it can constantly repeat the above process, the recycling and distribution of each transmission channel bandwidth are dynamic, scene without locking, suitable for high concurrent.

Description

Bandwidth allocation methods and equipment
Technical field
This application involves information technology field more particularly to a kind of bandwidth allocation methods and equipment.
Background technique
In current existing system, flow control generally is carried out using TC (traffic control) frame, to realize Bandwidth allocation.Since the position that the processing opportunity of TC frame is the close trawl performance in protocol stack is in that is, close to physical layer More rearward position in data transmitting path, due to that can not control the data from upper layer, it is possible to can make to send The problem of some buffer area in path is occupied full or largely occupies, and causes buffer bloat (caching overfill).And TC The processing of frame is all based on queue, needs to lock during processing, therefore concurrent processing performance is poor.In addition, TC frame Frame is limited to the bit wide (generally could support up 128 classification) of protocol fields, can not support the bandwidth of large-scale fine granulation Distribution, such as can not support the bandwidth allocation of connection rank.
Apply for content
The purpose of the application is to provide a kind of bandwidth allocation scheme, to solve concurrent processing performance in the prior art Poor problem.
To achieve the above object, this application provides a kind of bandwidth allocation methods, this method comprises:
When current transmission channel needs to transmit data, the active state of other transmission channels is detected, and from other transmission Inactive transmission channel is determined in channel, wherein the inactive transmission channel are as follows: do not counted excessively in preset duration According to the transmission channel of transmission;
The bandwidth share for recycling the inactive transmission channel, is added in globally available bandwidth;
It is the current transmission channel bandwidth allocation quota from the globally available bandwidth.
Further, the active state of other transmission channels is detected, and determines inactive biography from other transmission channels Defeated channel, comprising:
The active state of other transmission channels of preset quantity is detected, and in other transmission channels of the preset quantity In, determine inactive transmission channel.
Further, the active state of other transmission channels is detected, and determines inactive biography from other transmission channels Defeated channel, comprising:
Obtain the corresponding timestamp information of other transmission channels, wherein the timestamp information corresponds to transmission channel at it Update when carrying out data transmission;
The timestamp information and current time of more other transmission channels obtain comparison result;
If comparison result is more than preset duration, corresponding transmission channel is determined as to inactive transmission channel.
Further, this method further include:
When creating transmission channel, by the contextual information of the transmission channel be written to one of data structure it is vacant Data item in, wherein each the data item that has occupied is corresponding with a transmission channel in the data structure, the context Information includes the timestamp information and mark information of corresponding transmission channel, and the mark information is used for the status indication of data item To have occupied.
Further, the contextual information further includes the bandwidth value of guaranteeing the minimum of the transmission channel, the bandwidth value of guaranteeing the minimum The bandwidth share at least needing to distribute when transmitting data for the transmission channel.
Further, this method further include:
When discharging transmission channel, the bandwidth share of the transmission channel is recycled, is added in globally available bandwidth, and delete Except content of the transmission channel in corresponding data item, and it is vacant that the state of the data item is updated to.
Further, the bandwidth share of corresponding transmission channel is also preserved in the data item of the data structure;
Recycle the bandwidth share of the inactive transmission channel, comprising:
In the corresponding data item of the inactive transmission channel, its bandwidth share is reset;
For the current transmission channel bandwidth allocation quota, comprising:
Into the corresponding data item of the current transmission channel, its bandwidth share is written.
Further, after for the current transmission channel bandwidth allocation quota, comprising:
From its bandwidth share is read in the data structure in the data item of current transmission channel;
The sum of the flow for needing the data transmitted and bandwidth occupancy of current transmission channel are obtained, as target flow;
When the target flow is less than the bandwidth share, the data are transmitted.
Another aspect based on the application additionally provides a kind of bandwidth distribution device, which includes:
Condition checkout gear, for detecting the activity of other transmission channels when current transmission channel needs to transmit data State, and inactive transmission channel is determined from other transmission channels, wherein the inactive transmission channel are as follows: default The transmission channel of data transmission was not carried out in duration;
Bandwidth recyclable device is added to globally available band for recycling the bandwidth share of the inactive transmission channel In width;
Bandwidth allocation device, for from the globally available bandwidth, being the current transmission channel bandwidth allocation quota.
Further, the condition checkout gear, the active state of other transmission channels for detecting preset quantity, and In other transmission channels of the preset quantity, inactive transmission channel is determined.
Further, the condition checkout gear, for obtaining the corresponding timestamp information of other transmission channels, wherein The timestamp information corresponds to update when transmission channel carries out data transmission at it;The timestamp information of more other transmission channels And current time, obtain comparison result;If comparison result is more than preset duration, corresponding transmission channel is determined as inactive Transmission channel.
Further, the equipment further include:
Control device, for when creating transmission channel, the contextual information of the transmission channel to be written to data knot In one unappropriated data item of structure, wherein the data item and a transmission channel each occupied in the data structure Corresponding, the contextual information includes the timestamp information and mark information of corresponding transmission channel, and the mark information is used for will The status indication of data item is to have occupied.
Further, the contextual information further includes the bandwidth value of guaranteeing the minimum of the transmission channel, the bandwidth value of guaranteeing the minimum The bandwidth share at least needing to distribute when transmitting data for the transmission channel.
Further, the bandwidth recyclable device is also used to recycle the band of the transmission channel when discharging transmission channel Wide quota is added in globally available bandwidth;
The control device is also used to delete the transmission channel in corresponding data item when discharging transmission channel Content, and it is vacant that the state of the data item is updated to.
Further, the bandwidth share of corresponding transmission channel is also preserved in the data item of the data structure;
The control device is also used in the corresponding data item of the inactive transmission channel, by its bandwidth share It resets, and into the corresponding data item of the current transmission channel, its bandwidth share is written.
Further, the equipment further include:
Data transmission device is used for after for the current transmission channel bandwidth allocation quota, from the data structure Its bandwidth share is read in the data item of middle current transmission channel, obtains the flow and current transmission channel for needing the data transmitted The sum of bandwidth occupancy, as target flow;And when the target flow is less than the bandwidth share, transmit the number According to.
In addition, present invention also provides a kind of bandwidth distribution device, which includes:
Processor;And
It is arranged to the memory of storage computer executable instructions, the executable instruction makes the place when executed It manages device and executes method above-mentioned.
In scheme provided by the present application, when current transmission channel needs to transmit data, the work of other transmission channels is detected Dynamic state, and inactive transmission channel is determined from other transmission channels, then recycle the inactive transmission channel Bandwidth share is added in globally available bandwidth, and from from the globally available bandwidth, is distributed for the current transmission channel Bandwidth share.Wherein, inactive transmission channel refers to the transmission channel that data transmission was not carried out in preset duration, in office When transmission channel of anticipating needs to transmit data, process can be constantly repeated the above, each transmission channel bandwidth is returned It receives and distribution is dynamically, to be not necessarily to lock, the scene suitable for high concurrent.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is a kind of process flow diagram of bandwidth allocation methods provided by the embodiments of the present application;
Fig. 2 is process flow diagram when creating transmission channel in the embodiment of the present application;
Fig. 3 is process flow diagram when discharging transmission channel in the embodiment of the present application;
Fig. 4 is process flow diagram when carrying out data transmission using bandwidth allocation methods provided by the embodiments of the present application;
Fig. 5 is the schematic diagram of array defined in the embodiment of the present application;
Fig. 6 is a kind of structural schematic diagram of bandwidth distribution device provided by the embodiments of the present application;
Fig. 7 is the structural schematic diagram of another bandwidth distribution device provided by the embodiments of the present application;
The same or similar appended drawing reference represents the same or similar component in attached drawing.
Specific embodiment
The application is described in further detail with reference to the accompanying drawing.
In a typical configuration of this application, terminal, the equipment of service network include one or more processors (CPU), input/output interface, network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media, can be by any side Method or technology realize that information stores.Information can be computer readable instructions, data structure, the module of program or other numbers According to.The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory techniques, CD-ROM (CD- ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storages Equipment or any other non-transmission medium, can be used for storage can be accessed by a computing device information.
The embodiment of the present application provides a kind of bandwidth allocation methods, matches for distributing bandwidth appropriate to each transmission channel Volume, to control transmission channel flow, the process flow of this method is as shown in Figure 1, comprising:
Step S101 detects the active state of other transmission channels when current transmission channel needs to transmit data, and from Inactive transmission channel is determined in other transmission channels.Wherein, transmission channel refers to the channel of data transmit-receive, not only can be with For distributing network bandwidth, such as the transmission of network data, it can be used for the bandwidth of distribution other way data transmission, such as distribute The memory bandwidth etc. in data transmission or distribution I/O (input and output) scene between process.In the transmission for network data When, transmission channel can be the connection of the foundation between two equipment, and when for the transmission of data between process, transmission channel can To be message queue etc., in I/O scene when the read-write of data, transmission channel can be I/O channel (such as stream, file Deng).Bandwidth refers to the data volume that can be transmitted the unit time.
When this programme is applied to distribution network bandwidth, can be adapted for using RDMA (Remote Direct Memory Access, remote direct memory access), the high performance networks of the technologies such as InfiniBand (infinite bandwidth), be readily applicable to The environment of traditional Ethernet (such as TCP/IP network) or all kinds of virtualization networks.
When transmitting data, the embodiment of the present application can be realized in kernel state or User space according to corresponding transport protocol The distribution of network bandwidth can be completed in the method for offer.For example, sending ending equipment is logical in the high performance network using RDMA It crosses network to be directly transferred in one piece of storage region of receiving device data, the CPU of receiving device is only in the process Need to carry out single treatment in initialization and the end of transmission, it is most without being intervened in transmission process Processing can all be completed in User space.And TCP/IP network needs CPU participation that data are directly transferred to reception when transmitting data The operation of the designated storage area of end equipment, therefore most processing can all be completed in kernel state.The embodiment of the present application as a result, The bandwidth allocation scheme of offer is not limited to realize in kernel state or User space, can be selected according to the scene of practical application real Now in kernel state or User space.
In partition size, it can be set according to actual needs.Such as in the scene of network bandwidth allocation, according to The thickness of partition size, can choose the distribution of fine-grained connection rank, or also can choose the thicker process level of granularity Not, the distribution of process group rank.Wherein, each process group may include at least one process, and each process can correspond to one Or multiple connections.When scheme is realized, transmission channel, which is defined as connection, process or process group, can be realized corresponding granularity Bandwidth allocation.
Current transmission channel refers to the transmission channel for currently needing to send data, needs at current time to be its bandwidth allocation Quota, the bandwidth upper limit value of data is transmitted as it, to control flow, realizes bandwidth allocation.Other transmission channels Corresponding to current transmission channel, refer to one or more transmission channel other than current transmission channel, these transmission are logical Road is possible to currently transmitting data, it is also possible to just completed data transmission, or may also the long period do not pass Transmission of data.Inactive transmission channel refers to the transmission channel that data transmission was not carried out in preset duration, such as example The preset duration is set as 5 seconds, then inactive transmission channel is not carry out the transmission that data are transmitted in 5 seconds to lead to Road.
In a kind of embodiment of the application, a timestamp information, the timestamp can be safeguarded for each transmission channel Information update when its corresponding transmission channel carries out data transmission, such as connection 1 have sent data in 00:15:11, then its is right The timestamp information answered will be updated to 00:15:11, if hereafter having sent data, corresponding time in 00:15:14 again Stamp information will be updated to 00:15:14 again.
As a result, in the active state for detecting other transmission channels, and inactive transmission is determined from other transmission channels When channel, the corresponding timestamp information of other transmission channels can be first obtained, then the timestamp letter of more other transmission channels Breath and current time obtain comparison result, if comparison result is more than preset duration, corresponding transmission channel are determined as inactive Transmission channel.By taking aforementioned connection 1 as an example, in the active state of detection connection 1, if current time is 00:15:20, compare Relatively result is difference 6 seconds, indicates that connection 1 has had 6 seconds kinds not to be transmitted across data, if the preset duration set as 5 seconds, can be with Determine that connection 1 is inactive connection.
Step S102 recycles the bandwidth share of inactive transmission channel, is added in globally available bandwidth.Wherein, band Wide quota refers to that the bandwidth that a transmission channel has currently occupied, globally available bandwidth refer to unappropriated in the bandwidth upper limit Bandwidth, can be used to distribute to and currently need to transmit the transmission channels of data, such as the bandwidth upper limit is 10MB, current time Through there are the connection that 3 are transmitting data, the bandwidth share for these connection distribution distinguishes 1MB, 2MB and 3MB, then at this time Globally available bandwidth is 4MB, if wherein bandwidth match for 1MB be connected to transfer data and enter inactive state when, Its bandwidth share can be recycled, is added in globally available bandwidth, globally available bandwidth at this time then becomes 5MB.
By detecting the active state of other transmission channels, it can determine that inactive transmission is logical from other transmission channels Road, since inactive transmission channel had not carried out data transmission in a longer period of time, then it is considered that these are passed Defeated channel is also larger a possibility that transmitting without data the short time, therefore can recycle its bandwidth share, its bandwidth is matched Volume is reset, and is added in globally available bandwidth.
In actual scene, the other transmission channels that can choose preset quantity are detected, and preset quantity its In its transmission channel, inactive transmission channel is determined, select other transmission channels of detection that can use random manner, It can be the Selection Strategy according to setting, such as randomly select 64 connections and detected, or choose total transmission channel quantity N%.
Step S103 is current transmission channel bandwidth allocation quota from globally available bandwidth.In actual scene, to work as The bandwidth share of preceding transmission channel distribution can be current all globally available bandwidth, be also possible in globally available bandwidth A part, such as it can be set by the user a bandwidth value, the bandwidth share of the value is distributed for the transmission channel, it can also basis Historical traffic of the transmission channel when transmitting data estimates suitable bandwidth value, for the transmission channel bandwidth allocation quota.
It, can be first based on the overall situation before the bandwidth allocation scheme for implementing the application in one embodiment of the application Available bandwidth and current transmission channel need the bandwidth share distributed to be determined, if globally available bandwidth can be greater than or equal to Current transmission channel needs the bandwidth share distributed, then may not need and execute the recycling that step S101 and S102 carry out bandwidth, and Directly executing step S103 is current transmission channel bandwidth allocation quota.
For example, the bandwidth upper limit is 10MB, 3 connections for transmitting data are had existed at current time, for these companies Bandwidth share difference 1MB, 2MB and 3MB of distribution are met, then globally available bandwidth at this time is 4MB.If needing to create at this time Bandwidth share required for new connection is only 2MB, then current globally available bandwidth can satisfy the bandwidth allocation newly connected, from And it can be directly in the globally available bandwidth of 4MB, for the bandwidth of newly created connection distribution 2MB.
After distributing corresponding bandwidth share for current transmission channel, which can be transmitted as data Flow rate upper limit value.When transmitting data, the sum of the flow for needing the data transmitted and bandwidth occupancy of current transmission channel are obtained, As target flow, then compare the bandwidth share of target flow and distribution, it, can if target flow is less than bandwidth share To transmit data, otherwise retried according to transmission policy selection, postpone transmission or abandon etc..
The scheme of the application may be implemented in sending side or receiving side, logical by current transmission when sending side is realized Transmission data in road are the transmission process of data, therefore when the target flow for needing to send is more than bandwidth share, can be according to hair It send policy selection to retry, postpone transmission or abandon the processing such as data.And when receiving side is realized, it is passed by current transmission channel Transmission of data is the receive process of data, can be according to reception strategy choosing when needing received target flow to be more than bandwidth share It selects and abandons the processing such as data, request transmitting terminal repeating transmission.
When any one transmission channel needs to transmit data, process, each transmission can be constantly repeated the above The recycling and distribution of bandwidth chahnel are dynamically, to be not necessarily to lock, the scene suitable for high concurrent.It is different from TC frame, this Shen Please embodiment scheme be applied to sending side when can protocol stack socket (socket) in realize, in data send road More forward position in diameter, is able to suppress the generation of buffer bloat.
In order to enable the process of bandwidth allocation is more efficient, the management cost of each transmission channel can be married again into control Plane (creation and release of transmission channel), to guarantee being simple and efficient for data plane (data transmission).One is defined as a result, A data structure is used to manage the contextual information of transmission channel, the contextual information included at least corresponding transmission channel when Between stab information and mark information.The contextual information that a transmission channel is saved in each data item in data structure, when one When a data item has had been written into contextual information, state has as been occupied, otherwise the state of data item can be to occupy, Mark information can be used for by the status indication of data item be occupied, thereby ensure that can individually to each transmission channel into Row bandwidth allocation.
When creating transmission channel, the contextual information of transmission channel is written to a unappropriated number of data structure According in item.The data structure used in actual scene can be array, and other any feasible data furthermore also can be used Structure, such as matrix, data sequence etc..Each array item of array is used to store the contextual information of a transmission channel, is The better bandwidth allocation for supporting large-scale fine granulation can use Multidimensional numerical, and combine bitmap algorithm optimization The lookup of corresponding array item.Since timestamp information is also stored in array, renewal time stamp information or read access time are needed Accessible array is operated when stabbing information.Fig. 2 shows schematic diagrames when creation transmission channel.
In this case, it selects other transmission channels of preset quantity to be detected, determines inactive transmission channel When, the array item of fixed quantity can be scanned every time since the corresponding array item of current transmission channel.Such as current transmission is logical Be designated as 100 under the corresponding array item in road, then can scan down be designated as 101~164 64 array items, obtain the time therein Information is stabbed, the detection of active state is carried out.
In addition, can also include the bandwidth value of guaranteeing the minimum of transmission channel in contextual information, bandwidth value of guaranteeing the minimum refers to that transmission is logical The bandwidth share that road at least needs to distribute when transmitting data.If such as a connection needs to transmit more important information, because This at least needs to guarantee the bandwidth share of its 256KB when it needs to transmit data.
When discharging transmission channel, the bandwidth share of transmission channel is recycled, is added in globally available bandwidth, and deletes biography Content of the defeated channel in corresponding data item, and it is vacant that the state of data item is updated to, so that subsequent creation is new The data item can be used in transmission channel.In addition, the band of corresponding transmission channel can also be preserved in the data item of data structure If desired wide quota reads or modifies above- mentioned information, can directly access the data item in data structure, such as recycle and do not live When the bandwidth share of dynamic transmission channel, accessible corresponding data item, in the inactive corresponding data item of transmission channel In, its bandwidth share is reset.For current transmission channel bandwidth allocation quota, data item, Xiang Dangqian can also be directly accessed In the corresponding data item of transmission channel, its bandwidth share is written.After each creation or release transmission channel, can all it update Current transmission channel quantity.Fig. 3 shows schematic diagram when creation transmission channel.
And when transmitting data, its bandwidth share can be also read from the data item of current transmission channel in data structure, Then it obtains and needs the sum of flow and bandwidth occupancy of current transmission channel of the data transmitted, as target flow, then compare Compared with the bandwidth share of target flow and distribution, if target flow is less than bandwidth share, data can be transmitted, otherwise basis Transmission policy selection retries, postpones transmission or discarding etc..As a result, when data are transmitted, it is only necessary to be read from data structure The bandwidth share of corresponding transmission channel, for transmission channel management mainly in the control plane, i.e. transmission channel When creation and release, such mode ensure that being simple and efficient for data plane, and can divide in connection rank bandwidth Match.
Fig. 4 is the process flow diagram that data transmission is realized using method provided by the embodiments of the present application, which is used for Realize the bandwidth allocation of connection rank, the data structure for saving connection contextual information uses array, each array item (slot) Save one connection contextual information, guarantee the minimum bandwidth value and a mark information comprising timestamp information, the connection, such as Shown in Fig. 5.When connecting creation, its contextual information is written in a unappropriated slot, by the slot labeled as It occupies, so that the slot is mapped to connection, the bandwidth share (bandwidth occupied) furthermore connected also be can be written into It is subsequent to access the slot directly to obtain or update the information about the connection in slot.
The process flow of realization data transmission includes: in the present embodiment
Step S401 can calculate the current bandwidth occupancy of the connection, then when being sent to data by the connection first In addition the data volume for the data that this needs is sent, as the target flow judged.Calculate the meter of current bandwidth occupancy Sliding window algorithm, token bucket algorithm or other similar algorithms can be used in calculation mode.
In addition it is also possible to calculate target flow using other way, such as certain following a period of time can be estimated at current time The target flow at quarter selects corresponding sending strategy it is possible thereby to carry out the judgement of step S402 in advance.It estimates following possible Target flow mode can include but is not limited to following several: the bandwidth occupancy before being for example connected to based on this in N seconds is calculated The mode of average value, or based on modes such as the average bandwidth occupancy for transmitting certain class data in historical data.
Target flow and the bandwidth share for distributing to the connection are compared, see whether be more than bandwidth by step S402 Quota.Wherein, the bandwidth share of the connection is determined based on method shown in FIG. 1.
Step S403 is directly returned if target flow is more than bandwidth share, is retried or postponed according to policy selection It sends.
Step S404, if target flow is less than bandwidth share, the current bandwidth for updating connection is occupied.
Step S405 sends data by the connection.
Based on the same inventive concept, the equipment for realizing above-mentioned bandwidth allocation methods, institute are additionally provided in the embodiment of the present application Stating the corresponding method of equipment is the method in previous embodiment, and its principle solved the problems, such as is similar to this method.
A kind of bandwidth distribution device provided by the embodiments of the present application is matched for distributing bandwidth appropriate to each transmission channel Volume, to control transmission channel flow.The structure of the equipment as shown in fig. 6, include at least condition checkout gear 610, Bandwidth recyclable device 620 and bandwidth allocation device 630.Wherein, condition checkout gear 610 can need to pass in current transmission channel When transmission of data, the active state of other transmission channels is detected, and determines inactive transmission channel from other transmission channels.Its In, transmission channel refers to the channel of data transmit-receive, it not only can be only used for distribution network bandwidth, such as the transmission of network data, The bandwidth that can be used for distributing the transmission of other way data, such as I/O is transmitted or distributed to the data between distribution process, (input is defeated Memory bandwidth etc. in scene out).In the transmission for network data, transmission channel can be the foundation between two equipment Connection, when for the transmission of data between process, transmission channel can be message queue etc., the reading of data in I/O scene When writing, transmission channel can be the channel (such as stream, file etc.) of I/O.Bandwidth refers to the data volume that can be transmitted the unit time.
When this programme is applied to distribution network bandwidth, can be adapted for using RDMA (Remote Direct Memory Access, remote direct memory access), the high performance networks of the technologies such as InfiniBand (infinite bandwidth), be readily applicable to The environment of traditional Ethernet (such as TCP/IP network) or all kinds of virtualization networks.
When transmitting data, the embodiment of the present application can be realized in kernel state or User space according to corresponding transport protocol The distribution of network bandwidth can be completed in the method for offer.For example, sending ending equipment is logical in the high performance network using RDMA It crosses network to be directly transferred in one piece of storage region of receiving device data, the CPU of receiving device is only in the process Need to carry out single treatment in initialization and the end of transmission, it is most without being intervened in transmission process Processing can all be completed in User space.And TCP/IP network needs CPU participation that data are directly transferred to reception when transmitting data The operation of the designated storage area of end equipment, therefore most processing can all be completed in kernel state.The embodiment of the present application as a result, The bandwidth allocation scheme of offer is not limited to realize in kernel state or User space, can be selected according to the scene of practical application real Now in kernel state or User space.
In partition size, it can be set according to actual needs.Such as in the scene of network bandwidth allocation, according to The thickness of partition size, can choose the distribution of fine-grained connection rank, or also can choose the thicker process level of granularity Not, the distribution of process group rank.Wherein, each process group may include at least one process, and each process can correspond to one Or multiple connections.When scheme is realized, transmission channel, which is defined as connection, process or process group, can be realized corresponding granularity Bandwidth allocation.
Current transmission channel refers to the transmission channel for currently needing to send data, needs at current time to be its bandwidth allocation Quota, the bandwidth upper limit value of data is transmitted as it, to control flow, realizes bandwidth allocation.Other transmission channels Corresponding to current transmission channel, refer to one or more transmission channel other than current transmission channel, these transmission are logical Road is possible to currently transmitting data, it is also possible to just completed data transmission, or may also the long period do not pass Transmission of data.Inactive transmission channel refers to the transmission channel that data transmission was not carried out in preset duration, such as example The preset duration is set as 5 seconds, then inactive transmission channel is not carry out the transmission that data are transmitted in 5 seconds to lead to Road.
In a kind of embodiment of the application, a timestamp information, the timestamp can be safeguarded for each transmission channel Information update when its corresponding transmission channel carries out data transmission, such as connection 1 have sent data in 00:15:11, then its is right The timestamp information answered will be updated to 00:15:11, if hereafter having sent data, corresponding time in 00:15:14 again Stamp information will be updated to 00:15:14 again.
As a result, in the active state for detecting other transmission channels, and inactive transmission is determined from other transmission channels When channel, condition checkout gear 610 can first obtain the corresponding timestamp information of other transmission channels, then more other transmission The timestamp information and current time in channel obtain comparison result, if comparison result is more than preset duration, corresponding transmission is logical Road is determined as inactive transmission channel.By taking aforementioned connection 1 as an example, in the active state of detection connection 1, if current time is 00:15:20, then comparison result is difference 6 seconds, indicates that connection 1 has had 6 seconds kinds not to be transmitted across data, if setting it is default when A length of 5 seconds, then it can determine that connection 1 is inactive connection.
Bandwidth recyclable device 620 is used to recycle the bandwidth share of inactive transmission channel, is added to globally available bandwidth In.Wherein, bandwidth share refers to that the bandwidth that a transmission channel has currently occupied, globally available bandwidth refer in the bandwidth upper limit Unappropriated bandwidth can be used to distribute to the transmission channel for currently needing to transmit data, such as the bandwidth upper limit is 10MB, Current time has existed 3 connections for transmitting data, for these connection distribution bandwidth shares distinguish 1MB, 2MB and 3MB, then globally available bandwidth at this time is 4MB, if wherein bandwidth matches and transfers data and entrance is not lived for being connected to for 1MB When dynamic state, then its bandwidth share can be recycled, is added in globally available bandwidth, globally available bandwidth at this time then becomes 5MB。
Condition checkout gear 610, can be from other transmission channels really by the active state of the other transmission channels of detection Fixed inactive transmission channel, since inactive transmission channel had not carried out data transmission in a longer period of time, that It is considered that these transmission channels are also larger a possibility that transmitting without data the short time, therefore bandwidth recyclable device 620 can recycle its bandwidth share, its bandwidth share is reset, and be added in globally available bandwidth.
In actual scene, other transmission channels that condition checkout gear can choose preset quantity are detected, and In other transmission channels of preset quantity, inactive transmission channel is determined, select other transmission channels of detection that can use Random manner is also possible to the Selection Strategy according to setting, such as randomly selects 64 connections and detected, or chooses total The N% of transmission channel quantity.
Bandwidth allocation device 630 is used for from globally available bandwidth, is current transmission channel bandwidth allocation quota.Actual field Jing Zhong, bandwidth allocation device are that the bandwidth share of current transmission channel distribution can be current all globally available bandwidth, It can be a part in globally available bandwidth, such as a bandwidth value can be set by the user, it should for transmission channel distribution The bandwidth share of value can also estimate suitable bandwidth value according to historical traffic of the transmission channel when transmitting data, be The transmission channel bandwidth allocation quota.
In one embodiment of the application, before the bandwidth allocation scheme for implementing the application, bandwidth allocation device 630 First the bandwidth share distributed can be needed to be determined based on globally available bandwidth and current transmission channel, if globally available bandwidth The bandwidth share that current transmission channel needs to distribute can be greater than or equal to, then may not need by condition checkout gear 610 and band Wide recyclable device 620 carries out detection and bandwidth recycling, and is directly current transmission channel bandwidth allocation by bandwidth allocation device 630 Quota.
For example, the bandwidth upper limit is 10MB, 3 connections for transmitting data are had existed at current time, for these companies Bandwidth share difference 1MB, 2MB and 3MB of distribution are met, then globally available bandwidth at this time is 4MB.If needing to create at this time Bandwidth share required for new connection is only 2MB, then current globally available bandwidth can satisfy the bandwidth allocation newly connected, from And it can be directly in the globally available bandwidth of 4MB, for the bandwidth of newly created connection distribution 2MB.
After distributing corresponding bandwidth share for current transmission channel, which can be transmitted as data Flow rate upper limit value.When transmitting data, the data transmission device of bandwidth distribution device can obtain the stream for needing the data transmitted The sum of (data volume for needing to transmit) and the bandwidth occupancy of current transmission channel are measured, as target flow, then compares target The bandwidth share of flow and distribution can transmit data if target flow is less than bandwidth share, otherwise according to transmission plan Slightly selection retries, postpones transmission or discarding etc..
The scheme of the application may be implemented in sending side or receiving side, logical by current transmission when sending side is realized Transmission data in road are the transmission process of data, therefore when the target flow for needing to send is more than bandwidth share, can be according to hair It send policy selection to retry, postpone transmission or abandon the processing such as data.And when receiving side is realized, it is passed by current transmission channel Transmission of data is the receive process of data, can be according to reception strategy choosing when needing received target flow to be more than bandwidth share It selects and abandons the processing such as data, request transmitting terminal repeating transmission.
When any one transmission channel needs to transmit data, process, each transmission can be constantly repeated the above The recycling and distribution of bandwidth chahnel are dynamically, to be not necessarily to lock, the scene suitable for high concurrent.It is different from TC frame, this Shen Please embodiment scheme be applied to sending side when can protocol stack socket (socket) in realize, in data send road More forward position in diameter, is able to suppress the generation of buffer bloat.
In order to enable the process of bandwidth allocation is more efficient, the management cost of each transmission channel can be married again into control Plane (creation and release of transmission channel), to guarantee being simple and efficient for data plane (data transmission).One is defined as a result, A data structure is used to manage the contextual information of transmission channel, the contextual information included at least corresponding transmission channel when Between stab information and mark information.The contextual information that a transmission channel is saved in each data item in data structure, when one When a data item has had been written into contextual information, state has as been occupied, otherwise the state of data item can be to occupy, Mark information can be used for by the status indication of data item be occupied, thereby ensure that can individually to each transmission channel into Row bandwidth allocation.It thus can also include control device, for real in a kind of bandwidth allocation device provided by the embodiments of the present application Now control the relevant treatment of plane.
Control device is written to one of data structure not when creating transmission channel, by the contextual information of transmission channel In the data item of occupancy.The data structure used in actual scene can be array, furthermore also can be used and other arbitrarily may be used Capable data structure, such as matrix, data sequence etc..Each array item of array is used to store the context of a transmission channel Information can use Multidimensional numerical, and bitmap is combined to calculate to preferably support the bandwidth allocation of large-scale fine granulation Method optimizes the lookup of corresponding array item.Since timestamp information is also stored in array, renewal time stamp information or reading are needed Accessible array when timestamp information is taken to be operated.Fig. 2 shows schematic diagrames when creation transmission channel.
In this case, condition checkout gear is detected in other transmission channels of selection preset quantity, is determined not When movable transmission channel, the array item of fixed quantity can be scanned every time since the corresponding array item of current transmission channel. Such as be designated as 100 under the corresponding array item of current transmission channel, then can scan down be designated as 101~164 64 array items, Timestamp information therein is obtained, the detection of active state is carried out.
In addition, can also include the bandwidth value of guaranteeing the minimum of transmission channel in contextual information, bandwidth value of guaranteeing the minimum refers to that transmission is logical The bandwidth share that road at least needs to distribute when transmitting data.If such as a connection needs to transmit more important information, because This at least needs to guarantee the bandwidth share of its 256KB when it needs to transmit data.
When discharging transmission channel, bandwidth recyclable device can also recycle the bandwidth share of transmission channel, and being added to the overall situation can With in bandwidth, while control device will be deleted content of the transmission channel in corresponding data item, and make the state of data item more Newly to be vacant, so that the data item can be used in the new transmission channel of subsequent creation.In addition, in the data item of data structure The bandwidth share of corresponding transmission channel can also be preserved, above- mentioned information are if desired read or modify, it can direct access number According to the data item in structure, such as when recycling the bandwidth share of inactive transmission channel, accessible corresponding data item, In the corresponding data item of inactive transmission channel, its bandwidth share is reset.For current transmission channel bandwidth allocation quota, Data item can also be directly accessed, into the corresponding data item of current transmission channel, its bandwidth share is written.In each creation or After person discharges transmission channel, current transmission channel quantity can be all updated.Fig. 3 shows signal when creation transmission channel Figure.
And when transmitting data, bandwidth control equipment data sending device can from data structure current transmission channel Its bandwidth share is read in data item, then obtain the flows of data and current transmission channel that need to transmit bandwidth occupancy it With, as target flow, then compare the bandwidth share of target flow and distribution, if target flow is less than bandwidth share, Data can be then transmitted, otherwise retried according to transmission policy selection, postpone transmission or abandon etc..As a result, when data are transmitted, The bandwidth share for only needing to read corresponding transmission channel from data structure is mainly controlling the management of transmission channel In plane processed, i.e., the creation and release of transmission channel when, such mode ensure that being simple and efficient for data plane, and can be Connection rank is allocated bandwidth.
In addition, a part of the application can be applied to computer program product, such as computer program instructions, when its quilt When computer executes, by the operation of the computer, it can call or provide according to the present processes and/or technical solution. And the program instruction of the present processes is called, it is possibly stored in fixed or moveable recording medium, and/or pass through Broadcast or the data flow in other signal-bearing mediums and transmitted, and/or be stored according to program instruction run calculating In the working storage of machine equipment.Here, including an equipment as shown in Figure 7 according to one embodiment of the application, this sets Standby includes the memory 710 for storing computer program instructions and the processor 720 for executing program instructions, wherein when When the computer program instructions are executed by the processor, equipment operation is triggered based on aforementioned multiple embodiments according to the application Method and/or technology scheme,.
It should be noted that the application can be carried out in the assembly of software and/or software and hardware, for example, can adopt With specific integrated circuit (ASIC), general purpose computer or any other realized similar to hardware device.In one embodiment In, the software program of the application can be executed by processor to realize above step or function.Similarly, the software of the application Program (including relevant data structure) can be stored in computer readable recording medium, for example, RAM memory, magnetic or CD-ROM driver or floppy disc and similar devices.In addition, hardware can be used to realize in some steps or function of the application, for example, As the circuit cooperated with processor thereby executing each step or function.
It is obvious to a person skilled in the art that the application is not limited to the details of above-mentioned exemplary embodiment, Er Qie In the case where without departing substantially from spirit herein or essential characteristic, the application can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and scope of the present application is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included in the application.Any reference signs in the claims should not be construed as limiting the involved claims.This Outside, it is clear that one word of " comprising " does not exclude other units or steps, and odd number is not excluded for plural number.That states in device claim is multiple Unit or device can also be implemented through software or hardware by a unit or device.The first, the second equal words are used to table Show title, and does not indicate any particular order.

Claims (17)

1. a kind of bandwidth allocation methods, wherein this method comprises:
When current transmission channel needs to transmit data, the active state of other transmission channels is detected, and from other transmission channels The inactive transmission channel of middle determination, wherein the inactive transmission channel are as follows: data biography was not carried out in preset duration Defeated transmission channel;
The bandwidth share for recycling the inactive transmission channel, is added in globally available bandwidth;
It is the current transmission channel bandwidth allocation quota from the globally available bandwidth.
2. according to the method described in claim 1, wherein, detecting the active state of other transmission channels, and logical from other transmission Inactive transmission channel is determined in road, comprising:
The active state of other transmission channels of preset quantity is detected, and in other transmission channels of the preset quantity, really Fixed inactive transmission channel.
3. according to the method described in claim 1, wherein, detecting the active state of other transmission channels, and logical from other transmission Inactive transmission channel is determined in road, comprising:
Obtain the corresponding timestamp information of other transmission channels, wherein the timestamp information corresponds to transmission channel at it and carries out Data update when transmitting;
The timestamp information and current time of more other transmission channels obtain comparison result;
If comparison result is more than preset duration, corresponding transmission channel is determined as to inactive transmission channel.
4. according to the method described in claim 3, wherein, this method further include:
When creating transmission channel, the contextual information of the transmission channel is written to a unappropriated number of data structure According in item, wherein the data item each occupied in the data structure is corresponding with a transmission channel, the contextual information Timestamp information and mark information including corresponding transmission channel, the mark information are used to the status indication of data item be It occupies.
5. according to the method described in claim 4, wherein, the contextual information further includes the bandwidth of guaranteeing the minimum of the transmission channel Value, the bandwidth value of guaranteeing the minimum are the bandwidth share that the transmission channel at least needs to distribute when transmitting data.
6. method according to claim 4 or 5, wherein this method further include:
When discharging transmission channel, the bandwidth share of the transmission channel is recycled, is added in globally available bandwidth, and deletes institute Content of the transmission channel in corresponding data item is stated, and it is vacant that the state of the data item is updated to.
7. according to the method described in claim 4, wherein, corresponding transmission channel is also preserved in the data item of the data structure Bandwidth share;
Recycle the bandwidth share of the inactive transmission channel, comprising:
In the corresponding data item of the inactive transmission channel, its bandwidth share is reset;
For the current transmission channel bandwidth allocation quota, comprising:
Into the corresponding data item of the current transmission channel, its bandwidth share is written.
8. according to the method described in claim 7, wherein, after for the current transmission channel bandwidth allocation quota, also wrapping It includes:
From its bandwidth share is read in the data structure in the data item of current transmission channel;
The sum of the flow for needing the data transmitted and bandwidth occupancy of current transmission channel are obtained, as target flow;
When the target flow is less than the bandwidth share, the data are transmitted.
9. a kind of bandwidth distribution device, wherein the equipment includes:
Condition checkout gear, for detecting the active state of other transmission channels when current transmission channel needs to transmit data, And inactive transmission channel is determined from other transmission channels, wherein the inactive transmission channel are as follows: in preset duration The transmission channel of data transmission was not carried out;
Bandwidth recyclable device is added in globally available bandwidth for recycling the bandwidth share of the inactive transmission channel;
Bandwidth allocation device, for from the globally available bandwidth, being the current transmission channel bandwidth allocation quota.
10. equipment according to claim 9, wherein the condition checkout gear, for detecting other biographies of preset quantity The active state in defeated channel, and in other transmission channels of the preset quantity, determine inactive transmission channel.
11. equipment according to claim 9, wherein the condition checkout gear, it is corresponding for obtaining other transmission channels Timestamp information, wherein the timestamp information its correspond to transmission channel carry out data transmission when update;More other biographies The timestamp information and current time in defeated channel obtain comparison result;If comparison result is more than preset duration, by corresponding transmission Channel is determined as inactive transmission channel.
12. equipment according to claim 11, wherein the equipment further include:
Control device, for when creating transmission channel, the contextual information of the transmission channel to be written to data structure In one unappropriated data item, wherein the data item each occupied in the data structure is corresponding with a transmission channel, The contextual information includes the timestamp information and mark information of corresponding transmission channel, and the mark information is used for data item Status indication be occupied.
13. equipment according to claim 12, wherein the contextual information further includes the band of guaranteeing the minimum of the transmission channel Width values, the bandwidth value of guaranteeing the minimum are the bandwidth share that the transmission channel at least needs to distribute when transmitting data.
14. equipment according to claim 12 or 13, wherein the bandwidth recyclable device is also used to logical in release transmission When road, the bandwidth share of the transmission channel is recycled, is added in globally available bandwidth;
The control device is also used to delete content of the transmission channel in corresponding data item when discharging transmission channel, And it is vacant that the state of the data item is updated to.
15. equipment according to claim 12, wherein it is logical also to preserve corresponding transmission in the data item of the data structure The bandwidth share in road;
The control device is also used in the corresponding data item of the inactive transmission channel, its bandwidth share is reset, And into the corresponding data item of the current transmission channel, its bandwidth share is written.
16. equipment according to claim 15, wherein the equipment further include:
Data transmission device, for after for the current transmission channel bandwidth allocation quota, from the data structure when Its bandwidth share is read in the data item of preceding transmission channel, obtains the band of the flow and current transmission channel that need the data transmitted The sum of width occupancy, as target flow;And when the target flow is less than the bandwidth share, transmit the data.
17. a kind of bandwidth distribution device, wherein the equipment includes:
Processor;And
It is arranged to the memory of storage computer executable instructions, the executable instruction makes the processor when executed Execute such as method described in any item of the claim 1 to 8.
CN201711078855.6A 2017-11-06 2017-11-06 Bandwidth allocation method and device Active CN109756429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711078855.6A CN109756429B (en) 2017-11-06 2017-11-06 Bandwidth allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711078855.6A CN109756429B (en) 2017-11-06 2017-11-06 Bandwidth allocation method and device

Publications (2)

Publication Number Publication Date
CN109756429A true CN109756429A (en) 2019-05-14
CN109756429B CN109756429B (en) 2023-05-02

Family

ID=66399537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711078855.6A Active CN109756429B (en) 2017-11-06 2017-11-06 Bandwidth allocation method and device

Country Status (1)

Country Link
CN (1) CN109756429B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147109A (en) * 2019-05-21 2019-08-20 重庆长安汽车股份有限公司 A kind of archetype development system of automated driving system
CN112804084A (en) * 2020-12-28 2021-05-14 中金数据(武汉)超算技术有限公司 Bandwidth management method and device based on network interconnection line
CN114598649A (en) * 2022-03-17 2022-06-07 苏州浪潮智能科技有限公司 Kernel bandwidth management method and device, storage equipment and storage medium
WO2023207521A1 (en) * 2022-04-29 2023-11-02 北京有竹居网络技术有限公司 Traffic congestion control method and apparatus, computer readable medium and electronic device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030028641A1 (en) * 2001-07-30 2003-02-06 Zhi-Li Zhang Method and apparatus for a bandwidth broker in a packet network
CN101599908A (en) * 2009-07-15 2009-12-09 杭州华三通信技术有限公司 A kind of auto-allocation method of bandwidth and equipment
CN106533982A (en) * 2016-11-14 2017-03-22 西安电子科技大学 Dynamic queue scheduling device and method based on bandwidth borrowing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030028641A1 (en) * 2001-07-30 2003-02-06 Zhi-Li Zhang Method and apparatus for a bandwidth broker in a packet network
CN101599908A (en) * 2009-07-15 2009-12-09 杭州华三通信技术有限公司 A kind of auto-allocation method of bandwidth and equipment
CN106533982A (en) * 2016-11-14 2017-03-22 西安电子科技大学 Dynamic queue scheduling device and method based on bandwidth borrowing

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110147109A (en) * 2019-05-21 2019-08-20 重庆长安汽车股份有限公司 A kind of archetype development system of automated driving system
CN112804084A (en) * 2020-12-28 2021-05-14 中金数据(武汉)超算技术有限公司 Bandwidth management method and device based on network interconnection line
CN112804084B (en) * 2020-12-28 2022-09-13 中金数据(武汉)超算技术有限公司 Bandwidth management method and device based on network interconnection line
CN114598649A (en) * 2022-03-17 2022-06-07 苏州浪潮智能科技有限公司 Kernel bandwidth management method and device, storage equipment and storage medium
CN114598649B (en) * 2022-03-17 2023-08-04 苏州浪潮智能科技有限公司 Kernel bandwidth management method, device, storage equipment and storage medium
WO2023207521A1 (en) * 2022-04-29 2023-11-02 北京有竹居网络技术有限公司 Traffic congestion control method and apparatus, computer readable medium and electronic device

Also Published As

Publication number Publication date
CN109756429B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
EP3367251B1 (en) Storage system and solid state hard disk
CN109756429A (en) Bandwidth allocation methods and equipment
US20180343131A1 (en) Accessing composite data structures in tiered storage across network nodes
CN104090847B (en) Address distribution method of solid-state storage device
US10860493B2 (en) Method and apparatus for data storage system
US7401198B2 (en) Maximizing storage system throughput by measuring system performance metrics
US11397668B2 (en) Data read/write method and apparatus, and storage server
CN107408070A (en) More transaction journals in distributed memory system
US10884667B2 (en) Storage controller and IO request processing method
CN106230997B (en) Resource scheduling method and device
US10303374B2 (en) Data check method and storage system
CN110858162B (en) Memory management method and device and server
US9525727B2 (en) Efficient and scalable pull-based load distribution
CN111309644B (en) Memory allocation method and device and computer readable storage medium
EP2998862A1 (en) Method, device, and system for memory management
US20130232124A1 (en) Deduplicating a file system
CN110321331A (en) The object storage system of storage address is determined using multistage hash function
CN115334082A (en) Load balancing method, device, computer equipment, storage medium and product
US7660964B2 (en) Windowing external block translations
US20140351550A1 (en) Memory management apparatus and method for threads of data distribution service middleware
CN102137091A (en) Overload control method, device and system as well as client-side
CN108132759A (en) A kind of method and apparatus that data are managed in file system
CN105808150A (en) Solid state disk caching system for hybrid storage device
CN110209350A (en) It is a kind of to mix in storage architecture HPC system using the dynamic dispatching method of I/O request
CN111857992B (en) Method and device for allocating linear resources in Radosgw module

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant