# Artificial Intelligence-Based Discontinuous Reception for Energy Saving in 5G Networks
## 3 AI-DRX for Multiple Beam Communications
### Proposed AI-DRX Algorithm  
We propose artificial intelligence based DRX (AI-DRX) algorithm for multiple beams communications in 5G network. Our proposed algorithm enables DRX to achieve dynamic long or short sleep cycles and to reduce the power consumption of UE. AI-DRX algorithm works on ten-state model of DRX as shown in Figure 5. Algorithm 1 demonstrates AI-DRX mechanism and is elaborated below:  
* AI-DRX algorithm takes ON timer \(T_{ON}\), minimum threshold value \(Th_{Min}\) and maximum threshold value \(Th_{Max}\) as input (Line 1).
* AI-DRX examines the buffer for any incoming data packets (Line 2).
* If any packet is received in the buffer, the packets will be served and the value of dynamic sleep time \(T_{DY}\) will be predicted, simultaneously (Line 4).
* During the active time, if no beam misalignment occurs between UE and gNB, AI-DRX compares the predicted value of dynamic sleep time \(T_{DY}\) with threshold values \(Th_{Min}\) and \(Th_{Max}\).
* If the predicted value of dynamic sleep time \(T_{DY}\) is less than the minimum threshold value \(Th_{Min}\) (Line 8), UE continues to remain in the active time (Line 9).  
* If the predicted value of dynamic sleep time \(T_{DY}\) is greater than or equal to the minimum threshold value \(Th_{Min}\) and less than maximum threshold value \(Th_{Max}\) (Line 11). UE observes dynamic short sleep cycle (Line 12).
* In case of any beam misalignment after UE wakes up from dynamic short sleep cycle (Line 13), UE starts the beam training process (Line 14) and Feedback (Line 15) followed by ON time (Line 16).
* During ON time, if beam pairs are still misaligned (Line 17), UE searches beam pairs again (Line 18).
* During ON time, if a new packet arrives (Line 21), UE switches to active mode and start receiving data packets (Line 22).
* After completion of ON time, if no new packet arrives, UE continues to sleep for previous predicted time value \(T_{DY}\) of the long sleep cycle or short sleep cycle. respectively (Line 24).
* If \(T_{DY}\) is greater than \(Th_{Max}\) (Line 28) the UE will go to dynamic long sleep cycle (Line 29).
* UE will perform beam training and feedback after completion of each dynamic long sleep cycle (Line 30).
* In the case of beam misalignment during an active time (Line 35), UE performs beam training (Line 36) and feedback (Line 37) and then re-enter active time (Line 38).
* During the active time (Line 38), if UE still find beam misalignment (Line 39), AI-DRX executes beam training process again (Line 40).
* After the alignment of beam pairs, the UE transits to active time (Line 42).  
Figure 5: State diagram for AI-DRX.  
```
1:Input \(T_{ON}\), \(T_{Minit}\), \(T_{MMax}\)
2:Examine buffer for incoming packets
3:if Packets in buffer \(>0\)then
4:Serve the packets and Predict \(T_{DY}\) (\(S_{1}\))
5:else
6:if No Beam Misalignment then
7: Check \(T_{DY}\) (\(S_{1}\))
8:if\(T_{DY}<T_{Minit}\)then
9: Go to Step 4 (\(S_{0}\))
10:else
11:if\(Th_{Minit}\leq T_{DY}<T_{MMax}\)then
12: Go to Dynamic Short Sleep up to \(T_{DY}\) (\(S_{2}\))
13:if Beam Misalignment then
14: Execute Beam Training (\(S_{7}\))
15: Feedback (\(S_{8}\))
16: ON (\(S_{9}\))
17:if No Beam Aligned then
18: Go to Step 14 (\(S_{7}\))
19:endif
20:else
21:if New packet arrives before completion of ON Time \(T_{DY}\)then
22: Go to Step 4 (\(S_{9}\) to \(S_{0}\))
23:else
24: Go to Dynamic sleep for previous predicted time \(T_{DY}\) (\(S_{2}/S_{3}\))
25:endif
26:endif
27:else
28:if\(T_{DY}>T_{Mmax}\)then
29: Go to Dynamic Long sleep (\(S_{3}\))
30: Go to Step 14 (\(S_{7}\))
31:endif
32:endif
33:endif
34:else
35:if Beam Misalignment then
36: Execute Beam Training (\(S_{4}\))
37: Feedback (\(S_{5}\))
38: Active after Beam Training (\(S_{6}\))
39:if No Beam Aligned then
40: Go to Step 36 (\(S_{4}\))
41:else
42: Go to Step 4 (\(S_{0}\))
43:endif
44:endif
45:endif
46:endif
```  
**Algorithm 1** AI based DRX for Multiple Beam Communications.