Embodiment
Below in conjunction with embodiment, more detailed description is further done to technical scheme of the present invention.Obviously, described embodiment is only a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite of not making creative work, all should belong to the scope of protection of the invention.
Consult Fig. 1, Fig. 1 is the structural representation of the first execution mode of the device of acquisition user geographical location information provided by the invention.
The device 100 of this acquisition user geographical location information comprises: station address parameter acquisition module 110, user's geographical location information acquisition module 120.
Wherein, station address parameter acquisition module 110, obtains the address parameter of user during for determining to obtain global position system GPS information.
Concrete, the address parameter of the user got can be physical address parameter, namely represents the parameter in an actual physical city, such as Nanjing, Shenzhen or sakata district of Shenzhen.
Concrete, the address parameter of the user got can be mobile network is IP (InternetProtocol, the agreement interconnected between the network) address that device end distributes, and each IP address is the binary number of 32, usually be split into 4 " 8 bits ", the form of (a.b.c.d) is expressed as with " dotted decimal notation ", wherein, a, b, c, d are the decimal integers between 0 ~ 255, such as: 49.65.125.8.
User's geographical location information acquisition module 120, the address parameter for the user got according to station address parameter acquisition module 110 obtains user's geographical location information.
Concrete, if station address parameter is physical address parameter, needs to inquire about the mapping table between physical address parameter and geographical location information that local data base stores, thus obtain corresponding geographical location information.
If station address parameter is IP address, then needs to inquire about the mapping table between the IP address argument of local data base or the storage of third-party application provider and geographical location information, thus obtain corresponding geographical location information.
Concrete, the user's geographical location information got is longitude and the latitude of user.Because a lot of location-based application needs to use concrete longitude and latitude, thus calculates range information, such as, with the range information of other users, the range information with assigned address.
Be different from prior art, the device of acquisition user geographical location information of the present invention, when determining to obtain global position system GPS information, obtain the address parameter of user; Address parameter according to described user obtains user's geographical location information; Thus can when GPS information cannot be obtained, still can the substantially available user's geographical location information of automatic acquisition, avoid the operating process interrupting user in application use procedure, decrease the operation complexity of user, promote Consumer's Experience.
Consult Fig. 2, Fig. 2 is the structural representation of the second execution mode of the device of acquisition user geographical location information provided by the invention.
The device 200 of this acquisition user geographical location information comprises: station address parameter acquisition module 210, user's geographical location information acquisition module 220.
Wherein, station address parameter acquisition module 210, obtains the address parameter of user during for determining to obtain global position system GPS information.This module 210 comprises physical address parameter acquiring unit 211 or IP address argument acquiring unit 212.
Physical address parameter acquiring unit 211, during for determining to obtain global position system GPS information, obtains the physical address parameter of described user according to the registration scenarios of described user.Namely this physical address parameter represents the parameter in an actual physical city, such as Nanjing, Shenzhen or sakata district of Shenzhen.
Further, physical address parameter acquiring unit 211 comprises registration scenarios judgment sub-unit 2111, and registered address obtains subelement 2112, and default address obtains subelement 2113.
Wherein, whether registration scenarios judgment sub-unit 2111, during for determining to obtain global position system GPS information, fill in station address when judging whether described user registers and register; Registered address obtains subelement 2112, and during for judging described user registration at subelement 2111 and fill in station address, the station address filled in described in acquisition is the physical address parameter of described user; Default address obtains subelement 2113, during for not filling in station address when subelement 2111 judges that described user does not register or registers, obtains the physical address parameter of address as described user of system default.
IP address argument acquiring unit 212, during for determining to obtain global position system GPS information, obtains the IP address argument of described user.Described IP address argument is mobile network is IP (InternetProtocol, the agreement interconnected between the network) address that device end distributes, and is expressed as the form of (a.b.c.d), such as: 49.65.125.8 with " dotted decimal notation ".
User's geographical location information acquisition module 220, comprises mapping relations table acquiring unit 221 and user's geographical location information acquiring unit 222.
Wherein, mapping relations table acquiring unit 221, for obtaining the mapping relations table of address parameter and geographical location information in local data base or third-party application; User's geographical location information acquiring unit 222, the address parameter for the user got according to module 210 inquires about described mapping relations table, thus user's geographical location information that the address parameter obtaining described user is corresponding.
Concrete, if the station address parameter that station address parameter acquisition module 210 gets is physical address parameter, need to inquire about the mapping table between physical address parameter and geographical location information that local data base stores, thus obtain corresponding geographical location information; If the station address parameter that station address parameter acquisition module 210 gets is IP address, then inquire about the mapping table between the IP address argument of local data base or the storage of third-party application provider and geographical location information, thus obtain corresponding geographical location information.
Concrete, the user's geographical location information got is longitude and the latitude of user.Because a lot of location-based application needs to use concrete longitude and latitude, thus calculates range information, such as, with the range information of other users, the range information with assigned address.
Optionally, the device 200 of this acquisition user geographical location information further comprises display module 230, for showing the mode of current acquisition user geographical location information to described user, so that described user can provide more accurate geographical location information from main separation.
Concrete, can be only stop the bullet window mode in a few second or do not affect the wicket displaying reminder message of user operation, remind particular content such as: " default address of your current use is Shenzhen; please open the place of GPS switch or gps signal of moving one's steps, to provide better service ".
Be different from prior art, the device of acquisition user geographical location information of the present invention, when determining to obtain global position system GPS information, obtain the address parameter of user; Address parameter according to described user obtains user's geographical location information; Thus can when GPS information cannot be obtained, still can the substantially available user's geographical location information of automatic acquisition, avoid the operating process interrupting user in application use procedure, decrease the operation complexity of user, promote Consumer's Experience.
Consult Fig. 3, Fig. 3 is the schematic flow sheet of method first execution mode of acquisition user geographical location information provided by the invention.
The step of the method comprises:
When S301. determining to obtain global position system GPS information, obtain the address parameter of user.
Wherein, the address parameter obtaining user can be: the physical address parameter obtaining described user according to the registration scenarios of described user, or obtains the IP address argument of described user.Namely this physical address parameter represents the parameter in an actual physical city, such as Nanjing, Shenzhen or sakata district of Shenzhen.Described IP address argument is mobile network is IP (InternetProtocol, the agreement interconnected between the network) address that device end distributes, and is expressed as the form of (a.b.c.d), such as: 49.65.125.8 with " dotted decimal notation ".
Common, inquire about the geographical location information obtained according to IP address argument more accurate than the geographical location information obtained according to physical address parameter query, but often will use the data of third-party application according to IP address acquisition geographical location information, cost is higher.So the specific implementation of this step depends on the setting of application, such as, can be the mode only adopting the physical address parameter obtaining user.
Further, the physical address parameter obtaining user according to the registration scenarios of user is specially: determine whether described user registers and whether fill in station address in log-on message, if register and fill in station address, then the station address filled in described in obtaining is the physical address parameter of described user; If register and do not fill in station address or not registration, then obtain the physical address parameter of address as described user of system default.
S302. user's geographical location information is obtained according to the address parameter of described user.
Concrete, the implementation of this step is: the mapping relations table providing address parameter and geographical location information in local data base or third-party application, user's geographical location information that the address parameter obtaining described user according to described mapping relations table is corresponding.Preferential, when station address parameter is physical address parameter, need to inquire about the mapping table between physical address parameter and geographical location information that local data base stores, thus obtain corresponding geographical location information; When station address parameter is IP address, then inquire about the mapping table between the IP address argument of local data base or the storage of third-party application provider and geographical location information, thus obtain corresponding geographical location information.Common, only have the mapping table between third-party application provider meeting storing IP address parameter and geographical location information, therefore adopt the realization of this mode in IP address to need the support obtaining third-party application.Such as, third-party application is Baidu's map.
Described user optionally, can also comprise after step S302: the mode of showing current acquisition user geographical location information to described user, so that can provide more accurate geographical location information from main separation.
Concrete, can be only stop the bullet window mode in a few second or do not affect the wicket displaying reminder message of user operation, remind particular content such as: " you are current uses default address Shenzhen; please open the place of GPS switch or gps signal of moving one's steps, to provide better service ".
Be different from prior art, the method for acquisition user geographical location information of the present invention, when determining to obtain global position system GPS information, obtain the address parameter of user; Address parameter according to described user obtains user's geographical location information; Thus can when GPS information cannot be obtained, still can the substantially available user's geographical location information of automatic acquisition, avoid the operating process interrupting user in application use procedure, decrease the operation complexity of user, promote Consumer's Experience.
Consult Fig. 4, Fig. 4 is the schematic flow sheet of method second execution mode of acquisition user geographical location information provided by the invention, it gives the detailed process of an implementation.
The step of the method comprises:
Step 401: application APP obtains GPS information failure.
Concrete, can be the GPS information failure obtaining system when application start or in use procedure.Such as, fail-safe software shields the GPS information that this application obtains system, or user is in the bad environment of gps signal, and application all will be caused normally cannot to obtain GPS information.
Step 402: reading system configuration information, judges whether the geographical location information obtaining user according to IP address.If so, enter step 403, if not, enter step 406.
Common, the geographical location information that the geographical location information that obtains obtains than other modes (such as according to physical address parameter) is inquired about more accurate according to IP address argument, but often will use the data of third-party application according to IP address acquisition geographical location information, cost is higher.Therefore, whether system can according to allowing the actual conditions of accessing third-party application to arrange the mode whether adopting IP address.
Step 403: the IP address obtaining user.
Concrete, can be that to obtain mobile network use by user mobile terminal to distribute IP address argument, such as, the IP address of user is: 49.65.125.8.
Step 404: the IP address argument in accessing database and the mapping table between geographical location information, thus obtain user's geographical location information corresponding to IP address.
Preferential, the mapping table between the IP address argument provided in access third-party application database and geographical location information.If also there is this mapping table in application local data base, then can mapping table directly in access local database between IP address argument and geographical location information.
Such as, following table 1 is an example of the mapping table of IP address and geographical location information.
The mapping table of table 1IP address and geographical location information
IP address according to user is: 49.65.125.8, gets corresponding user's geographical location information to be: longitude is east longitude 118 ° 22 ", latitude is north latitude 31 ° 14 ".Common, also can provide physical address information corresponding to IP address in this mapping table, such as Shenzhen.
Step 405: this step is optional step, shows the mode of current acquisition user geographical location information to described user.
Such as, adopt the bullet window mode or wicket displaying reminder message that only stop a few second, the particular content reminded is such as: " the current IP address acquisition by you is Shenzhen to your position, please open the place of GPS switch or gps signal of moving one's steps, to provide better service ".
Step 406: judge whether user registers, if so, enter step 407, if not, enter step 411.
Step 407: judge whether user fill in station address when registering, and if so, enters step 408, if not, enters step 411.
Step 408: obtain the station address filled in when user registers, described station address is the physical address parameter of user.
This station address is a real physical metropolitan parameter, such as, and Nanjing, Shenzhen or sakata district of Shenzhen.
Step 409: the physical address in accessing database and the mapping table between geographical location information, thus obtain user's geographical location information corresponding to user's physical address.
Common, the mapping table between physical address parameter and geographical location information can be provided in the local data base of application.Such as, following table 2 is examples for the mapping table of physical address and geographical location information.
The mapping table of table 2 physical address and geographical location information
The physical address filled in when registering according to user is as Shenzhen, and getting corresponding user's geographical location information is: longitude is east longitude 114 degree 07 point, latitude is north latitude 22 degree 33 points.
Step 410: this step is optional step, shows the mode of current acquisition user geographical location information to described user.
Such as, adopt the bullet window mode or wicket displaying reminder message that only stop a few second, remind particular content such as: " you are current uses registered address Shenzhen, please open the place of GPS switch or gps signal of moving one's steps, to provide better service ".
Step 411: the default address obtaining system.
Common, system can non-anonymous login user or registration time do not have the user of Input Address information to distribute a default address.
Step 412: the physical address in accessing database and the mapping table between geographical location information, thus obtain user's geographical location information corresponding to default address.
The specific implementation refer step 409 of this step.
Step 413: this step is optional step, shows the mode of current acquisition user geographical location information to described user.
Such as, adopt the bullet window mode or wicket displaying reminder message that only stop a few second, remind particular content such as: " you are current uses default address Shenzhen, please open the place of GPS switch or gps signal of moving one's steps, to provide better service ".
Be different from prior art, the method for acquisition user geographical location information of the present invention, when determining to obtain global position system GPS information, obtain the address parameter of user; Address parameter according to described user obtains user's geographical location information; Thus can when GPS information cannot be obtained, still can the substantially available user's geographical location information of automatic acquisition, avoid the operating process interrupting user in application use procedure, decrease the operation complexity of user, promote Consumer's Experience.
The foregoing is only embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every utilize specification of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.