The invention provides a cable layout method for multiple substations and multiple types of fans, and a computer storage medium. The method comprises the steps that S1, acquiring initial parameters toform a data set; S2, minimizing the total square distance of the data set for all data points in the data set to obtain a cluster set; S3, according to the distance between the center of each clusterin the cluster set and the transformer substation, enabling the transformer substation to be in one-to-one correspondence with each cluster; S4, obtaining the total power generation capacity of the fans contained in each cluster, and obtaining the relation between the total power generation capacity and the maximum power generation capacity of the transformer substation corresponding to the cluster; S5, redistributing the data of the clusters according to the relationship, if the total capacity of the fans of all the clusters is smaller than or equal to the maximum power generation bearing capacity of the corresponding transformer substations, obtaining a clustering result, and otherwise, redistributing the data of the clusters; S6, calculating the distance between the fan of each clusterand the transformer substation corresponding to the cluster where the fan is located, and connecting the nearest fan point with the transformer substation; and S7, carrying out independent cable connection layout on the fans in each cluster.