# A Traffic Information Detection Method at Single Intersection Based on Wi-Fi Data
## 3 Methodology
### Calculation of Intersection Data
#### 3.3.1 Road Target Detection Based on MAC Address Matching  
The road target detected based on Wi-Fi data is defined as follows: the target passes through the Wi-Fi data collection points, including the upstream, crossing, and downstream of the intersection successively within a reasonable time range (the upstream and downstream here depend on the road target running track). All three collection sites were able to detect Wi-Fi signals from the target. The data collected by multiple device groups located at each collection point around the intersection are fused. \(data_{o}\) is the Wi-Fi data set of the intersection collection point. \(data_{e}\), \(data_{w}\), \(data_{s}\), and \(data_{n}\) are the Wi-Fi data sets of the four adjacent sections around the intersection in the east, west, south, and north directions. Taking the detection of road targets passing through the intersection from east to west as an example, the specific steps of the MAC address matching algorithm for Wi-Fi data at a single intersection are as follows:  
Step 1: The MAC address set that has not appeared for three consecutive minutes at the t minute in the data set data\({}_{o}\) is found in chronological order and is denoted as \(M\). Step 2: Wi-Fi data set \(data_{e}^{t}\) within the minutes from \(t-13\) to \(t-3\) is extracted in \(data_{e}\), and Wi-Fi data set \(data_{w}^{t}\) within the minutes from \(t-3\) to \(t+7\) is extracted in data\({}_{w}\). Step 3: Iterate over the MAC addresses in the data set \(M\). If the Wi-Fi data record corresponding to the MAC address can be found in \(data_{e}^{t}\) and \(data_{w}^{t}\), the target corresponding to the MAC address is the detected road target. Then, the timestamp corresponding to the maximum RSS (Wi-Fi signal strength) in the Wi-Fi data record of the collection point is regarded as the time when this road target passes through the location of the corresponding collection point. Step 4: The road target and its related information constitute the road target data set, which is denoted as \(obj-dataset\). The data set mainly includes the MAC address of the road target \(obj_{o}\), the corresponding travel time \(t_{o}^{in}\) of the entrance section when passing the intersection, the travel speed \(v_{o}^{in}\) of the entrance section, the travel time \(t_{o}^{out}\) of the exit \begin{table}
\begin{tabular}{c c c} \hline
**MAC Addresses** & **Timestamp** & **RSS** \\ \hline
50:XX:55:0F:F9:00 & 2019.4.24 08:25:01 & \(-87\) \\
78:XX:51:07:1E:19 & 2019.4.24 08:25:01 & \(-85\) \\ F0:X:59:18:24:7:35 & 2019.4.24 08:50:33 & \(-44\) \\
94:XX:29:7E:9:2 FD & 2019.4.24 09:52:06 & \(-75\) \\ B4:XX:44:EB:6:0F & 2019.4.24 12:20:26 & \(-7\) \\
1C:XX:CE:53:1E:23 & 2019.4.24 12:32:34 & \(-90\) \\ D4:XX:3F:46:68:67 & 2019.4.24 15:53:45 & \(-94\) \\
00:XX:4C:10:11:82 & 2019.4.24 08:50:56 & \(-39\) \\ \hline \end{tabular}
\end{table} 
Table 1: Examples of preprocessed data. section, the travel speed \(v_{o}^{out}\) of the exit section, and the orientation of the upstream and downstream collection points. Add one and jump to step 1 after completing the traversal. After MAC address matching, the road target \(obj_{o}\) passes through the intersection, the timestamps \(t_{o}^{st}\), \(t_{o}^{cc}\), and \(t_{o}^{nd}\) can be obtained when the target successively passes the data collection points upstream, crossing, and downstream of the intersection. Further, the travel time and travel speed of the road target passing through the entrance and exit sections of the intersection can be obtained by combining the actual location and relative distance of the collection point. The calculation is detailed in Formulas (6)-(9).