The temperature control of the spallation target in accelerator driven subcritical system is the important issue that has the direct impact on stable and reliable operation of the coupling system. The China initiative accelerator driven subcritical system (CiADS) is composed by three facilities, including the high power accelerator, dense granular spallation target (DGT) and the subcritical reactor, where the DGT is the key component in connecting the accelerator and subcritical reactor, and the gravity driven tungsten alloy granules are considered as the material and coolant for the spallation target. In order to keep the working temperature in normal operation condition around the presetting value without bringing the large perturbation, the intensity of proton beam and the flow speed of tungsten alloy granules are considered as the main control approaches in adjusting the temperature inside the DGT, and the proportional integral derivative (PID) controller has been established based on the two approaches for the better adaptability to the temperature control in spallation target system. Moreover, the simulation method and quantum evolutionary algorithm have been employed for the selection and optimization of main parameters in PID controller in order to substitute the time consuming and error prone tasks in traditional experiential selection process. Finally, the reference control scenarios have been used to demonstrate the feasibility and applicability of optimized method for the temperature control of the DGT system in CiADS.