## Materials and Methods
### Queue Length Estimation Algorithm Design  
#### 2.2.1 Basic Conditions  
To address the application conditions, without losing generality, the queue length estimation method proposed in this paper requires the following basic conditions:  
1. GPS and V2X modules are set on the automated vehicles, which can get and deliver the position and speed of vehicles. Nowadays, these modules are usually integrated in the automotive IoT module, such as modules supplied by Quectel corporation in China;
2. The edge computing server in the roadside units can accurately obtain the connected vehicle's ID and location;
3. There is at least one connected vehicle in each entrance lane for a sample cycle;
4. The length of the vehicles is not assumed to be identical, which is an enormous challenge to V2X-based traffic states sensing in a mixed traffic scenario.  
In our previous work, we proposed an algorithm for queue length estimation assuming that the length of vehicles is identical by converting according to the vehicle conversion coefficient [43].  
Nowadays, connected automated vehicles are not very popular. Comparing with traditional unconnected vehicles, the number of connected vehicles is rather few. Therefore, it is more realistic to consider the queue prediction of all unconnected vehicles for some sample cycles. There are many types of vehicles with different lengths travelling on the road. For connected vehicles, the characters including length, ID, weight of the vehicle are stored in the memory on board and can be delivered to other vehicles and roadside unit (RSU). However, for the unconnected vehicles, it is very difficult to get this information. Some literature refers to utilizing inductive loops to tackle this situation. The prediction task is done by information fusion. However, it is much less feasible to use and in addition, these infrastructures are expensive. To overcome these problems, a framework of IoT-based algorithm is proposed, that is a camera and V2X-based shockwave model integration to estimate the queue length at the signalized intersection.  
The task of queue length estimate based on IoT framework is achieved according to the following paradigm. As shown in Figure 2, queue length at the intersection is estimated based on computing results from the shockwave and image process. Some automated cars queuing at the intersection connect to the network through V2X, while traditional cars are not able to connect to the network. The connected car can provide computing service to estimate the queue length by exchanging information through V2X. Nevertheless, the system assumes that all the vehicles have the same dimension, which may not be the case in the actual situation. Thus, an image-based computing method is proposed to amend the result from V2X. It utilizes a DNN to classify the queuing vehicles in the image, and then calculates the queue length by counting and multiplying the length of every type. Suffering from the complex structure of DNN and the delivering delay from connected camera to the roadside unit, the queue length estimate result based on image usually takes a much longer time. Thus, these two methods are combined to estimate the queue length by the unified computing service framework. The computing details are shown in the following subsections.