With the rapid development of new renewable energy sources, microgrids, smart buildings and other forms of prosumers have emerged on a large scale. Energy sharing among multi prosumers can improve the overall economic efficiency. Based on taking into account the data privacy of each prosumer, a collaborative operation mechanism for energy sharing among multi prosumers is proposed. First, an internal scheduling model of prosumers with multiple distributed resources is constructed. Then, an iterative mechanism for multi prosumers tariffs is proposed to guide the tariff update by using the supply-demand relationship. Meanwhile, considering the privacy security of the prosumers, a electricity data aggregation method is designed based on Paillier homomorphic encryption algorithm and the secret sharing principle, which is capable of obtaining the system supply and demand information under the premise of protecting the privacy of all parties. Finally, the effectiveness and reasonableness of the proposed mechanism is verified through examples.