Skip to main content

SA Engine

SA Engine is a lightweight streaming analytics and AI software platform designed for running on resource-constrained edge devices including microcontrollers. It is an end-to-end platform enabling efficient development, training, deployment, and orchestration of analytics, computational, and AI models.

"SA Engine helps data analysts to get insights in real time and to automate operations with AI by enabling flexible and scalable real-time analytics on edge devices and provide a massive reduction in model development and deployment cycles compared to standard solutions."

SA Engine is built with a C core and has layers of Lisp and our own proprietary language OSQL (Object Stream Query Language) on top. SA Engine comes in two flavors:

  • Full version with ~5MB footprint.
  • Nanocore version (for microcontrollers) with ~17kB footprint.

The full version offers a Lisp interpreter, query optimization and compilation of expressions to native assembly. The Nanocore version also features the Lisp interpreter but lacks query optimization and compilation of expressions. Instead, when interacting and deploying models to the Nanocore version, the queries are first optimized and cross-compiled on a full SA Engine instance before they are sent to SA Engine on the microcontroller.

SA Engine can run on basically any hardware, such as Single Board Computers (SBCs), Microcontrollers (MCUs), Telematic units, Mobile devices, and PCs. It is hardware and OS agnostic, and the target hardware only needs a C99 compliant C compiler.

All analytics and processing can be run directly on the edge device without any need for costly cloud services. The device can even be disconnected from communication during operations and only pass information and analytics results whenever it has access to connectivity.

What is included in SA Engine?

Since SA Engine is a end-to-end solution for edge analytics it comes packed with lots of functionality to support all stages of edge analytics and to facilitate integration with existing enterprise systems and third party software.

  • Large set of mathematical and statistical functions, such as FFT, PCA, complex numbers, trigonometric, logarithmic, array, and vector functions.

  • Support for neural networks.

    • Neural networks engine (SANN) that can convert and run TensorFlow models.
    • TensorFlow Lite plugin for models intended to run on mobile devices.
  • Classical AI/ML algorithms, such as K-nearest neighbors, DBSCAN, DenStream, k-means, and linear regression.

  • Declarative easy-to-use SQL-like language. The queries are optimized and -- when possible -- compiled to native Assembly on the fly using a JIT compiler for immediate execution of complex queries.

  • Various data wrappers that can handle heterogenous data sources, such as a CAN bus wrapper.

  • Database integrations, MongoDB, PostgreSQL, or through JDBC.

  • Support for various data communication and messaging protocols, such as Kafka, MQTT, ZeroMQ, and Azure Event Hub.

  • Windowing functions, both count based and time based.

  • Data aggregation functions, such as max, mean, sum, variance, groupby, histogram, and user-defined.

  • Fast indexing with B-trees, hashing, geospatial, and bespoke.

  • Data security with TSL and user-defined protocols.

  • Language integrations for creating plugins in a wide range of programming languages, such as C, C++, Java, Lisp, and Python.

  • APIs for embedding SA Engine into existing applications. SA Engine has APIs for C, C++, Java, Lisp, JavaScript, and Python.

  • WEBHOOK API to control SA Engine using HTTP requests.

What are the key features of SA Engine?

High-level query language

SA Engine allows analysts and engineers to develop computations, filters and transformations over data using a declarative query language called OSQL (Object Stream Query Language). With OSQL models can be specified on a very high level without deep programming knowledge; you specify what to do rather than writing detailed programs expressing how to execute the models. The user needs not worry about details on how to efficiently implement programs that integrate large numbers of edge devices and servers.

Real-time interaction with edge device

SA Engine runs as an interpreter which enables users to control SA Engine interactively. This makes it possible to see data streams and analytics results in real time. It also facilitates tinkering with the data and adjusting models while the system is running, and getting hands-on insights without first storing data and analyzing it offline.

Eliminates the need for FOTA

The interactive nature of SA Engine facilitates the separation of the analytics cycle and the software cycle. This means that deploying analytical models and modifying them can be done without having to update the firmware on the device. Traditional edge AI solutions bake a single ML model into a firmware and deploy the model by updating the firmware on the device. This means that each model deployment or model update needs to be bundled with a firmware update, which usually have a much lower cadence than the analytics lifecycle (see figure below). It also introduces security risks that comes with updating the firmware and the device needs to be taken out of production during the update.

With SA Engine users can communicate directly with the application. The user can therefore work directly on the live real time data streams and develop and deploy models independently of the firmware update cycle. This enables an interactive process with radically faster iteration cycles. The only restriction is if a model is dependent on a plugin in other programming languages than OSQL or Lisp (in particular C), then a firmware update may be required even for SA Engine.

Analytical cycle

Rich set of analytics functions

The system includes a library of over 1000 predefined OSQL-functions for mathematical/statistical computations, machine learning algorithms, object stream filtering and transformation, signal processing, model and data management, and much more. The function library is continuously extended for new customer needs and it is easy to define and deploy new user functions on-the-fly.

Extendable with custom plugins

SA Engine is widely extensible and also includes loadable extensions for interacting with 3rd party libraries, such as neural network inference engines, common database formats, and sensor integrations (e.g., CAN bus).

Embeddable in existing application

SA Engine is embeddable in 3rd party applications by providing a rich API for many of the most common programming languages, such as C/C++, Java, Python, and JavaScript.

Scales out to large fleets of devices

The interactive nature of SA Engine makes scaling to large fleets of devices manageable in a way that FOTA-dependent solutions struggle with. Once SA Engine is installed, models can be deployed and updated centrally to thousands of devices without having to send out service personnel or even take them out of production.

model-deployment.png

Contents

  1. Installation - How to install SA Engine on various platforms.
  2. System description - An overview of the system, its parts and how systems on different machines interact.
  3. Working with edge devices - How to work with edge devices.
  4. Frontends - The frontends available for SA Engine.
  5. MLOps - How SA Engine handles the various stages of the MLOps pipeline.
  6. Concepts - Descriptions of various SA Engine-specific terms such as edges, nodes, stream models, OSQL and federations.