In order to maximize the primary secrecy rate, we researched the channel resource allocation of the primary user (PU) and the secondary user (SU) in the energy harvesting cognitive radio (EHCR) which is based on the cooperative communication and energy harvesting technology. In this network, the SU, which can harvest energy from the ambient, will assist the PU with cooperative communication. As a reward, the SU can get the opportunity to access the PU’s spectrum resource when the cooperative communication is over. Given the QoS demand of SU transmission node, we design a computing method of maximizing the primary secrecy rate. Numerical results demonstrate that the secrecy capacity is inverse proportional to the energy harvesting ratio, and it is also direct proportional to the cooperative communication ratio. We also figure out that the secrecy capacity is achievable. In the end, we assume that the SU works at a constant low sending power, when the cooperative communication ratio changes from 0.2 to 0.5, our research is lifting 79.28%, 80.46%, 64.23%, 78.85% on average, respectively, on the maximization of the secrecy rate, in comparison to the existing strategy. Moreover, the proposed algorithm is about 7.34 times efficient than the existing algorithms averagely.