The invention relates to an energy hub modeling method considering a solid oxide fuel cell and electricity-to-gas, which comprises the following steps of: S1, researching an electricity-to-gas model,a hydrogen storage tank model and a solid oxide fuel cell model before respectively establishing models for conversion equipment; S2, constructing an electricity-to-gas conversion model and a hydrogenstorage tank model; S3, for the solid oxide fuel cell model, describing an SOFC power generation mathematical model through the current I flowing out of the galvanic pile and the port voltage U, andthen obtaining an SOFC heating mathematical model by calculating the subtraction between the energy released in the chemical reaction process of the hydrogen supplied by the hydrogen storage tank andthe SOFC power generation amount; and S4, finally, when an energy hub optimization model is constructed, giving a cost calculation formula, meanwhile, establishing a unit model and constraint conditions, and the constraint conditions include power balance constraints, tie line constraints, water abandoning constraints and equipment model constraints. Meanwhile, the conversion efficiency between system energy sources is improved.