# An EfficientQ-Algorithm for RFID Tag Anticollision

Authors: Lingyun Zhao; Lukun Wang; Shan Du
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

In large-scale Internet of Things (IoT) applications, tags are attached to items, and users use a radiofrequency identification (RFID) reader to quickly identify tags and obtain the corresponding item information. Since multiple tags share the same channel to communicate with the reader, when they respond simultaneously, tag collision will occur, and the reader cannot successfully obtain the information from the tag. To cope with the tag collision problem, ultrahigh frequency (UHF) RFID standard EPC G1 Gen2 specifies an anticollision protocol to identify a large number of RFID tags in an efficient way. TheQ-algorithm has attracted much more attention as the efficiency of an EPC C1 Gen2-based RFID system can be significantly improved by only a slight adjustment to the algorithm. In this paper, we propose a novel Q-algorithm for RFID tag identification, namely, HTEQ, which optimizes the time efficiency of an EPC C1 Gen2-based RFID system to the utmost limit. Extensive simulations verify that our proposed HTEQ is exceptionally expeditious compared to other algorithms, which promises it to be competitive in large-scale IoT environments.


---

## Body

## 1. Introduction

RFID is a key enabler of the Internet of Things (IoT), playing a crucial role in connecting low-/nonpowered devices to IoT environments. EPC C1 Gen2 [1] is the standard RFID protocol devised to meet the needs of such applications. An RFID reader can communicate with hundreds of passive (nonpowered) tags within seconds, even at a distance of 10 meters from the tags. The most remarkable virtue of the Gen2 standard is its light weight. Due to the shared nature of RF medium, a passive RFID system requires a collision arbitration protocol to serialize responses of tags, mitigating collisions between the tag responses.Recently, there are mainly three kinds of collision arbitration protocols in tag identification, namely, Aloha-based [2–5], query tree-based [6–8], and tree splitting-based [9, 10] protocol. In the Aloha-based protocol, the reader combines tag number estimation and frame size adjustment strategies to identify tags. Specifically, the reader sends a query command containing a parameter F (F denotes the number of) to allow the tags to return the IDs. The reader detects the responses in each slot and distinguishes their different states: collision, empty, or singleton. According to slot statistics in a frame, the reader can estimate the cardinality of unread tags and update the new frame for the next round. Through theoretical analysis, the maximal system throughput of Aloha-based protocols is 0.368 [2–5]. In query tree-based protocols [6–8], the reader inquires about the tags through probe commands. Each tag is required to be equipped with a prefix matching circuit, and it will respond only when the tag ID matches the prefix of the probe command. Once a collision is detected, the reader will update the query prefix according to the position of collision bits. Then, the reader uses the updated prefixes to interrogate the tags until all of them are successfully identified. In tree splitting protocols, the reader continues to group the colliding tags with a separation probability of 0.5, until a certain group contains only one tag.TheQ-algorithm, adopted by the EPC C1 Gen2 standard, is a collision arbitration algorithm that clearly represents its lightweight property such that a couple of simple arithmetic operations constitute the algorithm. The Q-algorithm is composed of a few fundamental arithmetic and logical operations [1]. The flowchart of the Q-algorithm is illustrated in Figure 1. Looking specifically into the algorithm, it adds the constant c to Q when it finds collided replies and subtracts the c constant from Q whenever having no reply. The algorithm alters its frame size 2Q once the Q value has been changed. This simplicity of the logic and the use of a minimal number of computations make Gen2 RFID readers identify tags without wasting batteries in IoT environments. Another strength inherited in the Q-algorithm is the early adjustment of frame size, by which a disadvantageous frame size can be canceled before the end of the frame. The feature might have a substantial impact on the identification performance in large-scale and/or mobile tag environments such as smart factories and highways, which is an important characteristic of a quality collision arbitration algorithm [11].Figure 1
The flowchart of theQ-algorithm.Only a limited number of early researchers attempted to further improve the performance of theQ-algorithm [12–14]. The Q+ algorithm [12] suggested differentiating c into Ccoll and Cidle, which means the constant for a collision and an empty slot, respectively. The study also found the optimal ratio of Cidle to Ccoll (e‐2≈0.71828) which maximizes the per-slot throughput of tag identification. In a similar vein, the author in literature [13] presents a fine-tuned numerical method to determine the Q value. However, the study also considered a per-slot throughput as its objective, which means that, theoretically, the performance of such an algorithm is not very different from that of the Q+ algorithm.Another approach has been taken to improve theQ-algorithm in [14], where a per-time throughput is addressed as the metric of tag identification efficiency. This is important as the time duration of each slot (singleton, empty, and collision) is actually different from each other in the EPC C1 Gen2 standard. As the studies commonly recognized the difference, the algorithms were designed to determine Cidle and Ccoll that reduce the collision slots, whose time duration is significantly longer than the empty slots, rather than the total number of consumed slots. Although such an algorithm is a reasonable approach, the rigorous optimization of the Q-algorithm in terms of time efficiency has not been addressed. Due to such immaturity of the previous research efforts, the Q-algorithm has received little attention for a good while, despite its obvious benefits of lightweight property and innate ability of early adjustment.On the other hand, there are many works following the dynamic framed slotted Aloha (DFSA) to consider the time efficiency. The literature [15] conducted temporal analysis on the time efficiency of an FSA protocol, adopting an in-frame adjustment feature of the Q-algorithm. The performance of conventional DFSA depends on both an accurate cardinality estimation and adaptive frame adjustment. The cardinality estimation requires burdensome statistics and imposes high complexity. The latest research [3, 16] shows remarkable performance with optimization of frame sizes for fast identification; additional calculations for tag cardinality estimation were required on every slot.In this paper, we provide a theoretical analysis on the time performance of theQ-algorithm, and based on the analysis, the detailed structure of a highly time-efficient Q-algorithm (HTEQ) is proposed. Then, we provide a performance evaluation between major Q-algorithm variants and a competitive DFSA algorithm. In the following, we further discuss the experimental results.The contributions of this paper are summarized as follows.(1)
A rigorous analysis of the time performance of theQ-algorithm and the optimal parameters for a time-efficient Q-algorithm are derived(2)
We provide a thorough performance evaluation between the proposed HTEQ, other competitiveQ-algorithm variants, and representative DFSA. The factors behind the experimental results are examined concretely(3)
Through performance limitation analysis, a novel RFID tag identification algorithm, namely, HTEQ, is proposed, which provides highly competitive time efficiency in RFID anticollision for large-scale IoT applications, while maintaining the strengths of theQ-algorithm, such as early frame adjustment and low computational overhead


## 2. The Proposed Algorithm

In this section, we first analyze the time performance of an FSA protocol on which theQ-algorithm is premised and suggest a highly efficient Q-algorithm based on theoretical analysis.


### 2.1. Analysis on Time Performance

In the FSA protocol, a reader informs tags of a frame size, in which the tags randomly select their responding slots. In such a model, the tag identification delay can be defined as the average time between two successively identified tags. Givenn tags, the tag identification delay in a frame size F is expressed as
(1)ηn,F=Tn,FF×Ps,where Tn,F and Ps denote the expected time duration of a frame and the probability that a tag is successfully identified in a slot given n and F, respectively. The probability that k tags respond in a slot is given by
(2)Px=k=Cnk1Fk1−1Fn−k.Based on Equation (2), the probabilities of a success, an empty, and a collision slot are expressed as Ps=Px=1,Pe=Px=0,andPc=Px>1, respectively. Then, the expected time duration of a frame can be calculated by summing up all the expected delays in the frame as below:
(3)Tn,F=F×Ps×Ts+F×Pe×Te+F×Pc×Tc,where Ts,Te,andTc are the time durations of a success, an empty, and a collision slot, respectively. Note that the delay of the frame per second is ignored for convenience’s sake. By Equations (2) and (3), Equation (1) can be rewritten as
(4)ηn,F=F×Ps×Ts+F×Pe×Te+F×Pc×TcF×Ps=Ts+F−1nλ−1+Fn1−1F1−n−1×Tc,where λ=Te/Tc.


### 2.2. HTEQ Algorithm

Having observed the tag identification delay, we can achieve the maximization of per-time tag identification efficiency by minimizing the tag identification delay as the following:(5)argminFηn,F.As the objective function is convex for bothn and F, the optimum should be obtained by partially differentiating the function for nn≥1 instead of F on which the inverse of the derivative does not exist. Therefore, arranging ∂η/∂η=0 with respect to F, we get the optimal frame size as below:
(6)F∗=1−e−1+WΘ/n−1,where W is the Lambert W function or product logarithm and Θ=η−1/e. We then get Pe∗ and Pc∗ under the optimal condition by putting F∗ to the probabilities. Using these probabilities, we can build a stationary condition that converges to and keeps the frame size remaining at the optimum as follows:
(7)Pc∗×Ccoll=Pe∗×Cidle.With this relationship, taking limits inPc∗/Pe∗ as n→∞ for 0<η<1, it gives us the asymptotic proportions of the empty and collision slots under the optimal condition, and hence, the optimal ratio Cidle∗/Ccoll∗ is also attained:
(8)limn→∞Pcoll∗Pidle∗=Cidle∗Ccoll∗=e1+WΘ−WΘ−2.Note that the ratio of the probabilities and the ratio of theC values are in a reciprocal relationship. Figure 2 provides a detailed procedure of the HTEQ algorithm, where Cidle and Ccoll are constrained by Equation (8). The overall workflow of the proposed algorithm is similar to the Q-algorithm, adhering to the principle of not requiring any tag estimation scheme. The only difference with the Q-algorithm is the biased constants Cidle and Ccoll.Figure 2
The flowchart of the proposed HTEQ algorithm.


## 2.1. Analysis on Time Performance

In the FSA protocol, a reader informs tags of a frame size, in which the tags randomly select their responding slots. In such a model, the tag identification delay can be defined as the average time between two successively identified tags. Givenn tags, the tag identification delay in a frame size F is expressed as
(1)ηn,F=Tn,FF×Ps,where Tn,F and Ps denote the expected time duration of a frame and the probability that a tag is successfully identified in a slot given n and F, respectively. The probability that k tags respond in a slot is given by
(2)Px=k=Cnk1Fk1−1Fn−k.Based on Equation (2), the probabilities of a success, an empty, and a collision slot are expressed as Ps=Px=1,Pe=Px=0,andPc=Px>1, respectively. Then, the expected time duration of a frame can be calculated by summing up all the expected delays in the frame as below:
(3)Tn,F=F×Ps×Ts+F×Pe×Te+F×Pc×Tc,where Ts,Te,andTc are the time durations of a success, an empty, and a collision slot, respectively. Note that the delay of the frame per second is ignored for convenience’s sake. By Equations (2) and (3), Equation (1) can be rewritten as
(4)ηn,F=F×Ps×Ts+F×Pe×Te+F×Pc×TcF×Ps=Ts+F−1nλ−1+Fn1−1F1−n−1×Tc,where λ=Te/Tc.


## 2.2. HTEQ Algorithm

Having observed the tag identification delay, we can achieve the maximization of per-time tag identification efficiency by minimizing the tag identification delay as the following:(5)argminFηn,F.As the objective function is convex for bothn and F, the optimum should be obtained by partially differentiating the function for nn≥1 instead of F on which the inverse of the derivative does not exist. Therefore, arranging ∂η/∂η=0 with respect to F, we get the optimal frame size as below:
(6)F∗=1−e−1+WΘ/n−1,where W is the Lambert W function or product logarithm and Θ=η−1/e. We then get Pe∗ and Pc∗ under the optimal condition by putting F∗ to the probabilities. Using these probabilities, we can build a stationary condition that converges to and keeps the frame size remaining at the optimum as follows:
(7)Pc∗×Ccoll=Pe∗×Cidle.With this relationship, taking limits inPc∗/Pe∗ as n→∞ for 0<η<1, it gives us the asymptotic proportions of the empty and collision slots under the optimal condition, and hence, the optimal ratio Cidle∗/Ccoll∗ is also attained:
(8)limn→∞Pcoll∗Pidle∗=Cidle∗Ccoll∗=e1+WΘ−WΘ−2.Note that the ratio of the probabilities and the ratio of theC values are in a reciprocal relationship. Figure 2 provides a detailed procedure of the HTEQ algorithm, where Cidle and Ccoll are constrained by Equation (8). The overall workflow of the proposed algorithm is similar to the Q-algorithm, adhering to the principle of not requiring any tag estimation scheme. The only difference with the Q-algorithm is the biased constants Cidle and Ccoll.Figure 2
The flowchart of the proposed HTEQ algorithm.


## 3. Experimental Study

The performance of the proposed approach and the reference methods were examined by carrying out extensive simulations based on the Monte Carlo simulations. The performance of the tag identification algorithms is examined in two evaluation sessions with different comparison groups: (1) Group I for comparison betweenQ-algorithms, where the original Q-algorithm [1] and its variants in the strict sense of the term, Q+ [12] algorithm and fast Q [14] algorithm, are selected for the comparison, to prove the potential of the HTEQ algorithm, which relies on tag estimation and frame size determination strategies; (2) Group II for comparison with DFSA algorithms, where relatively recent, competitive DFSA algorithms, EACAEA [5] and TES-FAS [3], are chosen as the comparison targets. For the protocol parameters in the simulations, we adopt the same setting used in [14]: 1828.13 μs, 260.625 μs, and 516.625 μs are used for Ts,Te,andTc, respectively.For the fairness of the evaluation, theCidle and Ccoll values are recalculated accordingly with the aforementioned protocol parameters. Specifically, the Cidle and Ccoll values of fastQ remained the same as in [14]. For the sake of clarity of comparison, the Ccoll values of HTEQ and Q+ algorithm are set to be identical to the values of the fastQ algorithm, and the Cidle values are calculated using the ratios Cidle/Ccoll suggested by each algorithm. Table 1 summarizes the adjusted parameters. All the algorithms are implemented on MATLAB R2012b, and simulations are iterated up to 2000 times with varying random seeds [9, 17–19].Table 1
Parameters used for various algorithms.
AlgorithmsCcollCidleCidle/CcollHTEQ0.21180.08270.3906fastQ0.21180.15000.7081Q+ algorithm0.21180.15220.7182Q-algorithm0.21180.21181The simulation results in Figure3 show the identification delays for Q-algorithm-based collision arbitration algorithms to identify one tag. The simulations are carried out every 100 tags between 100 and 1000 tags to identify. Each result is recorded after 5000 iterations for the convergence of each simulation. In Figure 3, our proposed algorithm HTEQ clearly outperforms other reference algorithms. One interesting fact is that the performance of fastQ lies fairly behind that of HTEQ despite its own protocol parameter being used for the simulation. Most algorithms except the Q-algorithm are designed to be more sensitive to collision slots to quickly escape from undersized frames, which can make a huge overhead. They put more weight on the Ccoll value than Cidle.Figure 3
Comparison of identify delays of various algorithms.Hence,Cidle/Ccoll<1 holds in various algorithms. This is a rational approach; nevertheless, those algorithms except HTEQ did not consider a strict optimization of the Cidle/Ccoll value. For example, fastQ adopts 0.7081 for its Cidle/Ccoll value, but the optimal ratio is almost half of this value (0.3906), i.e., the fastQ algorithm may be fast, but not the fastest.The findings from an exhaustive simulation shown in Figure4 substantiate the contention above. The simulation results form an obvious convex shape on the Ccoll‐Cidle/Ccoll plane. The HTEQ algorithm is situated around the optimum area of the convex. The fastQ lies on the higher position Cidle/Ccoll=0.7081 and followed by the Q+ algorithm closely. This explains why fastQ and Q+ algorithm showed similar performance in Figure 3. As a result, it validates that the proposed HTEQ algorithm essentially achieved the highly efficient tag identification with the optimized parameter Cidle/Ccoll.Figure 4
Comparison of tag identification time per tag.As for the simulation results from Group II, shown in Figure5, HTEQ performs higher, where it consistently outdistances the other algorithms along with all the tag numbers. Given that OFLA and TES-FAS are exquisite algorithms designed to pursue the optimal frame size in regard to time efficiency, the difference in the performance is rather extraordinary. According to our in-depth analysis, both DFSA algorithms suffered from degradation due to the inaccurate tag cardinality estimation. As for OFLA, it is affected by imperfect frame size calculation in addition to the erroneous tag cardinality estimation.Figure 5
Performance comparison to DFSA algorithms.OFLA followed a similar process to HTEQ for finding the optimal frame size; however, it ended up with the use of the following approximation derived from a numerical method:(9)Fopt=a×m,where a is a linear approximation coefficient and a=1.44 is set for this environment. This is the reason that the performance of OFLA fluctuated along with the tag numbers. The time efficiency of OFLA rose and fall repeatedly according to whether Equation (9) gets closer to or away from the optimal curve which is a nonlinear curve as presented in Equation (6). In the case of TES-FAS, the degradation comes mostly from its inaccurate tag cardinality estimation. The maximum a posteriori estimator used in TES-FAS is known for a highly accurate tag cardinality; however, the subframe-based scheme and its own early frame adjustment feature caused the performance deterioration. The subframe-based scheme reassesses a current frame size whenever reaching its subframe sizes. As the small frame sizes given by the subframe-based scheme reduce sample sizes for tag cardinality estimation, significant estimation errors are accumulated. Although early frame adjustment may give an edge to TES-FAS over the evaluation, especially in the large-scale environment given in this paper, it turned out that the algorithm is caught between the trade-offs due to the degradation of tag cardinality estimation.On the other hand, HTEQ successfully found a closed-form solution for the optimal frame size and suggested the optimal relationship to determineCidle and Ccoll while maintaining the merits of the Q-algorithm. Note that this result is achieved without the consideration of computational cost, in which HTEQ is the most advantageous over the other DFSA algorithms. We assumed that the computational cost is neglectable in conceding that the excessive computational cost of the DFSA algorithms such as the MAP estimator can be reduced to that of the Q-algorithm-based algorithms by using a lookup table and additional memory space (0.3674 μs and 0.8451 μs, respectively, based on the computing power and computational overhead provided in [3]). The computation time that is amounting to 828 μs should be added to the identification time per tag of TES-FAS unless the lookup table is considered. In other words, HTEQ achieved the true optimal performance with a considerably lower computational cost of the Q-algorithm, without any assistance of additional resources.


## 4. Conclusion

This paper proposed a novel, highly time-efficientQ-algorithm for collision arbitration in large-scale IoT environments. The time performance of an FSA protocol deployed with the Q-algorithm is investigated, and the optimal parameters to maximize the per-time throughput of the Q-algorithm are derived based on the investigation. Our intensive simulations, including the exhaustive one and the comparison to the state-of-the-art DFSA algorithms, proved that the proposed algorithm is evidently the most time-efficient algorithm, taking full advantage of the innate strengths of the Q-algorithm.



---

*Source: 9967739-2021-05-10.xml*