CN107635144A - Server output stream amount method for limiting speed, device, server and DNS systems - Google Patents

Server output stream amount method for limiting speed, device, server and DNS systems Download PDF

Info

Publication number
CN107635144A
CN107635144A CN201711009986.9A CN201711009986A CN107635144A CN 107635144 A CN107635144 A CN 107635144A CN 201711009986 A CN201711009986 A CN 201711009986A CN 107635144 A CN107635144 A CN 107635144A
Authority
CN
China
Prior art keywords
video
request
output
upper limit
module
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.)
Pending
Application number
CN201711009986.9A
Other languages
Chinese (zh)
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.)
Storm Group Ltd By Share Ltd
Original Assignee
Storm Group Ltd By Share 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 Storm Group Ltd By Share Ltd filed Critical Storm Group Ltd By Share Ltd
Priority to CN201711009986.9A priority Critical patent/CN107635144A/en
Publication of CN107635144A publication Critical patent/CN107635144A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses server output stream amount method for limiting speed, device, server and DNS systems, this method to include:The video request acquisition video request according to receiving corresponds to the code check of video;The output speed upper limit of the server is determined according to the code check;The video data of video is corresponded to according to the output speed upper limit output video request.Technical scheme so that for different video when downloading, the maximum download rate that can reach improves the security of system not over the output speed upper limit set according to code check;Ensure that each user of request video obtains the video playback experience of smoothness, also, for the less video file of code check, the too high bandwidth traffic that will not be distributed, greatly save the bandwidth traffic of server, improve the utilization rate of network.

Description

Server output stream amount method for limiting speed, device, server and DNS systems
Technical field
The present invention relates to shaping network flow technical field, especially a kind of server output stream amount method for limiting speed, device, Server and DNS systems.
Background technology
With the high speed development of internet, user is increasing to the demand of video, and video website also increases.With This simultaneously, it is potential the problem of gradually display, video card screen phenomenon is also of common occurrence.As the content for providing Video service Distribution network (Content Delivery Network, abbreviation CDN) is needed before the video tastes of user's high quality are ensured Put, reduce impact of the flow to itself bottom-layer network caused by a large number of users, while reduce network input cost.
Generally this risk is reduced in traditional approach by the way of interface current limliting is done in the request to user.So-called interface Current limliting is exactly to limit the total flow in the flow of interface, including concurrent flow and certain time, can so be controlled well The query rate per second (Query Per Second, abbreviation QPS) of system, so as to improve the security of protection system and interface service Stability.
At present, conventional interface limited current algorithm has a. counter process, b. slip window samplings, c. token bucket algorithm, d. token buckets Algorithm etc. is several, and wherein token bucket algorithm and token bucket algorithm are to belong to service quality (Quality of Service, abbreviation QoS) The realization mechanism of field flow shape technique.Current limliting is done usually using these algorithms, primarily to prevent system pressure it is excessive, Ensure that the resource of user's request keeps uniformly and shields malicious requests, therefore be all to all requests in practical application scene Put on an equal footing, as long as interface flow is not above the upper limit, then the request of user is unrestricted, once and flow excess, then just Follow-up all requests can directly be refused.This is relatively applicable in operation system as web, because the Web page of user's request Face response speed is directly proportional with the network bandwidth flow shared by user, and bandwidth traffic is higher, and response is faster, otherwise gets over Slowly, or even can time-out.
But in Online Video operation system, because the smooth playing experience of video is related with video code rate, without with Network bandwidth flow is directly proportional, therefore, using the way of above-mentioned several interface current limlitings, due to all equal to all video requests Treat, do not ensure that each user of request video obtains the video playback experience of smoothness;It is in addition, less for code check Video file, the bandwidth traffic more high waste then to bandwidth traffic of distribution is more serious, relatively low to the utilization rate of network.
The content of the invention
A technical problem to be solved of the embodiment of the present invention is:In the prior art due to all video requests all Put on an equal footing, do not ensure that each user of request video obtains the video playback experience of smoothness;In addition, for code check compared with Small video file, the bandwidth traffic more high waste then to bandwidth traffic of distribution is more serious, relatively low to the utilization rate of network.
A kind of server output stream amount method for limiting speed of the embodiment of the present invention, device, server and DNS systems.The technology Scheme is as follows:
First aspect according to embodiments of the present invention, there is provided a kind of server output stream amount method for limiting speed, including:
The video request acquisition video request according to receiving corresponds to the code check of video;
The output speed upper limit of the server is determined according to the code check;
The video data of video is corresponded to according to the output speed upper limit output video request.
Optionally, the output speed upper limit that the server is determined according to the code check, including:
N times that the output speed upper limit is the code check is set, wherein, N is more than or equal to 1;
And/or the video request that the basis receives obtains the code check that the video request corresponds to video, including:
When receiving at least two video requests simultaneously, the code check that each video request corresponds to video is obtained;
And/or the output speed upper limit that the server is determined according to the code check, including:
Calculate the code check sum that at least two video request corresponds to video;
The first output speed upper limit is set according to the code check sum.
Optionally, the video data that video is corresponded to according to the output speed upper limit output video request, bag Include:
Export the video counts that at least two video request corresponds to video simultaneously according to the first output speed upper limit According to;
After the first video request at least two video request corresponds to the video data output of video, root The code check that the second video request finished according to not exporting corresponds to video sets the second output speed upper limit;
The video data of video is corresponded to according to the second output speed upper limit output second video request.
Optionally, the video data that video is corresponded to according to the output speed upper limit output video request, bag Include:
The video data of the first data volume is read according to the output speed upper limit;
It is determined that first number of token is asked from token bucket every time;
When the token number in the token bucket is more than or equal to first number, institute is obtained from the token bucket State first several token;
Export the video data of first data volume.
Optionally, the video data that video is corresponded to according to the output speed upper limit output video request, also Including:
When the token number in the token bucket is less than first number, and first data volume is less than or equal to and worked as During preceding permission burst flow, the video data of first data volume is exported;
Refresh the current value for allowing burst flow, the current permission burst flow is cut into first data Amount;
When the token number in the token bucket is less than first number, and first data volume be more than it is described current When allowing burst flow, the first preset time of delay obtains first several token.
Optionally, methods described also includes:
Request queue is obtained according to the video request;
Determine the size of request data package in the request queue;
According to the bandwidth between the size of the request data package and local terminal and video storage device, calculate and regarded for described The largest request number of frequency storage device;
Conjunction bag is carried out to the request data package for obtaining the largest request number in row in order from the request, closed And request bag;
The merging request bag is sent to the video storage device, request and merges request bag size identical with described Video data bag;
And/or methods described also includes:
The video data bag is received, the video data bag includes the sub-video data of the largest request number Bag, the sub-video data bag correspond with the request data package merged in request bag;
The video data bag is unpacked, obtains sub-video data bag corresponding with the request data package.
Second aspect according to embodiments of the present invention, there is provided a kind of server output stream amount speed-limiting device, including:
First acquisition module, for corresponding to the code check of video according to the video request acquisition video request received;
First determining module, for determining the output speed upper limit of the server according to the code check;
Output module, for corresponding to the video data of video according to the output speed upper limit output video request.
Optionally, first determining module, for setting the output speed upper limit as N times of the code check, wherein, N is more than or equal to 1;
And/or first acquisition module, for when receiving at least two video requests simultaneously, acquisition each to regard Frequency asks the code check of corresponding video;
And/or first determining module includes:
Calculating sub module, the code check sum of video is corresponded to for calculating at least two video request;
Submodule is set, for setting the first output speed upper limit according to the code check sum.
Optionally, the output module includes:
Output sub-module, for exporting at least two video request pair simultaneously according to the first output speed upper limit Answer the video data of video;
Submodule is set, for corresponding to the video counts of video when the first video request at least two video request After according to output, the second output speed upper limit is set according to the code check for not exporting the second video request for finishing and corresponding to video;
The output sub-module, correspondingly regarded for exporting second video request according to the second output speed upper limit The video data of frequency.
Optionally, the output module includes:
Reading submodule, for reading the video data of the first data volume according to the output speed upper limit;
Determination sub-module, for determining first number of the request token from token bucket every time;
Acquisition submodule, when the token number in the token bucket is more than or equal to first number, from the order First several token are obtained in board bucket;
Output sub-module, for exporting the video data of first data volume.
Optionally, the output module also includes:Refresh submodule,
The output sub-module, for being less than first number, and described when the token number in the token bucket When one data volume is less than or equal to the current permission burst flow, the video data of first data volume is exported;
The refreshing submodule, for refreshing the current value for allowing burst flow, by the current permission burst flow Amount cuts first data volume;
The acquisition submodule, for being less than first number, and described when the token number in the token bucket When one data volume is more than the current permission burst flow, the first preset time of delay obtains first several token.
Optionally, described device also includes:
Second acquisition module, for obtaining request queue according to the video request;
Second determining module, for determining the size of request data package in the request queue;
Computing module, for the bandwidth between the size according to the request data package and local terminal and video storage device, Calculate the largest request number for the video storage device;
Bag module is closed, for entering from the request to the request data package for obtaining the largest request number in row in order Row closes bag, obtains merging request bag;
Sending module, for the merging request bag to be sent to the video storage device, request with it is described merge ask Seek bag size identical video data bag.
And/or described device also includes:
Receiving module, for receiving the video data bag, the video data bag includes the largest request number Sub-video data bag, the sub-video data bag and the request data package that merges in request bag correspond;
Unpack module, for the video data bag to be unpacked, obtain son corresponding with the request data package and regard Frequency packet.
The third aspect according to embodiments of the present invention, there is provided a kind of server, include the server output of above-described embodiment Limit Rate device.
Fourth aspect according to embodiments of the present invention, there is provided a kind of DNS systems, including at least one above-mentioned server.
In the embodiment of the present invention, for each video request, the output flow all according to the code check of the video to server Speed limit is carried out, so allows for different video when downloading, the maximum download rate that can reach is set not over according to code check The output speed upper limit put, improve the security of system.Not only ensure that each user of request video obtains the video of smoothness Experience is played, also, for the less video file of code check, the too high bandwidth traffic that will not be distributed, greatlys save service The bandwidth traffic of device, improve the utilization rate of network.
In addition, the present invention method specific implementation when, due to the total bandwidth flow that server can be provided be it is fixed, The output speed upper limit based on code check for each video request distribution server, thus, actually server can be handled simultaneously Concurrent request quantity nor fixed, the maximum number of concurrent that server is handled simultaneously is based on the corresponding video of each request Code check and dynamic change, therefore so that the utilization rate of network is greatly improved.
Below by drawings and examples, technical scheme is described in further detail.
Brief description of the drawings
The accompanying drawing of a part for constitution instruction describes embodiments of the invention, and is used to explain together with description The principle of the present invention.
Referring to the drawings, according to following detailed description, the present invention can be more clearly understood, wherein:
Fig. 1 is the flow chart of the server output stream amount method for limiting speed shown in the embodiment of the present invention;
Fig. 2 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention;
Fig. 3 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention;
Fig. 4 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention;
Fig. 5 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention;
Fig. 6 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention;
Fig. 7 is the schematic diagram of the embodiment of the present invention and the server output speed of common speed limit technology;
Fig. 8 is another schematic diagram of the embodiment of the present invention and the server output speed of common speed limit technology;
Fig. 9 is the block diagram of the server output stream amount speed-limiting device shown in the embodiment of the present invention;
Figure 10 is the block diagram of the server output stream amount speed-limiting device shown in another embodiment of the present invention;
Figure 11 is the block diagram of the output module shown in the embodiment of the present invention;
Figure 12 is the block diagram of the output module shown in another embodiment of the present invention;
Figure 13 is the block diagram of the output module shown in another embodiment of the present invention.
Embodiment
The various exemplary embodiments of the present invention are described in detail now with reference to accompanying drawing.It should be noted that:Unless have in addition Body illustrates that the unlimited system of part and the positioned opposite of step, numerical expression and the numerical value otherwise illustrated in these embodiments is originally The scope of invention.
Simultaneously, it should be appreciated that for the ease of description, the size of the various pieces shown in accompanying drawing is not according to reality Proportionate relationship draw.
The description only actually at least one exemplary embodiment is illustrative to be never used as to the present invention below And its application or any restrictions that use.
It may be not discussed in detail for technology, method and apparatus known to person of ordinary skill in the relevant, but suitable In the case of, the technology, method and apparatus should be considered as part for specification.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi It is defined, then it need not be further discussed in subsequent accompanying drawing in individual accompanying drawing.
The embodiment of the present invention can apply to computer system/server, and it can be with numerous other universal or special calculating System environments or configuration operate together.Suitable for be used together with computer system/server well-known computing system, ring The example of border and/or configuration includes but is not limited to:Personal computer system, server computer system, thin client, thick client Machine, hand-held or laptop devices, the system based on microprocessor, set top box, programmable consumer electronics, NetPC Network PC, Little types Ji calculates machine Xi Tong ﹑ large computer systems and the distributed cloud computing technology environment including any of the above described system, etc..
Computer system/server can be in computer system executable instruction (such as journey performed by computer system Sequence module) general linguistic context under describe.Generally, program module can include routine, program, target program, component, logic, number According to structure etc., they perform specific task or realize specific abstract data type.Computer system/server can be with Implement in distributed cloud computing environment, in distributed cloud computing environment, task is by by the long-range of communication network links Manage what equipment performed.In distributed cloud computing environment, program module can be located at the Local or Remote meter for including storage device In calculation system storage medium.
In Online Video operation system, because the smooth playing experience of video is related with video code rate, without with network Bandwidth traffic is directly proportional, and the network bandwidth of the video consumption of different code checks is different, as long as and network bandwidth flow energy Meet the code check bandwidth of video playback, then the network bandwidth flow required for user will not just change substantially.Therefore, it is of the invention Purpose be just to provide and a kind of adaptively enter the method for Mobile state speed limit to server output stream amount for different video file.
Technical scheme provided in an embodiment of the present invention, it is related to the server that Online Video business is provided, for each video Request, speed limit is all carried out to the output flow of server according to the code check of the video, so ensures that different video is being downloaded When, the maximum download rate that can reach is not over the output speed upper limit set according to code check.Not only ensure request video Each user obtain the video playback experience of smoothness, also, for the less video file of code check, what will not be distributed is too high Bandwidth traffic, greatly save the bandwidth traffic of server, improve the utilization rate of network.
Fig. 1 is the flow chart of the server output stream amount method for limiting speed shown in the embodiment of the present invention.As shown in figure 1, the clothes Business device output flow method for limiting speed comprises the following steps:
Step S11, the code check of video is corresponded to according to the video request acquisition video request received.
Server is directed to each video request received, can all obtain once the code check that the video request corresponds to video.
Wherein, the video labeling to be asked video, such as video name, video address are generally comprised in video request Deng according to video labeling, the relevant information of the video, such as code check, form, size can be got.
Step S12, the output speed upper limit of server is determined according to code check.
Optionally, N times that the output speed upper limit is code check can be set, wherein, N is more than or equal to 1.
Wherein, N size can be provided according to server total output flow upper limit is set.If server Total output flow upper limit deficiency, then can be set to 1 by N;If total output flow upper limit of server is larger, N value also can phase It should increase.
For example, the code check of the video to be downloaded of the video request that server receives is 3MB/S, then it can be set and this regarded The output speed upper limit that frequency is downloaded is 3MB/S, if the total output flow upper limit of server is larger, the settable output speed upper limit is 6MB/S。
Step S13, the video data of video is corresponded to according to output speed upper limit output video request.
In the present embodiment, for each video request, all the output flow of server is carried out according to the code check of the video Speed limit, different video is so ensured that when downloading, the maximum download rate that can reach is set not over according to code check The output speed upper limit.So, not only ensure that each user of request video obtains the video playback experience of smoothness, also, For the less video file of code check, the too high bandwidth traffic that will not be distributed, the bandwidth traffic of server is greatlyd save, is carried The high utilization rate of network.
In addition, the present invention method specific implementation when, due to the total bandwidth flow that server can be provided be it is fixed, The output speed upper limit based on code check for each video request distribution server, thus, actually server can be handled simultaneously Concurrent request quantity nor fixed, the maximum number of concurrent that server is handled simultaneously is based on the corresponding video of each request Code check and dynamic change, therefore so that the utilization rate of network is greatly improved.
Fig. 2 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention.As shown in Fig. 2 The scene downloaded simultaneously for multiple videos, step S11 include:
Step S21, when receiving at least two video requests simultaneously, obtain the code that each video request corresponds to video Rate;
Step S12 includes:
Step S22, calculate the code check sum that at least two video requests correspond to video;
Step S23, the first output speed upper limit is set according to code check sum.
For example, server receives two video requests simultaneously, foradownloaded video A and B are asked respectively.Video A code check is 1MB/S, video B code check are 2MB/S.Video A and B are downloaded simultaneously, and the output speed upper limit that server can be set is 3MB/S, That is video A and B code check sums.If the total output flow upper limit of server is larger, it is 6MB/S that the output speed upper limit, which can be set, that is, is regarded 2 times of frequency A and B code check sum.
In the present embodiment, ensure that each video can obtain and meet the speed of download that user video plays experience, also, not Network bandwidth flow can be wasted.
Fig. 3 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention.As shown in figure 3, The scene downloaded simultaneously for multiple videos, step S13 include:
Step S31, export the video counts that at least two video requests correspond to video simultaneously according to the first output speed upper limit According to;
Step S32, the video data output that video is corresponded to when the first video request at least two video requests finish Afterwards, the code check that the second video request finished according to not exporting corresponds to video sets the second output speed upper limit;
Step S33, the video data of video is corresponded to according to the second video request of second output speed upper limit output.
For example, video A and B are downloaded simultaneously, completed when video B is downloaded, and video A does not download completion, then according to video A's Code check readjusts the server output speed upper limit.The output speed upper limit of settable server is 1MB/S.If server is always defeated The outflow upper limit is larger, and it is 2MB/S, i.e. the 2 of video A code checks times that the output speed upper limit, which can be set,.
In the present embodiment, when some video download after the completion of, discharge the bandwidth traffic shared by it at once, so as to for Other users foradownloaded video provides bandwidth traffic.The download for meeting user video and playing experience can be obtained in each video of guarantee On the premise of speed, speed limit more accurately is carried out to the bandwidth traffic of server, further improves the utilization rate of network bandwidth.
The present invention also provides an embodiment, is not simply to carry out speed limit according to video code rate, but combine token bucket Algorithm, further improve disposal ability of the server for burst data requests.
Fig. 4 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention.As shown in figure 4, The output speed upper limit of the server determined in step S12 is actually also the output speed upper limit of token bucket, step S13 bags Include:
Step S41, the video data of the first data volume is read according to the output speed upper limit;
Step S42, it is determined that asking first number of token from token bucket every time;
Step S43, when the token number in token bucket is more than or equal to first number, first is obtained from token bucket Several tokens;
Step S44, export the video data of the first data volume.
Wherein, first number of token is asked from token bucket every time, depending on the processing speed of server, i.e. server Prepare the time that the video data of the first data volume is spent.
In the present embodiment, the video code rate adjustment server output speed upper limit will be based on and be combined with token bucket algorithm, led to The output speed that token bucket is set is crossed, actually also defines the speed of token bucket generation token.It is adaptive according to different video Ground adjustment is answered to download shared bandwidth, the abundant utilization rate for improving network.
Fig. 5 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention.As shown in figure 5, When there are burst data requests, i.e., in token bucket during token lazy weight, step S13 also includes:
Step S51, when the token number in token bucket occur and being less than first number, and the first data volume is less than or equal to During current permission burst flow, the video data of the first data volume is exported;
Step S52, refresh the current value for allowing burst flow, allow burst flow to cut the first data volume by current;
Step S53, when the token number in token bucket is less than first number, and the first data volume is more than and currently allows to happen suddenly During flow, the first preset time of delay obtains first several token.
In the present embodiment, current permission burst flow is set, for example, the settable burst data requests for allowing 100ms, The data volume that this burst request can be adjusted according to being actually needed, allow burst flow according to current to determine whether to work as Preceding burst request.If certain token number obtained is inadequate, judge the video data of this output whether beyond current Allow burst flow, if without departing from, can be this transmission pay token in advance so that this is successfully transmitted.Now, will update Change the current data volume for allowing burst flow, being reduced this transmission.When running into burst request again, still judge that this is defeated Whether the video data gone out if exceeded, i.e., currently allows burst flow to be less than this beyond current permission burst flow The video data volume of secondary output, then need to postpone certain time, just allow to send after obtaining enough tokens.
So, for burst request, do not handled by the way of abandoning, but postpone certain time processing, can Further to improve the fluency of video playback, the Experience Degree of user is preferable.
The method of the embodiment of the present invention is described in detail with an instantiation below.
Fig. 6 is the flow chart of the server output stream amount method for limiting speed shown in another embodiment of the present invention.As shown in fig. 6, The server output stream amount method for limiting speed comprises the following steps:
Step S601, receive video request;
Step S602, the code check R for asking video is obtained according to video requestc
Step S603, the output speed upper limit S of server is setoutI.e. the output speed upper limit of token bucket is code check Rc2 Times, Sout=2Rc
Step S604, according to output speed upper limit SoutIt is determined that the video data of the first data volume D sizes is read every time;
Step S605, it is determined that asking first number N of token from token bucket every time;
Step S606, read the video data of D sizes;
Step S607, token is asked from token bucket;
Step S608, whether the token quantity for judging to ask is more than 0, if it is, step S609 is performed, if not, knot Beam;
Whether step S609, the token quantity for judging to ask are more than or equal to N, if it is, step S612 is performed, if It is no, perform step S610;
Step S610, judges whether D is less than or equal to current permission burst flow;If it is, step S611 is performed, if It is no, perform step S613;
Step S611, refreshing currently allow the value of burst flow, and burst flow current will be allowed to cut D, and by after refreshing Current permission burst flow return to step S611;
Step S612, the video data of D sizes is sent immediately;
Step S613, judge whether to postpone the first preset time T;If it is, perform step S607;If not, continue to hold Row S613.
In the embodiment of the present invention, also Mobile state speed limit and existing skill can will be entered to server output stream amount based on video code rate Other limited current algorithms are combined in art.
For example, the server output speed upper limit is determined according to video code rate, based on the output speed upper limit further according to counting Device method or slip window sampling are limited the number of video request in time window.
In another example determining the server output speed upper limit according to video code rate, the output speed upper limit is also token bucket algorithm The output speed of middle leaky bucket so that data stabilization ground injection network, the burst flow on smooth network.
Fig. 7 is the schematic diagram of the embodiment of the present invention and the server output speed of common speed limit technology.For single video Output, use the server output speed that the dynamic method for limiting speed of the embodiment of the present invention obtains as 3MB/S, common speed limit technology Server output speed be also 3MB/S.As shown in fig. 7, the download curve peak value in dynamic speed limit is basicly stable, but have The fluctuation up and down of small range, this is due to not to be further continued for circulation hair data when acquisition token is enough in speed limit, because It is relatively more to be asked in view of the concurrent user in peak period, it is impossible to take CPU always to consider the accuracy of speed limit, and want Distributing point CPU gives other users simultaneously and concurrently asked, and the purpose of speed limit is to not allow speed of download to exceed speed limit, is improved The security of system.
And the download curve of common speed limit (simple counter method) then fluctuates just very big, a substantially peak, so Just suspend afterwards for a moment.Further, since when speed limit is bigger, the data volume for needing reading to be replied in the unit interval also compares It is larger, thus, speed limit is also inaccurate.
Fig. 8 is another schematic diagram of the embodiment of the present invention and the server output speed of common speed limit technology.For multiple The output of video, for example, exporting two videos simultaneously.The code check of two videos is respectively 1MB/S and 2MB/S, and the present invention is implemented Dynamic method for limiting speed server output speed according to corresponding to each video that code check is set of example is respectively 1MB/S and 2MB/S. It is 1MB/S that common speed limit technology, which sets server output speed corresponding to each video,.
As shown in figure 8, the download curve in dynamic speed limit divide into 2 sections, the last period is 2 files while the song downloaded Line, latter section be 2MB code check file downloads it is complete after that remaining 1MB code check file download curve.By that can be seen in figure Going out, 2 video files are downloaded simultaneously, and the output speed of server is 3MB/S, when the video file of 2MB code checks has been downloaded, clothes The output speed of business device just falls below 1MB/S, is also just the code check of that remaining video file, speed limit is accurate, to network The utilization rate of bandwidth is very high.
The downloading process of common speed limit (simple counter method), because the downloading speed limiting of each video file is provided that 1MB/S, therefore the output speed of server should be in 2MB/S, and be shown in figure and fluctuated between 1MB/S~4MB/S, limit Speed is quite inaccurate, and whole download is all maintained at this speed interval, can not be adjusted according to the file of different code checks Whole speed of download is very low to the utilization rate of network bandwidth.
To sum up, it can be seen that the technology according to video code rate dynamic speed limit of the embodiment of the present invention, not only ensure that difference For video when downloading, the maximum download rate that can reach improves system not over the output speed upper limit set according to code check The security of system.Also, ensure that each user of request video obtains the video playback experience of smoothness.And for code check compared with Small video file, the too high bandwidth traffic that will not be distributed, greatlys save the bandwidth traffic of server, improves network Utilization rate.In addition, the present invention method specific implementation when, due to the total bandwidth flow that server can be provided be it is fixed, The output speed upper limit based on code check for each video request distribution server, thus, actually server can be handled simultaneously Concurrent request quantity nor fixed, the maximum number of concurrent that server is handled simultaneously is based on the corresponding video of each request Code check and dynamic change, therefore so that the utilization rate of network is greatly improved.
In another embodiment, because use of the client in request data to bandwidth is restricted, and local terminal (connects The server of client video request is received, the server includes being used to realize server output stream amount speed limit in the embodiment of the present invention The device of method) it is to be transmitted in LAN by long connection between video data storage device, for local terminal, two The bandwidth asymmetric at end, therefore local terminal has made conjunction bag to video data storage device request data and replying data to client With the processing logic of folding bag.
Local terminal is as follows to the flow to video data storage device request data:
Step A1, request queue is obtained according to video request.
Pass through the request queue, it is ensured that the succession of data is replied to client.
Step A2, determine the size of request data package in request queue.
In general, each request data package size is identical, thus, it is only required to determine first received in the request queue The size of individual request data package.
Step A3, according to the bandwidth between the size of request data package and local terminal and video storage device, calculate for regarding The largest request number of frequency storage device.
Step A4, conjunction bag is carried out to the request data package for obtaining largest request number in row in order from request, closed And request bag.
Step A5, request bag will be merged and sent to video storage device, asked with merging request bag size identical video Packet.
In the present embodiment, due to the bandwidth between local terminal and video storage device actually much larger than local terminal and client it Between bandwidth, can ask more data to video storage device every time.Therefore, according to the largest request of video storage device Number is carried out closing bag processing to request data package, and merging data bag is sent into video storage device request video data.So, Reduce to video storage device transmission request data package number, improve the transmission effect between local terminal and video storage device Rate.
In another embodiment, local terminal is as follows to the flow of client reply data:
Step B1, video data bag is received, video data bag includes the sub-video data bag of largest request number, and son regards Frequency packet corresponds with merging the request data package in request bag.
Step B2, video data bag is unpacked, and obtains sub-video data bag corresponding with request data package.
In the present embodiment, when receiving the video data bag of video storage device return, due to the video data bag pair Multiple request data packages are answered, therefore, it is necessary to are exported after unpacking further according to the output speed upper limit.
Following is apparatus of the present invention embodiment, can be used for performing the inventive method embodiment.
Fig. 9 is the block diagram of the server output stream amount speed-limiting device shown in the embodiment of the present invention, and the device can be by soft Part, hardware or both are implemented in combination with as some or all of of electronic equipment.As shown in figure 9, the server output stream Speed-limiting device is measured, including:
First acquisition module 91, for corresponding to the code check of video according to the video request acquisition video request received.
First determining module 92, for determining the output speed upper limit of server according to code check.
Output module 93, for corresponding to the video data of video according to output speed upper limit output video request.
Optionally, the first determining module 92, for setting the output speed upper limit as N times of code check, wherein, N is more than or equal to 1。
Figure 10 is the block diagram of the server output stream amount speed-limiting device shown in another embodiment of the present invention, as shown in Figure 10, First acquisition module 91, for when receiving at least two video requests simultaneously, obtaining each video request and corresponding to video Code check.Wherein it is determined that module 92 includes:Calculating sub module 101 and setting submodule 102.
Calculating sub module 101, the code check sum of video is corresponded to for calculating at least two video requests;
Submodule 102 is set, for setting the first output speed upper limit according to code check sum.
Figure 11 is the block diagram of the output module shown in the embodiment of the present invention, and as shown in figure 11, output module 93 includes:Output Submodule 111 and setting submodule 112.
Output sub-module 111, correspondingly regarded for exporting at least two video requests simultaneously according to the first output speed upper limit The video data of frequency.
Submodule 112 is set, for corresponding to the video counts of video when the first video request at least two video requests After according to output, the second output speed upper limit is set according to the code check for not exporting the second video request for finishing and corresponding to video.
Output sub-module 111, for corresponding to the video of video according to the second video request of second output speed upper limit output Data.
Figure 12 is the block diagram of the output module shown in another embodiment of the present invention, and as shown in figure 12, output module 93 includes: Reading submodule 121, determination sub-module 122, acquisition submodule 123 and output sub-module 124,
Reading submodule 121, for reading the video data of the first data volume according to the output speed upper limit.
Determination sub-module 122, for determining first number of the request token from token bucket every time.
Acquisition submodule 123, when the token number in token bucket is more than or equal to first number, obtained from token bucket First several token.
Output sub-module 124, for exporting the video data of the first data volume.
Figure 13 is the block diagram of the output module shown in another embodiment of the present invention, and as shown in figure 13, output module 93 also wraps Include:Refresh submodule 125.
Output sub-module 124, for being less than first number when the token number in token bucket, and the first data volume be less than or During equal to current permission burst flow, the video data of the first data volume is exported.
Refresh submodule 125, for refreshing the current value for allowing burst flow, allow burst flow to cut first by current Data volume.
Acquisition submodule 123, for being less than first number when the token number in token bucket, and the first data volume is more than and worked as During preceding permission burst flow, the first preset time of delay obtains first several token.
In another embodiment, the device also includes:
Second acquisition module, for obtaining request queue according to video request;
Second determining module, for determining the size of request data package in request queue;
Computing module, for the bandwidth between the size according to request data package and local terminal and video storage device, calculate For the largest request number of video storage device;
Bag module is closed, for carrying out conjunction bag to the request data package for obtaining largest request number in row in order from request, Obtain merging request bag;
Sending module, send to video storage device, ask identical with merging request bag size for request bag will to be merged Video data bag.
In another embodiment, the device also includes:
Receiving module, for receiving video data bag, video data bag includes the sub-video data of largest request number Bag, sub-video data bag correspond with merging the request data package in request bag;
Unpack module, for video data bag to be unpacked, obtain sub-video data bag corresponding with request data package.
The embodiment of the present invention also provides a kind of server, and the server that the server is included in above-mentioned each device embodiment is defeated Outflow speed-limiting device.
The embodiment of the present invention also provides a kind of DNS (Content Delivery Network, content distributing network) system, The system includes at least one above-mentioned server.
The device according to video code rate dynamic speed limit of the embodiment of the present invention, different video is not only ensure that when downloading, The maximum download rate that can reach improves the security of system not over the output speed upper limit set according to code check.And And ensure that each user of request video obtains the video playback experience of smoothness.And for the less video file of code check, The too high bandwidth traffic that will not be distributed, the bandwidth traffic of server is greatlyd save, improve the utilization rate of network.In addition, The method of the present invention is every based on code check because the total bandwidth flow that server can be provided is fixed in specific implementation The output speed upper limit of individual video request distribution server, thus, the concurrent request that actually server can be handled simultaneously For quantity nor fixed, the maximum number of concurrent that server is handled simultaneously is the code check based on the corresponding video of each request and dynamic Change, therefore so that the utilization rate of network is greatly improved.
Each embodiment is described by the way of progressive in this specification, what each embodiment stressed be and its The difference of its embodiment, same or analogous part cross-reference between each embodiment.For system embodiment For, because it is substantially corresponding with embodiment of the method, so description is fairly simple, referring to the portion of embodiment of the method in place of correlation Defend oneself bright.
The method and system of the present invention may be achieved in many ways.For example, can by software, hardware, firmware or Software, hardware, firmware any combinations come realize the present invention method and system.The said sequence of the step of for methods described Order described in detail above is not limited to merely to illustrate, the step of method of the invention, it is special unless otherwise Do not mentionlet alone bright.In addition, in certain embodiments, the present invention can be also embodied as recording program in the recording medium, these programs Including the machine readable instructions for realizing the method according to the invention.Thus, the present invention also covering storage is used to perform basis The recording medium of the program of the method for the present invention.
Description of the invention provides for the sake of example and description, and is not exhaustively or by the present invention It is limited to disclosed form.Many modifications and variations are obvious for the ordinary skill in the art.Select and retouch State embodiment and be to more preferably illustrate the principle and practical application of the present invention, and one of ordinary skill in the art is managed The present invention is solved so as to design the various embodiments with various modifications suitable for special-purpose.

Claims (14)

  1. A kind of 1. server output stream amount method for limiting speed, it is characterised in that including:
    The video request acquisition video request according to receiving corresponds to the code check of video;
    The output speed upper limit of the server is determined according to the code check;
    The video data of video is corresponded to according to the output speed upper limit output video request.
  2. 2. according to the method for claim 1, it is characterised in that
    The output speed upper limit that the server is determined according to the code check, including:The output speed upper limit is set to be N times of the code check, wherein, N is more than or equal to 1.
    With or
    The video request that the basis receives obtains the code check that the video request corresponds to video, including:Received when simultaneously During at least two video requests, the code check that each video request corresponds to video is obtained;
    With or
    The output speed upper limit that the server is determined according to the code check, including:
    Calculate the code check sum that at least two video request corresponds to video;
    The first output speed upper limit is set according to the code check sum.
  3. 3. according to the method for claim 2, it is characterised in that described that the video is exported according to the output speed upper limit The video data of the corresponding video of request, including:
    Export the video data that at least two video request corresponds to video simultaneously according to the first output speed upper limit;
    After the first video request at least two video request corresponds to the video data output of video, according to not Export the code check second output speed upper limit of setting that the second video request finished corresponds to video;
    The video data of video is corresponded to according to the second output speed upper limit output second video request.
  4. 4. according to the method any one of claim 1-3, it is characterised in that described defeated according to the output speed upper limit Go out the video data that the video request corresponds to video, including:
    The video data of the first data volume is read according to the output speed upper limit;
    It is determined that first number of token is asked from token bucket every time;
    When the token number in the token bucket is more than or equal to first number, described is obtained from the token bucket One several token;
    Export the video data of first data volume.
  5. 5. according to the method for claim 4, it is characterised in that described that the video is exported according to the output speed upper limit The video data of the corresponding video of request, in addition to:
    When the token number in the token bucket is less than first number, and first data volume is less than or equal to and current permitted Perhaps during burst flow, the video data of first data volume is exported;
    Refresh the current value for allowing burst flow, the current permission burst flow is cut into first data volume;
    When the token number in the token bucket is less than first number, and first data volume is more than described current allow During burst flow, the first preset time of delay obtains first several token.
  6. 6. according to the method for claim 1, it is characterised in that
    Methods described also includes:
    Request queue is obtained according to the video request;
    Determine the size of request data package in the request queue;
    According to the bandwidth between the size of the request data package and local terminal and video storage device, calculate and deposited for the video The largest request number of storage device;
    Conjunction bag is carried out to the request data package for obtaining the largest request number in row in order from the request, obtains merging and asks Seek bag;
    The merging request bag is sent to the video storage device, request and merges request bag size identical video with described Packet;
    And/or
    Methods described also includes:
    The video data bag is received, the video data bag includes the sub-video data bag of the largest request number, institute Sub-video data bag is stated to correspond with the request data package merged in request bag;
    The video data bag is unpacked, obtains sub-video data bag corresponding with the request data package.
  7. A kind of 7. server output stream amount speed-limiting device, it is characterised in that including:
    First acquisition module, for corresponding to the code check of video according to the video request acquisition video request received;
    First determining module, for determining the output speed upper limit of the server according to the code check;
    Output module, for corresponding to the video data of video according to the output speed upper limit output video request.
  8. 8. device according to claim 7, it is characterised in that first determining module, for setting the output speed The rate upper limit is N times of the code check, wherein, N is more than or equal to 1;
    And/or first acquisition module, for when receiving at least two video requests simultaneously, obtaining each video please Seek the code check of corresponding video;
    And/or first determining module includes:Calculating sub module and setting submodule,
    The calculating sub module, the code check sum of video is corresponded to for calculating at least two video request;
    The setting submodule, for setting the first output speed upper limit according to the code check sum.
  9. 9. device according to claim 8, it is characterised in that the output module includes:Output sub-module and setting Module,
    The output sub-module, for exporting at least two video request pair simultaneously according to the first output speed upper limit Answer the video data of video;
    The setting submodule, for corresponding to the video counts of video when the first video request at least two video request After according to output, the second output speed upper limit is set according to the code check for not exporting the second video request for finishing and corresponding to video;
    The output sub-module, video is corresponded to for exporting second video request according to the second output speed upper limit Video data.
  10. 10. according to the device any one of claim 7-9, it is characterised in that the output module includes:Read submodule Block, determination sub-module, acquisition submodule and output sub-module,
    The reading submodule, for reading the video data of the first data volume according to the output speed upper limit;
    The determination sub-module, for determining first number of the request token from token bucket every time;
    The acquisition submodule, when the token number in the token bucket is more than or equal to first number, from the order First several token are obtained in board bucket;
    The output sub-module, for exporting the video data of first data volume.
  11. 11. device according to claim 10, it is characterised in that the output module also includes:Refresh submodule,
    The output sub-module, for being less than first number, and first number when the token number in the token bucket When being less than or equal to the current permission burst flow according to amount, the video data of first data volume is exported;
    The refreshing submodule, for refreshing the current value for allowing burst flow, the current permission burst flow is subtracted Fall first data volume;
    The acquisition submodule, for being less than first number, and first number when the token number in the token bucket When being more than the current permission burst flow according to amount, the first preset time of delay obtains first several token.
  12. 12. device according to claim 7, it is characterised in that
    Described device also includes:
    Second acquisition module, for obtaining request queue according to the video request;
    Second determining module, for determining the size of request data package in the request queue;
    Computing module, for the bandwidth between the size according to the request data package and local terminal and video storage device, calculate For the largest request number of the video storage device;
    Bag module is closed, for being closed from the request to the request data package for obtaining the largest request number in row in order Bag, obtain merging request bag;
    Sending module, merge request bag with described for the merging request bag to be sent to the video storage device, request Size identical video data bag;
    And/or
    Described device also includes:
    Receiving module, for receiving the video data bag, the video data bag includes the son of the largest request number Video data bag, the sub-video data bag correspond with the request data package merged in request bag;
    Unpack module, for the video data bag to be unpacked, obtain sub-video number corresponding with the request data package According to bag.
  13. A kind of 13. server, it is characterised in that the server output stream amount speed-limiting device including the claims 7-12.
  14. 14. a kind of DNS systems, include the server of at least one the claims 13.
CN201711009986.9A 2017-10-25 2017-10-25 Server output stream amount method for limiting speed, device, server and DNS systems Pending CN107635144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711009986.9A CN107635144A (en) 2017-10-25 2017-10-25 Server output stream amount method for limiting speed, device, server and DNS systems

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711009986.9A CN107635144A (en) 2017-10-25 2017-10-25 Server output stream amount method for limiting speed, device, server and DNS systems

Publications (1)

Publication Number Publication Date
CN107635144A true CN107635144A (en) 2018-01-26

Family

ID=61106516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711009986.9A Pending CN107635144A (en) 2017-10-25 2017-10-25 Server output stream amount method for limiting speed, device, server and DNS systems

Country Status (1)

Country Link
CN (1) CN107635144A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108566415A (en) * 2018-03-12 2018-09-21 广东睿江云计算股份有限公司 A kind of Distributed concurrency control method based on web
CN110740174A (en) * 2019-09-30 2020-01-31 北京字节跳动网络技术有限公司 File downloading speed limiting method and device and electronic equipment
CN112600757A (en) * 2020-12-25 2021-04-02 深圳深度探测科技有限公司 Safety maintenance method based on asymmetric data transmission speed limiter
CN112839238A (en) * 2019-11-22 2021-05-25 腾讯科技(深圳)有限公司 Screen projection playing method and device and storage medium
CN113038186A (en) * 2021-02-07 2021-06-25 杭州又拍云科技有限公司 Method and configuration for flexible speed limit by automatically analyzing video code rate in content distribution network

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009194585A (en) * 2008-02-14 2009-08-27 Nec Corp Relay device
CN101674247A (en) * 2009-10-21 2010-03-17 中兴通讯股份有限公司 Method for supervising traffic flow and apparatus thereof
CN102624884A (en) * 2012-02-29 2012-08-01 上海聚力传媒技术有限公司 Method, device and facility for receiving peer-to-peer (P2P) resources
CN103108257A (en) * 2011-11-10 2013-05-15 中国科学院声学研究所 Method used for embedded terminal and capable of improving playback quality of streaming media and system used for embedded terminal and capable of improving playback quality of streaming media
CN105531968A (en) * 2013-09-11 2016-04-27 思科技术公司 Network-based adaptive rate limiting
CN106411773A (en) * 2016-08-29 2017-02-15 武汉微创光电股份有限公司 Traffic shaping method and system in video transmission based on token bucket

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009194585A (en) * 2008-02-14 2009-08-27 Nec Corp Relay device
CN101674247A (en) * 2009-10-21 2010-03-17 中兴通讯股份有限公司 Method for supervising traffic flow and apparatus thereof
CN103108257A (en) * 2011-11-10 2013-05-15 中国科学院声学研究所 Method used for embedded terminal and capable of improving playback quality of streaming media and system used for embedded terminal and capable of improving playback quality of streaming media
CN102624884A (en) * 2012-02-29 2012-08-01 上海聚力传媒技术有限公司 Method, device and facility for receiving peer-to-peer (P2P) resources
CN105531968A (en) * 2013-09-11 2016-04-27 思科技术公司 Network-based adaptive rate limiting
CN106411773A (en) * 2016-08-29 2017-02-15 武汉微创光电股份有限公司 Traffic shaping method and system in video transmission based on token bucket

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108566415A (en) * 2018-03-12 2018-09-21 广东睿江云计算股份有限公司 A kind of Distributed concurrency control method based on web
CN110740174A (en) * 2019-09-30 2020-01-31 北京字节跳动网络技术有限公司 File downloading speed limiting method and device and electronic equipment
CN112839238A (en) * 2019-11-22 2021-05-25 腾讯科技(深圳)有限公司 Screen projection playing method and device and storage medium
CN112600757A (en) * 2020-12-25 2021-04-02 深圳深度探测科技有限公司 Safety maintenance method based on asymmetric data transmission speed limiter
CN112600757B (en) * 2020-12-25 2023-03-10 深圳深度探测科技有限公司 Safety maintenance method based on asymmetric data transmission speed limiter
CN113038186A (en) * 2021-02-07 2021-06-25 杭州又拍云科技有限公司 Method and configuration for flexible speed limit by automatically analyzing video code rate in content distribution network

Similar Documents

Publication Publication Date Title
CN107635144A (en) Server output stream amount method for limiting speed, device, server and DNS systems
US10462138B2 (en) Application programming interface access controls
Wu et al. iCloudAccess: Cost-effective streaming of video games from the cloud with low latency
KR102196404B1 (en) Reducing latency
US8621220B2 (en) Systems and methods for identity encapsulated cryptography
WO2016188099A1 (en) Account activity level based-system resources allocation method and device
CN106209402B (en) A kind of telescopic method and equipment of virtual network function
US9305274B2 (en) Traffic shaping based on request resource usage
CN107038186A (en) Generate title, search result displaying, the method and device of title displaying
US11706092B2 (en) Activity-based resource allocation among virtual-computing sessions
CN105376176B (en) Ensure the methods, devices and systems of mobile Internet video traffic service quality
US11108720B2 (en) Upsell framework for network services
Hosanagar et al. Pricing and resource allocation in caching services with multiple levels of quality of service
CN110276184A (en) A kind of cloud computing resources authorization method and device
US20140279320A1 (en) Allocating and pricing virtual resources
WO2022267766A1 (en) Method, apparatus and device for accessing aggregate code payment page, and medium
CN106161285B (en) A kind of network resource allocation method and device
CN110033247A (en) Channel of disbursement recommended method and its system
WO2017193909A1 (en) Method and device for adjusting bandwidth
CN107147610A (en) The processing method and processing device of resource
WO2016011831A1 (en) Charging method and device, access device, and service quality control method and device
US10771392B1 (en) Increasing efficiency to rate limiting
Low Equilibrium bandwidth and buffer allocations for elastic traffics
CN107395663A (en) Data capture method and device
KR20220127327A (en) Adaptive state management for stateless services

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