无GPS的情况下实现定位的原理
说起定位,我们第一想到的便是GPS,无论你在哪里,只要能正常接收GPS信号,你就能知道你的位置,但GPS信号可相当不稳定,我是说在室内,或者在大街上,有高楼挡住的那种大街。但我发现许多手机即便在室内也能很精确地定位,我甚至做过试验,把GPS关了,定位依然可以!这到底是什么原理?
我考虑过这个问题,大概是我们使用了WIFI,而电信公司拥有几乎每个WIFI无线路由器的实际地址,所以根据我们的IP地址,就能大概知道位置。但自己又觉得好像不完全是这样……
终于今天发觉了这段文字,这是我在一本书上摘录下来的,很好地解答了这个疑问。
How The Mac knows where you are
OK, I’ll bite. To set my time zone automatically, the Mac has to know where I am. It doesn’t have GPS. So how does it do that?
Metropolitan areas today are blanketed by overlapping WiFi signals. At a typical Manhattan intersection, you might be in range of 20 base stations. Each one broadcasts its own name and unique network address (its MAC address—nothing to do with Mac computers) once every second. Although you’d need to be within 150 feet or so to actually get onto the Internet, a laptop or phone can detect this beacon signal from up to 1,500 feet away.
A company called Skyhook had a huge idea: Suppose you could correlate all those beacon signals with their physical locations. Why, you’d be able to simulate GPS—without the GPS!
And so, since 2004, 500 full-time Skyhook employees have been driving every road, lane, and highway in major cities around the world, measuring all those WiFi signals, noting their network addresses and locations. (Neither these vans nor the Mac ever has to connect to these base stations. They’re just reading the one-way beacon signals.)
So far, Skyhook’s database knows 50 million hot spots—and the precise longitude and latitude of each. The company licenses this information to companies, like Apple, that want to build location services into their gadgets.
To figure out where it is, the Mac sniffs around for WiFi base stations. If it finds any, it transmits their IDs back to Skyhook, which looks up those network addresses—and sends coordinates back to the Mac over the Internet.
That accuracy is good only to within 100 feet at best, and of course the Skyhook system fails completely once you’re out of populated areas—or whenever your Mac doesn’t have WiFi or an Internet connection. On the other hand, it works fast, and it works indoors, which GPS definitely doesn’t.
此段文字大致意思是说,有家叫Skyhook的公司(中文叫“天钩”?)雇佣了一大帮人到全世界各大城市各大角落去搜集那里的WIFI信号,WIFI无线路由器的位置是相对固定的,一个打开了WIFI的设备在一个城市的角落往往能接收到多个WIFI信号(不一定要都连接上无线路由器)根据这些信号的特性(包括信号强弱),就能得知设备距离各个基站(无线路由器)的大概距离,再到Skyhook的巨大的数据库去搜索相关数据,经过一番运算,就能得知当前设备的位置,所以虽然GPS没开,只要打开了WIFI,并且能连接互联网,你就能知道你的位置。当然了,很多地方的WIFI信号还没被搜集,有些地方根本没有WIFI,所以这种技术并非万能。