In the construction project, the building structure, as the main part of the building, plays the role of the main load-bearing skeleton, but due to the lack of scientific design scheme, it leads to the problems of high building cost, poor quality, high carbon emission, etc. In this paper, starting from the structural design specification in the field of construction and combining with the actual situation of building construction, we propose an optimization path of building structure design scheme based on K-means clustering algorithm, which obtains the scientific material distribution by clustering analysis of structural materials according to the indexes of price, quality, and carbon emission, so as to help the structural designers to design the structural scheme with low cost, good quality, and low carbon and environmental protection. It helps structural designers to design low-cost, high-quality and low-carbon emission structural solutions. Taking the application of K-menas clustering algorithm for cost control of hybrid building structural design as an example, the feasibility, scientificity and efficiency of K-means clustering algorithm in the cost optimisation of structural design scheme are verified. It is shown that: (1) K-means clustering algorithm has good feasibility at the level of building structure optimisation. (2) Compared with the traditional multi-objective optimisation method, the K-means algorithm solves the cost optimisation with fewer steps, simpler principles, faster speed and lower technical threshold. (3) The successful application of K-means algorithm in structural cost optimisation proves its feasibility in structural quality and carbon emission optimisation. For example, the quality of materials can be assigned corresponding weight indicators based on composition, physical properties, chemical properties, etc., and the K-means algorithm can be used to analyse the indicators by clustering and classify the materials into different quality levels. Carbon emission can be assigned according to the carbon content of the material, effective service life and other values and cluster analysis, the material will be different grades, to assist structural designers to control carbon emissions. This research method greatly improves the efficiency of building structure design, and is expected to solve the existing problems of structural design solutions and promote the development of green buildings.