Satellite communication network has the advantages of high, long and wide-area coverage. It becomes an important part of 5G network. Network-as-a-service requires real-time processing capability in orbit. In order to cope with this challenge, this paper proposes a flexible network slice support. The space-based edge computing system architecture and the resource management mechanism is designed. The resource allocation can be based on different QoS requirements according to the application scenario and business requirements. This paper models and simulates the satellite network and resource model system. The simulation results show that flexible network slice allocation can be performed according to the service QoS requirements, which can meet the bandwidth and computing resources requirements of different slices, reduce the delay, improve the throughput, reduce the network backhaul bandwidth pressure, and improve the comprehensive benefits of the satellite network.