The invention provides a photochromic staining solution suitable for an anodic oxidation technology, and provides a preparation method and a staining technique of the staining solution. The photochromic staining solution comprises following components of, by weight, 10-30 parts of organic solvents, 0.5-1.5 parts of photochromic dye, 1-2 parts of light stabilizers, 1-2 parts of antioxidants, and 2-8 parts of polymer materials. During staining, the staining solution is subjected to ultrasonic dispersion for several minutes, a certain negative pressure state is maintained, thus presentation of the staining effect is facilitated, meanwhile, the hole sealing voltage is increased by 10%-50%, and the photochromic oxidation film layer surface with excellent chroma is also advantageously obtained.The staining solution and the technique are applied to various oxidation film layers containing porous structures, thus the evenly stained material surface with the obvious color changing effect, goodweather resistance, good abrasion resistance and good color fixation is obtained, and the special sandblasting or drawing texture of the material surface can further be reserved.