1 / 20

Processing Data

Processing Data. Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu http://www.csee.usf.edu/~labrador. Outline. Mobile Device-side Processing Server-side Processing. Mobile Device-side Processing. The Critical Point Algorithm.

hedy
Télécharger la présentation

Processing Data

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Processing Data Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu http://www.csee.usf.edu/~labrador

  2. Outline • Mobile Device-side Processing • Server-side Processing

  3. Mobile Device-side Processing • The Critical Point Algorithm

  4. Distance-Based Critical Point Algorithm (DB-CPA) • First fix is marked as critical and sent to server • Distance from every valid coordinate to the last critical point is calculated • If the distance is greater than some distance threshold, then the last valid coordinate is marked as critical and sent to the server • If the distance is less than the threshold then the algorithm compares the Horizontal Dilution of Precision (HDOP) values of the last critical point and the last valid point • A lower HDOP value means better precision, therefore, if the last valid coordinate has a lower HDOP than the last critical, then the last valid coordinate is marked as critical point • If neither of the two conditions described above marks the last valid coordinate as critical, then the elapsed time from the last critical point to this last valid coordinate is calculated. If the elapsed time is greater than a time threshold, then the last valid coordinate is marked as critical

  5. Distance-Based Critical Point Algorithm (DB-CPA) • The thresholds play an important role in the algorithm • If the distance threshold is set too high, then many details of the path traversed by a field client will not be sent to the server • If the distance threshold is set too low, then many coordinates will be sent, incrementing the network and server processing overhead • In our current implementation, the distance threshold is set to 20 meters • This means that the field client will send a location update every second only if it is moving at a rate faster than 20 m/s (72 Km/h) • Also in our current implementation, we have kept the time threshold to 30 seconds • These two values can be easily changed to any other value that will make better sense and provide better performance to the system according to the tracking application.

  6. Distance-Based Critical Point Algorithm (DB-CPA)

  7. Short Trip – All Points

  8. Short Trip – Critical Points Only

  9. Long Trip – All Points

  10. Long Trip – Critical Points Only

  11. Distance Based Critical Point Algorithm(DB CPA)

  12. Server-side Processing • Many possibilities, as server has current and historical data • Entire picture of the application and users • Path prediction algorithm based on current data and past behavior • Finding friends, restaurants, etc. • Geo-fencing • Geo-sensing • Geo-advertisement based on user profile • Situational awareness • Traffic alert and emergency notifications • Etc.

  13. Situational Awareness • Wireless sensor network with intrusion detection capabilities integrated into the LBIS • Upon an intrusion detection, the WSN takes a picture and sends a message to the LBIS server • The LBIS server notifies the control station sending a message that also includes the picture • The LBIS server checks if there is any users within a radius of 100 meters from the WSN, and if so, it sends a message with picture to each of those users • Needs to track each user and calculate distances from each user to the location of the WSN

  14. Situational Awareness

  15. Intrusion in Main Control Station

  16. View in Field Client Device

  17. Calculating the Distance Between Two Users • In order to send notifications, the server needs to calculate the distance between the WSN and the individual active users • If distance is less than threshold (100 meters), then server sends a notification message to the user • Otherwise, the user is not notified • PostGIS has functions that make those calculations for you • ST_distance_spherereturns minimum distance in meters between two lon/lat geometries • This function currently does not look at the SRID of a geometry and will always assume its in WGS 84

  18. Calculating Closest Distance to a Point double distance = Double.MAX_VALUE; TrackingUpdatetheClosestOne = new TrackingUpdate();   try     {     try{ javax.naming.InitialContextic  = new javax.naming.InitialContext(); javax.sql.DataSourcedataSource = (javax.sql.DataSource)ic.lookup("jdbc/lbsbook");        Connection theConnection = dataSource.getConnection();        double latitude = Double.parseDouble(request.getParameter("lat"));        double longitude = Double.parseDouble(request.getParameter("lng")); PreparedStatementqueryStatement = theConnection.prepareStatement("select fieldsession.sessionid as sesid, fielduser.username as uname, ST_AsText(tracking.position) as pos, ST_distance_sphere(tracking.position, ST_GeomFromText('POINT(? ?)', 32661)) as distance"+“ from fieldsession, tracking,fielduser, select max(idtracking) as idtrack"+"from fieldsession, tracking"+"where fieldsession.datestop is NULL and fieldsession.sessionid = tracking.sessionid“+"group by fieldsession.sessionid) as s2“+"where fieldsession.datestop is NULL and“+"fieldsession.sessionid = tracking.sessionid and“+"tracking.idtracking = s2.idtrack and“+"fieldsession.iduser = fielduser.iduser”);

  19. Calculating ClosestDistance to a Point queryStatement.setDouble(1, longitude); queryStatement.setDouble(2, latitude); ResultSetrs = queryStatement.executeQuery();                     double d_temp = 0.0;                     while(rs.next())                     { d_temp = rs.getDouble("distance");                         if(d_temp < distance)                         { theClosestOne.setSessionid(rs.getInt("sesid")); theClosestOne.setUsername(rs.getString("uname"));                             Point theNewPoint = new Point(rs.getString("pos")); theClosestOne.setLongitude(theNewPoint.getX()); theClosestOne.setLatitude(theNewPoint.getY()); distance = d_temp;                         }                     }                     String theReturnString = "<"; theReturnString = theReturnString + ";“ +theClosestOne.getUsername()+";"+theClosestOne.getsessionId()+";“ +theClosestOne.getLongitude()+";"+theClosestOne.getLatitude()+">"; out.write(theReturnString);               }

  20. Calculating Closest Distance to a Point               catch (NamingException ex){ Logger.getLogger(DevicerServiceManagerImpl.class.getName()).log(Level.SEVERE, null, ex);               }               catch (SQLException ex){ Logger.getLogger(DevicerServiceManagerImpl.class.getName()).log(Level.SEVERE, null, ex);               }         }         finally         { out.close();         }

More Related