Processing method after a kind of communication equipment GPRS network is abnormal
Technical field
The present invention relates to the communications field, particularly relate to the processing method after a kind of communication equipment GPRS network exception.
Background technology
Along with the development of wireless communication technology, various Wireless Telecom Equipment emerges in multitude, and GPRS (General Packet Radio Service, be called for short GPRS) as the important Radio Transmission Technology of wireless communication field, be widely used in communication equipment miscellaneous, especially more extensive with the communication equipment in Internet of Things field, as communication equipments such as positioning tracker, environment monitoring equipment, intelligent electric meter, Wearable.
GPRS, also known as general packet radio service technology, is the key technology between 2G technology and 3G technology, is referred to as 2.5G technology visually by people, be gsm mobile telephone user can a kind of mobile data services.GPRS, from the continuous mode in channel transmission was different in the past, is transmit with package formula, and the expense that therefore user bears calculates with its data transmission unit, and do not need the time considering GPRS unlatching.Relative to the access speed of the 9.6kbps of GSM, GPRS has the access speed of 171.2kbps; In network connection setup time, GSM needs 10 ~ 30 seconds, and GPRS only needs the extremely short time just can have access to association requests; For expense, GSM is by connect hours charging, and GPRS only needs by data traffic charging; In the utilance of Internet resources, GPRS is much higher far away relative to the network utilization of GSM.If user is only unlocked the GPRS of communication equipment, and does not carry out the transmission of data, then can not produce any data expense to user; Only have when user utilizes GPRS to carry out transfer of data, just can produce certain data expense to user.
The transmission speed higher based on GPRS and relatively cheap cost of use, various communication equipment great majority adopt GPRS to carry out network service.But, communication equipment utilize GPRS carry out network connect and transfer of data process in, often due to the impact of communication equipment or surrounding signals intensity, cause GPRS network not connect, thus make communication equipment cisco unity malfunction, affect the normal user demand of people.
Summary of the invention
Technical problem to be solved by this invention provides a kind of when communication equipment GPRS network can not normally connect for above-mentioned prior art, and communication equipment can realize the processing method of GPRS network after the communication equipment GPRS network be dynamically connected is abnormal.
The present invention's adopted technical scheme that solves the problem is: the processing method after a kind of communication equipment GPRS network is abnormal, for processing the communication equipment of GPRS network exception, is characterized in that, comprising the following steps:
(1) whether normally communication equipment detects GPRS network connection status, and carries out judgement operation according to the GPRS network connection status detected:
(1-1) when GPRS network connection status is normal, then logging in network, starts the proper communication function of communication equipment;
(1-2) when GPRS network connection status occurs abnormal, then the operation of step (2) is performed;
(2) communication equipment carries out from being dynamically connected GPRS network, and when GPRS network reaches N from the number of times that is dynamically connected
1time, the network schemer of communication equipment is switched to offline mode, N
1for natural number;
(3), after the offline mode retention time reaches M second, the network schemer of communication equipment is switched to normal mode by offline mode, and again connects GPRS network, 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 N
2secondary, and when GPRS network fails normally to connect, then perform the operation of step (5), N
2for natural number;
(5) current time t is recorded
0, reboot flag is set, restarts communication equipment, and communication equipment is switched to normal startup mode, t
0for positive number;
(6) reboot flag, current time t in communication equipment read step (5)
0, and communication equipment restart the time Δ t expended, Δ t is positive number, and carries out judgement operation according to the reading result of reboot flag:
(6-1) when communication equipment does not read reboot flag, then networking operation is carried out according to normal networking step;
(6-2) when communication equipment reads reboot flag, then the current time T=t of communication equipment is set
0+ Δ t; And carry out networking operation according to normal networking step, then perform the operation of step (7), T is positive number;
(7) whether communication equipment normally detects GPRS network connection status again, and carries out judgement operation according to testing result:
(7-1) when GPRS network realizes normally connecting, then logging in network, the webserver time T that deletes reboot flag, acquisition is set
serverfor the proper communication function of communication equipment current time, open communication equipment, T
serverfor positive number;
(7-2) when GPRS network fails to realize normally connecting, then the operation of step (1) is performed.
Further, the proper communication function of described communication equipment comprises the combination in any of GPS positioning function or navigation feature or warning function or audio video transmission function or GPS positioning function, navigation feature, warning function, audio video transmission function.
Further, described offline mode retention time M, GPRS network are from being dynamically connected times N
1and N
2own characteristic respectively according to communication equipment is arranged.
Compared with prior art, the invention has the advantages that: when the GPRS network of communication equipment occurs abnormal, first, GPRS network is switched to offline mode and keeps a period of time, and then be switched to normal mode and carry out certainly being dynamically connected of GPRS network; Secondly, according to GPRS network again from the number of times be dynamically connected and network connection state, record current time, reboot flag is set, and communication equipment is restarted, again read reboot flag; Finally, according to the reading result of reboot flag, complete the normal open operation of the connection of communication equipment GPRS network and communication function successively, thus realize communication equipment when GPRS network is abnormal, communication equipment can repair GPRS function in time fast, automatically carry out GPRS network connection, be unlikely to, because the network service that abnormal conditions cause is interrupted for a long time, to ensure that the normal work of communication equipment.
Accompanying drawing explanation
Fig. 1 is the process flow figure in the embodiment of the present invention after communication equipment GPRS network exception.
Embodiment
Below in conjunction with accompanying drawing embodiment, the present invention is described in further detail.
The communication equipment supposing to have GPRS function is positioning tracker, positioning tracker has GPS positioning function, according to the feature of positioning tracker self, positioning tracker restart expend time Δ t=28 second, offline mode retention time M=5 second of positioning tracker, GPRS network is from being dynamically connected times N
1=5, GPRS network is from being dynamically connected times N
2=10.
Below in conjunction with Fig. 1, the processing method after abnormal to this positioning tracker GPRS network is described in detail:
(1) whether normally positioning tracker detects GPRS network connection status, and carries out judgement operation according to the GPRS network connection status detected:
(1-1) when GPRS network connection status is normal, then logging in network, starts the GPS positioning function of positioning tracker;
(1-2) when GPRS network connection status occurs abnormal, then the operation of step (2) is performed;
(2) positioning tracker carries out from being dynamically connected to GPRS network, and when GPRS network reaches 5 times from the number of times that is dynamically connected, the network schemer of positioning tracker is switched to offline mode, and offline mode is herein also known as suspension pattern, and the network connecting function by positioning tracker is closed;
(3), after the offline mode retention time reaches 5 seconds, the network schemer of positioning tracker is switched to normal mode by offline mode, namely starts network connecting function, and GPRS network is connected again;
(4) when GPRS network connection status is normal, then the operation of step (1-1) is performed; When GPRS network connects 10 times, and when GPRS network fails normally to connect, then perform the operation of step (5);
(5) current time t is recorded
0, reboot flag is set, restarts positioning tracker, and positioning tracker is switched to normal startup mode; Normal startup mode herein refers to and is normally started by closed condition by positioning tracker, until positioning tracker is in opening;
(6) reboot flag, current time t in positioning tracker read step (5)
0, and positioning tracker to restart the time expended be Δ t=28 second, and carry out judgement operation according to the reading result of reboot flag:
(6-1) when positioning tracker does not read reboot flag, then networking operation is carried out according to normal networking step; Normal networking step refer to start positioning tracker network connecting function, open GPRS function, search GPRS network, login and set up GPRS network connect;
(6-2) when positioning tracker reads reboot flag, then the current time T=t of positioning tracker is set
0+ 28; And carry out networking operation according to normal networking step, then perform the operation of step (7);
(7) whether positioning tracker normally detects GPRS network connection status again, and carries out judgement operation according to testing result:
(7-1) when GPRS network realizes normally connecting, then the webserver time T input network user's name and password login network, deleting reboot flag, acquisition is set
serverfor positioning tracker current time, i.e. T
positioning tracker _ current=T
server, open, log in the GPS of positioning tracker, thus realize positioning tracker and utilize GPRS to position the normal work of tracking;
(7-2) when GPRS network fails to realize normally connecting, then the operation of step (1) is performed.