With the development and application of blockchain technology, the privacy leakage problem brought by blockchain technology has become increasingly serious while providing immutability and transparency. Although ring signature has been widely used in blockchain privacy protection schemes, existing schemes are based on public key infrastructure system with high certificate management costs. In addition, with the increasing demand for domestic application of blockchain systems, existing national commercial cryptographic algorithms can no longer meet the increasingly complex application requirements of blockchain. To solve these problems, this paper proposes a constant-size ring signature scheme based on SM9 digital signature algorithm and proves its security under the random oracle model. In addition, based on this ring signature algorithm, this paper modifies the consortium blockchain, Hyperledger Fabric, to achieve transaction sender identity privacy protection. This paper utilizes the Miracl library to test the computation time and analyze the computational and communication costs of this approach. The experimental analysis results demonstrate that compared to existing solutions, this approach achieves several times efficiency improvement in signature generation and verification. When the number of ring members exceeds 20, this approach exhibits significant advantages in terms of signature communication costs.