## 4 Optimizing Shift Strategy Based on DP  
The dynamic programming algorithm is used to solve the optimization problem, by decomposing it into simpler sub-problems, and using the optimal solution of its sub-problems to obtain the optimal solution of the overall problem. Compared to the exhaustive attack method, DP not only reduces the amount of calculation, but also obtains many useful intermediate calculation processes [22]. After completing the modification of the AT economical shift strategy based on vehicle load and road slope, the DP algorithm will be used for global optimization.  
The gear state \(n_{g}(k)\) is used as a state variable, and the shift command \(u_{g}(k)\) is used as a control variable. For this \(6+2\) speed AT shift command, '\(-1\)' means to downshift one gear;  
Figure 6: Modification of shift strategy based on (**a**) vehicle load and (**b**) road slope.  
\({}^{\prime}0^{\prime}\) means to maintain the current gear; and '\(1^{\prime}\) means to upshift one gear \(u_{g}(k)=(-1,0,1)\). As a stepped transmission, it is necessary to discretize the AT gears ratios  
\[n_{g}(k+1)=\begin{cases}1,&if\;\;n_{g}(k)+u_{g}(k)\leq 1\\ 6,&if\;\;n_{g}(k)+u_{g}(k)\geq 6\\ n_{g}(k)+u_{g}(k),&other\end{cases}. \tag{19}\]  
Under the known driving conditions with vehicle speed, throttle opening, load, and road slope, the minimum vehicle fuel consumption is established as the optimization objective function, and then the optimal control sequence of the state variables \(n_{g}^{*}(k)\) can be solved  
\[n_{g}^{*}(k)=\underset{n_{g}(k)}{\operatorname{argmin}}Q=\sum_{k=0}^{N-1}b_{ E}(k)\Delta t. \tag{20}\]  
The optimization objective function of fuel consumption is  
\[J_{k}^{*}\big{(}n_{g}(k)\big{)}=\underset{u(k)}{\operatorname{min}}Q(k) \Delta t+J_{k}^{*}\big{(}n_{g}(k+1)\big{)}. \tag{21}\]  
Under the known actual road conditions, there are some situations where the road slope fluctuates violently. These fluctuations of the road slope may cause sudden changes in throttle opening and braking, while vehicle speed changes with a lag, which will lead the AT into cyclically shift. It is better to avoid or reduce these cyclic shifts because they not only reduce comfort and increase fuel consumption, but also accelerate clutch wear, which seriously affects the service life of the AT.  
\[\eta(k)=\lambda\big{|}n_{g}(k+1)-n_{g}(k)\big{|}, \tag{22}\]  
where, \(\lambda\) is the penalty coefficients for the number of shifts.  
The final objective function of DP optimization is:  
\[J_{k}^{*}\big{(}n_{g}(k)\big{)}=\underset{u(k)}{\operatorname{min}}\big{[}Q(k )\Delta t+J_{k}^{*}\big{(}n_{g}(k+1)\big{)}+\eta(k)\big{]}. \tag{23}\]  
Moreover, it is necessary to consider constraints caused by the engine.  
\[\left\{\begin{array}{c}\omega_{E,\min}\leq\omega_{E}(k)\leq\omega_{E,\max} \\ 0\leq T_{E}(k)\leq T_{E,\max}\end{array}\right.. \tag{24}\]  
The constraint variables in the transmission are  
\[u_{g}(k)=\begin{cases}\{0,1\},&if\;\;n_{g}(k)=1\\ \{-1,0\},&if\;\;n_{g}(k)=6\\ \{-1,0,1\},&other\\ 1\leq n_{g}(k)\leq 6\\ \sum\limits_{k=0}^{N-1}u_{g}(k)=0\end{cases}. \tag{25}\]  
The known working condition is divided into N stages, and the sampling step \(\Delta t\) is set to one second. Starting from the Nth stage of the last second, the entire condition is calculated from the bottom up to the first stage, so as to obtain the economical optimal solution for each stage of gear \(n_{g}(k)\) and shift command \(u_{g}(k)\). At a certain time, \(k\), the calculation steps based on DP is shown in Figure 7.