Skip to main content
Version: latest

Google BigQuery Integration

BigQuery is a serverless data warehouse providing scalable data analysis. Most business intelligence tools support data import from Google BigQuery giving access to the video analysis results in the familiar tools. Ultinous AI Suite produces alarms, counting and object detection information which can be made available as database records in Google BigQuery.

Before you start

Please make sure that you have:

  • A registered Google account for Google Cloud.
  • A new Google Cloud Project is created by you or your system administrator, and your Google Account has access to it.

Setup Google BigQuery

Create Credentials

  1. Login to Google Cloud Console.

  2. Open the hamburger menu on the upper left corner of the screen -> click APIs & Services.

  3. Click Credentials.

  4. Click + Create Credentials -> select Service Account

  5. Fill in the Service account name field: e.g. "AI Suite Service Account".

  6. You may leave the Service Account ID as default (auto generated).

  7. Click the Create and Continue button.

  8. The credentials are added to your Service Accounts list. Click on the new list item.

  9. Click the KEYS tab.

  10. Click Add Key -> Create new key.

  11. Select .json format.

  12. Click the Create button.

  13. Download the .json file.

NOTE: Make sure you don't lose this file for it cannot be obtained again without creating new credentials as well. This file will have to be uploaded to Ultinous AI Suite in a later step.

  1. Click the DETAILS tab.

  2. Copy the text in the Email section.

Create a BigQuery dataset

  1. Go to the hamburger menu on the upper left corner of the screen -> Click BigQuery.
  1. Find your project and click the ... button next to it -> Click Create Dataset.
  1. Add a new ID. and click the Create Dataset button.

Connect your Service Account with the new dataset

  1. Find your new dataset and Click ... button next to it -> Share
  1. In the Dataset Permission panel, click Add Principal.
  1. In the New principal field, paste the Service Account Email text you have copied in the Create Credentials section's steps.
  1. Set the Role to BigQuery Data Editor.

  2. Click SAVE.

Connect Ultinous AI Suite with your Google BigQuery dataset

Add your credentials to Ultinous AI Suite

  1. Go To Control Panel -> Integration.
  1. Scroll down to the Google BigQuery Credentials section, then upload the .json file you have downloaded in the Create Credentials step.
  1. Once it's successfully uploaded you can test if everything is set up correctly: To do so, type your dataset name in the Test Credentials section and click the button under it. If your settings are correct, a "Dataset accessed successfully" message will appear.

Enable BigQuery integration in your solution

  1. Register a new solution in your Solutions menu.

  2. In it configuration form, scroll down to Integration, then tick Google BigQuery.

  3. Type your dataset name.

  4. Add a table name. It will be created automatically if it does not exist yet.

    NOTE: For the same site, consider using the same table where you would like to handle data from the same site.0

Using the analytics data

NOTE: In extremely rare cases Google inserts a record multiple times. To filter duplicate records you can use SELECT DISTINCT * .... in your query.

Traffic counting data

Field NameTypeModeInfo
timestampTIMESTAMPNULLABLEThe time of the line crossing.
indexINTEGERNULLABLESince multiple objects can cross lines at the same time, these occurrences are differentiated by this value.
directionSTRINGNULLABLEOne of "IN", "OUT".
site_nameSTRINGNULLABLEThe Site name of the triggering camera set in the Cameras menu.
camera_display_nameSTRINGNULLABLEThe Display name of the triggering camera set in the Cameras menu.
camera_technical_nameSTRINGNULLABLEThe Technical name of the triggering camera set in the Cameras menu.
object_typeSTRINGNULLABLEOne of "PERSON_FULL_BODY ", "CAR", "BUS", "TRUCK", "MOTORCYCLE", "BICYCLE", "TRAIN", "BOAT", "AIRPLANE".
display_nameSTRINGNULLABLEHuman readable name of source Traffic Counter configuration
technical_nameSTRINGNULLABLEUnique name of source Traffic Counter configuration
schema_versionINTEGERNULLABLEVersion number of the table schema associated with the record

Multi object counting data

Field NameTypeModeInfo
from_timestampTIMESTAMPNULLABLEThe starting timestamp of the aggregation interval (inclusive)
to_timestampTIMESTAMPNULLABLEThe end timestamp of the aggregation interval (exclusive)
statusSTRINGNULLABLEOne of "OK", "ERROR"
site_namesSTRINGREPEATEDThe list of Site names of the triggering cameras set in the Cameras menu.
cameras_with_errorSTRINGREPEATEDThe Technical names of the cameras in error state during the aggregation interval
object_typeSTRINGNULLABLEOne of "PERSON_FULL_BODY ", "CAR", "BUS", "TRUCK", "MOTORCYCLE", "BICYCLE", "TRAIN", "BOAT", "AIRPLANE".
firstINTEGERNULLABLEThe number of objects in the first record of the aggregation.
lastINTEGERNULLABLEThe number of objects in the last record of the aggregation.
minINTEGERNULLABLEThe minimum number of objects in the aggregation.
maxINTEGERNULLABLEThe maximum number of objects in the aggregation.
averageNUMBERNULLABLEThe average number of objects in the aggregation.
medianINTEGERNULLABLEThe average number of objects in the aggregation.
display_nameSTRINGNULLABLEHuman readable name of source Multi Object Counter configuration
technical_nameSTRINGNULLABLEUnique name of source Multi Object Counter configuration
schema_versionINTEGERNULLABLEVersion number of the table schema associated with the record

Event data

Field NameTypeModeInfo
idSTRINGNULLABLEThe unique id of event record
timestampTIMESTAMPNULLABLEThe time of the event
display_nameSTRINGNULLABLEHuman readable name of source Alert configuration
typeSTRINGNULLABLEThe type of the Alert. One Of "CROWD_DETECTION", "INTRUSION_DETECTION", "MULTI_OBJECT_DETECTION", "COUNTER", "ZONE_CROSSING", "LOITERING_DETECTION", "STOPPED_DETECTION", "WRONG_DIRECTION_DETECTION", "PPE_DETECTION"
camera_idSTRINGNULLABLEThe id of the triggering camera.
camera_display_nameSTRINGNULLABLEThe Display name of the triggering camera set in the Cameras menu.
camera_technical_nameSTRINGNULLABLEThe Technical name of the triggering camera set in the Cameras menu.
site_namesSTRINGREPEATEDThe list of Site name of the triggering cameras set in the Cameras menu.
frame_timestampTIMESTAMPNULLABLEThe time of the triggering video frame
schema_versionINTEGERNULLABLEVersion number of the table schema associated with the record
snapshot_urlSTRINGNULLABLEGoogle Storage URL referring to
metadata_jsonJSONNULLABLEMetadata of the event.*

*See the relevant part of the integration guide for detailed description of the Event schema.