CN104125269A - Method and device for rate limitation - Google Patents

Method and device for rate limitation Download PDF

Info

Publication number
CN104125269A
CN104125269A CN201410310802.2A CN201410310802A CN104125269A CN 104125269 A CN104125269 A CN 104125269A CN 201410310802 A CN201410310802 A CN 201410310802A CN 104125269 A CN104125269 A CN 104125269A
Authority
CN
China
Prior art keywords
application process
information
speed
current
bandwidth
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
CN201410310802.2A
Other languages
Chinese (zh)
Other versions
CN104125269B (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.)
Chengdu kugou business incubator management Co.,Ltd.
Original Assignee
Guangzhou Kugou Computer Technology Co 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 Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201410310802.2A priority Critical patent/CN104125269B/en
Publication of CN104125269A publication Critical patent/CN104125269A/en
Application granted granted Critical
Publication of CN104125269B publication Critical patent/CN104125269B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention disclose a method and device for rate limitation, and belongs to the technical field of the terminals. The method comprises the steps of obtaining the information of application processes in the network connected state at present and network data information transmitted at present, determining the data transmission statistical information of each application process according to the information of the application processes and the network data information, determining whether the various application process include a first application process which is an application process of a specified type according to the correspondence of the stored application process types and the application processes, and when the various application process include the first application process and if the data transmission statistical information of the first application process is smaller than preset threshold, performing rate limitation on a second application process. The method for rate limitation has the advantages that the problem of instability generated by an application driver is avoided, the rate limitation efficiency is improved and the network bandwidth can be effectively distributed.

Description

Method for limiting speed and device
Technical field
The present invention relates to terminal technology field, particularly a kind of method for limiting speed and device.
Background technology
The Internet is a huge resource sharing platform, especially at P2P (Peer to Peer, point-to-point) in the network of pattern, the status of every station terminal is all reciprocity, terminal can be simultaneously as server and client side, in downloading the network data of other-end, also can adopt the mode uploaded to provide network data for other-end, to realize resource-sharing.And in terminal, various application processes share consolidated network bandwidth, if occupied a large amount of network bandwidths when a certain application process is moved, will affect the normal operation of other application processes.In view of the situation, can carry out speed restriction by the network data exchange process to each application process, the network bandwidth taking dynamically to adjust each application process, avoids interacting between application.
At present, the solution that prior art provides comprises: driving filter course based on operating system, obtain the application process information of carrying out network data exchange by driver, according to the variation of this application process information, each application process is carried out to speed limit, thereby dynamically adjust the channel width that each application process takies.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem:
Because the acquisition process of application processes information relates to driver, and driver is by the module of the transfer of data in related data transmission protocol processes network, therefore need to move different drivers according to different pieces of information host-host protocol obtains, it is larger that it realizes difficulty, and driver exists destabilizing factor, make the less stable of speed limit process.
Summary of the invention
In order to solve the problem of prior art, the embodiment of the present invention provides a kind of method for limiting speed and device.Described technical scheme is as follows:
On the one hand, provide a kind of method for limiting speed, described method comprises:
Obtain current application process information in network connection state and the network data information of current transmission; According to this application process information and this network data information, determine the transfer of data statistical information of each application process; According to the corresponding relation between application process type and the application process of storage, judge in this each application process whether comprise the first application process, the application process that this first application process is specified type; In the time that this each application process comprises the first application process, if the transfer of data statistical information of this first application process is less than predetermined threshold value, the second application process is carried out to speed restriction.
On the other hand, provide a kind of speed limiting device, described device comprises:
Acquisition of information module, for obtaining current application process information in network connection state and the network data information of current transmission; Information determination module, for according to this network data information and this application process information, determines the transfer of data statistical information of each application process; Application process judge module, for according to the corresponding relation between application process type and the application process of storage, judges in this each application process whether comprise the first application process, the application process that this first application process is specified type; Speed restriction module, in the time that this each application process comprises the first application process, if the transfer of data statistical information of this first application process is less than predetermined threshold value, for the second application process is carried out to speed restriction.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By obtaining current application process information in network connection state and the network data information of current transmission, determine the transfer of data statistical information of each application process; According to the corresponding relation between application process type and the application process of storage, judge the application process that whether comprises specified type in this each application process; In the time that this each application process comprises the application process of specified type, if the transfer of data statistical information of this first application process is less than predetermined threshold value, the second application process is carried out to speed restriction.The technical scheme that the embodiment of the present invention provides, by monitoring the transfer of data of each application process, the transfer of data statistical information that determines whether the first application process is less than predetermined threshold value, because predetermined threshold value is for ensureing the normal operating condition of the first application process, therefore, can determine whether that the application process of specified type is in abnormal running state, thereby the second application process is carried out to speed restriction, the instability problem of not only having avoided application driver to produce, and improve the efficiency of speed restriction, can effectively distribute the network bandwidth, the network that has promoted user is experienced.
Brief description of the drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the method for limiting speed flow chart that the embodiment of the present invention provides;
Fig. 2 is the method for limiting speed flow chart that the embodiment of the present invention provides;
Fig. 3 is the speed limiting device structural representation that the embodiment of the present invention provides.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Fig. 1 is the method for limiting speed flow chart that the embodiment of the present invention provides.Referring to Fig. 1, described method flow comprises:
101, obtain current application process information in network connection state and the network data information of current transmission.
102,, according to this application process information and this network data information, determine the transfer of data statistical information of each application process.
103, according to the corresponding relation between application process type and the application process of storage, judge in this each application process whether comprise the first application process, the application process that this first application process is specified type.
104,, in the time that this each application process comprises the first application process, if the transfer of data statistical information of this first application process is less than predetermined threshold value, the second application process is carried out to speed restriction.
In another embodiment provided by the invention, obtaining the current application process information in network connection state comprises: call appointing system API, enumerate the current application process information in network connection state, this application process information comprises any one in process ID, process title, source port number, source IP address, destination port number and target ip address.
In another embodiment provided by the invention, the network data information of obtaining current transmission comprises: the packet header of the network packet to current transmission is analyzed, and obtains the size of data that this network packet is carried and the connection object information of this network packet.
In another embodiment provided by the invention, according to this application process information and this network data information, the transfer of data statistical information of determining each application process comprises: according to the connection object information of any one and this network packet in process ID, process title, source port number, source IP address, destination port number and target ip address in this application process information, determine the size of data of network packet corresponding to each application process information; According to the size of data of network packet corresponding to each application process information, obtain the transmission speed of described each application process.
In another embodiment provided by the invention, in the time that this each application process comprises the first application process, if the transfer of data statistical information of this first application process is less than predetermined threshold value, the second application process is carried out to speed restriction to be comprised: in the time that this first application process is browser class process, if when the transfer of data statistical information of this browser class process is less than the first predetermined threshold value, this second application process is carried out to speed restriction; Or, in the time that this first application process is game on line class process, if when the transfer of data statistical information of this game class process is less than the second predetermined threshold value, this second application process is carried out to speed restriction; Or, in the time that this first application process is online audio-visual class process, if when the transfer of data statistical information of this online audio-visual class process is less than the 3rd predetermined threshold value, this second application process is carried out to speed restriction; Wherein, the first predetermined threshold value is less than the second predetermined threshold value and the 3rd predetermined threshold value.
In another embodiment provided by the invention, in the time that this each application process comprises the first application process, if the transfer of data statistical information of this first application process is less than predetermined threshold value, before the second application process is carried out to speed restriction, described method also comprises: current network bandwidth is tested, obtain current download bandwidth and current uploading bandwidth; The second application process being carried out in the process of speed restriction, adjust the transmission speed of this second application process according to current download bandwidth and current uploading bandwidth.
In another embodiment provided by the invention, the second application process being carried out in the process of speed restriction, according to current download bandwidth and current uploading bandwidth, the transmission speed of adjusting this second application process comprises: in the time that this first application process is browser class process, the uploading speed of this second application process is reduced to first ratio of deserving front uploading bandwidth, the speed of download of this second application process is reduced to second ratio of deserving front download bandwidth; Or, in the time that this first application process is game on line class process, the uploading speed of this second application process is reduced to the 3rd ratio of deserving front uploading bandwidth, the speed of download of this second application process is reduced to the 4th ratio of deserving front download bandwidth; Or, in the time that this first application process is online audio-visual class process, the uploading speed of this second application process is reduced to the 5th ratio of deserving front uploading bandwidth, the speed of download of this second application process is reduced to the 6th ratio of deserving front download bandwidth.
By obtaining current application process information in network connection state and the network data information of current transmission, determine the transfer of data statistical information of each application process; According to the corresponding relation between application process type and the application process of storage, judge the application process that whether comprises specified type in this each application process; In the time that this each application process comprises the application process of specified type, if the transfer of data statistical information of this first application process is less than predetermined threshold value, the second application process is carried out to speed restriction.The technical scheme that the embodiment of the present invention provides, by monitoring the transfer of data of each application process, the transfer of data statistical information that determines whether the first application process is less than predetermined threshold value, because predetermined threshold value is for ensureing the normal operating condition of the first application process, therefore, can determine whether that the application process of specified type is in abnormal running state, thereby the second application process is carried out to speed restriction, the instability problem of not only having avoided application driver to produce, and improve the efficiency of speed restriction, can effectively distribute the network bandwidth, the network that has promoted user is experienced.
Above-mentioned all optional technical schemes, can adopt any combination to form optional embodiment of the present invention, and this is no longer going to repeat them.
Fig. 2 is the method for limiting speed flow chart that the embodiment of the present invention provides.Referring to Fig. 2, described method flow comprises:
201, call appointing system API (Application Program Interface, application programming interfaces), obtain the current application process information in network connection state, this application process information comprises at least one item in process ID, process title, source port number, source IP address, destination port number and target ip address.
Wherein, the API with scanning application process function being provided by terminal operating system is provided appointing system API.Terminal, by calling this appointing system API, can be enumerated all application process information that connect in network under current system, comprises process ID, process title, source port number, source IP address, destination port number and target ip address etc.
By this step 201, can know current each application process of just carrying out network data transmission, and know the specifying information of each application process, as process ID, process title, source port number, source IP address, destination port number and target ip address, certainly, this application process information can also comprise some other for representing the information of running status of this application process, do not repeat at this.
202, the packet header of the network packet to current transmission is analyzed, and obtains the size of data that this network packet is carried and the connection object information of this network packet.
Wherein, the packet header of this network packet can refer to that IP head or the TCP of the received network packet of terminal is first-class, IP head or the TCP that can also refer to the network packet that terminal sends are first-class, in this packet header, include the address information etc. of size of data, connection object and the transmitting terminal of the data of carrying in the type information, bag of network packet, certainly, for the network packet that uses other procotols to transmit, its packet header type is likely different, as first-class in UDP etc., do not repeat at this.
In order to realize the analysis to network packet, can Network card setup be become to promiscuous mode by raw socket (row socket), to carry out the network monitoring based on source socket.Creating after raw socket, need to packet header (as IP head) option of operation be set by setsockopt () function (for the setting options value of any type, free position socket), and then by bind () function (for socket is connected with designated port), raw socket be tied to the local network interface card of terminal.In order to allow raw socket can receive all types of packets, also need to arrange by ioctlsocket () function (for socket is arranged), whether in person process packet header but also can specify.So far, just can start network packet to monitor, thereby the network packet listening to is analyzed.Can as stream socket or Datagram Socket, complete by recv () function obtaining of packet.But different from other two kinds of sockets is, the network packet that raw socket now captures is not merely simple data message, but include the most original data message in IP head, the first-class packet header of TCP, because the network packet in transmission over networks has all been passed through the packing of network layer and transport layer, therefore need according to its additional frame head, network packet to be analyzed, these data messages have retained original appearance when network data wraps in Internet Transmission.
203,, according to the connection object information of any one and this network packet in process ID, process title, source port number, source IP address, destination port number and target ip address in this application process information, determine the size of data of network packet corresponding to each application process information.
Connection object information entrained in the packet header of this network packet can refer to process ID, above-mentioned any application process information such as process title and destination port number, describe as an example of destination port number example, the process of this step 203 can comprise: in the time determining that the connection object information of the network packet of transmitting is first object port numbers, in the application process information that got of judgement, whether comprise first object port numbers, if, determine the first application process corresponding to this first object port numbers, according to the size of data of network packet corresponding to this first object port numbers, obtain the size of data of all packets that this first application process transmits.
It should be noted that, for an application process, its network packet of uploading or downloading can have multiple, now, the size of data of transmitting in order to calculate this application process, can respectively the size of data of uploading be added, and the size of data of downloading is added, with the bandwidth of knowing that this application process really takies.
204,, according to the size of data of network packet corresponding to each application process information, obtain the transmission speed of described each application process.
Particularly, the transmission speed of application process can refer to this application process velocity peak values at a time, also can refer to the speed average of this application process in a set period.Correspondingly, this step 204 can comprise following two kinds of different processes: (1) is every the first default duration, add up the size of data of network packet corresponding to this application process information, the transmission speed using the maximum transfer speed (being the size of data of transmitting in a certain moment) of this application process in this first default duration as this application process.(2) every the second default duration, add up the size of data of network packet corresponding to this application process information, the size of data summation that this application process sent or received in this second default duration is as the transmission speed of this application process.Certainly, these transmission speed computational methods are only giving an example of basis, and its specific algorithm can also be other algorithms that carry out according to analyzing packet header, is not specifically limited at this.And further, for different application processes, can have different transmission speed computational methods, be not specifically limited at this.
205, according to the corresponding relation between application process type and the application process of storage, judge in this each application process whether comprise the first application process, the application process that this first application process is specified type;
If so, execution step 206;
If not, finish.
Wherein, corresponding relation between application process type and application process that server is pre-stored, this corresponding relation can be for determining the type of each application process, application process type can comprise specified type and non-designated type, as, non-designated type can comprise antivirus software class, document class etc., and specified type can comprise online game class, online audio-visual class, browser class etc.In embodiments of the present invention, this specified type is the classification that running status may be subject to the network data transmission impact of the second application process, therefore, need to judge the application process whether in the current application process in network data exchange with specified type, can determine whether to carry out to the second application process the processing such as speed limit.Further, this specified type also can refer to the larger classification of network data transmission impact that is subject to the second application process, for the less application of some transfer of data own, it also can be subject to the network data transmission impact of the second application process, but, may be less on the impact of its operation, therefore, to this class application process, can be not considered.Certainly, specifically which application process belongs to specified type, can be arranged by Server Default, or be arranged according to self-demand by user.As, in setting up procedure, in order to ensure the normal renewal of antivirus software etc., also can antivirus software class be set to the one of specified type.
In embodiments of the present invention, the corresponding relation between application process type and application process can adopt the form of white list, particularly, is the corresponding relation of application process type and application process title (or application process ID) etc.That is to say, when defining an application process in network connection state, according to this application process title (or application process ID), corresponding relation between application process type and application process, obtain application process type corresponding to this application process, judge whether this application process type is specified type, if application process type is specified type, determine that this application process is the first application process, if application process type is not specified type, determine that this application process is not the first application process, if do not comprise the first application process in the current application process in network connection state, determine without the second application process is carried out to speed limit, finish.
206, current network bandwidth is tested, obtain current download bandwidth and current uploading bandwidth.
Wherein, in the process that current network bandwidth is tested, need to test respectively current download bandwidth and current uploading bandwidth, corresponding method of testing comprises the step of following (1)-(2):
(1) for the test of current download bandwidth, download target detection file operation by terminal, and repeat this down operation several times, finally to determine current download bandwidth.
(2), for the test of current uploading bandwidth, by realize on ping command protocols test respective objects network the winding time by reference in terminal, can obtain current uploading bandwidth.
It should be noted that, step 206 can be carried out determining while having the first application process, can also in the time having started the obtaining of application processes information and network data information, carry out, certainly, this specifically the opportunity of carrying out can also be other opportunitys, do not repeat at this.By test bandwidth, make terminal know the actual bandwidth ability of terminal in current network environment of living in.
207,, in the time that this each application process comprises the first application process, if the transmission speed of this first application process is less than predetermined threshold value, the second application process is carried out to speed restriction.
Wherein, in step 207, mentioned transmission speed is transfer of data statistical information, and in network data transmission process, this transfer of data statistical information has determined the network bandwidth that this application process takies.This predetermined threshold value refers to be set for the application process of each specified type, and this predetermined threshold value refers to the speed numerical value that can ensure normal operation.As, for the application process of certain online audio-visual class, its corresponding predetermined threshold value can be 500k/s, that is to say, in the time that the transfer of data statistical information of this application process reaches 500k/s, can normally move, do not affect user's viewing experience,, in the time that the data statistics information of this application process is less than 500k/s, need to carries out speed restriction to the second application process, thereby give way for this online audio-visual class application process.
In embodiments of the present invention, the second application process refers to the object that can carry out speed restriction, and this speed limiting device has the authority that the transmission speed of the second application process is limited.This speed limiting device can call the port of the second application process, and port is carried out to the settings such as speed restriction, to realize the speed restriction to the second application process.Certainly, this speed restriction can comprise restriction to uploading speed and the restriction respectively of speed of download, can be also to uploading speed and speed of download sum, that is to say that the transmission speed of this second application process limits, and is not specifically limited at this.
In the method for limiting speed providing in the present embodiment, the first dissimilar application process is also different to the demand of the network bandwidth, therefore, can be according to this first application program the different demands to the network bandwidth, this second application process is limited, can make speed restriction more targeted, also more effective for the distribution of the network bandwidth.In order to further illustrate, only taking the specified type in the present embodiment as browser class, game on line class and online audio-visual class describe respectively.
Step 207 " in the time that this each application process comprises the first application process; if the transfer of data statistical information of this first application process is less than predetermined threshold value; the second application process is carried out to speed restriction ", can comprise the steps one or more in 207a, 207b and 207c:
207a, in the time that this first application process is browser class process, if when the transfer of data statistical information of this browser class process is less than the first predetermined threshold value, this second application process is carried out to speed restriction.
Wherein, this first predetermined threshold value can be set for this browser class process, and in the time that the transfer of data statistical information of browser class process reaches this first predetermined threshold value, this browser class process can ensure normal operation.
It should be noted that, if when the transfer of data statistical information of this browser class process is less than the first predetermined threshold value, can be according to the actual bandwidth ability of current network, taking of the uploading bandwidth to this second application process and download bandwidth carried out speed restriction respectively.This step 207a specifically comprises: according to current network uploading bandwidth, the uploading speed of this second application process is reduced to first ratio of deserving front uploading bandwidth.According to current network download bandwidth, the speed of download of this second application process is reduced to second ratio of deserving front download bandwidth.
Wherein, this first ratio and the second ratio can be got equal value also can get unequal numerical value, can determine according to the degree of priority of upload and download, preferably, can be by second ratio that is greater than of the first ratio setting, to guarantee the download of the second application process in current terminal.To give way in order realizing effectively, need to, taking current actual bandwidth ability as benchmark, speed to be limited, improved the efficiency of speed restriction.
207b, in the time that this first application process is game on line class process, if when the transfer of data statistical information of this game class process is less than the second predetermined threshold value, this second application process is carried out to speed restriction.
Wherein, this second predetermined threshold value can be set for this game on line class process, and in the time that the transfer of data statistical information of game on line class process reaches this second predetermined threshold value, this game on line class process can ensure normal operation.
This step 207b specifically comprises: in the time that this first application process is game on line class process, according to current network uploading bandwidth, the uploading speed of this second application process is reduced to the 3rd ratio of deserving front uploading bandwidth.In the time that this first application process is game on line class process, according to current network download bandwidth, the speed of download of this second application process is reduced to the 4th ratio of deserving front download bandwidth.
Wherein, the 3rd ratio and the 4th ratio can be got equal value also can get unequal numerical value, can determine according to the degree of priority of upload and download, preferably, can be by the 4th ratio that is greater than of the 3rd ratio setting, to guarantee the download of the second application process in current terminal.To give way in order realizing effectively, need to, taking current actual bandwidth ability as benchmark, speed to be limited, improved the efficiency of speed restriction.
207c, in the time that this first application process is online audio-visual class process, if when the transfer of data statistical information of this online audio-visual class process is less than the 3rd predetermined threshold value, this second application process is carried out to speed restriction.
Wherein, the 3rd predetermined threshold value can be set for this online audio-visual class process, and in the time that the transfer of data statistical information of online audio-visual class process reaches the 3rd predetermined threshold value, this online audio-visual class process can ensure normal operation.Particularly, this step 207c comprises: in the time that this first application process is online audio-visual class process, according to current network uploading bandwidth, the uploading speed of this second application process is reduced to the 5th ratio of deserving front uploading bandwidth.In the time that this first application process is online audio-visual class process, according to current network download bandwidth, the speed of download of this second application process is reduced to the 6th ratio of deserving front download bandwidth.
Wherein, the 5th ratio and the 6th ratio can be got equal value also can get unequal numerical value, can determine according to the degree of priority of upload and download, preferably, can be by the 6th ratio that is greater than of the 5th ratio setting, to guarantee the download of the second application process in current terminal.To give way in order realizing effectively, need to, taking current actual bandwidth ability as benchmark, speed to be limited, improved the efficiency of speed restriction.
It should be noted that, for the first predetermined threshold value in above-mentioned steps 207a-207c, the second predetermined threshold value and the 3rd predetermined threshold value, because browser class process required bandwidth under normal operating condition is less, therefore, the first predetermined threshold value can be less than the second predetermined threshold value and the 3rd predetermined threshold value, and magnitude relationship between the second predetermined threshold value and the 3rd predetermined threshold value can be any relation, at this, magnitude relationship between each threshold value is not done to concrete restriction.
In the method for limiting speed providing in the present embodiment, according to different application process type, speed restriction ratio is set respectively, can make the speed restriction of this second application process more flexible, also more accurate for the distribution of the network bandwidth.
It should be noted that, further, step 201-207 is for only having first application process to describe in the scene of running status.In fact, can also there is the first application process scene in running status simultaneously of multiple specified type, for this scene, can be according to the transfer of data statistical information of the plurality of the first application process, and the actual bandwidth ability of current network, this second application process is carried out to speed restriction.Alternatively, can also reserve certain network bandwidth for the plurality of the first application process, make can compete this reserved network bandwidth between multiple the first application processes.Particularly, can be to carry out according to the mode of the priority for this multiple the first application process for this competition, for the first higher application process of priority is distributed the more network bandwidth, and be that the first application process that priority is lower is distributed the less network bandwidth.Usually, user can arrange according to self-demand the priority of the first application process, server distributes the corresponding network bandwidth according to the priority of each the first application process for it again, as, the priority of game on line class process can be greater than online audio-visual class process, and the priority of online audio-visual class process can be greater than browser class process.
The method that the present embodiment provides, by obtaining current application process information in network connection state and the network data information of current transmission, determines the transfer of data statistical information of each application process; According to the corresponding relation between application process type and the application process of storage, judge the application process that whether comprises specified type in this each application process; In the time that this each application process comprises the application process of specified type, if the transfer of data statistical information of this first application process is less than predetermined threshold value, the second application process is carried out to speed restriction.The technical scheme that the embodiment of the present invention provides, by monitoring the transfer of data of each application process, the transfer of data statistical information that determines whether the first application process is less than predetermined threshold value, because predetermined threshold value is for ensureing the normal operating condition of the first application process, therefore, can determine whether that the application process of specified type is in abnormal running state, thereby the second application process is carried out to speed restriction, the instability problem of not only having avoided application driver to produce, and improve the efficiency of speed restriction, can effectively distribute the network bandwidth, the network that has promoted user is experienced.
Fig. 3 is the speed limiting device structural representation that the embodiment of the present invention provides.Referring to Fig. 3, this device comprises acquisition of information module 301, information determination module 302, application process judge module 303 and speed restriction module 304.
Acquisition of information module 301, for obtaining current application process information in network connection state and the network data information of current transmission;
Information determination module 302, for according to described application process information and described network data information, determines the transfer of data statistical information of each application process;
Whether application process judge module 303, for according to the corresponding relation between application process type and the application process of storage, comprise the first application process, the application process that described the first application process is specified type in described each application process of judgement;
Speed restriction module 304, in the time that described each application process comprises the first application process, if the transfer of data statistical information of described the first application process is less than predetermined threshold value, carries out speed restriction to the second application process.
Alternatively, described acquisition of information module comprises:
API Calls unit, be used for calling appointing system API, enumerate the current application process information in network connection state, described application process information comprises any one in process ID, process title, source port number, source IP address, destination port number and target ip address.
Alternatively, described acquisition of information module comprises:
Information acquisition unit, analyzes for the packet header of the network packet to current transmission, obtains the size of data that described network packet is carried and the connection object information of described network packet.
Alternatively, described information determination module, for according to the connection object information of any one and described network packet in described application process information process ID, process title, source port number, source IP address, destination port number and target ip address, is determined the size of data of network packet corresponding to each application process information; According to the size of data of network packet corresponding to each application process information, obtain the transmission speed of described each application process.
Alternatively, described speed restriction module, in the time that described the first application process is browser class process, if when the transfer of data statistical information of described browser class process is less than the first predetermined threshold value, is carried out speed restriction to described the second application process; Or,
Described speed restriction module, in the time that described the first application process is game on line class process, if when the transfer of data statistical information of described game class process is less than the second predetermined threshold value, is carried out speed restriction to described the second application process; Or,
Described speed restriction module, in the time that described the first application process is online audio-visual class process, if when the transfer of data statistical information of described online audio-visual class process is less than the 3rd predetermined threshold value, is carried out speed restriction to described the second application process;
Wherein, the first predetermined threshold value is less than the second predetermined threshold value and the 3rd predetermined threshold value.
Alternatively, described device also comprises:
Bandwidth test module, for current network bandwidth is tested, obtains current download bandwidth and current uploading bandwidth;
Described speed restriction module, also for the process the second application process being carried out to speed restriction, according to current download bandwidth and current uploading bandwidth, is adjusted the transmission speed of described the second application process.
Alternatively, described speed restriction module is in the time that described the first application process is browser class process, the uploading speed of described the second application process is reduced to the first ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the second ratio of described current download bandwidth; Or,
Described speed restriction module is in the time that described the first application process is game on line class process, the uploading speed of described the second application process is reduced to the 3rd ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the 4th ratio of described current download bandwidth; Or,
Described speed restriction module is in the time that described the first application process is online audio-visual class process, the uploading speed of described the second application process is reduced to the 5th ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the 6th ratio of described current download bandwidth.
By obtaining current application process information in network connection state and the network data information of current transmission, determine the transfer of data statistical information of each application process; According to the corresponding relation between application process type and the application process of storage, judge the application process that whether comprises specified type in this each application process; In the time that this each application process comprises the application process of specified type, if the transfer of data statistical information of this first application process is less than predetermined threshold value, the second application process is carried out to speed restriction.The technical scheme that the embodiment of the present invention provides, by monitoring the transfer of data of each application process, the transfer of data statistical information that determines whether the first application process is less than predetermined threshold value, because predetermined threshold value is for ensureing the normal operating condition of the first application process, therefore, can determine whether that the application process of specified type is in abnormal running state, thereby the second application process is carried out to speed restriction, the instability problem of not only having avoided application driver to produce, and improve the efficiency of speed restriction, can effectively distribute the network bandwidth, the network that has promoted user is experienced.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can carry out the hardware that instruction is relevant by program completes, the program of being somebody's turn to do can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
This is only preferred embodiment of the present invention above, in order to limit the present invention, within the spirit and principles in the present invention not all, any amendment of doing, is equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (14)

1. a method for limiting speed, is characterized in that, described method comprises:
Obtain current application process information in network connection state and the network data information of current transmission;
According to described application process information and described network data information, determine the transfer of data statistical information of each application process;
According to the corresponding relation between application process type and the application process of storage, in described each application process of judgement, whether comprise the first application process, the application process that described the first application process is specified type;
In the time that described each application process comprises the first application process, if the transfer of data statistical information of described the first application process is less than predetermined threshold value, the second application process is carried out to speed restriction.
2. method according to claim 1, is characterized in that, obtains the current application process information in network connection state and comprises:
Call appointing system API, obtain the current application process information in network connection state, described application process information comprises any one in process ID, process title, source port number, source IP address, destination port number and target ip address.
3. method according to claim 1, is characterized in that, the network data information of obtaining current transmission comprises:
The packet header of the network packet to current transmission is analyzed, and obtains the size of data that described network packet is carried and the connection object information of described network packet.
4. method according to claim 3, is characterized in that, according to described application process information and described network data information, determines that the transfer of data statistical information of each application process comprises:
According to the connection object information of any one and described network packet in process ID, process title, source port number, source IP address, destination port number and target ip address in described application process information, determine the size of data of network packet corresponding to each application process information;
According to the size of data of network packet corresponding to each application process information, obtain the transmission speed of described each application process.
5. method according to claim 1, is characterized in that, in the time that described each application process comprises the first application process, if the transfer of data statistical information of described the first application process is less than predetermined threshold value, the second application process is carried out to speed restriction and comprise:
In the time that described the first application process is browser class process, if when the transfer of data statistical information of described browser class process is less than the first predetermined threshold value, described the second application process is carried out to speed restriction; Or,
In the time that described the first application process is game on line class process, if when the transfer of data statistical information of described game class process is less than the second predetermined threshold value, described the second application process is carried out to speed restriction; Or,
In the time that described the first application process is online audio-visual class process, if when the transfer of data statistical information of described online audio-visual class process is less than the 3rd predetermined threshold value, described the second application process is carried out to speed restriction;
Wherein, the first predetermined threshold value is less than the second predetermined threshold value and the 3rd predetermined threshold value.
6. method according to claim 1, it is characterized in that, in the time that described each application process comprises the first application process, if the transfer of data statistical information of described the first application process is less than predetermined threshold value, before the second application process is carried out to speed restriction, described method also comprises:
Current network bandwidth is tested, obtain current download bandwidth and current uploading bandwidth;
The second application process being carried out in the process of speed restriction, adjust the transmission speed of described the second application process according to current download bandwidth and current uploading bandwidth.
7. method according to claim 1, is characterized in that, the second application process being carried out in the process of speed restriction, according to current download bandwidth and current uploading bandwidth, the transmission speed of adjusting described the second application process comprises:
In the time that described the first application process is browser class process, the uploading speed of described the second application process is reduced to the first ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the second ratio of described current download bandwidth; Or,
In the time that described the first application process is game on line class process, the uploading speed of described the second application process is reduced to the 3rd ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the 4th ratio of described current download bandwidth; Or,
In the time that described the first application process is online audio-visual class process, the uploading speed of described the second application process is reduced to the 5th ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the 6th ratio of described current download bandwidth.
8. a speed limiting device, is characterized in that, described device comprises:
Acquisition of information module, for obtaining current application process information in network connection state and the network data information of current transmission;
Information determination module, for according to described application process information and described network data information, determines the transfer of data statistical information of each application process;
Whether application process judge module, for according to the corresponding relation between application process type and the application process of storage, comprise the first application process, the application process that described the first application process is specified type in described each application process of judgement;
Speed restriction module, in the time that described each application process comprises the first application process, if the transfer of data statistical information of described the first application process is less than predetermined threshold value, carries out speed restriction to the second application process.
9. device according to claim 8, is characterized in that, described acquisition of information module comprises:
API Calls unit, be used for calling appointing system API, enumerate the current application process information in network connection state, described application process information comprises any one in process ID, process title, source port number, source IP address, destination port number and target ip address.
10. device according to claim 8, is characterized in that, described acquisition of information module comprises:
Information acquisition unit, analyzes for the packet header of the network packet to current transmission, obtains the size of data that described network packet is carried and the connection object information of described network packet.
11. devices according to claim 10, it is characterized in that, described information determination module, for according to the connection object information of any one and described network packet in described application process information process ID, process title, source port number, source IP address, destination port number and target ip address, is determined the size of data of network packet corresponding to each application process information; According to the size of data of network packet corresponding to each application process information, obtain the transmission speed of described each application process.
12. devices according to claim 8, it is characterized in that, described speed restriction module is in the time that described the first application process is browser class process, if when the transfer of data statistical information of described browser class process is less than the first predetermined threshold value, described the second application process is carried out to speed restriction; Or,
Described speed restriction module, in the time that described the first application process is game on line class process, if when the transfer of data statistical information of described game class process is less than the second predetermined threshold value, is carried out speed restriction to described the second application process; Or,
Described speed restriction module, in the time that described the first application process is online audio-visual class process, if when the transfer of data statistical information of described online audio-visual class process is less than the 3rd predetermined threshold value, is carried out speed restriction to described the second application process;
Wherein, the first predetermined threshold value is less than the second predetermined threshold value and the 3rd predetermined threshold value.
13. devices according to claim 8, is characterized in that, described device also comprises:
Bandwidth test module, for current network bandwidth is tested, obtains current download bandwidth and current uploading bandwidth;
Described speed restriction module, also for the process the second application process being carried out to speed restriction, according to current download bandwidth and current uploading bandwidth, is adjusted the transmission speed of described the second application process.
14. devices according to claim 8, it is characterized in that, described speed restriction module is in the time that described the first application process is browser class process, the uploading speed of described the second application process is reduced to the first ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the second ratio of described current download bandwidth; Or,
Described speed restriction module is in the time that described the first application process is game on line class process, the uploading speed of described the second application process is reduced to the 3rd ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the 4th ratio of described current download bandwidth; Or,
Described speed restriction module is in the time that described the first application process is online audio-visual class process, the uploading speed of described the second application process is reduced to the 5th ratio of described current uploading bandwidth, the speed of download of described the second application process is reduced to the 6th ratio of described current download bandwidth.
CN201410310802.2A 2014-06-30 2014-06-30 Method for limiting speed and device Active CN104125269B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410310802.2A CN104125269B (en) 2014-06-30 2014-06-30 Method for limiting speed and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410310802.2A CN104125269B (en) 2014-06-30 2014-06-30 Method for limiting speed and device

Publications (2)

Publication Number Publication Date
CN104125269A true CN104125269A (en) 2014-10-29
CN104125269B CN104125269B (en) 2018-08-14

Family

ID=51770533

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410310802.2A Active CN104125269B (en) 2014-06-30 2014-06-30 Method for limiting speed and device

Country Status (1)

Country Link
CN (1) CN104125269B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104954286A (en) * 2015-05-29 2015-09-30 小米科技有限责任公司 Bandwidth allocation method and device
CN105471862A (en) * 2015-11-20 2016-04-06 上海斐讯数据通信技术有限公司 Method and system for stabilizing game operation
CN106230741A (en) * 2016-09-18 2016-12-14 杭州迪普科技有限公司 A kind of method and apparatus that message is carried out speed limit
CN107205084A (en) * 2017-05-11 2017-09-26 北京小米移动软件有限公司 Network speed processing method, device and the terminal of application program
CN107634962A (en) * 2017-10-11 2018-01-26 广东欧珀移动通信有限公司 The management method and Related product of network bandwidth
CN108173909A (en) * 2017-12-15 2018-06-15 北京臻迪科技股份有限公司 Method of data synchronization, mobile terminal and computer readable storage medium
CN108668163A (en) * 2018-05-03 2018-10-16 广州虎牙信息科技有限公司 Live play method, apparatus, computer readable storage medium and computer equipment
CN108762665A (en) * 2018-04-08 2018-11-06 中兴通讯股份有限公司 A kind of method and device of control storage device read-write
CN108965358A (en) * 2017-05-19 2018-12-07 腾讯科技(深圳)有限公司 The method and apparatus for applying the downloading application program in first terminal and server
CN110830478A (en) * 2019-11-12 2020-02-21 福州汇思博信息技术有限公司 Method, system, equipment and medium for multi-process network distribution
CN110932930A (en) * 2019-11-13 2020-03-27 苏州浪潮智能科技有限公司 Detection method, device and medium for server PCIE link stability
CN112039799A (en) * 2017-12-06 2020-12-04 贵州白山云科技股份有限公司 Method, server, system, device and medium for network bandwidth management
CN113726691A (en) * 2021-08-20 2021-11-30 北京字节跳动网络技术有限公司 Bandwidth reservation method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101431473A (en) * 2008-12-31 2009-05-13 深圳市迅雷网络技术有限公司 Method and apparatus for implementing network speed limit
CN102209107A (en) * 2011-05-11 2011-10-05 奇智软件(北京)有限公司 Intelligent speed-limiting method and device and downloading system
CN102629909A (en) * 2012-03-30 2012-08-08 奇智软件(北京)有限公司 Traffic counting method and system based on processes
CN102932273A (en) * 2012-10-17 2013-02-13 北京奇虎科技有限公司 Method and device for adjusting occupation of process bandwidth
CN103838630A (en) * 2014-03-03 2014-06-04 联想(北京)有限公司 Information processing method, system and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101431473A (en) * 2008-12-31 2009-05-13 深圳市迅雷网络技术有限公司 Method and apparatus for implementing network speed limit
CN102209107A (en) * 2011-05-11 2011-10-05 奇智软件(北京)有限公司 Intelligent speed-limiting method and device and downloading system
CN102629909A (en) * 2012-03-30 2012-08-08 奇智软件(北京)有限公司 Traffic counting method and system based on processes
CN102932273A (en) * 2012-10-17 2013-02-13 北京奇虎科技有限公司 Method and device for adjusting occupation of process bandwidth
CN103838630A (en) * 2014-03-03 2014-06-04 联想(北京)有限公司 Information processing method, system and electronic equipment

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104954286B (en) * 2015-05-29 2019-03-15 小米科技有限责任公司 The method and device of bandwidth allocation
CN104954286A (en) * 2015-05-29 2015-09-30 小米科技有限责任公司 Bandwidth allocation method and device
CN105471862A (en) * 2015-11-20 2016-04-06 上海斐讯数据通信技术有限公司 Method and system for stabilizing game operation
CN106230741A (en) * 2016-09-18 2016-12-14 杭州迪普科技有限公司 A kind of method and apparatus that message is carried out speed limit
CN107205084A (en) * 2017-05-11 2017-09-26 北京小米移动软件有限公司 Network speed processing method, device and the terminal of application program
CN108965358B (en) * 2017-05-19 2020-11-10 腾讯科技(深圳)有限公司 Method and device for downloading application program applied to first terminal and server
CN108965358A (en) * 2017-05-19 2018-12-07 腾讯科技(深圳)有限公司 The method and apparatus for applying the downloading application program in first terminal and server
CN107634962A (en) * 2017-10-11 2018-01-26 广东欧珀移动通信有限公司 The management method and Related product of network bandwidth
CN107634962B (en) * 2017-10-11 2019-06-18 Oppo广东移动通信有限公司 The management method and Related product of network bandwidth
CN112039799A (en) * 2017-12-06 2020-12-04 贵州白山云科技股份有限公司 Method, server, system, device and medium for network bandwidth management
CN112039799B (en) * 2017-12-06 2023-06-06 贵州白山云科技股份有限公司 Network bandwidth management method, server, system, equipment and medium
CN108173909A (en) * 2017-12-15 2018-06-15 北京臻迪科技股份有限公司 Method of data synchronization, mobile terminal and computer readable storage medium
CN108762665A (en) * 2018-04-08 2018-11-06 中兴通讯股份有限公司 A kind of method and device of control storage device read-write
CN108762665B (en) * 2018-04-08 2023-06-09 中兴通讯股份有限公司 Method and device for controlling reading and writing of storage device
CN108668163B (en) * 2018-05-03 2020-03-20 广州虎牙信息科技有限公司 Live broadcast method and device, computer readable storage medium and computer equipment
CN108668163A (en) * 2018-05-03 2018-10-16 广州虎牙信息科技有限公司 Live play method, apparatus, computer readable storage medium and computer equipment
CN110830478A (en) * 2019-11-12 2020-02-21 福州汇思博信息技术有限公司 Method, system, equipment and medium for multi-process network distribution
CN110932930A (en) * 2019-11-13 2020-03-27 苏州浪潮智能科技有限公司 Detection method, device and medium for server PCIE link stability
CN110932930B (en) * 2019-11-13 2021-08-10 苏州浪潮智能科技有限公司 Detection method, device and medium for server PCIE link stability
CN113726691A (en) * 2021-08-20 2021-11-30 北京字节跳动网络技术有限公司 Bandwidth reservation method, device, equipment and storage medium
CN113726691B (en) * 2021-08-20 2024-04-30 北京字节跳动网络技术有限公司 Bandwidth reservation method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN104125269B (en) 2018-08-14

Similar Documents

Publication Publication Date Title
CN104125269A (en) Method and device for rate limitation
JP7173587B2 (en) Packet transmission system and method
US12081446B2 (en) Systems and methods for pacing data flows
US8737217B2 (en) Systems and methods for dynamic quality of service
US8171123B2 (en) Network bandwidth detection and distribution
CN107104897B (en) Data transmission method and system based on path
JP2019520745A (en) System and method for improving the total throughput of simultaneous connections
JP7496022B2 (en) Client, server, receiving method and transmitting method
US8051195B1 (en) Method and system for providing data streams in a virtual environment
CN108322401A (en) The control method and device of network transmission congestion
CN115277806A (en) Cloud desktop connection method, device and equipment
US9560141B2 (en) Method and apparatus of performing peer-to-peer communication establishment
Rao et al. Can realistic bittorrent experiments be performed on clusters?
WO2015113437A1 (en) Data packet processing method and device based on parallel protocol stack instances
White et al. Low latency DOCSIS: Technology overview
US20220138029A1 (en) Distributed load balancing for access points
CN113824648B (en) QoE-based MPTCP data packet scheduling method and device
JP4285101B2 (en) Real-time data communication system, real-time data communication apparatus, and real-time data communication method
CN112995049B (en) Application acceleration method, user side network equipment and system
JP7556579B2 (en) Packet transmission system and method
EP3065352B1 (en) Data transmission method, device and system
US9515887B2 (en) Communication processing device, communication processing method, and program
Zhang et al. Cross: A Delay Based Congestion Control Method for RTP Media
KR102066591B1 (en) Apparatus and method for optimizing resource of system based on self-adaptive for natwork application
CN117914797A (en) Data transmission delay adjusting method and data transmission delay adjusting device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 510660 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17

Applicant after: Guangzhou KuGou Networks Co., Ltd.

Address before: 510000 B1, building, No. 16, rhyme Road, Guangzhou, Guangdong, China 13F

Applicant before: Guangzhou KuGou Networks Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220406

Address after: 4119, 41st floor, building 1, No.500, middle section of Tianfu Avenue, Chengdu hi tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan 610000

Patentee after: Chengdu kugou business incubator management Co.,Ltd.

Address before: No. 315, Huangpu Avenue middle, Tianhe District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU KUGOU COMPUTER TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right