Swarm intelligence algorithm is an emerging evolutionary computing technology, which has become the focus of more and more researchers. It has a very special connection with artificial life, especially evolutionary strategies and genetic algorithms. The swarm intelligence algorithms you see include genetic algorithm, particle swarm optimization algorithm, and ant colony algorithm. This part of the content has been supplemented in the article. Evolutionary computing is a group-oriented random search technology and method produced by simulating the evolutionary process of organisms in nature. Evolutionary computing is based on natural selection strategy: survival of the fittest, elimination of the unfit, and individuals with large fitness values have a higher survival probability than individuals with small fitness values. The purpose of this paper is to study the structure optimization of carbon nanotubes based on swarm intelligence algorithm and evolutionary computation. It is expected to optimize the structure of carbon nanotube materials with the help of intelligent evolution algorithm, so that it can be used in more fields. In this paper, the preparation process and principle of carbon nanotube-based gas sensors are studied, and the preparation process of the side-heated gas sensor is selected. This paper focuses on the strain sensing performance of carbon nanotubes, analyzes various parameters that characterize the sensing performance, and proposes feasible technical routes for improvement, optimization and improvement. The experimental results in this paper show that when different proportions of oxides are added, the tensile strength of carbon nanotube materials is increased by about 8%, and the elastic modulus is increased by up to 40%. After adding CNFs, the tensile strength increased by up to 18%, and the elastic modulus increased by up to 50%.