Recently, unmanned aerial vehicle (UAV)-assisted maritime communication systems have drawn considerable attention due to their potential for broadband maritime communication applications. However, their limited energy resources remains a critical issue in providing long-term data transmission support for maritime applications. In this study, an integrated sea–air–terrestrial communication system was constructed for marine data collection, where several unmanned surface vessels (USVs) are deployed to collect marine data from underwater sensors (UWSs), and a UAV hovers above these USVs as a relay node, transmitting marine data from USVs to an onshore base station (BS). To prolong the lifetime of the UAV relay, mobile edge computing technology is applied in USVs for partial data computing, which reduces the to-be-relayed data volume from UAVs to USVs to onshore BS as well as the relay energy consumption of UAV. A parallel data computing and transmission scheme was developed for simultaneous local data computing and relaying in the proposed system. Accordingly, a UAV energy consumption minimization problem was formulated with constraints on the USV’s computational ability, the USV’s transmission power budget, the UAV transmission power budget, and the maximum system latency. To effectively solve this nonconvex optimal problem, an energy optimal partial data computing and relaying strategy was constructed by successively optimizing the data partial computational offloading ratio, USV transmit power allocation, and UAV transmit power. Numerical simulations were used to verify the effectiveness of the proposed strategy.