With the development of microelectronics and the miniaturization of electronic devices, the use of molecular materials to construct various components in electronic circuits has become a most likely development trend. Compared with silicon-based semiconductor components, molecular electronic device has the advantages of small size, high integration, low energy consumption and fast response. In recent years, more and more molecules have been used to design molecular devices such as molecular diodes, molecular switches, molecular field effect transistors and molecular memories. In this paper, sandwich structure devices based on graphene nanoribbon electrodes are constructed. The first-principles calculation method combining density functional theory and non-equilibrium Green’s function is adopted to design the molecular devices with functional characteristics. The effects of redox reactions on the electrical transport properties of molecular devices are systematically discussed. The main research contents of this paper are as follows. The switching characteristics of an anthraquinone molecular device based on graphene electrode are studied. The zigzag-edge nanoribbons and armchair-edge graphene nanoribbons are selected as electrodes. Considering the two isomers of anthraquinone (HQ) and anthraquinone (AQ) molecules in the redox reaction, the double electrode molecular junction is constructed. The effects of redox reaction and electrode structure on the switching characteristics of anthraquinone molecular devices are discussed. It is found that the current in the HQ configuration is significantly greater than that in the AQ configuration, regardless of the zigzag-edge graphene electrode or the armchair-edge graphene electrode. That is, under the redox reaction, the anthraquinone molecules show significant switching characteristics. The switching ratio of zigzag-edge graphene electrode is selected to reach a maximum of 3125, and that of armchair-edge graphene electrode is selected to maximum of 1538. In addition, when the armchair-edge graphene is used as an electrode in the HQ configuration, the negative differential resistance is obviously between 0.7 and 0.9 V.