With the rapid development of the Internet of Things (IoT), massive terminals and emerging applications bring a large amount of data. As an essential prerequisite for mining potential value from these data, data sharing is crucial and getting more and more attention. However, security and privacy concerns, and the lack of effective incentive mechanisms in the decentralized environment hinder the data owners from sharing their data. In this article, we propose a federated learning (FL) and blockchain-based privacy-preserving data sharing system, which solve the privacy leakage problem of FL and the scalability problem of blockchain by their technical complementarity. Considering the resource shortage and the heterogeneity of terminals, we first design a cross-layer architecture by exploiting the cloud-edge-terminal collaboration, and innovatively propose differential data sharing by dividing the providers into origin data providers and model providers. Then, we design a targeted incentive mechanism to maximize the utility of requesters and two types of data providers by formulating it into a two-stage Stackelberg game. Finally, a gradient-based algorithm is designed to get the optimal solution. Theoretical analysis and numerical simulations show that the proposed data-sharing system could eliminate privacy concerns and motivate more participants to share data. With 500 nodes, the differentiated data sharing scheme (DASC) is 1.72 s faster than the shared model scheme (SMC) and 2.59 s faster than SDC. In terms of utility of the requester, DASC is 2.0 x 10(3) higher than SDC, and 9.27 higher than SMC in average utility of providers.