CN103179536A - Disconnected GPRS (General Packet Radio Service) automatic redialing method - Google Patents
Disconnected GPRS (General Packet Radio Service) automatic redialing method Download PDFInfo
- Publication number
- CN103179536A CN103179536A CN2013100941208A CN201310094120A CN103179536A CN 103179536 A CN103179536 A CN 103179536A CN 2013100941208 A CN2013100941208 A CN 2013100941208A CN 201310094120 A CN201310094120 A CN 201310094120A CN 103179536 A CN103179536 A CN 103179536A
- Authority
- CN
- China
- Prior art keywords
- gprs
- automatically
- redialing
- ppp0
- ping
- 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
Links
Images
Abstract
The invention relates to the field of wireless communication, and in particular relates to a disconnected GPRS (General Packet Radio Service) automatic redialing method of Linux embedded type equipment. The invention provides a method which can effectively reduce the flow consumption and is simple and efficient. The method comprises the following steps of: monitoring the flow difference of virtual sockets ppp0 (Point to Point Protocol) at time intervals T, and detecting whether the communication respect to primarily selected and backup DNS (Domain Name System) servers are normal through a ping order, in order to determine whether to redial; and directly sending a redialing signal to a PPPD (Point to Point Protocol Daemon) progress to realize redialing. The method is a reliable method which can effectively reduce the flow consumption and increase the redialing speed. The disconnected GPRS automatic redialing method is applied to the field of GPRS wireless communication.
Description
Technical field
The present invention relates to field of wireless communication, especially relate to a kind of method that GPRS broken string of Linux embedded device redials automatically
.
Background technology
In the embedded lower GPRS radio communication exploitation of Linux, generally need embedded device online for a long time; Where you are and where it's at you see, and we often can run into the problem gone offline.Trace it to its cause, mainly contain following some:
1. the T3212(periodical position renewing timer of different districts under same lane place LAC) value arranges when inconsistent, when cell reselection occurs, can cause LAU (Location Area Update), RAU (Routing Area Update).At present existing network lane place LAC and Route Area RAU are set to unanimously, when generation LAU, must trigger RAU.LAU, RAU can cause DTFTP to download the delay increasing frequently, when serious, can cause going offline.
2. need to be upgraded to route (RAU) when GPRS communicates by letter, will be gone offline once routing update is unsuccessful.
3. between logon server and beginning downloading data, cell reselection occurring causes going offline.
For disconnection, existing general processing method is as follows:
1. whether judgement/var/run/ppp0.pid file exists.
If the pppd dial-up success can be added ppp0.pid file, the pid of the current pppd process of this file record under/var/run catalogue.If it exists, online; If do not exist, broken string, now just need to dial again.
2. use the ping command determination whether online.
If using first-selected dns server IP1 and standby dns server IP2 as two outer net IP.At first need to survey the connectedness of embedded device and DNS1, can realize by " ping – s 1 – c 2 IP1 ", as result of detection is communicated with first-selected dns server, think that GPRS is online, enter the next round judgement after waiting for a period of time; As the result of detection embedded device is not communicated with first-selected dns server, need to survey the connectedness of embedded device and standby dns server.In like manner, be communicated with standby dns server as embedded device and enter the next round judgement, as embedded device is not communicated with standby dns server yet, now thinks and need to redial the GPRS broken string.General adopt FEFO PPPD process to rerun method that the PPP-ON script enables the PPPD process realizes redialing.
For first method, be obviously worthless.Facts have proved that radio communication likely disconnects when the pppd process is normally moved.Also can learn to go offline whether exist and there is no inevitable contacting with the pppd process by the analysis of causes that goes offline.
For second method, not only can cause the waste of flow but also redial speed also very slow.
The value of going ping to add to return with a byte comes to 9 bytes, and namely one hour with 9*12*60=6480B ≈ 6.33KB.In the practical application of embedded device, usually can require equipment online for a long time, will cause the flow serious waste like this.
Adopt FEFO pppd process, the redial method of the ppp-on script startup pppd process of reruning makes the speed of redialing very slow.
Summary of the invention
Technical problem to be solved by this invention is: the problem existed for prior art, a kind of method that provides GPRS broken string of Linux embedded device automatically to redial.Whether by the difference in flow of monitoring virtual interface ppp0 time interval T and survey with first-selection, standby dns server and communicate by letter normally by ping order, whether detection GPRS breaks, and judges whether thus to be redialed; And realize redialing by directly the PPPD process being sent to the replay signal.Can solve traffic consumes so too high, and reach the effect that improves the speed that redials.
The technical solution used in the present invention is as follows:
A kind of method that GPRS broken string redials automatically comprises:
Step 1: after the Linux embedded device dial-up success that contains the GPRS module, generating virtual interface ppp0, and current time and previous moment difference in flow after monitoring virtual interface ppp0 time interval T, zero if described flow difference is greater than, the GPRS module does not go offline, without redialing; If described flow difference equals zero, perform step 2;
Step 2: whether the process of automatically replaying is surveyed and is communicated by letter normally with first-selected dns server by the ping order, if can lead to by ping, without redialing; If can not lead to by ping, need carry out step 3;
Step 3: whether the process of automatically replaying is surveyed and is communicated by letter normally with standby dns server by the ping order, if can lead to by ping, without redialing; If can not lead to by ping, think and gone offline, carry out step 4;
Step 4: the process that redials sends and redials signal to the pppd dialing process.
After described automatic replay process redials signal to the transmission of pppd dialing process, if there is trigger event to make pppd dialing process state for dead, the pppd dialing process will disconnect the LCP connection, and judge whether the GPRS module does not need again to connect, the GPRS module requires to disconnect or the GPRS module connects unsuccessful number and is greater than maximum, when above-mentioned condition is true time, the replay process re-starts the dialing request.
The described process that automatically redials is usingd byte number difference that virtual interface ppp0 current time and previous moment after time interval T receive data as basis for estimation, detailed process:
Step 11: replay process automatically is by file reading/proc/net/dev, until find the row of ppp0 beginning;
Step 12: the data of ppp0 beginning row in the process of automatically replaying resolution file/proc/net/dev obtain the byte number P1 received;
Step 13: the process of automatically replaying repeating step 11, step 12 after time interval T obtain the byte number P2 that current time virtual interface ppp0 receives, and P2-P1 is flow difference
.
in sum, owing to having adopted technique scheme, the invention has the beneficial effects as follows:
Whether the byte number difference of 1) by virtual interface ppp0, at time interval T, receiving data is as basis for estimation, detect and break, and can effectively reduce the GPRS unnecessary traffic consumes in automatic replay process that breaks.
2)automatically whether the replay process communicates by letter normally with first-selected, standby dns server by ping order detection embedded device, and whether determine to be redialed is a kind of method that reliable decision redials.
3)after described automatic replay process redials signal to the transmission of pppd dialing process, if there is trigger event to make pppd dialing process state for dead, the pppd dialing process will disconnect the LCP connection, and judge whether the GPRS module does not need again to connect, the GPRS module requires to disconnect or the GPRS module connects unsuccessful number and is greater than maximum, when above-mentioned condition is true time, the replay process re-starts the dialing request, significantly improves the speed that redials, and saves the system program expense.
4)automatically the replay process, by the row started with " ppp0 " in file reading/proc/net/dev, obtains the difference in flow of obtaining after time interval value T, and this method is simple, practical, efficient.
The accompanying drawing explanation
Examples of the present invention will be described by way of reference to the accompanying drawings, wherein:
The pppd main flow chart that dials in Fig. 1 the design
.
Embodiment
Disclosed all features in this specification, or the step in disclosed all methods or process, except mutually exclusive feature and/or step, all can combine by any way.
Disclosed arbitrary feature in this specification (comprising any accessory claim, summary and accompanying drawing), unless special narration all can be replaced by other equivalences or the alternative features with similar purpose.That is,, unless special narration, each feature is an example in a series of equivalences or similar characteristics.
This patent related description
1, peaked the program according to pppd is set, maximum can change.
2, the LCP connection is the abbreviation of LCP.Be a subset of ppp protocol, in PPP communication, transmitting terminal and receiving terminal wrap to determine that by sending LCP those are the necessary informations in transfer of data.LCP checks the sign of chained device, and decision is to accept or refusal; Determine receivable packet byte number in transmission; Check both sides' configuration and whether mate, if do not mate break link.Only, in the situation that the link of LCP bag is available, data could realize network service.LCP is responsible for establishment, maintenance and the termination of link between equipment.
3, file/proc/net/dev effect: reflected in real time the flow information of network interface, recorded bag and the byte number of each network interface card sending and receiving, wherein secondary series is the statistics of the byte number received of docking port.The present invention is by reading file/proc/net/dev a line a line, until find the row of ppp0 beginning, this just means the information that comprises the GPRS data on flows that found, and next only need to be resolved the row data, obtains out the byte number wherein received.By the appeal method, in the time interval, obtain the byte number once received every T, before and after calculating, the difference of twice can estimate the byte number that in the T time interval, the ppp0 interface is received.
3, the course of work: after the Linux embedded device that contains the GPRS module starts pppd process dial-up success, generating virtual interface ppp0; Start subsequently automatic replay process, it is usingd and calculates data word joint number difference that virtual interface ppp0 current time and previous moment after time interval T receive as basis for estimation, zero if difference is greater than, and thinks that GPRS does not go offline, without redialing; If described flow difference equals zero, whether the process of automatically replaying is surveyed embedded device by the ping order and is communicated by letter normally with first-selected dns server, if communication is normal, without redialing; If undesired, whether the process of automatically replaying is surveyed embedded device by the ping order and is communicated by letter normally with standby dns server, if communication is normal, without redialing; If undesired, think that GPRS has broken, now automatically redialing process can send and redial signal to the pppd process, and the pppd process enters dialing process after receiving and redialing signal.
Embodiment mono-: a kind of method that GPRS broken string redials automatically comprises:
Step 1: after the Linux embedded device dial-up success that contains the GPRS module, generating virtual interface ppp0, automatically the replay process is usingd data word joint number difference that virtual interface ppp0 current time and previous moment after time interval T receive as basis for estimation, if difference is greater than zero, think that the GPRS module does not go offline, without redialing, if difference equals zero, perform step 2;
Step 2: whether the process of automatically replaying is surveyed embedded device by the ping order and is communicated by letter normally with first-selected dns server, if can lead to by ping, without redialing; If can not lead to by ping, need carry out step 3;
Step 3: whether the process of automatically replaying is surveyed embedded device by the ping order and is communicated by letter normally with standby dns server, if can lead to by ping, without redialing; If can not lead to by ping, think and gone offline, carry out step 4;
Step 4: the process that redials sends and redials signal to the pppd dialing process.
Embodiment bis-: as described in Figure 1, on embodiment mono-basis, after described automatic replay process redials signal to the transmission of pppd dialing process, if there is trigger event to make pppd dialing process state for dead, the pppd dialing process will disconnect the LCP connection, and judge whether the GPRS module does not need again to connect, the GPRS module requires to disconnect or the GPRS module connects unsuccessful number and is greater than maximum, when above-mentioned condition is true time, the replay process re-starts the dialing request.(in prior art, when there being trigger event to make current state, be dead, the pppd process will disconnect LCP and connect, and judge whether not need again to connect, or requirement disconnects, or connect unsuccessful number and be greater than maximum; If condition of appeal is for very finish the pppd process.)
Embodiment tri-: on embodiment mono-or two bases, described automatic replay process is usingd data word joint number difference that virtual interface ppp0 current time and previous moment after time interval T receive as the basis for estimation detailed process:
Step 11: replay process automatically is by file reading/proc/net/dev, until find the row of ppp0 beginning;
Step 12: the data of ppp0 beginning row in the process of automatically replaying resolution file/proc/net/dev obtain and receive byte number P1; Wherein/proc/net/dev;
Step 13: the process of automatically replaying repeating step 11, step 12 after time interval T obtain the byte number P2 that current time virtual interface ppp0 receives, and P2-P1 is the data word joint number difference of receiving.
The present invention is not limited to aforesaid embodiment.The present invention expands to any new feature or any new combination disclosed in this manual, and the arbitrary new method disclosed or step or any new combination of process.
Claims (3)
1. the method that GPRS broken string redials automatically is characterized in that comprising:
Step 1: after the Linux embedded device dial-up success that contains the GPRS module, generating virtual interface ppp0, automatically the replay process is usingd data word joint number difference that virtual interface ppp0 current time and previous moment after time interval T receive as basis for estimation, if difference is greater than zero, the GPRS module does not go offline, without redialing; If difference equals zero, perform step 2;
Step 2: whether the process of automatically replaying is surveyed embedded device by the ping order and is communicated by letter normally with first-selected dns server, if can lead to by ping, without redialing; If can not lead to by ping, need carry out step 3;
Step 3: whether the process of automatically replaying is surveyed embedded device by the ping order and is communicated by letter normally with standby dns server, if can lead to by ping, without redialing; If can not lead to by ping, think and gone offline, carry out step 4;
Step 4: the process that redials sends and redials signal to the pppd dialing process.
2. the method that a kind of GPRS broken string according to claim 1 redials automatically, after it is characterized in that described automatic replay process redials signal to the transmission of pppd dialing process, if there is trigger event to make pppd dialing process state for dead, the pppd dialing process will disconnect the LCP connection, and judge whether the GPRS module does not need again to connect, the GPRS module requires to disconnect or the GPRS module connects unsuccessful number and is greater than maximum, when above-mentioned condition is true time, the replay process re-starts the dialing request.
3. the method automatically redialed according to the described a kind of GPRS broken string of claim 2 or 3, it is characterized in that described automatic replay process usings data word joint number difference that virtual interface ppp0 current time and previous moment after time interval T receive as basis for estimation, detailed process:
Step 11: replay process automatically is by file reading/proc/net/dev, until find the row of ppp0 beginning;
Step 12: the data of ppp0 beginning row in the process of automatically replaying resolution file/proc/net/dev obtain and receive byte number P1;
Step 13: the process of automatically replaying repeating step 11, step 12 after time interval T obtain the byte number P2 that current time virtual interface ppp0 receives, and P2-P1 is flow difference.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310094120.8A CN103179536B (en) | 2013-03-22 | 2013-03-22 | A kind of GPRS breaks the method automatically redialed |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310094120.8A CN103179536B (en) | 2013-03-22 | 2013-03-22 | A kind of GPRS breaks the method automatically redialed |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103179536A true CN103179536A (en) | 2013-06-26 |
CN103179536B CN103179536B (en) | 2016-02-10 |
Family
ID=48639099
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310094120.8A Active CN103179536B (en) | 2013-03-22 | 2013-03-22 | A kind of GPRS breaks the method automatically redialed |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103179536B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI507076B (en) * | 2014-02-10 | 2015-11-01 | Hon Hai Prec Ind Co Ltd | Wlan access device and method of controlling wireless signals |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101453352A (en) * | 2007-12-07 | 2009-06-10 | 华为技术有限公司 | Path failure detection method and apparatus |
CN102307122A (en) * | 2011-09-06 | 2012-01-04 | 北京傲天动联技术有限公司 | Ethernet over Coax (EoC) link failure detection system and method |
CN102546619A (en) * | 2011-12-29 | 2012-07-04 | 浙江工业大学 | Modbus protocol conversion system based on 3G (The 3rd Generation Telecommunication) Internet access |
CN102843274A (en) * | 2012-08-31 | 2012-12-26 | 杭州华三通信技术有限公司 | Method and device for detecting multi-link fault |
-
2013
- 2013-03-22 CN CN201310094120.8A patent/CN103179536B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101453352A (en) * | 2007-12-07 | 2009-06-10 | 华为技术有限公司 | Path failure detection method and apparatus |
CN102307122A (en) * | 2011-09-06 | 2012-01-04 | 北京傲天动联技术有限公司 | Ethernet over Coax (EoC) link failure detection system and method |
CN102546619A (en) * | 2011-12-29 | 2012-07-04 | 浙江工业大学 | Modbus protocol conversion system based on 3G (The 3rd Generation Telecommunication) Internet access |
CN102843274A (en) * | 2012-08-31 | 2012-12-26 | 杭州华三通信技术有限公司 | Method and device for detecting multi-link fault |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI507076B (en) * | 2014-02-10 | 2015-11-01 | Hon Hai Prec Ind Co Ltd | Wlan access device and method of controlling wireless signals |
US9439227B2 (en) | 2014-02-10 | 2016-09-06 | Hon Hai Precision Industry Co., Ltd. | Wireless local area network access device and method of controlling wireless signals |
Also Published As
Publication number | Publication date |
---|---|
CN103179536B (en) | 2016-02-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102223257B (en) | Heartbeat interval adjusting method, server, client terminal and communication system | |
CN100553213C (en) | A kind of method and apparatus of WLAN abnormal quick restoring | |
CN105227398A (en) | Long method of attachment, system and its apparatus, terminal are shared in multi-service | |
CN105517110A (en) | Method and apparatus for connecting bluetooth device | |
CN103281161A (en) | Communication method for GPS (Global Positioning System) positioning terminal and background server | |
CN104735697A (en) | Mobile terminal automated calling field test method and system based on AT instruction | |
CN102437943A (en) | Method and device for surfing Internet based on 3G ( 3rd Generation Telecommunication) data card | |
CN105246111A (en) | Adaptive local area network and internet switching method | |
CN101207432A (en) | Method and system for implementation of time auto synchronization | |
CN101778107B (en) | State synchronization processing method and device | |
CA1237208A (en) | Mechanized loop testing using a local metallic access port | |
CN103179536B (en) | A kind of GPRS breaks the method automatically redialed | |
CN103220283A (en) | Method, equipment and system for network sharing | |
CN112333797A (en) | Intelligent switching system and method for terminal communication card operator based on eSIM technology | |
CN101753448A (en) | Method and device for establishing ATM communication connection | |
CN111065069B (en) | T-BOX data network recovery method and device | |
CN104602285A (en) | Disaster recovery method and equipment | |
CN103441894A (en) | Method and system for L2TP concurrent connection performance test | |
EP2536067B1 (en) | Apparatus and method for implementing point to point protocol data service link-disconnect | |
EP1693985A1 (en) | A SYSTEM AND METHOD FOR TESTING THE SUBSCRIBER’S LINE | |
US5448573A (en) | Automatic circuit switching device restorable without a hit and its method | |
CN107846403B (en) | Method and system for communication between SIM card and application server | |
CN104735696A (en) | Mobile terminal communication switchover field test method and system based on AT command | |
CN102014033B (en) | Method and system for restoring services of fault nodes in ring network | |
JP4854655B2 (en) | Polarity control system, access gateway, and polarity control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: No. 333, Yunhua Road, Chengdu hi tech Zone, China (Sichuan) pilot Free Trade Zone, Chengdu, Sichuan 610041 Patentee after: China Electronics Technology Network Security Technology Co.,Ltd. Address before: No. 333, Yunhua Road, high tech Zone, Chengdu, Sichuan 610041 Patentee before: CHENGDU WESTONE INFORMATION INDUSTRY Inc. |