Driven by the massively growing applications in Internet of Things (IoT) and the new requirements of the six generation (6G) wireless network, the amount of terrestrial mobile devices (TMDs) and data traffic in wireless communications have increased explosively. Consequently, the integrated terrestrial-satellite relay networks (ITSRNs) have emerged to address the issue of the huge wireless traffic with limited allocated resources, which attracts extensive research attention to the field of IoT. Limited improvement of system throughput is realized by configuring terrestrial relays (TR) in the previous works. In this paper, by introducing an aerial relay (AR), we propose a novel structure of ITSRN and investigate the system throughput maximization and energy consumption minimization problems by jointly optimizing power allocation and AR altitude. Specifically, the system implementation includes two periods: satellite to relay (S-R) period and satellite to devices (S-D) period. To maximize the overall system throughput, we propose a joint optimization scheme of the power allocation and altitude of AR. Due to its non-convexity, a bilevel programming method is proposed to obtain the global optimal solution, where the closed-form expressions of power allocation and the optimal altitude of AR are derived. Subsequently, we investigate the energy consumption minimization problem during S-R period, which is formulated as a convex problem. We propose a low complexity algorithm and derive the optimal closed-form solution based on the rigorous mathematical analysis. The effectiveness of the proposed algorithms and solutions are verified by extensive simulations.