The topology optimization and analysis were studied on the area of piston pin boss for a high-speed gasoline engine based on the variable density topology optimization method. Firstly, the model of the variable density topology optimization was founded. Then, the topology optimization and topology deconstruction on the piston pin boss were carried out by using Hyper Works. In this process, the minimum mass of piston was pursued as an objective function and the displacements of specified nodes on the piston skirt were made as constraints. Based on the topology optimization, the piston configuration of curved rod frame was designed. The complex stress of the piston before and after optimization was calculated respectively by ANSYS. The calculation results indicate that the piston mass can be lightened by 30% through optimizing under the same level of maximal stress, with satisfying the strength requirements. Therefore, the aim of piston lightweight is achieved, and there is no stress concentration in the area of the optimizing piston pin boss, which is propitious to the deformation compatibility of the piston pin boss.