...
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.
Code Block | ||
---|---|---|
| ||
{
"parking_session_uuid": "e9fcc95e-b9cd-4e7f-b275-092a62daf61d",
"involved_devices": [
{
"device_id": "a33b47",
"hardware_type": "Sparkit Surface V3.9",
"position": {
"network_id": "23f3e949-2dd3-47ca-b00f-c3310d4ce418",
"custom_id": "684d395c-e875-422a-904d-c095ad981cc6",
"latitude": 50.793682,
"longitude": -1.0986286,
"group": {
"id": 1545,
"type": "unmarked_parking_bay",
"name": "cambridgepark32",
"custom_id": "684d395c-e875-422a-904d-c095ad981cc6",
"zone_id": 5,
"level_id": null,
"floor_number": null
},
"group_inner_id": 1
}
}
],
"correction_counter": 0,
"session_start": {
"event_time": "2021-01-26T07:48:40.121000+00:00",
"delta_time_sec": 60,
"message_trace_ids":
[
"d1b6d450-cc5f-83d4-adbe-c9f5383fb0d8"
]
}
} |
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
Code Block | ||
---|---|---|
| ||
{
"parking_session_uuid": "e9fcc95e-b9cd-4e7f-b275-092a62daf61d",
"involved_devices": [
{
"device_id": "a33b47",
"hardware_type": "Sparkit Surface V3.9",
"position": {
"network_id": "23f3e949-2dd3-47ca-b00f-c3310d4ce418",
"custom_id": "684d395c-e875-422a-904d-c095ad981cc6",
"latitude": 50.793682,
"longitude": -1.0986286,
"group": {
"id": 1545,
"type": "unmarked_parking_bay",
"name": "cambridgepark32",
"custom_id": "684d395c-e875-422a-904d-c095ad981cc6",
"zone_id": 5,
"level_id": null,
"floor_number": null
},
"group_inner_id": 1
}
}
],
"correction_counter": 0,
"session_start": {
"event_time": "2021-01-26T07:48:40.121000+00:00",
"delta_time_sec": 60,
"message_trace_ids": [
"d1b6d450-cc5f-83d4-adbe-c9f5383fb0d8"
]
},
"session_end": {
"event_time": "2021-01-26T07:51:26.466000+00:00",
"delta_time_sec": 0,
"message_trace_ids": [
"06f75246-20e5-9d48-404b-fa965bbdefe7"
]
}
} |
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:
Code Block | ||
---|---|---|
| ||
{
"parking_session_uuid": "da2ecb68-efb1-458e-ba5d-e5ba80b87f6e",
"involved_devices": [
{
"device_id": "33c83",
"hardware_type": "Sparkit Surface V3.9",
"position": {
"network_id": "00000000-0000-0000-0000-000000033c83",
"custom_id": "cd4206ec-6876-4eca-b859-d5735dd97386",
"latitude": 50.780323,
"longitude": -1.0682689,
"group": {
"id": 1729,
"type": "unmarked_parking_bay",
"name": "5EastneyEsplanade",
"custom_id": "cd4206ec-6876-4eca-b859-d5735dd97386",
"zone_id": 5,
"level_id": null,
"floor_number": null
},
"group_inner_id": 54
}
}, {
"device_id": "33e5f",
"hardware_type": "Sparkit Surface V3.9",
"position": {
"network_id": "00000000-0000-0000-0000-000000033e5f",
"custom_id": "cd4206ec-6876-4eca-b859-d5735dd97386",
"latitude": 50.78033,
"longitude": -1.0682275,
"group": {
"id": 1729,
"type": "unmarked_parking_bay",
"name": "5EastneyEsplanade",
"custom_id": "cd4206ec-6876-4eca-b859-d5735dd97386",
"zone_id": 5,
"level_id": null,
"floor_number": null
},
"group_inner_id": 55
}
}
],
"correction_counter": 0,
"session_start": {
"event_time": "2021-01-26T09:54:08.287000+00:00",
"delta_time_sec": 0,
"message_trace_ids": [
"65ab2a63-e7c2-8674-aa3d-7047cb428a31"
]
},
"partial_end": {
"event_time": "2021-01-26T10:03:23.900000+00:00",
"delta_time_sec": 0,
"message_trace_ids": [
"56d9035a-e4dc-9661-0804-a968d9a92d0b"
],
"network_id": "00000000-0000-0000-0000-000000033e5f",
"custom_id": "cd4206ec-6876-4eca-b859-d5735dd97386"
}
} |
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.
Expand | ||
---|---|---|
|
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:
Code Block | ||
---|---|---|
| ||
{
"parking_session_uuid": "da2ecb68-efb1-458e-ba5d-e5ba80b87f6e",
"involved_devices": [
{
...
}
],
"correction_counter": 0,
"session_start": {
"event_time": "2021-01-26T09:54:08.287000+00:00",
"delta_time_sec": 120,
"message_trace_ids": [
"65ab2a63-e7c2-8674-aa3d-7047cb428a31"
]
},
...
} |
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.
Code Block | ||
---|---|---|
| ||
{
"parking_session_uuid": "da2ecb68-efb1-458e-ba5d-e5ba80b87f6e",
"involved_devices": [
{
...
}
],
"correction_counter": 1,
"session_start": {
"event_time": "2021-01-26T09:55:32.944000+00:00",
"delta_time_sec": 0,
"message_trace_ids": [
"857e7628-38d4-4497-9229-c25d78096d52"
]
},
...
} |
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”
Info |
---|
You can find RabbitMQ configuration instruction on the special documentation page https://nwaveio.atlassian.net/wiki/pages/createpage.action?spaceKey=RAP&title=RabbitMQ%20messaging%20explanation&linkCreation=true&fromPageId=1856962570 |
Endpoint & Route Setup
...