Specific embodiment
For the ease of the understanding of those skilled in the art, the invention will be further described.
A kind of embodiment according to the invention, the method that progress information processing between a kind of server and client side is provided,
This method comprises the following steps:
Mobile terminal timing acquisition to periphery WIFI signal emission source MAC Address, and by MAC Address and mobile terminal
Device id is uploaded onto the server.
Wherein the mobile terminal can be mobile phone, PAD or other tablet computers.First by the WIFI moulds on the mobile terminal
Block is set on state, is attached with the WIFI signal of surrounding, then the MAC of timing acquisition to WIFI signal emission source
Location, and the device id of the MAC Address and mobile terminal is uploaded onto the server.
Wherein, server storage has the mapping relations of the MAC Address of WIFI signal emission source, MAC Address and GeoHash,
The mapping relations of the mapping relations of GeoHash and fence, device id and online message push channel;
The GeoHash is that the unique string of identified geographic grid encodes, and the geographic grid includes geographic warp
The longitude and latitude of two dimension can be weaved into one-dimensional character string by degree and latitude scope, GeoHash;The fence is to include one
Or the virtual geographic range of multiple adjacent or non-conterminous GeoHash;The device id is to be generated according to device hardware information
Unique device identification is generated uniquely by server and is saved in the terminal iidentification of mobile terminal;
After server receives the MAC Address and device id of mobile terminal transmission, into database to the WIFI signal
The MAC Address of emission source is matched.
The database pre-sets or the MAC Address according to mobile terminal timing acquisition and sets
Standby ID is uploaded and is carried out preserving formation.Server has prestored the MAC of all detectable WIFI signal emission sources in the database
The geography information of address.
If MAC Address successful match, according to the MAC Address and the mapping relations of GeoHash stored in server,
Corresponding GeoHash information is quickly calculated by cache.
According to the GeoHash information and the mapping relations of fence stored in server, fence information is obtained.
Then judge location status of the mobile terminal in fence, and enclosed according to the mobile terminal in electronics
The location status on column, to the mobile terminal PUSH message.
Following steps are specifically included to the mobile terminal PUSH message:
According to preset geographic range, location status of the mobile terminal in fence is cached.
The location status includes:Into state, hold mode and leave state.In default geographic range, the shifting
Whether dynamic terminal scanning connects according to user to after WIFI wireless signals, confirms whether the mobile terminal enters the wireless network,
It is also held in the default geographic range with still having left this scope to enclose, be cached.
According to location status of the mobile terminal in fence, in preset geographic range, phase is triggered
The virtual events answered, the virtual events include:Entry event, holding event and leave event.
According to the virtual events, trigger corresponding message and currently existed according to the device id lookup mobile terminal
The message push channel of line, and message is pushed to by mobile terminal by long interface channel.
Further, before location status of the mobile terminal in fence is judged, the server needs
The fence information of pre-set fixed range.
The fence includes a certain range of physical geographic location set.
The fence is the collection of the virtual geographic range comprising one or more adjacent or non-conterminous GeoHash
It closes.
Further, the MAC Address for the WIFI signal emission source that the server is uploaded according to mobile terminal timing,
Location status of the mobile terminal in fence is updated;It needs to consider to set in mobile terminal for leaving event
It is standby (such as upload information in the case of) occur under abnormal conditions, by timeout mechanism judge equipment whether occurred from
Open event.
Further, according to the type quick indexing of the virtual events and/or the corresponding message of filtering.
Further, the step of mobile terminal receives PUSH message is further included:
The mobile terminal is according to the PUSH message content received, displaying notice or startup application program.
Current most of mobile terminal is provided with WIFI module and/or bluetooth module, therefore utilizes WIFI module
And/or the wireless signal that bluetooth module is sent identifies mobile terminal, is a kind of to facilitate feasible scheme.
Another embodiment according to the invention provides a kind of server for real-time detection mobile terminal geographical location,
Including:
Information receiving module:For receiving the MAC Address and device id of the WIFI signal emission source of mobile terminal transmission.
Address matching module:For being matched into database to the MAC Address of WIFI signal emission source, and judge
MAC Address whether successful match.
Data obtaining module:For according to the MAC Address and the mapping relations of GeoHash stored in server, obtaining
Obtain GeoHash information;And according to the GeoHash and the mapping relations of fence stored in server, obtain fence
Information.
Position judging module:For judging location status of the mobile terminal in fence, the location status
Including:Into state, hold mode and leave state.
Information cache module:For according to preset geographic range, to the mobile terminal in fence
Location status is cached.
Event trigger module:For the location status according to the mobile terminal in fence, preset
In geographic range, corresponding virtual events are triggered, the virtual events include:Entry event, holding event and leave event.
Info push module:For according to the virtual events, triggering corresponding message and searching institute according to device id
The current online message push channel of mobile terminal is stated, and message is pushed to by mobile terminal by long interface channel.
Another embodiment according to the invention provides a kind of system in real-time detection mobile terminal geographical location, including:Institute
State server and mobile terminal, the MAC Address of the mobile terminal timing acquisition to periphery WIFI signal emission source, and by MAC
The device id of address and mobile terminal is uploaded onto the server.
The foregoing describe many details in order to fully understand the present invention.But above description be only the present invention compared with
Good embodiment, the invention can be embodied in many other ways as described herein, therefore the present invention is from public above
The limitation for the specific implementation opened.Any those skilled in the art are not departing from technical solution of the present invention ambit simultaneously
Under, all using foregoing description disclose methods and technical content technical solution of the present invention is made it is many it is possible variation and/or
Modification.Therefore, all contents without departing from technical solution of the present invention, technical spirit according to the invention is to made for any of the above embodiments
Any simple modifications, equivalents, and modifications still fall within the scope of technical solution of the present invention protection.