This paper proposes a Knowledge Conflict Reasoning (KCR) framework to address the problem of large-scale language models (LLMs) struggling to resolve conflicting knowledge from multiple sources, particularly knowledge conflicts across conflicting contexts in long texts. KCR relies on reinforcement learning to train LLMs to select and adhere to contexts with stronger logical consistency when presented with conflicting contexts. First, it extracts inference paths, expressed as text or local knowledge graphs, from conflicting long text contexts. Based on these paths, the model is trained to follow the correct inference path, thereby enhancing its ability to resolve knowledge conflicts within long text contexts. Experimental results demonstrate that the proposed framework significantly improves the knowledge conflict resolution capabilities of various LLMs.