1 Star 0 Fork 15

irobotkits / Serving

forked from PaddlePaddle / Serving 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Encryption_EN.md 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
huangjianhui 提交于 2021-11-15 18:05 . Update Encryption_EN.md

MOEDL ENCRYPTION INFERENCE

(简体中文|English)

Paddle Serving provides model encryption inference, This document shows the details.

Principle

We use symmetric encryption algorithm to encrypt the model. Symmetric encryption algorithm uses the same key for encryption and decryption, it has small amount of calculation, fast speed, is the most commonly used encryption method.

Got an Encrypted Model

Normal model and parameters can be understood as a string, by using the encryption algorithm (parameter is your key) on them, the normal model and parameters become an encrypted one.

We provide a simple demo to encrypt the model. See the examples/C++/encryption/encrypt.py

Start Encryption Service

Suppose you already have an encrypted model(in the encrypt_server/),you can start the encryption model service by adding an additional command line parameter --use_encryption_model

CPU Service

python -m paddle_serving_server.serve --model encrypt_server/ --port 9300 --use_encryption_model

GPU Service

python -m paddle_serving_server.serve --model encrypt_server/ --port 9300 --use_encryption_model --gpu_ids 0

At this point, the server does not really start, but waits for the key。

Client Encryption Inference

First of all, you got have the key which is used in the process of model encryption.

Then you can configure your client with the key, when you connect the server, this key will send to the server and the server will keep it.

Once the server gets the key, it uses the key to parse the model and starts the model prediction service.

Example of Model Encryption Inference

Example of model encryption inference, See the examples/C++/encryption/

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/irobotkits/Serving.git
git@gitee.com:irobotkits/Serving.git
irobotkits
Serving
Serving
v0.9.0

搜索帮助

344bd9b3 5694891 D2dac590 5694891