3D printing technology is widely used in orthopedic surgery for damage repair. As an implant, the biomimetic bone must have an appropriately sized pore and porosity to meet cell growth, nutrient transferring and the lightweight requirements. Bone models can be obtained using CT scans of broken bone joints, but the porous structure inside the bone cannot be reconstructed. This paper presents a design and optimization of bionic bones with microstructure suitable for 3D printing. First, we use triply period minimum surfaces (TPMS) to construct an adjustable porous structure, which has adjustable pores. For calculation efficiency, the porous structure is optimized at the macro scale to obtain a lightweight porous bone model that meets the stress conditions. Finally, the macroscopic optimized structure is mapped to obtain the microscopic porous bone structure according to the homogenization theory. The experimental results show that the method proposed in this paper not only has high computational efficiency, but also can achieve light weight effect under the stress conditions. The method has great potential for application in the design and optimization of medical bionic bone.