With the large-scale, open distributed systems appear, creates a dynamic trust management to make up for lack of a static trust mechanism. However, the existing trust models have the following problems: (1) do not consider the historical behavior enough. (2) Can not effectively prevent malicious behavior. To solve the above problems, an trust model based on rewards and punishment mechanism is presented in this paper. The model is based on historical transactions as well as other users of the recommended confidence-building reward and punishment mechanism, the simulation tests show that the model can effectively identify malicious entities, improve transaction success rate.