The development of shale gas, an unconventional energy source, will help improve China's energy structure. The National Energy Administration of China has included it in the national strategic emerging industry, which is also one of the five high-end novel growth industry plans in Sichuan Province. Drilling engineering is the key technology of shale gas exploration, while drilling waste fluid is one of the most representative wastes in the drilling process. The drilling waste fluid has the characteristics of a large amount of production, a complex composition, and a high treatment cost. The treatment of drilling waste fluid is critical for the long-term development of the surrounding environment of drilling operations sites. The effect of anions and cations on the performance of drilling fluid is studied by taking the apparent viscosity, plastic viscosity, dynamic shear force, and medium pressure filtration loss of the drilling fluid as the main indicators. Combined with the numerical simulation of the Box-Behnken module in the software of Design Expert, the requirements for the preparation of drilling fluid by recycling water-based drilling fluid are determined as follows: (1) polymer drilling fluid:hardness ≤ 1.00 g/L,Al3+ ≤ 4.80 g/L,Fe3+ ≤ 0.20 g/L,pH=7~10; (2) polysulfo nate dril-ling fluid: hardness ≤ 3.35 g/L,Al3+ ≤ 10.00 g/L,Fe3+ ≤ 2.80 g/L,SO4 2- ≤ 20.00 g/L pH=7~10; (3) Potassium polysulfonate drilling fluid: hardness ≤ 96.00 g/L,Al3+ ≤ 1.85 g/L,Fe3+ ≤1.65 g/L,SO4 2- ≤50.00 g/L, pH=7~10.