如何正确地对GSM蜂窝塔进行三角测量以获取位置? [英] How to properly triangulate GSM cell towers to get a location?

查看:319
本文介绍了如何正确地对GSM蜂窝塔进行三角测量以获取位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我试图在c#(.net 4)中完成所有这些灾难,所以如果你想出一些代码来帮助我,那将是值得赞赏的,但真正的任何事情在这一点上都会有所帮助。



我有一种设备只能获取GSM Cell信息(顺便通过 AT + KCELL 命令)我有一些关于手机信号塔(每个都有LAC,MCC,MNC,手机ID,信号强度和第一个时间提前量)的值。因此,我认为我是一个能够提出某种经纬度坐标的好地方(虽然不准确,但是,好吧)。这是我寻求帮助的地方,因为现在我的小脑子很困惑......

我可以看到提供单元代码解析的各种服务(Google,Open Cell ID等),他们把LAC,MCC等作为参数并返回一个坐标。因此,我认为他们返回的将是我通过的塔的坐标。所以在我的情况下,我可以发送我拥有的所有LAC等,并获得经度和纬度的集合。辉煌,但那不是我的设备所在。现在我想我需要做一些三角测量,而这正是我缺乏知识会伤害到我的地方。



我到目前为止对吗?假设我是,我该如何执行这个计算(有没有什么东西可以告诉我如何处理所有这些数字,或者更好的是,我可以引用一些开源库,并将所有这些东西加入到以获得某些明智的东西)我假设我需要使用时间提前量来计算出一个距离手机信号塔的近似距离(可能以某种方式使用信号强度),但是做什么呢?我要做?正如你所看到的 - 我在这里深深地感受到了一切!



例如,我可能会从前面提到的AT命令中获得回复:

  5,74,33,32 f210,157e,8101,50,0,79,3,32 f210,157e,80f7,37,64,5 ,32f210,157e,810b,37,55,32,32f210,157e,9d3,27,41,33,32f210,157e,edf8,15 

打破它并解析它我会得到(我希望我解析这个权利 - 当然有一个错误在我的解析例程中,但它看起来很合理): p>

 单元格数量:5 

单元格1

  LAC:5502 
MNC:1
MCC:232
手机号码:33025
信号:80
ARFCN:74
BSIC:33
时间提前:0
经度:14.2565389
Latitude:48.2248439

单元格2

  LAC:5502 
MNC:1
MCC:232
手机ID:33015
信号: 55
ARFCN:79
BSIC:3
经度:14.2637736
纬度:48.2331576

单元格3

  LAC:5502 
MNC:1
MCC:232
手机ID:33035
信号:55
ARFCN:64
BSIC:5
经度:14.2488966
纬度:48.232513

单元格4

  LAC:5502 
MNC:1
MCC:232
手机号码:2515
信号:39
ARFCN:55
BSIC:32
经度:14.2488163
Latitude:48.2277972

单元格5

  LAC:5502 
MNC:1
MCC:232
手机号码:60920
信号:21
ARFCN:41
BSIC:33
经度:14.2647612
纬度:48.2299558

所以,所有这些信息,我如何以最准确的方式找到我真正在哪里?

解决方案

我可以用一点理论来帮助你。

三角形基本上找到3个圆的交点。

每个移动塔都是一个圆的中心。圆的大小与该塔的信号强度有关。



3个圆圈重叠的地方就是用户的位置。



你可以做一些非常基本的三角测量,如下所示:

 
3
tx1,ty1
tx2,ty2
tx3,ty3

有信号强度s1,s2,s3

我们计算每个信号的权重。基本上,对于每个塔的0到1的数字,权重之和总和为1.

加权信号w1,w2,w3其中:
w1 = s1 /(s1 + s2 + s3)
w2 = s2 /(s1 + s2 + s3)
w3 = s3 /(s1 + s2 + s3)


用户将在
x:(w1 * tx1 + w2 * tx2 + w3 * tx3)
y:(w1 * ty1 + w2 * ty2 + w3 * ty3)

以下是使用您问题中的值的示例:

 

s1 = 80
s2 = 55
s3 = 55
s4 = 55
s5 = 21

w1 = 80 /(80 + 55 + 55 + 55 + 21 )
w2 = 55 /(80 + 55 + 55 + 55 + 21)
w3 = 55 /(80 + 55 + 55 + 55 + 21)
w4 = 55 /(80 + 55 + 55 + 55 + 21)
w5 = 21 /(80 + 55 + 55 + 55 + 21)

w1 = 0.3007519
w2 = 0.2067669
w3 = 0.2067669
w4 = 0.2067669
w5 = 0.0789474

1.经度:14.2565389
1.纬度:48.2248439

2.经度: 14.2637736
2.纬度:48.2331576

3.经度:14.24 88966
3.纬度:48.232513

4.经度:14.2488163
4.纬度:48.2277972


5.经度:14.2647612
5.纬度:48.2299558


位置经度=
14.2565389 * 0.3007519 +
14.2637736 * 0.2067669 +
14.2488966 * 0.2067669 +
14.2488163 * 0.2067669 +
14.2647612 * 0.0789474

位置纬度:=
48.2248439 * 0.3007519 +
48.2331576 * 0.2067669 +
48.232513 * 0.2067669 +
48.2277972 * 0.2067669 +
48.2299558 * 0.0789474

结果经度:14.255507
结果纬度:48.2291628


First of all, I am trying to do all this disaster in c# (.net 4) so if you come up with some code to help me that would be appreciated but really anything would help at this point.

I have a situation where I have a device that can only get GSM Cell information (incidentally via the AT+KCELL command) so I have a collection of values about cell towers (each has LAC, MCC, MNC, Cell ID, Signal Strength and the first Timing Advance). I think, therefore, I am in a good place to be able to come up with some sort of longitude and latitude coordinate (albeit inaccurate, but, well meh). This is where I am reaching out for help because now my little brain is confused...

I can see various services that provide cell code resolution (Google, Open Cell ID, etc) and they take LAC,MCC etc as arguments and return a coordinate. I figure that what they return would, therefore, be the coordinate of the given tower I pass in. So in my case I could send off all the LACs etc that I have and get back a collection of longitude and latitudes. Brilliant, but that is not where my device is. Now I think I need to do some kind of triangulation and this is where my lack of knowledge is hurting me.

So am I right so far? Assuming I am, how do I perform this calculation (is there something out there that will tell me what to do with all these numbers or, even better, some open source library I can reference and feed all this stuff into to get something sensible)?

I'm assuming that I would need to use the timing advance to work out some approximate distance from a cell tower (maybe using the signal strength somehow) but what do I have to do? As you can tell - I am way out of my depth here!

For example, this is something I might get back from the aforementioned AT command:

5,74,33,32f210,157e,8101,50,0,79,3,32f210,157e,80f7,37,64,5,32f210,157e,810b,37,55,32,32f210,157e,9d3,27,41,33,32f210,157e,edf8,15

breaking it up and parsing it I would get (I hope I parse this right - there is a chance there is a bug in my parsing routine of course but it looks reasonable):

Number of cells: 5

Cell 1

LAC: 5502
MNC: 1
MCC: 232
Cell ID: 33025
Signal: 80
ARFCN: 74
BSIC: 33
Timing advance: 0
Longitude: 14.2565389
Latitude: 48.2248439

Cell 2

LAC: 5502
MNC: 1
MCC: 232
Cell ID: 33015
Signal: 55
ARFCN: 79
BSIC: 3
Longitude: 14.2637736
Latitude: 48.2331576

Cell 3

LAC: 5502
MNC: 1
MCC: 232
Cell ID: 33035
Signal: 55
ARFCN: 64
BSIC: 5
Longitude: 14.2488966
Latitude: 48.232513

Cell 4

LAC: 5502
MNC: 1
MCC: 232
Cell ID: 2515
Signal: 39
ARFCN: 55
BSIC: 32
Longitude: 14.2488163
Latitude: 48.2277972

Cell 5

LAC: 5502
MNC: 1
MCC: 232
Cell ID: 60920
Signal: 21
ARFCN: 41
BSIC: 33
Longitude: 14.2647612
Latitude: 48.2299558

So with all that information how do I find, in the most accurate way, where I actually am?

解决方案

I can help you with a bit of the theory.

Triangulation is basically finding the intersection point of 3 circles.

Each mobile tower is the center of a circle. The size of the circle is relative to the signal strength of that tower.

The place where the 3 circles overlap is where the user is.

You can do some very basic triangulation as follows:

3 Towers at 
 tx1,ty1 
 tx2,ty2 
 tx3,ty3

With signal strengths s1, s2, s3

We calculate the weight of each signal. Essentially a number from 0 to 1 for each tower where the sum of the weights adds up to 1.

Weighted signal w1, w2, w3 where:
 w1 = s1/(s1+s2+s3)
 w2 = s2/(s1+s2+s3)
 w3 = s3/(s1+s2+s3)


User will be at
x: (w1 * tx1 + w2 * tx2+ w3 * tx3)
y: (w1 * ty1 + w2 * ty2+ w3 * ty3)

Here is a working example using the values from your question:


s1 = 80
s2 = 55
s3 = 55
s4 = 55
s5 = 21

w1 = 80 / ( 80 + 55 + 55 + 55 + 21 ) 
w2 = 55 / ( 80 + 55 + 55 + 55 + 21 ) 
w3 = 55 / ( 80 + 55 + 55 + 55 + 21 ) 
w4 = 55 / ( 80 + 55 + 55 + 55 + 21 ) 
w5 = 21 / ( 80 + 55 + 55 + 55 + 21 ) 

w1 = 0.3007519
w2 = 0.2067669
w3 = 0.2067669
w4 = 0.2067669
w5 = 0.0789474

1. Longitude: 14.2565389
1. Latitude: 48.2248439

2. Longitude: 14.2637736
2. Latitude: 48.2331576

3. Longitude: 14.2488966
3. Latitude: 48.232513

4. Longitude: 14.2488163
4. Latitude: 48.2277972


5. Longitude: 14.2647612
5. Latitude: 48.2299558


Location Longitude = 
 14.2565389 * 0.3007519 + 
 14.2637736 * 0.2067669 + 
 14.2488966 * 0.2067669 +
 14.2488163 * 0.2067669 +
 14.2647612 * 0.0789474

Location Latitude: = 
 48.2248439 * 0.3007519 + 
 48.2331576 * 0.2067669 + 
 48.232513 * 0.2067669 +
 48.2277972 * 0.2067669 +
 48.2299558 * 0.0789474

Result Longitude: 14.255507
Result Latitude: 48.2291628

这篇关于如何正确地对GSM蜂窝塔进行三角测量以获取位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆