RabbitMQ Parking Sessions
Parking Session Logging
The second generation of Parking Session Logging API is designed for comprehensive parking session representation.
It provides robust session integrity control and auto-correction service in the case of partial sensor message loss.
This API allows customers to focus on business applications of parking sessions instead of postprocessing of individual sensor occupancies.
This API includes sensors’ positioning, grouping and zoning attributes so that your data receiving service can be stateless.
General Info
The API can be used with all types of parking lots: marked spaces, open bays, off-street parking and garages.
Please, watch the video at the end of this document to learn how to set up RabbitMQ Endpoint in the Nwave Console.
API details
Data objects
Every parking session is described by the following data structure:
{
"parking_session_uuid": "string",
"correction_counter": integer,
"session_start":{
"event_time": "string" // timestamptz, yyyy-MM-dd'T'HH:mm:ss.SSSXXX (2019-06-13T16:16:51.000+00:00)
"delta_time_sec": integer,
"message_trace_ids":["strings""]
},
"partial_end":{
"event_time": "string" // timestamptz, yyyy-MM-dd'T'HH:mm:ss.SSSXXX (2019-06-13T16:16:51.000+00:00)
"delta_time_sec": "integer",
"message_trace_ids":["strings"],
"network_id": "string", // unexpectedly released position
"custom_id": "string"
},
"session_end":{
"event_time": "string" // timestamptz, yyyy-MM-dd'T'HH:mm:ss.SSSXXX (2019-06-13T16:16:51.000+00:00)
"delta_time_sec": integer,
"message_trace_ids":["strings"]
},
"involved_devices":[
{
"serial_id": "string", # deprecated
"device_id": "string",
"hardware_type": "string",
"position":{
"network_id": "string",
"custom_id": "string",
"latitude": float,
"longitude": float,
"group":{
"id": int,
"type": "string",
"name": "string",
"custom_id": "string",
"zone_id": int,
"level_id": int,
"level_name": "string",
"floor_number": int
},
"group_inner_id": int,
"labels":["string"]
}
},
...
],
"auth_ble_tag": {
"tag_id": "string",
"event_time": "string"
},
"auth_mobile": {
"session_id": "string",
"event_time": "string"
}
}
Objects description
parking_session_uuid
- a unique parking session-id;
correction_counter
- total number of corrections.
"session_start":{
"event_time":string // timestamptz, yyyy-MM-dd'T'HH:mm:ss.SSSXXX (2019-06-13T16:16:51.000+00:00)
"delta_time_sec":integer,
"message_trace_ids":[strings]
}
The object session_start
is sent to open a parking occupancy session:
event_time
- a session start timestamp;
delta_time_sec
- an error of session start time in seconds;
message_trace_ids
- tracing identifiers of raw device messages related to the session start
"session_end":{
"event_time":string // timestamptz, yyyy-MM-dd'T'HH:mm:ss.SSSXXX (2019-06-13T16:16:51.000+00:00)
"delta_time_sec":integer,
"message_trace_ids":[strings]
}
The object session_end
is sent to close a parking occupancy session:
event_time
- a session end timestamp;
delta_time_sec
- an error of session end time in seconds;
message_trace_ids
- tracing identifiers of raw device related to the session end.
partial_end
object can be received only for Open Bay parking type
A partial end is an event where two sensors were occupied in an open bay session but only one sensor was released. This is a temporary state of parking sessions. A session_end
object will always be sent when the second sensor is released in that session.
event_time
- a timestamp of unexpected sensor release;
delta_time_sec
- a timestamp error in seconds;
message_trace_ids
- tracing identifiers of messages which describe unexpected release;
network_id
- network_id of a sensor’s position that was unexpectedly released;
custom_id
- a user-defined identifier of a sensor’s position that was unexpectedly released.
involved_devices
- a list which contains a description of parking sensors involved in a parking session;
serial_id
- a parking sensor serial ID (deprecated);
device_id
- a parking sensor serial ID;
hardware_type
- a parking sensor hardware model;
position
.network_id
- a position network_id;
position
.custom_id
- a position user-defined identifier;
position
.latitude
/longitude
- a position geolocation coordinates;
position
.group
.id
- a position group ID;
position
.group
.type
- a position group type. Possible values: general
, unmarked_parking_bay
, marked_parking_bay
;
position
.group
.name
- a position group name;
position
.group
.custom_id
- a position group user-defined ID;
position
.group
.zone_id
- an ID of a zone which contains positions group;
position
.group
.level_id
- an ID of level (floor) which contains positions group;
position
.group
.level_name
- a Name of level (floor) which contains positions group;
position
.group
.floor_number
- a floor number which contains positions group;
position
.group_inner_id
- an index number of a position in positions group;
position
.labels
- list of position labels
The object auth_ble_tag
contains user authorization information if a user authorized on parking space using Nwave’s BLE-Tag;
tag_id
- ID of BLE-Tag;
event_time
- a timestamp of user authorization.
The object auth_mobile
contains user authorization information if a user authorized on a parking space using mobile application connected to the Nwave One-Click Check-in service;
one_click_session_id
- an ID of One-Click Check-in session;
event_time
- a timestamp of user authorization.
Examples
Session start message
When a parking session starts, the Nwave cloud builds a message that contains only data about the sensor and time of parking session beginning.
It can contain one or two described devices depending on the device’s group type.
as you can see, the value of field delta_time_sec
is 60. It means, that real parking session start time is between 2021-01-26T07:48:40 - 60 sec
and 2021-01-26T07:48:40 + 60 sec
.
Session end message
Partial-end message
Partial-end is possible only for unmarked group type when a car parks on 2 neighbouring sensors. When a car releases only a single sensor, the partial-end message is sent. When the car releases the second sensor, the session end message is sent. This event can happen when a car tries to join traffic on a busy road.
Here we show an example of the partial-end message:
In the example above you can see that object “partial-end” contains only one sensor.
When the second sensor in the session is released, the Nwave cloud will add a “session-end” object to the end of the partial-end message.
Session edges correction
As you can see in the examples above, all the messages contain the correction_counter
field. This field and the field parking_session_uuid
allows you to apply corrections to parking sessions in the right order.
Parking session correction is an important functionality of Parking Session Logging API. The wireless data reception is not ideal, so some messages may be lost. To minimize this effect, Nwave recommends to use at least 2 stations in the same area, but message loss is still possible. Nwave Cloud analyzes additional data from parking sensors and recovers most of the lost messages. When a message is recovered, the Nwave Cloud analyzes occupancy history and makes a correction. It may correct the session’s start or end time as well as create new parking sessions.
For example, let’s consider 2 messages describing the parking session starting:
The message above contains the session_start
object with delta_time_sec
field equal to 0 and correction_counter
field equal to 0. The following message corrects the previous one and decreases session start time delta.
As you can see, the correction message contains the same parking_session_uuid
, incremented correction_counter
and more accurate event_time
. The second message contains different “message”trace_ids”
Endpoint & Route Setup