• 沒有找到結果。

Model Function for Movements of Vehicles

Acquisition in Vehicular Sensor Networks

2.3 Model Functions and In-Network Aggregation in Vehicle Sidesin Vehicle Sides

2.3.2 Model Function for Movements of Vehicles

In light of the objective of model functions, this section presents algorithm LR to model movements of vehicles. Since the movements of vehicles are on the road networks that consist of road segments, movements of vehicles can be modeled as a series of line segments that could fit road segments of road networks. Instead of transmitting the detailed position information of vehicles, a series of line segments can be used to approximate movements of vehicles. Thus, the amount of position data reported by vehicles can be reduced.

Background of Linear Regression

Since the positions of a vehicle are relevant to time, we can represent the positions with respect to time into a sequence of position points(x1, y1, t1), ...(xm, ym, tm), where xi and yi is the longitude and latitude of the vehicle at time ti. Denote (X(t), Y (t)) be the estimated coordinate of a vehicle at time t. We intend to derive two vectors (ax, ay) and (bx, by) such that (X(t), Y (t)) = (ax, ay) × t + (bx, by)

Since the new position points of vehicles keep generating and are recorded at the vehicle side, one challenge issue is that whether we should use another new line to represent the recent movements or not. Thus, we should justify whether the line derived by recent movements is similar to the original line or not.

Suppose that the coefficient matrices of a linear regression line L are A =

· ax ay bx by

¸

. The direction vector ofL, denoted as −→vL, is represented as(ax, ay).

The similarity of two lines could be measured as cosine similarity. Assume that we have direction vectors −→vL1 and −→vL2. The similarity of two vectors is formulated as sim(−→vL1, −→vL2) = |−−→v−−→vL1·−−→vL2

L1||−−→vL2|. The larger value in the cosine similarity between two vectors, the more similar in their lines.

Design of algorithm LR

Given an error threshold²`, the derived model functions ˆf should make sure that the value of RM SE(S, ˆf ) is smaller than ²`. To guarantee that the RMSE is bounded, algorithm LR should detect the variation of movements such that a ve-hicle can upload the regression line that can best represent the current movement.

To achieve this goal, a vehicle should maintain four linear regression lines: the line derived at current time point (denoted as CL), the line uploaded to the cen-tralized server last time (denoted asSL), the backward line (denoted as BL) and the forward line (denoted asN CL). In the beginning, algorithm LR keeps collect-ing position data points until the number of data points is larger than a threshold Nmin. It is because that if there are a few position points collected, a new coming point may affect the direction ofCL significantly. Thus, a vehicle should collect sufficient amount of data points such that the derivedCL can capture the current movement from these data points. Then, the CL will be first sent to the server side and be stored in the both side as SL. Consequently, the server side can use SL to derive the moving behavior of a vehicle. For example, given Nmin = 4, there are four data points in Figure 2.3(a). TheCL is first generated by these data points. CL is also stored as SL and CL is uploaded to the server side.

With time passing by, a vehicle collects more and more position points. The movements may become complicated and thus need be described by several linear regression lines rather than one. For example, in Figure 2.3(e), it can be seen that this vehicle makes a turn betweend5andd6, and the originalSL in Figure 2.3(a) cannot represent its moving behavior after d6. To detect such deviation, a break point is used to divide the whole set of data points into two subsets. According to such a break point, we can decide which position points can be used to derive a new CL to represent its current moving behavior precisely. Thus, the server

can capture new behavior by deriving SL according to the new regression line uploaded.

Algorithm LR incrementally maintains a potential break pointb to verify whether the moving direction changes or not. Specifically, suppose that the current posi-tion points involving in CL are (d1, d2, ..., dk) where dk is a new incoming po-sition point. According to a potential break point b, we can derive a backward regression line BL for (d1, ..., b = dj) and a forward regression line N CL for (dj, ..., dk) with their direction vectors −−→vBL and −v−−→N CL. Given a threshold β, if sim(−−→vBL, −−→vBL) > β, the moving behavior described by position points before and afterb does not change tremendously so that b is set to be the new coming posi-tion pointdk. Otherwise, the position ofb does not change since position points before b and that after b may represent different moving behavior. Given the er-ror bound for trajectories²T, if theRM SE((d1, ..., dk), SL) > ²T, these position points represent different moving behavior thanSL does. In this case, a vehicle should upload the forward regression line N CL to the server to set the CL and SL to be N CL to guarantee the model satisfying the error bound. The detailed algorithm is shown below:

Consider an illustrative example in Figure 2.3. The threshold β is shown in terms of angle. Once the angle between two vectors are larger than the given angle, the similarity between these two vectors are larger thanβ. In the beginning, in Figure 2.3(a), theCL is uploaded to the server side and also stored as SL. From d4 to d5, the potential break pointb keeps going forward to be d4 and d5 since sim(−−→

VBL,−−−→

VN CL) > β. With the new data points d6 coming, as shown in Figure 2.3(b), the break pointb keep being d5sincesim(−−→VBL,−−−→VN CL) < β. However, the line N CL is unnecessary to be uploaded to the server side. Figure 2.3(c) shows that CL is still like SL. Until d8 is generated, Figure 2.3(e) shows that RMSE betweend6,d7,d8andSL is large enough. Thus, as shown in Figure 2.3(d), the

Algorithm 1: Algorithm LR

INPUT : Error Bound: ²`; Spliting Threshold:β; Minimum Number of Data Points: Nmin

OUTPUT: The uploaded line:SL

while there is a new incoming data pointdkdo

1

if the number of points≤ Nminthen