Skip to content

The source code for the paper "TrajEdge: An Efficient and Lightweight Trajectory Data Analysis Framework in Edge Environment".

Notifications You must be signed in to change notification settings

ZJU-DAILY/TrajEdge

Repository files navigation

TrajEdge: An Efficient and Lightweight Trajectory Data Analysis Framework in Edge Environment

Introduction

This repository holds source code for the paper "TrajEdge: An Efficient and Lightweight Trajectory Data Analysis Framework in Edge Environment".

Overview

Environment Preparation

  • Java 11
  • Docker
  • Docker Compose
  • CentOS 7.0

To set a edge simulated environment, you need to install Docker first, then configure the docker cluster:

cd TrajEdge
docker-compose up -d 

Then you will get a cluster of storm in docker container.

Next you can use tcconfig to set the network latency and bandwidth between docker container for better simulated the edge-to-edge and edge-to-cloud communication.

tcset eth0 --delay 100ms --rate 100Kbps --network 192.168.0.10

BTW, we also provide detailed scripts for configuring the network by running:

chmod +x ./scripts/configureNetwork.sh & ./scripts/configureNetwork.sh

Last, you need to run python ./scripts/allocateNode.py for mapping the external node into edge device.

Datasets Description

We use 2 publicly available real-world trajectory and road map data, which can be obtained from Geolife, T-Drive. And the synthetic dataset of Oldenburg can be generated in LINK.

Don't forget to upload your data to all docker container in cluster by using:

chmod +x ./scripts/copyData.sh & ./scripts/copyData.sh

Usage

  1. Prepare your trajectory data like below:

    [Lat] [Lng] [TimeStamp]
    

    Each column is separated by a blank.

  2. Modify your data loader class in directory Spout

  3. Pack the project into fat jar TrajEdge-storage.jar and TrajEdge-stream.jar using Maven

  4. Set up the storage cluster of TrajEdge

    chmod +x ./scripts/deployStorage.sh & ./scripts/deployStorage.sh
  5. Copy the jar to docker and run the topology TrajectoryUploadTopology to store trajectory data

    docker cp ./TrajEdge-stream/target/TrajEdge-stream-1.0-SNAPSHOT.jar nimbus:/opt/storm/lib/
    
    docker exec -it nimbus storm jar /opt/storm/lib/TrajEdge-stream-1.0-SNAPSHOT.jar org.example.TrajectoryUploadTopology test-1 true 1000
  6. Run the query topology, including TrajectoryIdQueryTopology , TrajectorySpacialRangeQueryTopology, TrajectoryTimeRangeQueryTopology and TrajectorykNNQueryTopology.

    # ID temporal
    docker exec -it nimbus storm jar /opt/storm/lib/TrajEdge-stream-1.0-SNAPSHOT.jar org.example.TrajectoryIdQueryTopology 1 0 8 geolife
    # space range
    docker exec -it nimbus storm jar /opt/storm/lib/TrajEdge-stream-1.0-SNAPSHOT.jar org.example.TrajectorySpacialRangeQueryTopology 1 true 1 geolife
    # space time range
    docker exec -it nimbus storm jar /opt/storm/lib/TrajEdge-stream-1.0-SNAPSHOT.jar org.example.TrajectorySpacialTemporalRangeQueryTopology 1 8 geolife
    # k-nn
    docker exec -it nimbus storm jar /opt/storm/lib/TrajEdge-stream-1.0-SNAPSHOT.jar org.example.TrajectorykNNQueryTopology 1 true 8 geolife 1

Citation

If you use our code for research work, please cite our paper as below:

@article{,
  title={TrajEdge: An Efficient and Lightweight Trajectory Data Analysis Framework in Edge Environment},
  author={Changhao He, Ziquan Fang, Linsen Li, Yunjun Gao},
  year={2025},
}

About

The source code for the paper "TrajEdge: An Efficient and Lightweight Trajectory Data Analysis Framework in Edge Environment".

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published