The rapid growth of communication and information industry is inseparable from electronic technology. When the semiconductor device with charge is powered on, the charge discharge path forms an instantaneous high pulse to form a conductive path, and the high-energy pulse absorbed by the device pin damages the chip. The main function of biological immune system is to detect, identify and kill non-self substances called antigens in vivo and in vitro, and its essence is on-line autonomous fault diagnosis and health monitoring in vivo. In this article, a fault diagnosis model of semiconductor devices and integrated circuits based on artificial immune algorithm (AIA) is proposed. By collecting the characteristic data of circuits in various working states, the working states of integrated circuits are analyzed and predicted, so as to realize the electrostatic discharge (ESD) protection of semiconductor devices and integrated circuits. The simulation results show that compared with the traditional particle swarm optimization (PSO) algorithm, this method has obvious advantages in the later stage of operation, and the error is reduced by 20.85%. By introducing this model into the design of integrated circuits, the performance of circuits can be optimized and analyzed, the efficiency of circuit design can be improved, and the problem of multi-index conflict in integrated circuits can be solved well.