The performance of automatic Web service composition in massive service candidate collection behaves badly when running inappropriate strategy on whole candidate collection. A new service composition model is proposed to solve this problem. The model formally describes Web service via ontology technique, which can easily get the user's demand. The paper first defines the cost to satisfy user's requirement, then finds out most similar Web services, and constructs the directed acyclic graph based on cost by composition cost relations of Web services. At last,the system applies depth first service search algorithm on the graph to find an optimal composition component. The results of experiment proved that this model have high composition efficiency and high success ratio.