UCAP: Unified Controls Acquisition and Processing Framework

UCAP (Unified Controls Acquisition and Processing) is a generic, self-service online data processing platform developed by CERN’s Controls Software & Services (CSS) group. The framework serves as a streamlined solution for handling data processing tasks within the CERN Accelerator Control System, following a three-stage approach: Acquisition, Transformation, and Publishing/Presentation.

CDS entry: https://cds.cern.ch/record/2809575?ln=en GitLab repository: https://gitlab.cern.ch/acc-co/ucap/ucap-core Documentation: https://ucap-docs.web.cern.ch

What UCAP Does

UCAP addresses common data processing patterns found throughout CERN’s control systems, including data concentrators, software interlocks, logging adaptations, and autopilot-style control software. The framework enables users to develop data transformations in Java or Python while providing self-service capabilities for deployment, operation, and monitoring.

The system operates as a multitenant platform with isolated deployment units called nodes. As of 2021 Q3, UCAP consisted of 105 nodes running on 6 physical servers, performing around 20,000 data transformations. The framework has been rapidly adopted across CERN’s accelerator complex, including Linac4, PSB, PS, SPS, and LHC.

Three-Layer Architecture

Acquisition Layer

The Acquisition Layer handles data collection from various sources using JAPC (Java API for Parameter Controls), a CERN standard library. The layer supports a wide range of inputs, including UCAP itself for chaining transformations.

Event Builders are key components that group inputs from multiple Controls Devices. UCAP provides 10 different event builder implementations that users can select and configure. For example, a basic event builder configuration might look like this:

{
  "type": "GroupTriggeredCycleStampGrouped",
  "triggerGroup": {
    "subscriptions": [
      {"parameter": "MAGNET_1/Acq"},
      {"parameter": "MAGNET_2/Acq"}
    ],
    "timeoutMs": 1000
  }
}

This configuration instructs UCAP to group data from two magnet sources based on their timestamps, with a 1-second timeout for data collection.

Transformation Layer

The Transformation Layer performs the actual data processing using converter algorithms. UCAP provides over 20 standard converters for common operations like merging homogeneous data from multiple sources or splitting multiplexed data for logging. Users can also develop custom converters.

A simple Python converter example demonstrates adding two values from beam loss monitors (BLMs):

def convert(event):
    log = logging.getLogger(__name__)
    result = AcquiredParameterValue(
        published_parameter_name,
        event.trigger_value.header
    )
    
    v1 = event.get_plain_value('BLM1')
    v2 = event.get_plain_value('BLM2')
    result.update_value("result", v1 + v2)
    
    log.info("Input: %s", event)
    log.info("Output: %s", result)
    return FailSafeParameterValue(result)

This converter extracts values from two beam loss monitors, sums them, and publishes the result.

Publishing Layer

The Publishing Layer makes transformation results available to consumers through an RDA3 Device Server (Remote Device Access). Results can be consumed by C++, Java, and Python clients, or directly logged in NXCALS (Next CERN’s Accelerator Logging Service).

Self-Service Model

UCAP implements a self-service approach that separates responsibilities between the UCAP team and end-users:

  • UCAP team: Provides infrastructure, tools, training, and support for development, testing, and deployment
  • End-users: Focus on developing domain-specific transformation algorithms and managing their configurations

When users begin using UCAP, they receive two dedicated nodes:

  • A PRO node for operational purposes
  • A TEST node for verification before deployment

Tools and User Experience

UCAP-CLI

The framework includes a rich command-line tool (UCAP-CLI) with extensive TAB-based auto-completion for managing nodes, displaying commands, devices, transformations, and package names. The CLI connects to PRO, TEST, and local UCAP nodes and serves both end-users and the UCAP team for maintenance purposes.

Monitoring and Dashboards

UCAP provides automatic Grafana dashboards for each node and device, showing subscription status, conversion errors, and input/output rates. These dashboards enable quick fault isolation, such as identifying when inputs are down or conversion errors occur.

Real-World Applications

UCAP handles various use cases across CERN’s accelerator complex:

  • Simple aggregations: Combining data from multiple sources
  • Complex machine reports: Generating comprehensive operational summaries
  • Software interlock preprocessing: Preparing data for safety systems
  • Data concentrators: Collecting and organizing distributed measurements
  • Logging adaptations: Formatting data for long-term storage

The framework successfully replaced numerous custom and complex standalone systems, fulfilling its objective as a truly “Unified” Controls Acquisition and Processing platform.

Technical Implementation

UCAP uses proven technologies including Java, Spring Boot, REST APIs, and OSGi framework for dynamic code loading. The system supports both Java and Python development environments, with Java-Python communication handled over TCP. The platform integrates with CERN’s existing infrastructure, including FESA-style alarms, LASER alarm service integration, and role-based access control.