如何根据IP地址和端口号将数据路由到我的数据库? [英] how to route data in to my database based on IP Address and port number?

查看:545
本文介绍了如何根据IP地址和端口号将数据路由到我的数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的项目是GPS车辆跟踪系统,在这个项目中我必须从设备获取数据(即纬度和经度),它(GPS设备)通过ip地址发送数据端口号到服务器,所以我怀疑我如何将数据路由到我的数据库&特别表?

例如:服务器IP:122.178.137.22

服务器包含一些数据库,

我的数据库名称为GPSAPP,它包含表格是GPSApi_Table,

和GPS设备将数据发送到SERVER IP(122.178.137.22),数据如下:

 imei:< span class =code-digit> 353451044508750 , 001  0809231929  ,, F,  055403  000 ,A, 2233  1870 ,N, 11354  3067 , E, 0  00  ,,; 



即设备只能向ip地址发送数据





我的问题是以上数据必须是路由(存入GPSAPP数据库和GPSApi_Table)



我该怎么办?

解决方
这真的取决于GPS数据是如何存储在服务器上,你的选择是去这些数据。如果它是纯文本并且数据可以在您能够通过例如cifs共享执行ETL的服务器上访问,则可以通过执行以下操作来加载数据:



  BULK   INSERT  dbo.GPSApi_Table 
FROM ' some_location / gpsdata'
WITH

FIELDTERMINATOR = ' ,'
ROWTERMINATOR = ' \ n'
);





该表必须反映您提取的数据。否则,在将数据加载到sql server之前,需要进行一些转换。当然也欢迎一些验证。



我的建议是看看SSIS来帮助你建立ETL。在您构建并测试它之后,您可以在SQL Server中安排它在生产中定期运行。



希望这可以帮助您



Harold


Hello ,
My project is GPS vehicle tracking system,in this project i have to fetch data(i.e latitude and longitude) from device , it(GPS device) sends the data through ip address with port number to server, so my doubt is how can i route that data into my database & particular table?
Ex: SERVER IP:122.178.137.22
server contains some databases,
My data base name GPSAPP, it contains table which is GPSApi_Table,
and GPS device sends data to SERVER IP(122.178.137.22) the data as follow as ..

imei:353451044508750,001,0809231929,,F,055403.000,A,2233.1870,N,11354.3067,E,0.00,,;


i.e device can send data to ip address only



my porblem is above data has to be route(store into GPSAPP database& GPSApi_Table)

how can i do it?

解决方案

It really depends on how the GPS data is stored on the server and what your options are to get to that data. If it is in plain text and the data is accessible on the server where you are able to execute the ETL through for example a cifs share you could load the data by doing a something like:

BULK INSERT dbo.GPSApi_Table
   FROM 'some_location/gpsdata'
   WITH 
      (
         FIELDTERMINATOR =',',
         ROWTERMINATOR =' \n'
      );



The table has to reflect the data you extract. Otherwise you need to do some transformations before you load the data in to sql server. Some validations would be welcome as well of course.

My suggestion would be to take a look at SSIS to help you build the ETL. After you build and tested it you can then schedule it in SQL Server to run periodically in production.

Hope this helps you

Harold


这篇关于如何根据IP地址和端口号将数据路由到我的数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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