Under the cloud computing environment, traditional security mechanisms are difficult to effectively protect the confidentiality and integrity of sensitive data. Aiming at the security protection of sensitive data in cloud storage environment, this paper proposes an optimization algorithm for sensitive data discovery and integrity checking based on Intel SGX trusted execution environment. Methodologically, the SGX-based trusted execution environment framework is constructed, the integrity verification scheme combining the multi-branch path tree (MBT) data structure and bilinear pair algorithm is designed, and the third-party verification organization and blockchain network are introduced to realize data integrity verification. The data verification in challenge-answer mode is realized through the smart contract mechanism, and the file version verification is optimized by combining the version sequence number parameter. The results show that when the number of files reaches 1900, the total execution time of this paper’s scheme is reduced by 51.29% and 32.76% compared with the B-PDP and SA-PDP schemes, respectively. Tests based on the MNIST dataset show that the time overheads of the storage and validation phases are 0.728ms and 0.291ms, respectively. The overall performance of the Trusted Execution Environment network reaches 95.48% of the original Fabric, with only a 6.42% increase in latency and a 5.03% decrease in throughput. The conclusion proves that the scheme can significantly improve the efficiency of sensitive data verification under the premise of guaranteeing security, and provides an effective guarantee for data security in cloud storage environment.