The Yang-Baxter equation has become a significant theoretical tool in a variety of areas of physics. It is desirable to investigate the quantum simulation of the Yang-Baxter equation itself, exploring the connections between quantum integrability and quantum information processing, in which the unity of both the Yang-Baxter equation system and its quantum entanglement should be kept as a whole. In this work, we propose a duality quantum simulation algorithm of the Yang-Baxter equation, which contains the Yang-Baxter system and an ancillary qubit. Contrasting to conventional methods in which the two hand sides of the equation are simulated separately, they are simulated simultaneously in this proposal. Consequently, it opens up a way to further investigate entanglements in a Yang-Baxter equation.