Embodiment
In order to make the object of the invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing and embodiment, the present invention is further elaborated, for the ease of explanation, only show the part relevant with the embodiment of the invention.Should be appreciated that the specific embodiment that this place is described, only be used to explain the present invention, not in order to restriction the present invention.
The present invention confirms the APN that working application need be used by judging the identification of wifi network and operator; When wifi does not open or do not have the wifi network; Further judge whether to exist SIM and whether be to use said SIM to land for the first time; If; Then read the network profile that presets; Networking mode according to the networking pattern in the network profile is put down in writing is networked; And write down the networking mode and the access point of this login; By multiple decision logic, having solved when diverse network is applied in networking needs the user to carry out the trouble of network configuration; Particularly,, then preferentially carry out network and connect, improve network speed and user and experience by wifi if wifi opens and has the wifi network.
Embodiment one
The method flow diagram that a kind of APN of Fig. 1 embodiment of the invention switches.Described method may further comprise the steps:
S101 judges whether wifi opens and have a wifi network, if then get into step S104, if not, then get into step S102;
Whether S102 judges whether to exist the sim card and is to use said SIM to land for the first time, if, then get into step S103, if not, then get into step S105;
S103 reads the network profile that presets, and networks according to the networking mode that the networking pattern in the network profile is put down in writing, and writes down the networking mode and the access point of this login;
S104 carries out network through wifi and connects;
S105 if judge the SIM existence and use the non-first time said SIM to land, then gets into step S106;
S106 uses the networking mode of said login record to carry out network with access point and is connected;
Wifi is preferential: can economize flow to the user, save money, and wifi speed be fast;
Needed networking pattern when said network profile carries out the network connection for the record working application, and corresponding networking mode and the access point of said networking pattern, said working application is for carrying out the application program that network connects through mobile internet.
Said networking pattern comprises: the pattern of networking automatically, socket networking pattern, http networking pattern or the pattern of manually networking.
When said networking pattern was automatic networking pattern, the method for networking automatically was following:
S201 judges whether to exist the access point of http networking mode, if the access point that then obtains the http networking mode carries out network and connects, if not, then get into step S202;
S202 judges whether to create the access point of http networking mode, if then create the access point of http networking mode and carry out network and connect, if not, then get into step S203;
The APN that uses in the professional WAP browser of the 2G of CHINAUNICOM is UNIWAP; The APN that the professional WAP browser of 3G uses is 3GWAP, and the APN of Intranet is CMWAP in the China Mobile, all need carry out network through the access point of http networking mode based on the application of above APN and connect; For the working application of enjoying the flow set meal; Preferentially carry out network through the http access point and connect, save network traffics, for example mobile dream network uses and just can at first use the http access point to carry out the network connection;
S203 judges whether to exist the access point of socket networking mode, if the access point that then obtains the socket networking mode carries out network and connects, if not, then get into step S204;
S204 judges whether to create the access point of socket networking mode, if then create the access point of socket networking mode and carry out network and connect; If, then the using system access point does not carry out the network connection;
For example internet game is used, and must need the access point of socket networking mode to carry out the network connection; The APN that the last public network of the 2G of CHINAUNICOM uses is UNINET; The APN that professional card of surfing Internet of 3G and last public network use is 3GNET; The APN that China Mobile's card of surfing Internet and last public network use is CMNET; All need carry out network through the access point of socket networking mode based on the application of above APN and connect, connect or smooth network application for needs are long, the access point through the socket networking mode carries out network and connects;
Illustrate: working application is used the sim of China Mobile card; The preferential use cmwap of China Mobile that selects; Use the 10.0.0.172 server to carry out network and connect,, then create this access point if this access point does not exist; If can't create the cmwap access point; Then attempt using the socket mode to network, if there is no the cmnet access point is then created the cmnet access point; If can't create, the access point of then attempting the using system existence carries out network and connects;
When said networking pattern was socket networking pattern, described " networking mode according to the networking pattern in the network profile is put down in writing is networked " was specially:
S301 judges whether to exist the access point of socket networking mode, if then the access point through said socket networking mode carries out network and connects, if not, then get into step S302;
S302 judges whether to create the access point of socket networking mode, if the access point of then creating the socket networking mode carries out network and connects.
Such as the application of internet game, can in configuration file, preset and use socket networking pattern to carry out the network connection.
When said networking pattern was http networking pattern, described " networking mode according to the networking pattern in the network profile is put down in writing is networked " was specially:
S401 judges whether to exist the access point of http networking mode, if then the access point through said http networking mode carries out network and connects, if not, then get into step S402;
S402 judges whether to create the access point of http networking mode, if the access point of then creating the http networking mode carries out network and connects.
For example mobile dream network's working application can be selected http networking pattern to carry out network in network profile and connect.
When said networking pattern was manual networking pattern, described " the networking pattern in the configuration file Network Based put down in writing networking mode network " was specially:
The reading system access point selects an access point in the said system access point to carry out the network connection.
Such as some client, just need the manual selective system access point of user, when system's access point had only one, then acquiescence was exactly to carry out network through this unique system's access point to connect.
APN through judging that the definite working application of wifi network and operator identification need be used in the embodiment of the invention; When wifi does not open or do not have the wifi network; Further judge whether to exist SIM and whether be to use said SIM to land for the first time, if then read the network profile that presets; Networking mode according to the networking pattern in the network profile is put down in writing is networked; And write down the networking mode and the access point of this login, through multiple decision logic, having solved when diverse network is applied in networking needs the user to carry out the trouble of network configuration; Particularly,, then preferentially carry out network and connect, improve network speed and user experience, save flow simultaneously and reduce expenses through wifi if wifi opens and has the wifi network; If SIM exists and use the non-first time said SIM to land, then use the networking mode of login record to carry out network and be connected with access point, avoid the user to land the trouble that all need repeat network settings at every turn, further improve the speed of network connection; Through automatic networking pattern; The preferential access point of selecting existing http networking mode; Secondly select to create the access point of http networking mode, the user priority of conveniently enjoying the flow set meal uses the access point of http networking mode, further saves flow and expense; When the access point that does not have the http networking mode and can't create the access point of http networking mode the time; Select the access point of existing socket networking mode again, secondly select to create the access point of socket networking mode, make things convenient for the user in the time can not carrying out the network connection, to remove to select or create the access point of socket networking mode automatically through the access point of http networking mode; Avoid the user blindly carry out network settings, the problem that causes network to connect; Through socket networking pattern, be suitable for and need carry out the network application that network connects through the access point of socket networking mode, for example online game must select to use the access point of socket networking mode to carry out the network connection; Through http networking pattern, be suitable for the access point that needs the http networking mode and carry out the network application that network connects, for example mobile dream network only needs the access point of http networking mode to carry out the network connection; Described manual networking pattern is used for individual networks, can only carry out network through the access point of selective system and connect; Through presetting four kinds of networking patterns, satisfy various working application and carry out network and all of the access point of networking mode are attempted connecting possible judgement when connecting, thereby carrying out network, the access point of the networking mode of selecting to be suitable for connects, intelligence more, logic is reasonable.
Embodiment two
Fig. 2 is the structural representation of a kind of APN switched system first preferred embodiment of the present invention.
Said system comprises: wifi judge module, first operator's judge module and networking mode selection module;
Said wifi judge module links to each other with said first operator's judge module, is used to judge whether wifi opens and have a wifi network, if not, then notifies said first operator's judge module to continue to judge;
Said first operator's judge module; Link to each other with said networking mode selection module with said wifi judge module; Be used to judge whether to exist the sim card and whether be to use said SIM to land for the first time, if then notify said networking mode selection module to carry out the selection of networking mode;
Said networking mode selection module; Link to each other with said first operator's judge module; Be used to read the network profile that presets, network according to the networking mode that the networking pattern in the network profile is put down in writing, and the networking mode and the access point of record login.
Said working application is for carrying out the application program that network connects through mobile internet.
Needed networking pattern and corresponding networking mode and the access point of said networking pattern when said network profile carries out the network connection for the record working application.
The further optimization of technique scheme is that said system also comprises the wifi network connecting module, is illustrated in figure 3 as the structural representation of a kind of APN switched system second preferred embodiment of the present invention;
Said wifi network connecting module links to each other with said wifi judge module, be used for when the judged result of wifi judge module when being, then carry out network and connect through wifi.
Wifi is preferential: can economize flow to the user, save money, and wifi speed be fast.
The further optimization of technique scheme is that said system also comprises second operator's judge module, is illustrated in figure 4 as the structural representation of a kind of APN switched system the 3rd preferred embodiment of the present invention;
Said second operator's judge module; Link to each other with the networking mode selection module with said first operator's judge module; Be used for when said first operator's judge module judged result for not the time; If continue then to judge the SIM existence and use the non-first time said SIM to land that the networking mode that then obtains networking mode selection module record carries out network with access point and is connected.
The further optimization of technique scheme is; Said networking mode selection module also comprises networking and memory module and automatic networking module; Said automatic networking module comprises the first networking judge module, the second networking judge module, the 3rd networking judge module, tetrad net judge module and systems connection module, is illustrated in figure 5 as the structural representation of a kind of APN switched system the 4th preferred embodiment of the present invention;
Said networking and memory module; Link to each other with automatic networking module with said second operator's judge module; Be used to read the network profile that presets; The networking mode of being put down in writing according to the networking pattern in the network profile is also notified corresponding networking module, the networking mode and the access point of record login simultaneously;
Said automatic networking module links to each other with said networking and memory module, is used to receive the notice of said networking and memory module, and notifies the said first networking judge module to begin to judge the networking mode that needs connection, carries out network simultaneously and connects;
The said first networking judge module links to each other with the said second networking judge module, is used to judge whether to exist the access point of http networking mode; If; The access point that then obtains the http networking mode carries out network and connects, and if not, then notifies the second networking judge module;
The said second networking judge module; Link to each other with the 3rd networking judge module with the said first networking judge module; Be used to judge whether to create the access point of http networking mode; If; Then create the access point of http networking mode and carry out network and connect; If not, then notify the 3rd networking judge module;
The APN that uses in the professional WAP browser of the 2G of CHINAUNICOM is UNIWAP; The APN that the professional WAP browser of 3G uses is 3GWAP, and the APN of Intranet is CMWAP in the China Mobile, all need carry out network through the access point of http networking mode based on the application of above APN and connect; For the working application of enjoying the flow set meal; Preferentially carry out network through the http access point and connect, save network traffics, for example mobile dream network uses and just can at first use the http access point to carry out the network connection.
Said the 3rd networking judge module; Link to each other with tetrad net judge module with the said second networking judge module; Be used to judge whether to exist the access point of socket networking mode, if the access point that then obtains the socket networking mode carries out network and connects; If, then do not notify tetrad net judge module;
Said tetrad net judge module links to each other with the systems connection module with said the 3rd networking judge module, is used to judge whether to create the access point of socket networking mode, if then create the access point of socket networking mode and carry out the network connection; If deny, then the reporting system networking module;
Said systems connection module links to each other with said tetrad net judge module, is used to obtain system's access point and carries out the network connection;
For example internet game is used, and must need the access point of socket networking mode to carry out the network connection; The APN that the last public network of the 2G of CHINAUNICOM uses is UNINET; The APN that professional card of surfing Internet of 3G and last public network use is 3GNET; The APN that China Mobile's card of surfing Internet and last public network use is CMNET; All need carry out network through the access point of socket networking mode based on the application of above APN and connect, connect or smooth network application for needs are long, the access point through the socket networking mode carries out network and connects;
Illustrate: working application is used the sim of China Mobile card; The preferential use cmwap of China Mobile that selects; Use the 10.0.0.172 server to carry out network and connect,, then create this access point if this access point does not exist; If can't create the cmwap access point; Then attempt using the socket mode to network, if there is no the cmnet access point is then created the cmnet access point; If can't create, the access point of then attempting the using system existence carries out network and connects;
The further optimization of technique scheme is; Said networking mode selection module also comprises the socket networking module; Said socket networking module comprises 5-linked net judge module and the 6th networking judge module, is illustrated in figure 6 as the structural representation of a kind of APN switched system the 5th preferred embodiment of the present invention;
Said socket networking module links to each other with said networking and memory module, is used to receive the notice of said networking and memory module, and notifies 5-linked net judge module to begin to choose the required networking mode of network connection, carries out network simultaneously and connects;
Said 5-linked net judge module links to each other with said the 6th networking judge module, is used to judge whether to exist the access point of socket networking mode; If; Then the access point by said socket networking mode carries out the network connection, if not, then notifies said the 6th networking judge module;
Said the 6th networking judge module links to each other with said 5-linked net judge module, is used to judge whether to create the access point of the corresponding socket networking mode of working application, if the access point of then creating the socket networking mode carries out network and connects;
Such as the application of internet game, can in configuration file, preset and use socket networking pattern to carry out the network connection.
The further optimization of technique scheme is; Said networking mode selection module also comprises the http networking module; Said http networking module comprises the 7th networking judge module and the 8th networking judge module, is the structural representation of a kind of APN switched system the 6th preferred embodiment of the present invention like Fig. 7;
Said http networking module links to each other with said networking and memory module, is used to receive the notice of said networking and memory module, and notifies the 7th networking judge module to begin to choose the required networking mode of network connection, carries out network simultaneously and connects;
Said the 7th networking judge module links to each other with said the 8th networking judge module, is used to judge whether to exist the access point of http networking mode; If; Then the access point by said http networking mode carries out the network connection, if not, then notifies said the 8th networking judge module;
Said the 8th networking judge module links to each other with said the 7th networking judge module, is used to judge whether to create the access point of http networking mode, if the access point of then creating the http networking mode carries out network and connects.
For example mobile dream network's working application can be selected http networking pattern to carry out network in network profile and connect.
The further optimization of technique scheme is that said networking mode selection module also comprises manual networking module, is illustrated in figure 8 as the structural representation of a kind of APN switched system the 7th preferred embodiment of the present invention;
Said manual networking module links to each other with said networking and memory module, is used to receive the notice of said networking and memory module, and the reading system access point, carries out network through system's access point and connects.
Such as some client, just need the manual selective system access point of user, when system's access point had only one, then acquiescence was exactly to carry out network through this unique system's access point to connect.
The further optimization of technique scheme is; Above-mentioned automatic networking module, socket networking module, http networking module and manual networking module, these four kinds of networking modules can independently exist, and also can make up existence; Based on the difference of working application, independent assortment.
Judge the APN that wifi network and the definite working application of operator's identification need be used through the wifi judge module in the embodiment of the invention; When wifi does not open or do not have the wifi network; Further judge whether to exist SIM and whether be to use said SIM to land for the first time, if then read the network profile that presets by the networking mode selection module by first operator's judge module; Networking mode according to the networking pattern in the network profile is put down in writing is networked; And write down the networking mode and the access point of this login, through multiple decision logic, having solved when diverse network is applied in networking needs the user to carry out the trouble of network configuration; Particularly, if when the judged result of wifi judge module be that wifi opens and when having the wifi network, then preferentially carries out network through wifi through the wifi network connecting module and connect, improve network speed and user experience, save flow simultaneously and reduce expenses; If first operator's judge module judged result is not for the time; Judge the SIM existence and use the non-first time said SIM to land if then continue; The networking mode that then obtains networking mode selection module record carries out network with access point and is connected; Avoid the user to land the trouble that all need repeat network settings at every turn, further improve the speed that network connects; Read the network profile that presets through networking and memory module; The networking mode of being put down in writing according to the networking pattern in the network profile is also notified corresponding networking module, writes down the networking mode and the access point of this login simultaneously, through automatic networking module; The preferential access point of selecting existing http networking mode; Secondly select to create the access point of http networking mode, the user priority of conveniently enjoying the flow set meal uses the access point of http networking mode, further saves flow and expense; When the access point that does not have the http networking mode and can't create the access point of http networking mode the time; Select the access point of existing socket networking mode again, secondly select to create the access point of socket networking mode, make things convenient for the user in the time can not carrying out the network connection, to remove to select or create the access point of socket networking mode automatically through the access point of http networking mode; Avoid the user blindly carry out network settings, the problem that causes network to connect; Through the socket networking module, be suitable for and need carry out the network application that network connects through the access point of socket networking mode, for example online game must select to use the access point of socket networking mode to carry out the network connection; Through the http networking module, be suitable for the access point that needs the http networking mode and carry out the network application that network connects, for example mobile dream network only needs the access point of http networking mode to carry out the network connection; Described manual networking module is used for individual networks, can only carry out network through the access point of selective system and connect; Through presetting four kinds of networking modules, satisfy various working application and carry out network and all of the access point of networking mode are attempted connecting possible judgement when connecting, thereby carrying out network, the access point of the networking mode of selecting to be suitable for connects, intelligence more, logic is reasonable; And four kinds of networking modules can independently exist, and also can combine to exist, and according to various working application independent assortments, satisfy application demand widely.
The system that APN provided by the invention switches can be applied to need set up on the mobile device of network connection, for example: PDA, mobile phone etc.
Those having ordinary skill in the art will appreciate that; All or part of step in realization the foregoing description method can be accomplished through the program command related hardware; Described program can be stored in the computer read/write memory medium, and described storage medium can be ROM, RAM, disk, CD etc.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.