Mobile edge computing (MEC) has become a more and more popular technology, which plays a very important role in various fields. In view of the task of offloading of multiple users, most of the existing studies do not take into account data sharing and cooperation among users, which can easily lead to less generalization of the model trained by a single user, and some data sharing may also cause privacy leakage. Then, this paper uses the method of federated reinforcement learning to solve this problem in order to insure privacy. Besides, considering the poor quality of local models, which leads to the poor versatility of the overall parameters, this paper proposes a federated reinforcement learning method based on Attention mechanism to aggregate the parameter weights, which makes the new model more generalized. The experimental results show that the federated reinforcement learning task offloading model with Attention mechanism can reduce the processing delay of the task.