A topology optimization method for the design of thermal cloak is proposed. The thermal scattering theory is introduced to pre-define the initial topology of the thermal invisible cloak as two layers to reduce the number of design variables. In bilayer concentric rings, insulating and high thermal conductivity materials are used to mask heat flow and correct thermal properties. Topology optimization based on the CMA-ES strategy is applied to quickly obtain the best configuration of available materials. The influence of the thermal properties of the material on the optimal configuration and the deflection angle of the thermal flux at the boundary surface has been investigated. Numerical simulations were performed to compare the function of the optimal cloak with that of the ideal metamaterial and the single insulating layer. The results show that despite its simple structure, the bilayer scattering cloak exhibits excellent cloaking performance under different thermal boundary conditions. In this work, the perfect scattering elimination is achieved by adjusting the layer thickness ratio of the cloak with the initial defined structure rather than seeking the optimal thermal conductivity of material, so as to avoid the problem of mismatch between the actual and ideal parameters. Compared to continuous optimization method, the pre-defined bilayer structure is easy to manufacture. Our scheme introduces thermal scattering theory to pre-set the initial structure of the topology optimization method, which provides a general, convenient, and efficient means for the design and application of thermally functional materials.