The presence of unknown RFID tags can occur when new, unread tagged objects are introduced into the system, either accidentally or intentionally. Additionally, unknown tags can result from tag duplication errors, where multiple tags have the same identifier, or tag malfunctions, where a tag fails to transmit its identifier correctly. This research addresses the critical issue of detecting unknown tags, focusing on optimizing processing time and energy efficiency in terms of memory usage when detecting these tags. A novel algorithm called SWOR (Sliding Window XOR-based Detection) is introduced, specifically designed to identify unknown tags within RFID data streams. SWOR utilizes a sliding window mechanism combined with an XOR filter, enabling efficient detection of unknown tags while reducing unnecessary processing, which can lead to prolonged processing times, high memory consumption, and scalability issues. Experimental results demonstrate that SWOR decreases execution time by an average of 27% across various tests, outperforming existing approaches in terms of processing time for RFID event streams. The materials and methods employed include comprehensive simulations and real-world RFID data streams to validate the algorithm's effectiveness. This study highlights the potential for significant improvements in RFID system efficiency and paves the way for future research in optimizing RFID tag detection methodologies. The implications for further research include exploring the integration of SWOR with other RFID system components and examining its performance in diverse operational environments. This research contributes to the development of more robust and efficient RFID systems, thereby enhancing their reliability and scalability for various future applications.