Summary of the invention
Present invention is primarily targeted at a kind of method for controlling network flow of proposition and device, it is intended to realize APN card is made
The control more become more meticulous with flow.
For achieving the above object, the present invention provides a kind of method for controlling network flow, and described method comprises the steps:
Receive the network access request that terminal sends when using APN card, obtain the URL ground of described network access request
Location;
Determine the type of service of described network access request according to the URL address got, described type of service is divided in advance
It are furnished with corresponding network traffics;
Judge the most satisfied use bar preset of residual flow that the type of service of described network access request is currently corresponding
Part;
The network traffics the most then consumed described network access request according to described residual flow are controlled.
Alternatively, the network access request that described reception terminal sends when using APN card, obtaining the access of described network please
Before the step of the URL address asked, also include:
The type of service different for network access request distributes corresponding network traffics.
Alternatively, whether the residual flow of the described type of service currently correspondence judging described network access request meets pre-
If the step of use condition include:
Obtain described network access request request data package take flow, and by the business of described network access request
The residual flow of type currently correspondence is as the first residual flow;
If the flow that takies of described request data package is less than or equal to described first residual flow, then judge that described first remains
Residual current amount meets default use condition;
The described step bag network traffics that described network access request consumes being controlled according to described residual flow
Include:
The flow that takies according to described request data package updates the network traffics that described network access request consumes.
Alternatively, whether the residual flow of the described type of service currently correspondence judging described network access request meets pre-
If the step of use condition also include:
Obtain described network access request response data packet take flow, and by described first residual flow with described
The difference taking flow of request data package is as the second residual flow;
If the flow that takies of described response data packet is less than or equal to described second residual flow, then judge that described second remains
Residual current amount meets default use condition;
The described step being controlled the network traffics that described network access request consumes according to described residual flow is also
Including:
The flow that takies according to described response data packet updates the network traffics that described network access request consumes.
Alternatively, the network access request that described reception terminal sends when using APN card, obtaining the access of described network please
After the step of the URL address asked, also include:
Private ip according to APN card described in described URL address acquisition;
Judge that described APN card is the most registered according to described private ip;
If it is not, then return error message to terminal;The most then perform step: determine described according to the URL address got
The type of service of network access request, described type of service has allocated corresponding network traffics in advance;
Or, it is judged that within whether described URL address is in default blacklist;
The most then return error message to terminal;If it is not, then perform step: determine described according to the URL address got
The type of service of network access request, described type of service has allocated corresponding network traffics in advance.
Additionally, for achieving the above object, the present invention also provides for a kind of control of network flow quantity device, and described device includes:
First acquisition module, for receiving the network access request that terminal sends when using APN card, obtains described network
The URL address of access request;
Determine module, for determining the type of service of described network access request, described industry according to the URL address got
Service type has allocated corresponding network traffics in advance;
Whether first judge module, for judging the currently corresponding residual flow of the type of service of described network access request
Meet the use condition preset;
Control module, if meeting default for the residual flow that the type of service of described network access request is currently corresponding
Use condition, then the network traffics consumed described network access request according to described residual flow are controlled.
Alternatively, described device also includes:
Distribution module, distributes corresponding network traffics for the type of service different for network access request.
Alternatively, described first judge module includes:
Acquiring unit, takies flow, and by described network for obtain the request data package of described network access request
The residual flow of the type of service of access request currently correspondence is as the first residual flow;
Identifying unit, if the flow that takies for described request data package is less than or equal to described first residual flow, then
Judge that described first residual flow meets default use condition;
The described network access request of flow renewal that takies that described control module is additionally operable to according to described request data package disappears
The network traffics of consumption.
Alternatively, what described acquiring unit was additionally operable to obtain the response data packet of described network access request takies flow,
And using the difference taking flow of described first residual flow and described request data package as the second residual flow;
If the flow that takies that described identifying unit is additionally operable to described response data packet is less than or equal to described second residual stream
Amount, then judge that described second residual flow meets default use condition;
The described network access request of flow renewal that takies that described control module is additionally operable to according to described response data packet disappears
The network traffics of consumption.
Alternatively, described device also includes:
Second acquisition module, for the private ip according to APN card described in described URL address acquisition;
According to described private ip, second judge module, for judging that described APN card is the most registered;If it is not, then to terminal
Return error message;If, it is determined that module determines the service class of described network access request according to the URL address got
Type, described type of service has allocated corresponding network traffics in advance;
Or, within described second judge module is additionally operable to judge whether described URL address is in default blacklist;If
It is then to return error message to terminal;If not, it is determined that according to the URL address got, module determines that described network accesses asks
The type of service asked, described type of service has allocated corresponding network traffics in advance.
The present invention receives the network access request that terminal sends when using APN card, obtains described network access request
URL address;Determine the type of service of described network access request according to the URL address got, described type of service is divided in advance
It are furnished with corresponding network traffics;Judge whether the residual flow of the type of service currently correspondence of described network access request meets pre-
If use condition;The network traffics the most then consumed described network access request according to described residual flow are controlled.
The APN card that this enterprise is issued by the present invention by arranging flow-control module to realize in corporate intranet carries out flow-control, nothing
Additionally need to develop for APP internal logic;Additionally, Network is classified by the present invention by URL address, and in advance
Configure the utilizable flow under every APN card each business classification, when receiving the network access request of terminal, by URL ground
Location determines the type of service of described network access request, and is realized this visit by the residual flow that this type of service is currently corresponding
Ask the control of the network traffics of request.The present invention is by being controlled the flow of different network service and limiting such that it is able to
Realize the control using flow more to become more meticulous on APN card.
Detailed description of the invention
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The present invention provides a kind of method for controlling network flow.
With reference to the schematic flow sheet that Fig. 1, Fig. 1 are inventive network flow control methods first embodiment.Described method bag
Include following steps:
Step S10, receives the network access request that terminal sends when using APN card, obtains described network access request
URL address.
APN card is a kind of network traffics card, with common SIM (Subscriber Identification Module visitor
Family identification module) unlike card, terminal use APN card carry out network access time, the domain name of card is pointed to specific enterprise and is prevented fires
Wall, so each terminal uses network traffics all can be routed to enterprise firewall through APN passage, then carries out net by corporate intranet
Network data are transmitted.The present embodiment is by arranging flow-control module in corporate intranet, it is achieved flow-control, traffic statistics and phase
The data answered forward.
It is a network system architecture schematic diagram in various embodiments of the present invention with reference to Fig. 2, Fig. 2.This network system includes
APN passage, corporate intranet and public network.Wherein, flow-control module is arranged in corporate intranet, as one service respectively with note
Volume realizes communication between server, Web proxy server, for controlling the stream of each network access request that terminal APP sends
Amount;Registrar is for binding private ip and the card number of APN card, it is provided that the registration of card number and inquiry service;Web proxy services
Device, for providing all rotating functions of the network information, such as sends an external resource access request when terminal end, this request quilt
Proxy server identification and by proxy server on behalf of outwards asking resource, when external resource server responds this access request
Time, this response results is fed back to terminal by proxy server again.
In the present embodiment, mobile terminal can be mobile phone, and panel computer etc. has the equipment of network access functions.At end
When end uses APN card to carry out network access request, the flow-control module being positioned in corporate intranet receives the network of terminal and accesses
Ask and obtain URL (Uniform Resource Locator, the URL) address of this network access request, i.e.
The network address, the network information resource that terminal will access is pointed in this network address.
Step S20, determines the type of service of described network access request, described service class according to the URL address got
Corresponding network traffics allocated in advance by type.
After flow-control module gets the URL address of described network access request, further according to the URL ground got
Location determines that the type of service of described network access request, described type of service have allocated corresponding network traffics in advance.
In the present embodiment, controlling to realize the fine granularity of flow, those skilled in the art can be primarily based on URL ground
Network is classified by location, and the URL of standard generally comprises type of server, host name, path and filename, service class
Type can divide according to different filenames, such as can be divided into basic business (such as word, picture, link), show business
Business (such as video, music), downloading service and other business etc..Usually, there is larger difference in the flow of different business consumption, than
As less in word class business consumed flow and video class business consumed flow is more, therefore Network is classified and with evidence
The used flow that different business demands is differently configured, it is possible to realize management and control more targeted to flow.
Then, the used network flow data by the type of service classified in advance and for every kind of type of service configuration is deposited
Storage is in respective memory unit, and memory element is additionally operable to real time record residual flow.Flow-control module is according to URL address search
Business categorical data in memory element, and then can determine the type of service of network access request and the residual flow of correspondence.
It should be noted that when configuring the used flow of each business, can be by the unified configuration of enterprise default settings, it is possible to
To realize user to the individual cultivation of different business utilizable flow and amendment by terminal related service, can enter in being embodied as
Row selects flexibly.
Step S30, it is judged that whether the residual flow of the type of service of described network access request currently correspondence meets is preset
Use condition.
Flow-control module judges whether the residual flow of the type of service currently correspondence of described network access request meets
The use condition preset, such as, can disappear residual flow currently corresponding for type of service more than or equal to network access request
The flow of consumption is as default use condition, if condition is not satisfied, then refusal network accesses and returns error message to terminal.
Step S40, if the residual flow of the type of service of described network access request currently correspondence meets default use
Condition, then the network traffics consumed described network access request according to described residual flow are controlled.
Such as, there is residual flow and residual flow more than or equal to working as when the business classification belonging to described URL address
When front network access request needs the flow consumed, it is determined that this residual flow meets default use condition, now, flow-control
Module can send this request to Web proxy server and automatically deduct current network access request consumption from residual flow
Flow;Certainly, by terminal service, flow-control module can also display to the user that the lower residue of current this business classification is how many
Flow, by the user decide whether that network to be proceeded accesses.
In the present embodiment, flow-control module receives the network access request that terminal sends when using APN card, obtains
The URL address of described network access request;The type of service of described network access request is determined according to the URL address got,
Described type of service has allocated corresponding network traffics in advance;Judge the type of service currently correspondence of described network access request
Whether residual flow meets the use condition preset;The most then according to described residual flow, described network access request is consumed
Network traffics be controlled.The present embodiment is by arranging what this enterprise was issued by flow-control module realization in corporate intranet
APN card carries out flow-control, it is not necessary to additionally develop for APP internal logic;Additionally, the present embodiment is by URL address pair
Network is classified, and is pre-configured with the utilizable flow under every APN card each business classification, is receiving the net of terminal
During network access request, determined the type of service of described network access request by URL address, and the most right by this type of service
The residual flow answered realizes the control of the network traffics to this access request.The present embodiment is by the flow to different network service
It is controlled and limits such that it is able to realizing the control using flow more to become more meticulous on APN card.
Further, with reference to the schematic flow sheet that Fig. 3, Fig. 3 are inventive network flow control methods the second embodiment.Base
Before the embodiment shown in above-mentioned Fig. 1, described step S10, it is also possible to including:
Step S50, the type of service different for network access request distributes corresponding network traffics.
As a kind of embodiment, flow-control module can be the type of service distribution that network access request is different in real time
Corresponding network traffics, such as, obtain the residual flow that current APN card is total, then according to every kind of traffic assignments set in advance
Flow percentage, calculating should be for every kind of traffic assignments how many network traffics, to realize the dynamic distribution of network traffics;When
So, flow-control module can also be that the type of service distribution that network access request is different is corresponding according to certain time interval
Network traffics, can be arranged in being embodied as flexibly.
In the present embodiment, by distributing corresponding network traffics for the type of service different for network access request, it is achieved
The dynamic distribution of network traffics, i.e. flow-control module can make full use of the residual flow of current APN card, it is to avoid certain industry
Residual flow under service type is more and can not get the situation generation used.
Further, reference Fig. 4, Fig. 4 is the refinement flow process in second embodiment of the invention being controlled network traffics
Schematic diagram.Based on the embodiment shown in above-mentioned Fig. 3, described step S30 may include that
Step S31, obtain described network access request request data package take flow, and accessed by described network please
The residual flow of the type of service asked currently correspondence is as the first residual flow;
Step S32, if the flow that takies of described request data package is less than or equal to described first residual flow, then judges institute
State the first residual flow and meet default use condition.
Described step S40 may include that
Step S41, if the residual flow of the type of service of described network access request currently correspondence meets default use
Condition, then update, according to the flow that takies of described request data package, the network traffics that described network access request consumes.
In the present embodiment, the flow consumed due to network access request is usually by request data package size and number of responses
Determining according to bag size, therefore, flow-control module can first obtain the request data package of described network access request and calculate
Go out and take uninterrupted, then this request data package is taken flow and current corresponding business classification lower residual flow that is first residue
Flow contrasts, if the flow that takies of described request data package is less than or equal to the first residual flow, then judges the first residue
Flow meets default use condition, and request data package now takies the flow network traffics as consumption, to complete to consume
The renewal of network traffics, then network request is forwarded to proxy server;If described request data package to take flow big
In current residual flow, the most do not update network traffics and return error message to terminal.
Further, with reference to Fig. 5, Fig. 5 it is another refinement in second embodiment of the invention, network traffics being controlled
Schematic flow sheet.Described step S30 can also include:
Step S33, obtain described network access request response data packet take flow, and by described first residual stream
The difference taking flow of amount and described request data package is as the second residual flow;
Step S34, if the flow that takies of described response data packet is less than or equal to described second residual flow, then judges institute
State the second residual flow and meet default use condition.
Described step S40 can also include:
Step S42, if the residual flow of the type of service of described network access request currently correspondence meets default use
Condition, then update, according to the flow that takies of described response data packet, the network traffics that described network access request consumes.
When receiving the response that network accesses, flow-control module obtains corresponding Web server by proxy server
Response data packet also calculates and takies uninterrupted, meanwhile, by taking of described first residual flow and described request data package
The difference of flow is as the second residual flow, then this response data packet takies flow residual stream lower with current corresponding business classification
I.e. the second residual flow of amount contrasts, if the flow that takies of described request data package is less than or equal to the second residual flow, this
Time response data packet taken flow as the network traffics consumed, to complete the renewal of the network traffics consumed, meanwhile, by net
Network response is forwarded to mobile terminal, completes network access procedure;If the flow that takies of described response data packet is more than current residual
Flow, does not the most update network traffics and returns error message to terminal.
The present embodiment considers request and two stages of response of terminal network access request, carries out network access in terminal
During request, the use flow in two stages is respectively controlled by flow-control module by the condition preset, and then judgement is
No permission terminal proceeds network and accesses, it is possible to ensure that the residual flow under every kind of business classification will not be for negative value, i.e. every kind
The flow that network access under business classification consumes, not over preset value, meets user's fine-grained flow-control demand.
Further, with reference to the schematic flow sheet that Fig. 6, Fig. 6 are inventive network flow control methods the 3rd embodiment.Base
In the above embodiments, after described step S10, it is also possible to including:
Step S60, according to the private ip of APN card described in described URL address acquisition;
According to described private ip, step S70, judges that described APN card is the most registered;
Step S80, if described APN card is unregistered, then returns error message to terminal;If described APN card is registered, then hold
Row step: determine the type of service of described network access request according to the URL address got, described type of service is allocated in advance
There are corresponding network traffics.
In the present embodiment, the registration of APN card includes the write of APN card data, such as system of real name information, the card number of APN card
Binding information etc. with private ip.After flow-control module extracts private ip from URL, private ip can be uploaded to registration clothes
Business device, registrar detects whether the log-on message of this APN card meets pre-conditioned, must be such as system of real name register and
Card number is bound with private ip, if this private ip is bound with APN card, and APN card is system of real name registration, then sentence
Fixed described APN card is registered, and now, registrar returns registered message to flow-control module, and flow-control module is again
The type of service of described network access request is determined according to the URL address got;Otherwise, if this private ip does not sticks into APN
Row binding, or the registration of APN card not system of real name, then judge that described APN card is unregistered, and now refusal network accesses and to terminal
Return error message.Certainly, what whether APN card was registered pre-conditioned can be arranged flexibly, the most only needs private ip and APN to stick into
Row binding.
Especially, if the URL that flow-control module gets is registration message, the most directly send the message to registration clothes
Business device, is completed the registration service such as binding of private ip and APN card, so that mobile terminal can carry out network by registrar
Access.
It should be noted that the IP address that private ip i.e. terminal uses in local area network, connect shakiness at terminal network
Fixed, or when being switched to the reasons such as data cube computation to cause network to reconnect by WIFI, terminal is required for uploading registration message to note
Volume server, to complete the binding of new IP and card number, reason is that the private ip of APN card is dynamically distributed by operator, often
Secondary terminal reconnects network and IP all can be caused to change.Flow-control module middle extraction private ip from URL ground just can identify and be
Which APN is stuck in carries out network access.
The present embodiment is by binding card number and the private ip of APN card, by extracting private ip from URL address, it is possible to know
Do not go out the most chartered APN card, and refuse the network access request of unregistered APN card, it is possible to realize network and access message
Filtration treatment.
Further, with reference to the schematic flow sheet that Fig. 7, Fig. 7 are inventive network flow control methods the 4th embodiment.Institute
After stating step S10, it is also possible to including:
Step S90, it is judged that within whether described URL address is in default blacklist;
Step S100, if within described URL address is in default blacklist, then returns error message to terminal;If institute
Within stating the blacklist that URL address is not at presetting, then perform step: determine that described network is visited according to the URL address got
Ask that the type of service of request, described type of service have allocated corresponding network traffics in advance.
In the present embodiment, can be in advance based on URL address and network access is arranged blacklist, flow-control module is obtaining
After getting URL address, within can first determining whether whether URL address is in default blacklist, the most then refusal network is visited
Ask and return error message to terminal;If it is not, then determine the service class of described network access request according to the URL address got
Type.
The present embodiment is by arranging blacklist to URL, and when the URL that user accesses is within blacklist, intercepting should
Seek message such that it is able to avoid user to access some illegal or dangerous website, it is possible to achieve network and access at the filtration of message
Reason, makes network access environment safer.
The present invention also provides for a kind of control of network flow quantity device.
With reference to the high-level schematic functional block diagram that Fig. 8, Fig. 8 are inventive network volume control device first embodiment.Described dress
Put and include:
First acquisition module 10, for receiving the network access request that terminal sends when using APN card, obtains described net
The URL address of network access request.
APN card is a kind of network traffics card, with common SIM (Subscriber Identification Module visitor
Family identification module) unlike card, terminal use APN card carry out network access time, the domain name of card is pointed to specific enterprise and is prevented fires
Wall, so each terminal uses network traffics all can be routed to enterprise firewall through APN passage, then carries out net by corporate intranet
Network data are transmitted.The present embodiment is by arranging flow-control module in corporate intranet, it is achieved flow-control, traffic statistics and phase
The data answered forward.
It is a network system architecture schematic diagram in various embodiments of the present invention with reference to Fig. 2, Fig. 2.This network system includes
APN passage, corporate intranet and public network.Wherein, flow-control module is arranged in corporate intranet, as one service respectively with note
Volume realizes communication between server, Web proxy server, for controlling the stream of each network access request that terminal APP sends
Amount;Registrar is for binding private ip and the card number of APN card, it is provided that the registration of card number and inquiry service;Web proxy services
Device, for providing all rotating functions of the network information, such as sends an external resource access request when terminal end, this request quilt
Proxy server identification and by proxy server on behalf of outwards asking resource, when external resource server responds this access request
Time, this response results is fed back to terminal by proxy server again.
In the present embodiment, mobile terminal can be mobile phone, and panel computer etc. has the equipment of network access functions.At end
When end uses APN card to carry out network access request, the first acquisition module 10 receives the network access request of terminal and obtains this net
URL (Uniform Resource Locator, URL) address, the i.e. network address of network access request, this net
The network information resource that terminal will access is pointed in network address.
Determine module 20, for determining the type of service of described network access request according to the URL address got, described
Type of service has allocated corresponding network traffics in advance;
After the first acquisition module 10 gets the URL address of described network access request, determine module 20 further according to
The URL address got determines that the type of service of described network access request, described type of service have allocated corresponding net in advance
Network flow.
In the present embodiment, controlling to realize the fine granularity of flow, those skilled in the art can be primarily based on URL ground
Network is classified by location, and the URL of standard generally comprises type of server, host name, path and filename, service class
Type can divide according to different filenames, such as can be divided into basic business (such as word, picture, link), show business
Business (such as video, music), downloading service and other business etc..Usually, there is larger difference in the flow of different business consumption, than
As less in word class business consumed flow and video class business consumed flow is more, therefore Network is classified and with evidence
The used flow that different business demands is differently configured, it is possible to realize management and control more targeted to flow.
Then, the used network flow data by the type of service classified in advance and for every kind of type of service configuration is deposited
Storage is in respective memory unit, and memory element is additionally operable to real time record residual flow.Determine that module 20 is deposited according to URL address search
Business categorical data in storage unit, and then can determine the type of service of network access request and the residual flow of correspondence.Need
It is noted that when configuring the used flow of each business, can be by the unified configuration of enterprise default settings, it is also possible to
Realize user to the individual cultivation of different business utilizable flow and amendment by terminal related service, can carry out in being embodied as
Select flexibly.
First judge module 30, for judging that the residual flow of the type of service currently correspondence of described network access request is
The no satisfied use condition preset;
First judge module 30 judges that the residual flow of the type of service currently correspondence of described network access request is the fullest
The use condition that foot is preset, such as, can be by residual flow currently corresponding for type of service more than or equal to network access request
The flow consumed is as default use condition, if condition is not satisfied, then refusal network accesses and returns error message to terminal.
Control module 40, presets if meeting for the residual flow that the type of service of described network access request is currently corresponding
Use condition, then the network traffics consumed described network access request according to described residual flow are controlled.
Such as, there is residual flow and residual flow more than or equal to working as when the business classification belonging to described URL address
When front network access request needs the flow consumed, it is determined that this residual flow meets default use condition, now, control module
40 can send this request to Web proxy server and automatically deduct what current network access request consumed from residual flow
Flow;It is of course also possible to display to the user that lower residue how many flows of current this business classification by terminal service, user determine
Network to be proceeded accesses.
In the present embodiment, the first acquisition module 10 receives the network access request that terminal sends when using APN card, obtains
Take the URL address of described network access request;Determine that module 20 determines described network access request according to the URL address got
Type of service, described type of service has allocated corresponding network traffics in advance;First judge module 30 judges that described network is visited
Ask the most satisfied use condition preset of residual flow that the type of service of request is currently corresponding;The most then control module 40
The network traffics consumed described network access request according to described residual flow are controlled.The present embodiment is by corporate intranet
The middle flow-control module that arranges realizes the APN card of issuing this enterprise and carries out flow-control, it is not necessary to carry out for APP internal logic
Extra exploitation;Additionally, Network is classified by the present embodiment by URL address, and it is pre-configured with every each industry of APN card
By URL address, utilizable flow under business classification, when receiving the network access request of terminal, determines that described network accesses and asks
The type of service asked, and the control of the network traffics to this access request is realized by the residual flow that this type of service is currently corresponding
System.The present embodiment is by being controlled the flow of different network service and limiting such that it is able to realize APN card is used flow
The control more become more meticulous.
Further, with reference to the functional module signal that Fig. 9, Fig. 9 are inventive network volume control device the second embodiment
Figure.Based on the embodiment shown in above-mentioned Fig. 8, described device also includes:
Distribution module 50, distributes corresponding network traffics for the type of service different for network access request.
As a kind of embodiment, distribution module 50 can be the type of service distribution phase that network access request is different in real time
The network traffics answered, such as, obtain the residual flow that current APN card is total, then according to every kind of traffic assignments stream set in advance
Amount percentage ratio, calculating should be for every kind of traffic assignments how many network traffics, to realize the dynamic distribution of network traffics;Certainly,
Distribution module 50 can also be that the type of service that network access request is different distributes corresponding network according to certain time interval
Flow, can be arranged in being embodied as flexibly.
In the present embodiment, distribution module 50 is by distributing corresponding network for the type of service different for network access request
Flow, it is achieved that the dynamic distribution of network traffics, i.e. can make full use of the residual flow of current APN card, it is to avoid certain business
Residual flow under type is more and can not get the situation generation used.
Further, with reference to the refinement high-level schematic functional block diagram that Figure 10, Figure 10 are the first judge module.Described first judges
Module 30 may include that
Acquiring unit 31, takies flow, and by described net for obtain the request data package of described network access request
The residual flow of the type of service of network access request currently correspondence is as the first residual flow;
Identifying unit 32, if the flow that takies for described request data package is less than or equal to described first residual flow,
Then judge that described first residual flow meets default use condition;
The flow that takies that described control module 40 is additionally operable to according to described request data package updates described network access request
The network traffics consumed.
In the present embodiment, the flow consumed due to network access request is usually by request data package size and number of responses
Determining according to bag size, therefore, acquiring unit 31 can first obtain the request data package of described network access request and calculate
Take uninterrupted, it is determined that this request data package is taken flow residual flow lower with current corresponding business classification i.e. by unit 32 again
First residual flow contrasts, if the flow that takies of described request data package is less than or equal to the first residual flow, then judges
First residual flow meets default use condition, and now request data package is taken flow as the net consumed by control module 40
Network flow, to complete the renewal of the network traffics consumed, is then forwarded to proxy server by network request;If described number of request
Be more than current residual flow according to the flow that takies of bag, then control module 40 does not update network traffics and returns mistake letter to terminal
Breath.
Further, with continued reference to Figure 10, described acquiring unit 31 is additionally operable to obtain the response of described network access request
Packet take flow, and using the difference taking flow of described first residual flow and described request data package as second
Residual flow;
If the flow that takies that described identifying unit 32 is additionally operable to described response data packet remains less than or equal to described second
Flow, then judge that described second residual flow meets default use condition;
The flow that takies that described control module 40 is additionally operable to according to described response data packet updates described network access request
The network traffics consumed.
When receiving the response that network accesses, flow-control module obtains corresponding Web server by proxy server
Response data packet also calculates and takies uninterrupted, meanwhile, by taking of described first residual flow and described request data package
The difference of flow is as the second residual flow, then this response data packet takies flow residual stream lower with current corresponding business classification
I.e. the second residual flow of amount contrasts, if the flow that takies of described request data package is less than or equal to the second residual flow, this
Time control module 40 response data packet is taken flow as consume network traffics, with complete consume network traffics more
Newly, meanwhile, network response is forwarded to mobile terminal, completes network access procedure;If described response data packet take flow
More than current residual flow, the most do not update network traffics and return error message to terminal.
The present embodiment considers request and two stages of response of terminal network access request, carries out network access in terminal
During request, the use flow in two stages is respectively controlled by flow-control module by the condition preset, and then judgement is
No permission terminal proceeds network and accesses, it is possible to ensure that the residual flow under every kind of business classification will not be for negative value, i.e. every kind
The flow that network access under business classification consumes, not over preset value, meets user's fine-grained flow-control demand.
Further, show with reference to the functional module that Figure 11, Figure 11 are inventive network volume control device the 3rd embodiment
It is intended to.Described device also includes:
Second acquisition module 60, for the private ip according to APN card described in described URL address acquisition;
According to described private ip, second judge module 70, for judging that described APN card is the most registered;If it is not, then to end
End returns error message;If, it is determined that module 20 determines the business of described network access request according to the URL address got
Type, described type of service has allocated corresponding network traffics in advance;
In the present embodiment, the registration of APN card includes the write of APN card data, such as system of real name information, the card number of APN card
Binding information etc. with private ip.After second acquisition module 60 extracts private ip from URL, private ip can be uploaded to registration
Server, registrar detects whether the log-on message of this APN card meets pre-conditioned, must be such as that system of real name is registered also
And card number binds with private ip, if this private ip is bound with APN card, and APN card is system of real name registration, then
Second judge module 70 judges that described APN card is registered, and now, registrar returns registered message, determines module 20 again
The type of service of described network access request is determined according to the URL address got;Otherwise, if this private ip does not sticks into APN
Row binding, or the registration of APN card not system of real name, then judge module 60 judges that described APN card is unregistered, and now refusal network is visited
Ask and return error message to terminal.Certainly, what whether APN card was registered pre-conditioned can be arranged flexibly, the most only needs privately owned
IP and APN card is bound.
Especially, if the URL that flow-control module gets is registration message, the most directly send the message to registration clothes
Business device, is completed the registration service such as binding of private ip and APN card, so that mobile terminal can carry out network by registrar
Access.
It should be noted that the IP address that private ip i.e. terminal uses in local area network, connect shakiness at terminal network
Fixed, or when being switched to the reasons such as data cube computation to cause network to reconnect by WIFI, terminal is required for uploading registration message to note
Volume server, to complete the binding of new IP and card number, reason is that the private ip of APN card is dynamically distributed by operator, often
Secondary terminal reconnects network and IP all can be caused to change.Flow-control module middle extraction private ip from URL ground just can identify and be
Which APN is stuck in carries out network access.
The present embodiment is by binding card number and the private ip of APN card, by extracting private ip from URL address, it is possible to know
Do not go out the most chartered APN card, and refuse the network access request of unregistered APN card, it is possible to realize network and access message
Filtration treatment.
Further, with continued reference to Figure 11, described second judge module 70 is additionally operable to judge whether described URL address is in
Within the blacklist preset;The most then return error message to terminal;If not, it is determined that module 20 is according to the URL ground got
Location determines that the type of service of described network access request, described type of service have allocated corresponding network traffics in advance.
In the present embodiment, can be in advance based on URL address and network access is arranged blacklist, flow-control module is obtaining
After getting URL address, within the second judge module 70 can first determine whether whether URL address is in default blacklist, if
It is that then refusal network accesses and returns error message to terminal;If not, it is determined that module 20 is true according to the URL address got
The type of service of fixed described network access request.
The present embodiment is by arranging blacklist to URL, and when the URL that user accesses is within blacklist, intercepting should
Seek message such that it is able to avoid user to access some illegal or dangerous website, it is possible to achieve network and access at the filtration of message
Reason, makes network access environment safer.
These are only the preferred embodiments of the present invention, not thereby limit the scope of the claims of the present invention, every utilize this
Equivalent structure or equivalence flow process that bright description and accompanying drawing content are made convert, or are directly or indirectly used in other relevant skills
Art field, is the most in like manner included in the scope of patent protection of the present invention.