The invention relates to a method for generating H2 and CO by the two-step thermochemical cycle decomposition of H2O and/or CO2 by taking a nano CexM1-xO2-delta (M is La, Y, Sm or Zr) sosoloid as an active material. The method mainly comprises the following steps of: (1) enabling the active material to release oxygen at a high temperature, and (2) enabling the active material which comprises a large number of oxygen vacancies to react with H2O/CO2 at a low temperature to release H2/CO. In the Ce0.75Zr0.25O2 system, the yield of H2 is 21ml/g and is higher than the yield of H2 of 11ml/g reported in a literature, and the yield of CO is 25.5ml/g and is higher than the yield of CO of 7ml/g reported in a literature, and in the Ce0.85M0.15O2-delta (M is La, Y or Sm) system, the yield of H2 is 12-13ml/g, and the yield of CO is 13ml/g. The active material can take the high-temperature heat generated from the concentration of solar energy as an energy source, and the H2O/CO2 can serve as a raw material to react to generate the H2/CO. The method can not lead to the generation of other byproducts, is clean, can not cause pollution and is expected to be an effective technology for preparing a chemical fuel by using the solar energy.