This repository holds source code for the paper "TrajEdge: An Efficient and Lightweight Trajectory Data Analysis Framework in Edge Environment".
- 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.10BTW, we also provide detailed scripts for configuring the network by running:
chmod +x ./scripts/configureNetwork.sh & ./scripts/configureNetwork.shLast, you need to run python ./scripts/allocateNode.py for mapping the external node into edge device.
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- 
Prepare your trajectory data like below:
[Lat] [Lng] [TimeStamp]Each column is separated by a blank.
 - 
Modify your data loader class in directory
Spout - 
Pack the project into fat jar
TrajEdge-storage.jarandTrajEdge-stream.jarusing Maven - 
Set up the storage cluster of TrajEdge
chmod +x ./scripts/deployStorage.sh & ./scripts/deployStorage.sh - 
Copy the jar to docker and run the topology
TrajectoryUploadTopologyto store trajectory datadocker 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
 - 
Run the query topology, including
TrajectoryIdQueryTopology,TrajectorySpacialRangeQueryTopology,TrajectoryTimeRangeQueryTopologyandTrajectorykNNQueryTopology.# 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
 
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},
}
