The interaction capability provided by the Internet of Things (IoT) significantly increases communication between human and machine, changing our lives gradually. However, the abundant constructions of 5G small base stations (SBSs) and large-scaled access of IoT terminal equipment (TE) will surely cause a dramatic increase in energy expense costs of a wireless communication system. In this study, we designed a bilateral random model of TE allocation and energy decisions in IoT, and proposed a mixed energy supply algorithm based on a matching game and convex optimization to minimize the energy expense cost of the wireless communication system in IoT. This study divided the problem of minimizing energy expense cost of the system into two steps. First, the random allocation problem of TEs in IoT was modeled to a matching game problem. This step is to obtain the TE matching scheme that minimizes the energy consumption of the whole system on the basis of guaranteeing the quality of service of TEs. Second, the energy decision problem of SBS was modeled into a convex optimization problem. The energy purchase scheme of SBSs with the minimum energy expense cost of the system was obtained by solving the optimal solution of the convex optimization. According to the simulation results, the proposed mixed energy supply scheme can decrease the energy expense cost of the system effectively.