> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/solutions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/solutions/iot-solution/machine-sensors-pipeline.md).

# Machine Sensors – Pipeline

## **The Interface of Pipeline**

The following pipelines provide the complete workflow for equipment monitoring and detecting anomalies.

### **Anomaly Detection Workflow Interface**

<div align="left"><figure><img src="https://1639562757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FijvHnz0DM3Img2NKY2aa%2Fuploads%2Fn7SHBJ4gD5sliz8XKiC9%2Fimage.png?alt=media&amp;token=8591f08a-f883-4aff-9d3b-cb87d62e9369" alt=""><figcaption></figcaption></figure></div>

### **Anomaly Detection Workflow**

* In the first part of the workflow, the data we are fetching from the shared event will be parallelly processed in three ways.
  * For prediction using DS Lab Runner Component
  * For Detection using the Python component
  * Storing raw data in mongo collection **\[Collection Name: adnoc\_raw\_data]**

## **Components Used in the first part of the Pipeline**

### **DS Formatter Python Component**

&#x20;      From the shared event, we fetch the data and send it to the Python component which formats   &#x20;

&#x20;     the data structure and further sends only the value field to the DS Lab Runner.

### **Data Science Lab Runner Component**

&#x20;     This component is used for the prediction of the sensor data which we send through the  &#x20;

&#x20;     python component and it will send the predictions to the out event.

### **Anomaly MGW PyMongo Writer**

&#x20;    This component will write the predicted data in mongo collectio&#x6E;**. \[Collection Name**&#x20;

&#x20;     **og\_anamoly\_data]**

### **Rule Engine Python Component**

&#x20;    From the shared event, we fetch the data and send it to the Python component, using lookup&#x20;

&#x20;    collection which we have already stored in the *bi\_testing* database. We check whether the&#x20;

&#x20;   generated data is an anomaly or normal data and send it to the output event with a flagged  field&#x20;

&#x20;    named ***is\_alert*** with values as “***yes***” or “***no***”.

### **Raw Data PyMongo Writer**

&#x20;   This component will write the raw data which we generated in the Data Generator pipeline in the&#x20;

&#x20;   Mongo collectio&#x6E;**. \[Collection Name: adnoc\_raw\_data].**

<div align="left"><figure><img src="https://1639562757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FijvHnz0DM3Img2NKY2aa%2Fuploads%2F5YR20Qtma63DoHFa77CQ%2Fimage.png?alt=media&amp;token=c5fb39ef-0a74-4a2f-ac36-539475b85117" alt=""><figcaption></figcaption></figure></div>

* In the second part of the workflow, after passing through the Rule Engine Component which detects the anomaly, gives a flagged column called ***is\_alert,*** and goes through the Rule Splitter which segregates normal and anomaly data in different workflows:
  * The normal data goes through the python component which changes the data structure and sends it to the Web Socket producer.
  * The anomaly data is further divided into three ways and parallelly processed as explained:
    * The anomaly data go through the Python component that changes the data structure and sends it to the Web Socket Producer which will send data to the dashboard for producing an alert.
    * The anomaly data will kick start the Jira Python component to create a Jira Ticket.
    * Store the alert data in the Mongo collection **\[Collection Name: adnoc\_alert\_tag\_values]**

## **Components Used in the second part of the Pipeline**

### **Rule Splitter Component**

&#x20;   This component is used for segregating the anomaly and normal data using the flagged field&#x20;

&#x20;    **“is\_alert”** dividing the workflows into two.

### **Web Socket Normal Python component**

&#x20;  This component is used to format the normal data’s structure to the web socket’s structure and it &#x20;

&#x20;  will send it to the web socket producer.

### **Web Socket Producer Normal**

&#x20;  This component will send the normal data to the Web socket client.

### **Web Socket Anomaly Python component**

&#x20; This component is used to format the anomaly data’s structure to the web socket’s structure and  &#x20;

&#x20; it will send it to the web socket producer.

### **Web Socket Producer Anomaly**

&#x20;  This component will send the anomaly data to the Web socket client from there it will be used in &#x20;

&#x20;  a dashboard for the live alert.

### **Jira Python component**

&#x20;  This component is used to create a ticket for a specific sensor alert in Jira.

### **Alert Data PyMongo Writer**

&#x20;  This component will write the alert data in mongo collection. **{Collection** **Name:**  &#x20;

&#x20;   **adnoc\_alert\_tag\_values]**

<div align="left"><figure><img src="https://1639562757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FijvHnz0DM3Img2NKY2aa%2Fuploads%2FKc1RBgdhX6eUYxKCr8VR%2Fimage.png?alt=media&amp;token=0e628d82-e46c-46d8-b5aa-3c5ff43740c7" alt=""><figcaption></figcaption></figure></div>

&#x20;                         &#x20;

&#x20;

&#x20;

&#x20;
