## 4 Model Formulation
### Upper-Layer model  
Considering the fixed phase sequence in this study, the cycle length and phase duration will be optimized. To facilitate modelling, the NEMA ring barrier structure is adopted, according to Figure 5. Each ring's and barrier group's respective 2 phases are indexed as \(p=1\), 2. For instance, the phases in Figure 5 are indexed as \(p=1\) for pass directions m of 1, 3, 5, and 7 and as \(p=2\) for pass directions m of 2, 4, 6, and 8. A urban road traffic system is highly stochastic in nature. The traffic condition of the road network at any time depends not only on the incoming and outgoing traffic volume in the current period, but also on the traffic conditions and control strategies of previous cycles. Since the road network situation changes in each cycle, the traffic conditions of the previous cycles and the current cycle must be considered when optimizing the signal control strategy for the current cycle. The signal control system needs to be discretized into a multistep decision process to better adapt to changes in traffic operating conditions and the environment. Dynamic programming is a method to solve the optimization of the multistep decision process, which can transform the multistep optimal control problem into multiple one-step optimal control problems, and finally achieve optimal process results. Therefore, optimal signal timing in the upper layer is considered a discrete-time dynamic-programming issue. To prevent a dimension problem in the dynamic planning process, the idea from [PERSON]'s paper [11] is applied in this study. The barrier groups in the NEMA loop are used as the basic stages, and the CAVs and HVs in multiple signal cycles within prediction range T are made to pass the intersection in an optimal way by rolling and repeating barrier group 1 and barrier group 2. This is shown in Figure 6.  
The rolling repeated barrier group scheme fully considers the coupling relationship between the traffic situations of the previous and current cycles. As shown in Figure 7, in addressing a real-time traffic control problem, when the suggested model is solved using the most recent traffic state, the signal timing information of the previous two barrier groups is used. In the first barrier group, the optimization program applies the calculated signal timing results to the second signal timing cycle according to the real-time CAV and the predicted HV arrival information. Using Figure 7 as an illustration, throughout the  
Figure 4: Three-layer optimization model framework. Figure 5: Ring barrier controller structure. first barrier group of the current signal control cycle, the model optimizes the supplied data using a calculation, and the results of the optimization calculation determine the signal control scheme and CAV trajectory planning of the first barrier group in the second cycle. The CAV of the first barrier group in the second cycle begins to leave the adjustment zone and enter the designated CAV lane once the first barrier group in the first cycle has completed its operation. The real-time entrance speed and the signal control timing are used to change the speed of the CAV queue in the passing zone and the variable virtual waiting zone. Similarly, the second barrier group in the first cycle will affect the second barrier group's signal control scheme and CAV trajectory planning in the second cycle. In this way, a rolling repetitive barrier group scheme is formed. The upper-layer control model discretizes the optimal signal duration problem into a time-based dynamic programming problem. The state update frequency is set to \(\Delta t\), meaning that the objective function is computed every \(t\) seconds, and the total signal control duration is \(T\). State \(s_{j}\) at stage \(j\) is defined as the sum of time steps allotted up to stage \(j-1\). The decision variable \(u_{j}\) is used to represent how many time steps were allowed to stage \(j\).