In order to facilitate more renewable energy and reduce carbon emissions, a novel structure of the virtual power plant (VPP) is designed including the power-to-hydrogen (PtH) equipment and the steam methane reforming (SMR) plant, as well as adjustable load, energy storage devices and wind power plants. On this basis, a flexible carbon emission mechanism is proposed based on the energy coordination among power-to-hydrogen equipment, SMR plants and gas-fired units. Under this new structure and carbon emission mechanism, the VPP makes purchasing and selling decisions in the day-ahead and real-time markets and optimizes the operating strategies of its internal components. It is established both of a deterministic model and a robust optimization model for purchasing and selling strategies of the VPP considering flexible carbon emission mechanism in this paper. In addition, the two models are simulated and analyzed. According to the simulation results, the VPP, based on the proposed new structure and flexible carbon emission mechanism, can not only make steady profits, but also facilitate more wind energy, while meeting the demand for hydrogen, electricity and reducing carbon emissions. The flexible carbon emission mechanism would not only satisfy the carbon emissions constraints, but also increase the whole profit of the VPP compared with the independent carbon emission mechanism. In order to deal with the uncertainty of wind power output and electricity market price, the scheduling strategy of the VPP is more conservative and less economical since robust optimization maximizes operational benefits in the worst case scenario. Nevertheless, it has stronger robustness and the ability to resist the fluctuation of the market price. The buying and selling behaviors and adjustable loads of VPP are affected by the uncertainty of electricity price. Based on the simulation analysis of deterministic scenarios and uncertain scenarios, the proposed flexible carbon emission mechanism can significantly improve the operating profit of the VPP.