locked
GPS Tracking System - Advice needed RRS feed

  • Question

  • User1652955864 posted

    Hi to all

    I am going to develop a GPS tracking system which basically receives data from GPS device via GPRS store them in database show them for the real time monitoring and generate the reports.

    What I need now is some advice in:

    1. The data are transmited via GPRS connection over TCP. There are over 1000 units that sends data once per second. What is the best way to handle those data (receive, phrase, store in SQL, and show them in real time)? (really need clear advice here!)

    2. Can this system be done with Web Forms, Ajax, and SQL 2008 R2? If not what is proposed?

     

    Thank you in advance

    Armend

    Thursday, October 11, 2012 5:22 PM

Answers

  • User-1528094326 posted

    The best thing you can do since its just regular packets coming over TCP is use as little overhead as possible. A Windows Service lends itself completely to this, and you can use the TcpListener object in the System.Net.Sockets namespace to capture all the incoming data.

    The windows service will be able to handle anything you want extremely fast.

    After your backend is completed with that, you can create your front end with whatever tech you want.

    1) Best way is to use the TcpListener and capture the data using a Windows Service

    2) Capturing cannot be done via Ajax or Web Forms, but you can use the Windows Service to store information into SQL Server or some type of intermediate respository for viewing. You can VIEW the data with any standard web tech you want, but capturing will require some low level code like Sockets and the TcpListener in order to get the quality you want.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 11, 2012 6:59 PM
  • User-1528094326 posted

    Having the windows service communicate directly with the viewing mechanism generally isn't supported and you would need to use some type of interop in order to make it work anyway. Not only is it harder to do, but it can also hinder the service performance. Much easier to just let the service collect info and dump it into a database or some other medium.

    In my experience an sql database works perfect for this. That way you have the service operating normally and just inserting data to the database, and the database is taking all the pain of having to read and write at the same time from the View and from the Service.

    The most simple way to display the data that refreshes every second is going to be using AJAX. It's very light and requires little effort.

    There are essentially two common ways to set that up:

    1) Use an <asp:Timer> ajax control and have it Tick every second and query the data and return it to the controls inside of an update panel.

    2) Another idea that is probably a bit lighter, and more client friendly is to create a regular asp.net web service that queries the database or other medium you are storing the data into. Then use the <asp:ScriptManager> and regular javascript functions to query the data every second. Javascripts SetInterval(1000) works best for this as a super light timer, instead of using SetTimeout(1000) and resetting the timeout later.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 12, 2012 4:27 PM

All replies

  • User-1528094326 posted

    The best thing you can do since its just regular packets coming over TCP is use as little overhead as possible. A Windows Service lends itself completely to this, and you can use the TcpListener object in the System.Net.Sockets namespace to capture all the incoming data.

    The windows service will be able to handle anything you want extremely fast.

    After your backend is completed with that, you can create your front end with whatever tech you want.

    1) Best way is to use the TcpListener and capture the data using a Windows Service

    2) Capturing cannot be done via Ajax or Web Forms, but you can use the Windows Service to store information into SQL Server or some type of intermediate respository for viewing. You can VIEW the data with any standard web tech you want, but capturing will require some low level code like Sockets and the TcpListener in order to get the quality you want.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 11, 2012 6:59 PM
  • User1652955864 posted
    I thank you very much sir, using windows services and tcp socket i have no problem and it was in my mind too, after your opinion ok definatley i will go for it. As for me the bigest challange now is how to display the information in realtime using webforms and ajax only, but without refreshing the page or even a part of it every second. So Shall i store the data to sql direct from WS TCP socket and then from SQL to webforms for live view? Or Is there a way to grab the data from WS to webform in real time Hope you understant what i mean the fastest & easiest way to display the data in realtime??? Help please, it is highly approciated. RGDS Armend
    Friday, October 12, 2012 4:18 PM
  • User-1528094326 posted

    Having the windows service communicate directly with the viewing mechanism generally isn't supported and you would need to use some type of interop in order to make it work anyway. Not only is it harder to do, but it can also hinder the service performance. Much easier to just let the service collect info and dump it into a database or some other medium.

    In my experience an sql database works perfect for this. That way you have the service operating normally and just inserting data to the database, and the database is taking all the pain of having to read and write at the same time from the View and from the Service.

    The most simple way to display the data that refreshes every second is going to be using AJAX. It's very light and requires little effort.

    There are essentially two common ways to set that up:

    1) Use an <asp:Timer> ajax control and have it Tick every second and query the data and return it to the controls inside of an update panel.

    2) Another idea that is probably a bit lighter, and more client friendly is to create a regular asp.net web service that queries the database or other medium you are storing the data into. Then use the <asp:ScriptManager> and regular javascript functions to query the data every second. Javascripts SetInterval(1000) works best for this as a super light timer, instead of using SetTimeout(1000) and resetting the timeout later.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 12, 2012 4:27 PM
  • User1652955864 posted
    Sir i thank you again for your commitement to advice. Any way if you know any link of any video or tutorial on the second approach by using java script to handle dataview will be helpfull to me. Rgds armend
    Saturday, October 13, 2012 11:40 AM
  • User-1528094326 posted

    I don't know of any videos but you can search youtube. Here is a quick link though that shows how to assign a web service in the ScriptManager, and then you can call it using javascript.

    http://www.codedigest.com/Articles/ASPNET/387_Asynchronous_Access_To_WebServices_using_ScriptManager_in_AspNet_Ajax.aspx

    Monday, October 15, 2012 4:03 PM