Data isolation has become an obstacle to scale up query processing over big data, since sharing raw data among data owners is often prohibitive due to security concerns. A promising solution is to perform secure queries and analytics over a federation of multiple data owners leveraging techiniques like secure multi-party computation (SMC) and differential privacy, as evidenced by recent work on data federation and federated learning.
OpenHuFu is an open-sourced system for efficient and secure query processing on a data federation. It provides flexibility for researchers to quickly implement their algorithms for processing federated queries with SMC techniques, such as secret sharing, garbled circuit and oblivious transfer. With its help, we can quickly conduct the experimental evaluation and obtain the performance of the designed algorithms over benchmark datasets.
- Linux or MacOS
- Java 11
- Maven (version at least 3.5.2)
- C++ (generate TPC-H data)
- Python3 (generate spatial data)
- Git & Git LFS (Git Large File Storage)
Run the following commands:
- Clone OpenHuFu repository:
git clone https://github.com/BUAA-BDA/OpenHuFu.git
- Download big files from Git LFS(Large File Storage)
cd OpenHuFu
git lfs install --skip-smudge
git lfs pull
- Build:
cd OpenHuFu
bash scripts/build/package.sh
OpenHuFu is now installed in release
If you use Macs with Apple Silicon Chips(ARM), you need to add this to settings.xml
(maven settings file):
<profiles>
<profile>
<id>apple-silicon</id>
<properties>
<os.detected.classifier>osx-x86_64</os.detected.classifier>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>apple-silicon</activeProfile>
</activeProfiles>
Relational data: TCP-H
bash scripts/test/extract_tpc_h.sh
cd dataset/TPC-H V3.0.1/dbgen
cp makefile.suite makefile
make
# x is the number of database,y is the volume of each database(MB)
bash scripts/test/generateData.sh x y
Spatial sample data: dataset/newyork-taxi-sample.data
:
Generate spatial data:
pip3 install numpy
python3 scripts/test/genSyntheticData.py databaseNum dataSize [distribution name] [params]
The distributions we support and their params are as follow:
Distribution | param1 | param2 |
---|---|---|
uni | low (default = -1e7) | high (default = 1e7) |
nor | mu (default = 0) | sigma (default = 1e5) |
exp | mu (default = 5e6) |
(If needed, you can modify scripts/test/genSyntheticData.py
)
A java wrapper of ABY using SWIG.
- not make install ABY before. (if installed, please remove installed files, especially files in
/usr/local/lib/cmake
) - init git submodule
git submodule update --init
-
check cmake version >= 3.16, gcc version >= 8.0, java jdk version >= 11, swig3.0, GMP, Boost >= 1.66.0
(After installing the new version, you may need to manually update the dynamic link library (e.g. libstdc++.so.6), otherwise the dynamic link library will use the old version.)
-
set OPENHUFU_ROOT
export OPENHUFU_ROOT={OpenHuFu root path}
# e.g.
# export OPENHUFU_ROOT=~/dev/release
- run package.sh, and the package result will be installed in
${OPENHUFU_ROOT}/lib
# for first installation, or cpp code is modified, add 'all' to update .so library
# after running the script, need to move .so .a files in swig/build/lib into java lib path manually, e.g., /usr/lib/jni
./package.sh
(When using, you should add the parameter -Djava.library.path=${OPENHUFU_ROOT}/lib
to add the library path)
swig
: the swig interface of aby, use .i file to wrap C++ functions, the generated java code will be placed insrc/java/com/hufudb/openhufu/mpc/aby/*
, please do not add these generated files to gitsrc
: the ProtocolExecutor interface of aby(Aby.java
,AbyFactory.java
), wrapper for swig interface to interactive with OpenHuFu
- Develop your algorithms
- Aggregate:
class extends com.hufudb.openhufu.owner.implementor.aggregate.OwnerAggregateFunction
/**
* The class must contains a constructor function with parameters:
* (OpenHuFuPlan.Expression agg, Rpc rpc, ExecutorService threadPool, OpenHuFuPlan.TaskInfo taskInfo)
*/
- Join:
- Set the algorithm for the query(example in owner.yaml):
openhufu:
implementor:
aggregate:
sum: com.hufudb.openhufu.owner.implementor.aggregate.sum.SecretSharingSum
count: null
max: null
min: null
avg: null
join: com.hufudb.openhufu.owner.implementor.join.HashJoin
- Running benchmarks
bash scripts/test/benchmark.sh
- Evaluating communication cost
Before running benchmarks on OpenHuFu, you can follow the instructions to evaluate communication cost of the query:
- Monitoring the port
# run the shell script as root
# 8888 is the port number
sudo bash scripts/test/network_mmonitor/start.sh 8888
- Calculating the communication cost
# run the shell script as root
sudo bash scripts/test/network_mmonitor/monitor.sh
- Plan
- Function Call
- Filter
- Projection
- Join: equi-join, theta join
- Cross products
- Aggregate(inc. group-by)
- Limited window aggs
- Distinct
- Sort
- Limit
- Common table expressions
- Spatial Queries:
- range query
- range counting
- knn query
- distance join
- knn join
- Communication Cost
- Running Time
- Total Query Time
- Local Query Time
- Encryption Time
- Decryption Time
If you find OpenHuFu helpful in your research, please consider citing our papers and the bibtex are listed below:
- Hu-Fu: Efficient and Secure Spatial Queries over Data Federation. Yongxin Tong, Xuchen Pan, Yuxiang Zeng, Yexuan Shi, Chunbo Xue, Zimu Zhou, Xiaofei Zhang, Lei Chen, Yi Xu, Ke Xu, Weifeng Lv. Proc. VLDB Endow. 15(6): 1159-1172 (2022). [paper] [slides] [bibtex]
Other helpful related work from our group is listed below:
-
Efficient Approximate Range Aggregation Over Large-Scale Spatial Data Federation. Yexuan Shi, Yongxin Tong, Yuxiang Zeng, Zimu Zhou, Bolin Ding, Lei Chen. IEEE Trans. Knowl. Data Eng. 35(1): 418-430 (2023). [paper] [bibtex]
-
Hu-Fu: A Data Federation System for Secure Spatial Queries. Xuchen Pan, Yongxin Tong, Chunbo Xue, Zimu Zhou, Junping Du, Yuxiang Zeng, Yexuan Shi, Xiaofei Zhang, Lei Chen, Yi Xu, Ke Xu, Weifeng Lv. Proc. VLDB Endow. 15(12): 3582-3585 (2022). [paper] [bibtex]
-
Data Source Selection in Federated Learning: A Submodular Optimization Approach. Ruisheng Zhang, Yansheng Wang, Zimu Zhou, Ziyao Ren, Yongxin Tong, Ke Xu. DASFAA 2022. [paper] [bibtex]
-
Fed-LTD: Towards Cross-Platform Ride Hailing via Federated Learning to Dispatch. Yansheng Wang, Yongxin Tong, Zimu Zhou, Ziyao Ren, Yi Xu, Guobin Wu, Weifeng Lv. KDD 2022. [paper] [bibtex]
-
Efficient and Secure Skyline Queries over Vertical Data Federation. Yuanyuan Zhang, Yexuan Shi, Zimu Zhou, Chunbo Xue, Yi Xu, Ke Xu, Junping Du. IEEE Trans. Knowl. Data Eng. (2022). [paper] [bibtex]
-
Federated Topic Discovery: A Semantic Consistent Approach. Yexuan Shi, Yongxin Tong, Zhiyang Su, Di Jiang, Zimu Zhou, Wenbin Zhang. IEEE Intell. Syst. 36(5): 96-103 (2021). [paper] [bibtex]
-
Industrial Federated Topic Modeling. Di Jiang, Yongxin Tong, Yuanfeng Song, Xueyang Wu, Weiwei Zhao, Jinhua Peng, Rongzhong Lian, Qian Xu, Qiang Yang. ACM Trans. Intell. Syst. Technol. 12(1): 2:1-2:22 (2021). [paper] [bibtex]
-
A GDPR-compliant Ecosystem for Speech Recognition with Transfer, Federated, and Evolutionary Learning. Di Jiang, Conghui Tan, Jinhua Peng, Chaotao Chen, Xueyang Wu, Weiwei Zhao, Yuanfeng Song, Yongxin Tong, Chang Liu, Qian Xu, Qiang Yang, Li Deng. ACM Trans. Intell. Syst. Technol. 12(3): 30:1-30:19 (2021). [paper] [bibtex]
-
An Efficient Approach for Cross-Silo Federated Learning to Rank. Yansheng Wang, Yongxin Tong, Dingyuan Shi, Ke Xu. ICDE 2021. [paper] [slides] [bibtex]
-
Federated Learning in the Lens of Crowdsourcing. Yongxin Tong, Yansheng Wang, Dingyuan Shi. IEEE Data Eng. Bull. 43(3): 26-36 (2020). [paper] [bibtex]
-
Federated Latent Dirichlet Allocation: A Local Differential Privacy Based Framework. Yansheng Wang, Yongxin Tong, Dingyuan Shi. AAAI 2020. [paper] [bibtex]
-
Federated Acoustic Model Optimization for Automatic Speech Recognition. Conghui Tan, Di Jiang, Huaxiao Mo, Jinhua Peng, Yongxin Tong, Weiwei Zhao, Chaotao Chen, Rongzhong Lian, Yuanfeng Song, Qian Xu. DASFAA 2020. [paper] [bibtex]
-
Efficient and Fair Data Valuation for Horizontal Federated Learning. Shuyue Wei, Yongxin Tong, Zimu Zhou, Tianshu Song. Federated Learning 2020. [paper] [bibtex]
-
Profit Allocation for Federated Learning. Tianshu Song, Yongxin Tong, Shuyue Wei. IEEE BigData 2019. [paper] [slides] [bibtex]
-
Federated Machine Learning: Concept and Applications. Qiang Yang, Yang Liu, Tianjian Chen, Yongxin Tong. ACM Trans. Intell. Syst. Technol. 10(2): 12:1-12:19 (2019). [paper] [bibtex]