The space-air-ground integrated network (SAGIN) can enhance the performance of the Internet of Vehicles (IoV). However, the basic hardware differences among communication systems are large, which leads to communication difficulties between different communication systems. To effectively manage multiple communications networks (satellite networks, air networks and terrestrial networks) and computing resources in IoV, this paper proposes a SAGIN-IoV edge-cloud architecture based on software defined networking (SDN) and network function virtualization (NFV). In addition, we construct an optimization model based on SAGIN-IoV’s service requirements, and propose an improved algorithm. Experimental results show that the improved algorithm can effectively optimize the resource scheduling problem of SAGIN-IoV.