A routing method suitable for a frequency spectrum-flexible optical network includes the steps of: a. performing initialization configuration on a network; b. waiting for a service request to start; c. analyzing the type of the received service request, if the service request is a connection establishing request, entering the Step d, and if the service request is a connection releasing request, entering the Step h; d. starting route selection; e. judging whether a routing result is successful, if yes, entering the Step f, otherwise, entering the Step g; f. allocating frequency spectrum resources; g. searching a service chain table, and defining a process event of a next connection request; and h. releasing resources, and returning to the Step b. According to the routing method, in the routing process, selection and reforming of the frequency spectrum resources are performed, and allocation of the frequency spectrum resources is performed at the same time. The method adopts a heuristic algorithm, and has better flexibility than a traditional ILP method, does not need a central computational node, does not need global information, can completely adopt a distributed method to process, and is suitable for application to a large-scale network.