Taking the maximum contact pressure as the objective function for, the optimal design model of the offshore flange connector was established to analyze the impact of the flange cone's angle and the curvature radius of the lenticular gasket's contact surface on the sealing performance of the connector. An optimized three-dimensional model of the offshore flange connector was constructed using the MATLAB software's fmincon function to obtain the optimal size of the cone angle and curvature radius. The maximum contact pressure and maximum equivalent stress values of the non-optimized and optimized offshore flange connectors under the cross combination of two design pressures and six operating temperatures were analyzed by Workbench software, and the sealing performance of the non-optimized and optimized offshore flange connectors was compared according to the sealing judgment basis. The results show that compared with the previously studied offshore flange connector, the sealing structure of optimized offshore flange exhibits maximum increase in contact pressure increase but maximum decrease in equivalent stress. Under actual operating circumstances, the optimized offshore flange connection performs better in sealing and is less prone to breakage.