A kind of processing method after communication equipment GPRS network exception
Technical field
The present invention relates to the processing method behind the communications field, more particularly to a kind of communication equipment GPRS network exception.
Background technology
With the continuous development of wireless communication technology, various Wireless Telecom Equipments emerge in multitude, and GPRS (General
Packet Radio Service, abbreviation GPRS) important Radio Transmission Technology as wireless communication field, it is widely used
It is especially more extensive with the communication equipment of Internet of Things field in miscellaneous communication equipment, such as positioning tracker, environmental monitoring
The communication equipments such as equipment, intelligent electric meter, Wearable.
GPRS, also known as general packet radio service technology, are the key technologies between 2G technologies and 3G technology, by people
Visually be referred to as 2.5G technologies, be a kind of available mobile data services of gsm mobile telephone user.GPRS with it is in the past continuous
It is in the mode of channel transmission different, it is to be transmitted with package formula, therefore the expense that user is born is with its data transmission list
Position calculates, the time opened without considering GPRS.Relative to GSM 9.6kbps access speed, GPRS possesses
171.2kbps access speed;In terms of network connection settling time, GSM need 10~30 seconds, and GPRS only need it is extremely short
Time can has access to association requests;For expense, GSM is by Connection Time charging, and GPRS is only needed by number
According to charge on traffic;In terms of the utilization rate of Internet resources, GPRS relative to GSM network utilization will be much high it is more.If
User is only unlocked the GPRS of communication equipment, the transmission without carrying out data, then will not produce any data to user
Expense;Only when user is carried out data transmission using GPRS, certain data expense can be just produced to user.
Used based on transmission speed higher GPRS and most of relatively cheap cost of use, various communication equipments
GPRS carries out network service.However, communication equipment is using GPRS during network connection and data transfer is carried out, often by
In the influence of communication equipment or surrounding signals intensity, GPRS network is caused not connect, so that communication equipment is not
Energy normal work, influence the normal use demand of people.
The content of the invention
The technical problems to be solved by the invention are to provide one kind in communication equipment GPRS network for above-mentioned prior art
When can not normally connect, communication equipment can realize the processing after the communication equipment GPRS network exception that GPRS network connects automatically
Method.
Technical scheme is used by the present invention solves the above problems:A kind of processing after communication equipment GPRS network exception
Method, for handling the abnormal communication equipment of GPRS network, it is characterised in that comprise the following steps:
(1) whether communication equipment detection GPRS network connection status is normal, and according to the GPRS network connection status of detection
Carry out judgement operation:
(1-1) then logging in network, starts the proper communication function of communication equipment when GPRS network connection status is normal;
(1-2) then performs the operation of step (2) when GPRS network connection status occurs abnormal;
(2) communication equipment is connected automatically to GPRS network, and reaches N when GPRS network connects number automatically1When, will
The network mode of communication equipment is switched to offline mode, N1For natural number;
(3) after the offline mode retention time reaches the M seconds, the network mode of communication equipment is switched to normally by offline mode
Pattern, and GPRS network is attached again, M is positive number;
(4) when GPRS network connection status is normal, then the operation of step (1-1) is performed;When GPRS network connects N2It is secondary,
And GPRS network then performs the operation of step (5), N when failing normally to connect2For natural number;
(5) current time t is recorded0, reboot flag is set, restarts communication equipment, and communication equipment is switched to just
Normal start-up mode, t0For positive number;
(6) reboot flag in communication equipment read step (5), current time t0And communication equipment restarts consuming
Time Δ t, Δ t are positive number, and carry out judgement operation according to the reading result of reboot flag:
(6-1) then carries out networking operation when communication equipment does not read reboot flag according to normal networking step;
(6-2) then sets the current time T=t of communication equipment when communication equipment reads reboot flag0+Δt;And
Networking operation is carried out according to normal networking step, then performs the operation of step (7), T is positive number;
(7) whether communication equipment is normally carried out detecting to GPRS network connection status again, and is carried out according to testing result
Judge operation:
(7-1) when GPRS network realizes normal connection, then logging in network, delete reboot flag, the network obtained be set
Server time TServerFor communication equipment current time, the proper communication function of open communication equipment, TServerFor positive number;
(7-2) then performs the operation of step (1) when GPRS network fails to realize normal connection.
Further, the proper communication function of the communication equipment includes GPS location function or navigation feature or alarm work(
Energy or audio video transmission function or GPS location function, navigation feature, warning function, any combination of audio video transmission function.
Further, offline mode retention time M, GPRS network connect times N automatically1And N2Respectively according to communication
The own characteristic of equipment is configured.
Compared with prior art, the advantage of the invention is that:When the GPRS network of communication equipment occurs abnormal, first,
GPRS network is switched to offline mode and kept for a period of time, then again switches to normal mode progress GPRS network oneself
Dynamic connection;Secondly, the number and network connection state connected automatically again according to GPRS network, record current time, weight is set
Mark is opened, and communication equipment is restarted, again reads off reboot flag;Finally, according to the reading result of reboot flag, successively
The connection of communication equipment GPRS network and the normally-open operation of communication function are completed, so as to realize that communication equipment is different in GPRS network
Chang Shi, communication equipment can quickly repair GPRS functions in time, automatically carry out GPRS network connection, be unlikely to because abnormal feelings
Network service caused by condition is interrupted for a long time, ensure that the normal work of communication equipment.
Brief description of the drawings
Fig. 1 is the process flow figure after communication equipment GPRS network exception in the embodiment of the present invention.
Embodiment
The present invention is described in further detail below in conjunction with accompanying drawing embodiment.
Assuming that the communication equipment with GPRS functions is positioning tracker, positioning tracker has GPS location function, according to
The characteristics of positioning tracker itself, Δ t=28 seconds time of positioning tracker restarting consuming, the flight mould of positioning tracker
M=5 seconds formula retention time, GPRS network connect times N automatically1=5, GPRS network connects times N automatically2=10.
Below in conjunction with Fig. 1, the processing method after the positioning tracker GPRS network exception is described in detail:
(1) whether positioning tracker detection GPRS network connection status is normal, and connects shape according to the GPRS network of detection
State carries out judgement operation:
(1-1) then logging in network, starts the GPS location function of positioning tracker when GPRS network connection status is normal;
(1-2) then performs the operation of step (2) when GPRS network connection status occurs abnormal;
(2) positioning tracker is connected automatically to GPRS network, and is reached 5 times when GPRS network connects number automatically
When, the network mode of positioning tracker is switched to offline mode, offline mode herein is also known as suspension pattern, will position with
The network connecting function of track device is closed;
(3) after the offline mode retention time reaches 5 seconds, the network mode of positioning tracker is switched to just by offline mode
Norm formula, that is, start network connecting function, and GPRS network is attached again;
(4) when GPRS network connection status is normal, then the operation of step (1-1) is performed;When GPRS network connect 10 times,
And GPRS network then performs the operation of step (5) when failing normally to connect;
(5) current time t is recorded0, reboot flag is set, restarts positioning tracker, and positioning tracker is switched
To normal startup mode;Normal startup mode herein refers to by closed mode normally being started positioning tracker, directly
Opening is in positioning tracker;
(6) reboot flag in positioning tracker read step (5), current time t0And positioning tracker restarts consumption
The time taken is the Δ t=28 seconds, and carries out judgement operation according to the reading result of reboot flag:
(6-1) then carries out networking operation when positioning tracker does not read reboot flag according to normal networking step;
Normal networking step refers to starting the network connecting function of positioning tracker, opens GPRS functions, search GPRS network, steps on
Record and establish GPRS network connection;
(6-2) then sets the current time T=t of positioning tracker when positioning tracker reads reboot flag0+28;
And networking operation is carried out according to normal networking step, then perform the operation of step (7);
(7) whether positioning tracker is normally carried out detecting to GPRS network connection status again, and is entered according to testing result
Row judges operation:
(7-1) then inputs network user's name and password login network, deletes and restart when GPRS network realizes normal connection
Mark, the webserver time T obtained is setServerFor positioning tracker current time, i.e. TPositioning tracker _ current=TServer, open,
The GPS of positioning tracker is logged in, the normal work of locating and tracking is carried out so as to realize positioning tracker using GPRS;
(7-2) then performs the operation of step (1) when GPRS network fails to realize normal connection.