## 4 Proposed CPCROK Scheme
### Ikf-Cgtgm  
In this method, mRNAs are required to store beacons and the number of pseudonym changes for vehicles. When a vehicle enters the mix zone, the mRSU checks if the number of pseudonym changes reaches the limit. If this vehicle has passed adequate mix zones, there is no need to generate fake beacons. However, if this vehicle is still vulnerable, the mRSU will retrieve beacons for this vehicle and report to the IKF-CGTGM. This module is used to preprocess the real vehicle trajectories to gather coarse-grained predictions. The traditional Kalman filter makes state estimations in a linear dynamic system. However, the vehicle maneuver in the junction cannot be regarded as a linear movement. Steering angle and radius have a great influence on the results predicted by a linear model. Thus, the traditional Kalman filter is not suitable for estimating vehicle behaviors in junctions. As a result, an improved Kalman filter (IKF) is introduced using beacons before a vehicle enters the mix zone to establish a model. Then IKF-CGTGM involves the steering angle of this vehicle to continue updating the model by giving the predicted state a deflection direction. When a vehicle has passed a junction, the information extracted from beacons is passed to the IKF, which includes vehicle ID, vehicle trajectory before entering the mix zone, length of the beacon sequence in the mix zone, and the system command. Before the vehicle enters the mix zone, its trajectory information is open to everyone. The traditional Kalman filter can be used to gather estimations \(x\) by continuously updating the Kalman gain \(K\) and covariance matrix \(P\) in the iterative process. In accordance with the traditional Kalman filter, all trajectory points are involved in the iteration as measurements \(Z\), in which the speed is focused only:  
\[Z= \begin{bmatrix}v_{x}\\ v_{y}\end{bmatrix}  \tag{9}\]  
In a certain iteration \(i\), the speed information of the trajectory point predicted by the Kalman filter is corrected by the measurement matrix \(Z_{i}\) from \(\hat{x}_{i}\) to \(x_{i}\). Figure 3: Flowchart of CPCROK modules. However, the vehicle information inside the mix zone is not provided to the IKF since the objective is to predict the vehicle's complete journey within the mix zone. The iteration in the traditional Kalman filter stops at the edge of the mix zone. Therefore, a new observation matrix based on the predicted state and the system command is generated to continue the update step. The system command is the angle \(\theta\) that the vehicle is expected to turn in the mix zone, given the inbound angle \(\theta_{in}\) and outbound angle \(\theta_{out}\):  
\[\theta=\pm(\theta_{in}+\theta_{out}) \tag{10}\]  
If the vehicle chooses to take a right turn within (\(0^{\circ},180^{\circ}\)), \(\theta\) takes a positive value; otherwise, \(\theta\) takes a negative value. The direction of the predicted state is changed by the system command to create a definite measurement \(Z^{{}^{\prime}}\):  
\[Z^{{}^{\prime}}= \begin{bmatrix}v_{y}\times sin\theta_{correct}+v_{x}\times cos \theta_{correct}\\ v_{y}\times cos\theta_{correct}-v_{x}\times sin\theta_{correct}\end{bmatrix}  \tag{11}\]  
where:  
\[\theta_{correct}=\frac{1}{2}\theta \tag{12}\]  
The decision to use \(\frac{1}{2}\theta\) for angle correction in our model was empirically determined. If \(Z^{{}^{\prime}}\) is amended by \(\theta\) after each iteration, it will cause the vehicle to turn too quickly during predictions. Therefore, \(\theta_{correct}\) is used instead to make the rotation smoother. We experimented with various correction factors and found that \(\frac{1}{2}\theta\) consistently yielded a coarse-grained trajectory that closely approximates the real one. This specific adjustment is crucial not only for enhancing the performance of our model but also for optimizing computational efficiency. By reducing the complexity of the input to the RNN, we effectively decrease the computational overhead required, thereby accelerating the generation of fake beacons.