To reduce the base station energy consumption and co-channel interference in heterogeneous cellular networks, a joint optimization algorithm combined with energy harvesting and energy cooperation was proposed with the objective of energy efficiency optimization.First, a mixed-integer nonlinear programming problem for joint resource allocation was constructed considering the constraints of user service quality, the constraints of cellular base station power, and the constraints of renewable energy harvesting.Second, considering that the problem was an NP-hard problem which was difficult to solve directly, the complex original problem was decomposed into three subproblems, such as user association, power allocation, and energy cooperation, with the fixed-variable method, which were solved by using the Lagrangian pairwise method, particle swarm optimization algorithm, and matching theory, respectively.Finally, the final solution of the original problem was obtained by combining the above three algorithms through convergent iterative algorithms.The simulation results show that the proposed algorithm has improved convergence and system energy efficiency compared with the comparison algorithm.