Attacking and Protecting Data Privacy in Edge–Cloud Collaborative Inference Systems