Basic modules overview

The core data tables behind the platform — channel_data archives, equipment, seances sessions and archive-type reference parameters.

In the “Global Secure IoT Platform”, data is organized in the form of tables, which can be classified according to the main data representation modules.

Data Archives

Data archives in the system store historical information such as IoT device metrics, equipment data, and other measurements. The main table for storing archive data is channel_data.

FieldTypeDescription
idbigintUnique record identifier (primary key).
equipment_idbigintReference to equipment (equipment.id).
seance_idbigintReference to session (seances.id).
channel_idbigintReference to channel (channels.id).
unit_idbigintReference to unit of measurement (units.id).
archive_type_idintegerArchive type reference (referenceparameters.id).
event_timeintegerThe time of the event (eg timestamp).
valuecharacter varying(100)The value received from the channel.
created_attimestamp(6) without time zoneTime when the record was created.
updated_attimestamp(6) without time zoneTime when the record was last updated.

This table stores data received from equipment channels and associates them with equipment, sessions, channels, and units through external keys, which allows the data to be classified according to specified attributes for further data analysis and processing.

  • equipment_id refers to the table equipment.
  • seance_id refers to the table seances.
  • channel_id refers to the table channels.
  • unit_id refers to the table units.
  • archive_type_id refers to the table referenceparameters,

Metering devices

The equipment table is used to store information about the equipment that is used in the system. This module is key to managing data associated with physical devices such as meters, sensors, controllers, and other types of equipment.

FieldTypeDescription
idbigintUnique identifier of the record (primary key).
equipment_type_idbigintReference to the equipment type.
serial_numbercharacter varying(25)Serial number of the equipment.
manufacture_datetimestamp(6) without time zoneThe date of manufacture of the equipment.
installation_datetimestamp(6) without time zoneInstallation date of the equipment.
program_versioncharacter varying(100)Software version of the equipment.
created_attimestamp(6) without time zoneTime when the record was created.
updated_attimestamp(6) without time zoneTime when the record was last updated.

The equipment table:

  • stores basic data about the equipment, such as serial number, date of manufacture and installation;
  • the program_version field allows tracking the version of the software installed on the equipment;
  • the created_at and updated_at fields allow tracking changes in equipment data.
  • linked to other tables such as equipment_types, channel_data and channels through foreign keys.
  • allows you to add, update and retrieve information about equipment in the system.

The equipment table based data view module allows efficient management of equipment information in the system.

It provides:

  • Storage of basic equipment data.
  • Software version management.
  • Communication with other entities in the system.

Communication Sessions

The seances table is used to store information about communication sessions and equipment activity. Sessions represent periods of activity during which data is exchanged between the equipment and the system. This module is key to managing and analyzing data associated with communication sessions.

Let’s take a closer look at this module.

FieldTypeDescription
idbigintUnique identifier of the record (primary key).
telemetry_idbigintReference to telemetry (telemetry.id).
event_timeintegerThe time of the event.
evtidsmallintThe identifier of the event.
trycntsmallintThe number of attempts.
tryflcharacter varying(12)The flag of the attempt.
statesmallintSession status.
btmintegerBattery charge.
rssiintegerSignal strength (if used).
created_attimestamp(6) without time zoneTime when the record was created.
updated_attimestamp(6) without time zoneTime when the record was last updated.

The seances module is used for:

  • Storing information about communication sessions and equipment operation.
  • Manage session-related data (e.g., event time, session status, signal strength, battery power).
  • Analyzing sessions to identify problems or optimize system performance.
  • Session status management: the state field allows you to monitor the session status (e.g., successful, error, etc.).
  • Session analysis: the duration_session and session_traffic fields allow you to analyze the duration and volume of session traffic.
  • Change tracking: the created_at and updated_at fields allow you to track changes in session data.

Archive Types

The archive_type_id attribute is used to categorize data in the channel_data table by archive type. This allows data to be organized into different categories such as hourly, daily, monthly, abnormal situations and other archive types.The referenceparameters table stores reference information about archive types.

The basis for this module is the relationship between the channel_data and referenceparameters tables.

FieldTypeDescription
idbigintUnique identifier of the record (primary key).
namecharacter varying(30)The name of the unit of measure.
varnamecharacter varying(30)Short variable name for the unit of measure.
descriptioncharacter varying(100)Description of the unit of measurement.
parent_idintegerA reference to the parent parameter (hierarchy).
referencemodel_idintegerReference to the directory model.
created_attimestamp(6) without time zoneTime when the record was created.
updated_attimestamp(6) without time zoneTime when the record was last updated.
deleted_attimestamp(6) without time zoneTime when the record was deleted (soft delete).

The archive_type_id field in the channel_data table allows you to categorize data by archive type.

For example:

ruby
[ 'Archive types', 'archive_types', 'Archive types (hourly, daily, monthly)',
  [
    ['Hourly readings archive', 'hourly'],
    ['Daily readings archive', 'daily'],
    ['Monthly readings archive', 'monthly'],
    ['Emergency situations archive', 'nesht'],
    ['Events archive', 'event'],
    ['Valve status', 'valve'],
    ['Current state', 'current_state'],
    ['Updated firmware', 'update_app'],
    ['Send SMS', 'send_sms'],
    ['Send JSON', 'send_json'],
    ...
  ]
]

Specified archives, if necessary, can be grouped into groups:

  • current data (current_state) - indicators at the moment of communication session;
  • aggregated data (hourly, daily, monthly) - summary indicators for a certain period of time;
  • events and abnormal situations (nesht, event) are records of significant changes or occurrences in the system. They may be related to equipment, users or external factors.
  • valve status (valve)-the state and control of the meter valve, if any;
  • control actions (update_app, send_sms, send_json) are records of commands or actions that have been performed to control the system or equipment.
  • etc.

The archive_type_id data representation module allows you to efficiently categorize data into archive types and manage reference information. It provides:

  • Classification of data in the channel_data table.
  • Managing reference information about archive types.
  • Analyzing data by archive type.
آخرین به‌روزرسانی در

آیا این صفحه مفید بود؟