The invention discloses a biogas slurry ecological purification method based on microalgae cultivation. The method comprises the following steps: (1) biogas slurry pretreatment; (2) habituated culture of autotrophic microalgae, namely, obtaining algae strains capable of rapidly growing in 70%-100% biogas slurry; (3) preparation of a seed solution; (4) a biogas slurry purification method during growing of microalgae, namely, after expanded cultivation, inoculating the habituated algae species into an open photobioreactor for cultivation, obtaining chlorella biomass growing by high density through a semi-continuous culture method and optimized methods such as fed-batch cultivation, and purifying the biogas slurry; (5) biochemical breaking of microalgae cell walls, namely, introducing the microalgae cells into a biochemical wall breaking pool, putting freshwater fish into the pool, and obtaining algae slurry subjected to wall breaking; and (6) collection of the microalgae cells and recycling of the biogas slurry. According to the method, not only is a method provided for purifying the biogas slurry, but also the obtained algae cells and the biogas slurry can be recycled, so that ecologicalization treatment of the biogas slurry is realized, the environment is improved, and furthermore, the economic and social benefits are produced.