In an Internet of Vehicles (IoV) scenario, a vehicle's metadata consists of its inherent properties, such as the vehicle identification number, exterior color, and engine model, and its latest status data, such as the current GPS coordinates, engine speed, and vehicle speed. This topic describes how to design table schemas and search index structures for IoV scenarios.
Table schema
Assume that the table used to store vehicle metadata is named vehicles_metadata. The following table describes its schema.
For more information about table design, see Table design.
Field name | Type | Description |
vin_id (Primary key column) | String | The vehicle identification number (VIN). It uniquely identifies a vehicle. |
v_color | String | The exterior color of the vehicle. |
license_plate_number | String | The license plate number. |
mileage | Double | The current mileage. |
speed | Double | The current speed. |
pressure_level | String | The pressure level. |
engine_rpm | Integer | Engine speed. |
inner_temp | Double | The interior temperature. |
outer_temp | Double | The exterior temperature. |
gps | String | The GPS coordinates of the vehicle. For example, |
ignition_state | String | The ignition state. Valid values:
|
bms_soc | Double | Emission value |
Search index structure
Assume that a search index named vehicles_metadata_index is created for the vehicles_metadata table. The following table shows the structure of the search index. Select index fields and field types that are suitable for your query scenarios.
The data types in the search index must match the corresponding data types in the data table. If the types do not match, the data is discarded as dirty data. Additionally, Geo-point and Nested types require specific formats. If the format is incorrect, the data is also discarded. This can result in data that is queryable in the table but not in the search index. For more information about data type mapping, see Data types.
Field name | Type |
vin_id | Keyword |
v_color | Keyword |
license_plate_number | Text |
mileage | Double |
speed | Double |
pressure_level | Keyword |
engine_rpm | Long |
inner_temp | Double |
outer_temp | Double |
gps | Geo-point |
ignition_state | Keyword |
bms_soc | Double |