Content of the invention
The invention provides a kind of file transmitting method and the network equipment, in order to solve to be arranged on phase due to the network equipment more
To scattered place, and away from control centre.When the abnormal conditions of the underfed on data card or arrearage, control centre
It is unable to the residual flow on real-time monitoring data card, lead to the unexpected interruption of network service, situations such as cause message packet loss, impact
Client traffic.Meanwhile, after control centre carries out arrearage to the network equipment and supplements with money, the network equipment can not recover to be registered to net automatically
Network, needs special service technician to be processed to scene, increases the problem of cost of equipment maintenance.
In a first aspect, the invention provides a kind of file transmitting method, methods described includes:
After mobile communication interface loads success on the network equipment, start the traffic monitoring described mobile communication interface of acquisition current
Utilizable flow;
According to the MTU of configuration and currently available flow on described mobile communication interface, calculate and currently may be used
Send message number;
Message number and currently available flow currently can be sent according to calculate, message to be sent is transmitted.
Second aspect, the invention provides a kind of network equipment, the described network equipment includes:
Interface load-on module, for loading mobile communication interface, and starts after described mobile communication interface loads success
Traffic monitoring module;
Traffic monitoring module, is used for carrying out the traffic monitoring acquisition currently available flow of described mobile communication interface;
Computing module, for according to the MTU of configuration and currently available stream on described mobile communication interface
Amount, calculates and currently can send message number;
Message sending module, for currently sending message number and currently available flow according to calculate, to pending
Literary composition of delivering newspaper is transmitted.
Beneficial effects of the present invention are:The present invention only adds simple judgement in existing message transmission flow and counts
Deng operation, using MTU MTU as basic message length, by the Approach by inchmeal of message number can be sent, it is to avoid message
Can the double counting to utilizable flow in transmission process, by judging to send whether message number is 0, to determine send report
Literary composition.In the case of not affecting sending performance, realize the autonomous monitor in real time of flow of equipment end.Simultaneously in the process of traffic statistics
In flow abnormal conditions are processed accordingly.The invention belongs to pure software is realized, it is not rely on the change of the network equipment,
The flow service condition of the network equipment can flexibly be monitored, improve the stability that the network equipment runs, reduce client and network is set
Standby maintenance cost and human input.
Specific embodiment
For making technical scheme become more apparent, in conjunction with accompanying drawing, the present invention is described in further details:
For solving to be arranged on the place of relative distribution due to the network equipment, and away from control centre more.When on data card
During the abnormal conditions of underfed or arrearage, control centre is unable to the residual flow on real-time monitoring data card, leads to network
The unexpected interruption of service, situations such as cause message packet loss, affects client traffic.Meanwhile, when control centre is carried out to the network equipment
After arrearage is supplemented with money, the network equipment can not recover to be registered to network automatically, needs special service technician at scene
Reason, increases the problem of cost of equipment maintenance.
In conjunction with the application scenarios shown in Fig. 1, embodiments provide a kind of file transmitting method, the method is according to
The value of big transmission unit (MTU, Maximum Transmission Unit) carrys out calculated flow rate service condition, and uses in flow
During take different flow processing modes when residual flow reaches different flow thresholds.As shown in Fig. 2 methods described
Including:
After mobile communication interface loads success on step 201, the network equipment, start traffic monitoring and obtain described mobile communication
The currently available flow of interface;
In this step, described startup traffic monitoring obtains currently available flow, including:
Before the described network equipment is dialled up on the telephone by described mobile communication interface, obtained by way of message search just
Beginning utilizable flow;
Obtain described mobile communication interface in real time and send message byte number;
Calculate initial utilizable flow and obtain currently available flow with the difference sending message byte number.
Preferably, during traffic monitoring, different flow thresholds can be set, according to these flow thresholds to work as
Front utilizable flow is monitored and executes corresponding flow processing mode.
Described startup traffic monitoring obtains currently available flow, also includes:
If currently available flow is more than first flow threshold value, postpone certain time according still further to acquisition cycle time setting
Currently available flow;
If currently available flow is more than second flow threshold value less than or equal to first flow threshold value, generate flow early warning information
And report;
If currently available flow is more than the 3rd flow threshold is less than or equal to second flow threshold value, generate alarming flow information simultaneously
Report;In inventive embodiments, alarming flow information can only report certain number of times, such as 10 times, if having reported 10
Secondary, then no longer report.
If currently available flow is less than the 3rd flow threshold, generates flow Stop message and reported with short message mode.For keeping away
Exempt to consume residual flow, in embodiments of the present invention, flow Stop message can only report certain number of times, such as 5 times.If
Through reporting 5 times, then do not continuing to report.
After flow Stop message is reported with short message mode, then the currently available traffic conditions of periodic queries message search,
If continuous 5 message searches, less than utilizable flow information, restart a modem, realize the modem after arrearage and restart completing net
Network is registered.
The big I of above 3 flow thresholds is configured according to practical application scene, but first flow threshold value is more than
Second flow threshold value, second flow threshold value is more than the 3rd flow threshold.As first flow threshold value=initial available stream can be arranged
Amount * 30%, second flow threshold value=initial utilizable flow * 10%, the 3rd flow threshold=initial utilizable flow * 2%.
Example, different flag bits can be arranged in actual applications to realize different flow processing modes,
As setting flag bit is flag, then can arrange the different flag values flow process side different to represent execution
Formula, such as:Definition flag value is the currently available flow of periodic queries during FREE_WAIT;
Flag value is for reporting control centre by flow early warning information during WARN_WATER;
Flag value for during LOW_WATER by alarming flow information reporting to control centre's flag value for during STOP_WATER with
Flow Stop message is reported control centre by short message mode;
Flag value is for obtaining initial utilizable flow by way of message search during FLOW_QUERY.
The present invention is capable of away from control centre and installs the autonomous monitoring of flow of the scattered network equipment and remotely control
System, it is to avoid the flow overdraw of the network equipment impacts to the normal operation of equipment, improves the stability that equipment runs, reduces net
The maintenance cost of network equipment and human input.
Step 202, according on described mobile communication interface configuration MTU and currently available flow, calculate
Go out and currently can send message number;
In this step, the MTU according to configuration on described mobile communication interface, calculates and currently can send
Message number, including:
By currently available flow divided by MTU, the value of gained is currently to send message number;Here calculating
Formula is:Message number=currently available flow/MTU currently can be sent, MTU here could be arranged to 1500.
When currently available flow is less than MTU, currently can send message number and be calculated as 0.Such as, here work as
Front utilizable flow is 1400, because MTU is 1500, now currently can send message number and be less than 1, then by now
Message number currently can be sent and be calculated as 0.
MTU can be selected by tester in the range of the network equipment allows in embodiments of the present invention
Select configuration.
What step 203, basis calculated currently can send message number and currently available flow, and message to be sent is carried out
Send.
In this step, what described basis calculated currently can send message number and currently available flow, to be sent
Message is transmitted, including:
It is not 0 and currently available flow is more than the 3rd flow threshold when judging currently can to send message number, then send institute
State message to be sent, add up simultaneously and sent the byte number of message;
Preferably, in this step, after sending message to be sent, currently can be sent message number and be subtracted 1, add up simultaneously and send out
Deliver newspaper the byte number of literary composition, be 0 until message number currently can be sent, so pass through to send the Approach by inchmeal of message number, it is to avoid report
Double counting to utilizable flow in civilian transmission process.
When judging that currently can send message number is 0, and the message byte number of message to be sent is less than currently available stream
Amount, sends described message to be sent, adds up simultaneously and has sent the byte number of message;
Example:Message number to be sent is 1300, and current residual utilizable flow is 1400, and it is less than MTU
1500, but being greater than message number to be sent is 1300, then allow to send this message to be sent, otherwise forbid sending this and pending deliver newspaper
Literary composition.
When judging to generate flow Stop message, no longer message to be sent is transmitted.
The present invention only adds the operations such as simple judgement and statistics in existing message transmission flow, with maximum transmitted list
Unit as basic message length, by the Approach by inchmeal of message number can be sent, it is to avoid to utilizable flow in message transmission process
Can double counting, by judging to send whether message number is 0, to determine send message.In the feelings not affecting sending performance
Under condition, realize the autonomous monitor in real time of flow of equipment end.During traffic statistics, phase is carried out to flow abnormal conditions simultaneously
The process answered.The invention belongs to pure software is realized, it is not rely on the change of the network equipment, can flexibly monitor the network equipment
Flow service condition, improves the stability that the network equipment runs, and reduces cost of equipment maintenance and the human input of client.
The embodiment of the present invention additionally provides a kind of network equipment, it is possible to implement a kind of message transmitting party of the embodiment of the present invention
Method, as shown in figure 3, the described network equipment 30 includes:
Interface load-on module 301, for loading mobile communication interface, and opens after described mobile communication interface loads success
Dynamic traffic monitoring module;
Traffic monitoring module 302, is used for carrying out the traffic monitoring acquisition currently available flow of described mobile communication interface;
Computing module 303, for the MTU and currently available according to configuration on described mobile communication interface
Flow, calculates and currently can send message number;
Message sending module 304, for currently sending message number and currently available flow according to calculate, treats
Send message to be transmitted.
Described traffic monitoring module 302, specifically for:
Before the described network equipment is dialled up on the telephone by described mobile communication interface, obtained by way of message search just
Beginning utilizable flow;
Obtain described mobile communication interface in real time and send message byte number;
Calculate initial utilizable flow and obtain currently available flow with the difference sending message byte number.
Described traffic monitoring module 302, is additionally operable to:
If currently available flow is more than first flow threshold value, postpone certain time according still further to acquisition cycle time setting
Currently available flow;
If currently available flow is more than the first flow threshold values such as second flow threshold value is less than, generate flow early warning information simultaneously
Report;
If currently available flow is more than the 3rd flow threshold is less than or equal to second flow threshold value, generate alarming flow information simultaneously
Report;
If currently available flow is less than the 3rd flow threshold, generates flow Stop message and reported with short message mode.
Described computing module 303, specifically for:
By currently available flow divided by MTU, the value of gained is currently to send message number;
When currently available flow is less than MTU, currently can send message number and be calculated as 0.
Described message sending module 304, specifically for:
It is not 0 and currently available flow is more than the 3rd flow threshold when judging currently can to send message number, then send institute
State message to be sent, add up simultaneously and sent the byte number of message;
When judging that currently can send message number is 0, and the message byte number of message to be sent is less than currently available stream
Amount, sends described message to be sent, adds up simultaneously and has sent the byte number of message;
When judging to generate flow Stop message, no longer message to be sent is transmitted.
The present invention, in the case of not affecting sending performance, realizes the autonomous monitor in real time of flow of the network equipment.Exist simultaneously
During traffic statistics, flow abnormal conditions are processed accordingly.The present invention does not rely on the change of the network equipment, can
With the flow service condition on the flexible monitoring network equipment, improve the stability that the network equipment runs, reduce the equipment dimension of client
Shield cost and human input.
The above, the only specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, and any
Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, all should contain
Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be defined by described scope of the claims.