The invention provides a connection optimization scheme for a roof photovoltaic system based on a building information model (BIM). According to the scheme, digital modeling is performed on a building, a solar annual motion model is established, and the exposure dose of a fixed photovoltaic component is acquired; modeling simulation is performed on a cell model and a photovoltaic array hardware circuit, corresponding exposure dose data is allocated to each photovoltaic module, an output characteristic P-V curve of an array is acquired, and the generating capacity of the photovoltaic componentis calculated; the generating capacity, inverter model selection, roof cost, roof photovoltaic array cost and other factors of different connection schemes are comprehensively considered, and an optimization objective function is established; and a globally optimal solution of the objective function is solved, an optimal connection scheme and inverter type are acquired, and automatic connection ofthe photovoltaic array is realized in the BIM. Through the scheme, by selecting an appropriate photovoltaic array connection mode, the photovoltaic investment return period can be obviously shortened, and the effect of optimizing the roof photovoltaic system is achieved.