如何从GPS获取数据并发送到服务器,以及如何保存到数据库 [英] How to get data from GPS and send to server and how save to database

查看:570
本文介绍了如何从GPS获取数据并发送到服务器,以及如何保存到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个带有PHP的网页,数据可以从数据库中读取,包括lat,long,speed和它在地图上显示数据。我有一个MVT380跟踪器,我可以设置IP和端口,所以通过GPRS的数据可以发送到这些IP和端口。

I designed a web page with PHP, the data can be read from database including lat, long, speed and it displays the data on a map. I have a MVT380 tracker that I can set IP and port on, so the data through GPRS can be sent to these IP and port.

问题是如何读取数据并将其保存在数据库中(是否有任何特殊的硬件可以读取发送的数据到这些IP和端口并保存到数据库?或者我们应该设计一个网页,可以通过GET / POST协议读取数据并将其保存数据库?)。有没有其他方法?

The problem is how to read the data and save it in database (is there any special hardware that can read the sent data to these IP and port and save it to database? or should we design a web page that can read the data through GET/POST protocol and save it to database?). Is there any other way?

推荐答案

我有同样的问题:如何使用php从设备接收GPS数据?

经过一些努力之后,这是我得到的:

After a little struggle this is what I got:

对于将TCP / UDP数据发送到IP地址和端口的GPS跟踪设备,我们真的需要一个服务器。将没有POST / GET数据。服务器将通过需要解码的端口接收数据。 即使没有Java的任何知识,我也可以安装一个软件,并根据我的喜好操作它。

For a gps tracker device that sends TCP/UDP data to an ip address and port we really need a server. There will be no POST/GET data. The server will receive data through a port that needs to be decoded. But it was not as complicated as I thought. Even without any knowledge of Java I was able to install a software and manipulate it to my liking.

我做了什么:

有一个Windows服务器(2012)托管(6个月免费),所以我可以试试。
下载opengts并严格遵循其使用手册。并没有发现它很难。它工作没有多少头痛
一旦我得到了一切正在工作的部分,我可以玩设备,它是工作正常。当然,我们需要知道设备发送和解码的协议(数据),以便它可以保存在数据库中。

Got a windows server (2012) hosting (6 months for free) so I could try it out. Downloaded opengts and followed their instruction manual exactly. And did not find it hard at all. It worked without having much headache Once I got to the part where everything was working I could play around with the device and it was working fine. Ofcourse we need to know the protocol (the data) that the device is sending and decode so it can be saved in the database.

这篇关于如何从GPS获取数据并发送到服务器,以及如何保存到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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