The privacy-protected algorithm (PPA) is pivotal in the realm of machine learning, especially for handling sensitive data types, such as medical and financial records. PPA enables two distinct operations: data publishing and data analysis, each capable of functioning independently. However, the field lacks a unified framework or an efficient algorithm to synergize these operations. This deficiency inspires our current research endeavor. In this paper, we introduce a novel dual-mode empirical risk minimization (D-ERM) model, specifically designed for integrated learning tasks. We also develop an alternating minimization differential privacy protection algorithm (AMDPPA) for implementing the D-ERM model. Our theoretical analysis confirms the differential privacy and accuracy of AMDPPA. We validate the algorithm’s efficacy through numerical experiments using real-world datasets, demonstrating its ability to effectively balance privacy with learning efficiency.