The heterogeneous network composed of small cell base stations (SCBSs) and macro base stations (MBSs) has been widely deployed to alleviate the load of conventional MBSs, which may also cause severe interference and large energy consumption. The existing literature generally focus on the heterogeneous networks either without cooperation or with cross-tier cooperation. In this paper, we introduce a central controller and mobile edge cloud (MEC) servers and propose a heterogeneous network with SCBSs cooperation, i.e., the intra-tier cooperation. A novel load balancing metric instead of the simple access probability ratio is introduced. Based on the utility theory, we comprehensively evaluate several important performance metrics such as connectivity probability, load balancing, and energy efficiency to optimize the overall performance of the network. Moreover, in the special case of allowing partial connectivity, the discrete stochastic optimization algorithm is proposed so that the software-defined networks (SDNs) controller can adjust network parameters with the help of MEC servers to maximize the overall energy efficiency. The simulation results demonstrate that our proposed approach is valid to optimize the network in accordance with the user requirements. This paper provides a useful reference for the practical deployment of software-defined heterogeneous networks where the energy efficiency is increasingly becoming a key concern.