Message to Developers: If you are interested in Industrial IoT, the OPC UA protocol, time series data prediction, and intelligent alarms, or if you want to learn how to build a complete AIoT application with Spring Boot, this article is for you. We will start from the problems and gradually show how to design, develop, and deploy a usable industrial edge intelligent system.
Introduction: Starting from Developers’ Confusion
In the past two issues, we introduced:
- “OPC UA Predictive Maintenance: How to Break Free from Data Dependency?”— Discussing the possibility of AI prediction without training
- “The Industrial Alarm Revolution: AI Prediction Says Goodbye to Manual Configuration, Easily Achieving Proactive Anomaly Warnings!”— Showcasing intelligent alarm solutions based on prediction deviations
During our communication with readers, we found that many friends encountered some common difficulties when learning and practicing industrial IoT projects:
- Function Dispersal: Predictive services and alarm systems are deployed separately, requiring an understanding of two projects to run the complete process, resulting in high integration barriers
- Fragmented Documentation: Lack of a unified, end-to-end solution description, making the complete link from device access to data display unclear
- Ambiguous Value: Developers cannot see the complete business loop and do not know what practical problems this project can solve
Therefore, we made a significant integration:Deeply integrating the predictive service into the main project, reorganizing the documentation, with the sole goal of reducing the learning and usage costs for developers.
Today, let us interpret this project from the developer’s perspective—AIoT Vision Collector: What problems does it solve, how is it designed and implemented, how to get started quickly, and how to conduct secondary development.
1. What Problems Does This Project Solve?
Before we start learning the technical details, let us first understand the business background and core value of this project.
1.1 Real Challenges in Industrial Sites
Pain Point 1: The “Noble Threshold” of Predictive Maintenance
Traditional industrial AI prediction requires:
- ❌ Massive historical data (at least several months or even years)
- ❌ A team of professional data scientists (training, tuning, deployment)
- ❌ High-performance computing resources (GPU clusters, cloud platforms)
- ❌ Long investment cycles (starting from 6-12 months)
Result: Small and medium-sized enterprises are deterred, with a project success rate of less than 30%.
Pain Point 2: The “Bottomless Pit” of Alarm Configuration
Industrial sites often have tens of thousands of monitoring points:
- ❌ Manually configuring upper and lower limit thresholds for each point (huge workload)
- ❌ Static thresholds cannot adapt to dynamic working conditions (false alarm rates as high as 60%+)
- ❌ Delayed alarms lead to discovering equipment damage only after it occurs (passive handling)
- ❌ Alarm storms leave maintenance personnel overwhelmed (alarm fatigue)
Result: Either configurations are incomplete, or they simply“lie flat“ and do not configure.
Pain Point 3: The “Fragmentation” of System Integration
- ❌ One system for OPC UA collection
- ❌ Another for historical data storage
- ❌ Predictive services deployed separately
- ❌ Alarm monitoring is yet another independent platform
- ❌ Visualization requires additional development
Result: Systems are incompatible, data islands are severe, and maintenance costs are high.
2. Project Design Philosophy: One Project to Solve the Entire Link
2.1 Core Design Philosophy
AIoT Vision Collector is designed to:Make complex industrial intelligence simple and easy to use.
We compress the complete link of industrial intelligence into a lightweight application:

2.2 Five Core Capabilities
Capability 1: Zero-Threshold OPC UA Device Access
- ✅ Web Interface for Visual Management: No programming required, just click to add devices
- ✅ Intelligent Browsing of OPC UA Nodes: Automatically discover namespaces and nodes, eliminating the need to manually check documentation
- ✅ Parallel Data Collection from Multiple Devices: Supports simultaneous connections to multiple devices, automatically handling connection exceptions
- ✅ Real-Time Status Monitoring: Connection status, collection time, and data quality are clear at a glance
Scenario Example:
# Adding a device requires just 3 steps: 1. Enter the device name (e.g., "Production Line No. 1 Press") 2. Fill in the OPC UA address (e.g., "opc.tcp://192.168.1.10:4840") 3. Click "Browse Nodes" and check the points to monitor (e.g., temperature, pressure, vibration)
Capability 2: No-Training AI Prediction (Core Innovation)
This is our proud breakthrough:
Traditional Solution:
Collect data (6 months) → Clean and label (1 month) → Train model (2 weeks) → Tune and deploy (1 week) Total: at least 8 months, cost over 500,000
Our Solution:
Start application (5 minutes) → Configure device (10 minutes) → Start prediction (real-time) Total: 15 minutes, cost 0 (open source)
Technical Principles:
- 🔬 Based on Transformer Pre-trained Model (similar to a time series version of GPT)
- 🔬 Pre-trained on a large-scale industrial dataset (transfer learning)
- 🔬 Accepts 300 historical points, predicts 60 future points (default configuration)
- 🔬 No local training required, direct inference (supports Raspberry Pi deployment)
Prediction Cache Mechanism (Performance Optimization):
Prediction cache features:├─ Scheduled prefetch: automatically predicts future data every 30 seconds├─ Intelligent coverage: ensures at least 2 minutes of predicted results in advance├─ Tolerance matching: time deviations within 30 seconds are automatically aligned└─ On-demand query: directly returns cache upon user request, millisecond-level response
Capability 3: Intelligent Deviation Early Warning (Alarm Revolution)
Say goodbye to traditional“threshold configuration hell“, we use AI prediction to achieveproactive anomaly detection:
Working Principle:
Real-time collected value vs predicted value → Calculate deviation percentage → Exceeding threshold triggers early warning
Featured Functions:
- ✅ Adaptive Threshold: Default 10% deviation triggers alarm, adjustable based on working conditions
- ✅ Repetition Suppression: No repeated alarms for the same point within 5 minutes (avoiding alarm storms)
- ✅ Early Warning Levels:
- 🟢 Normal (deviation <10%)
- 🟡 Attention (deviation 10-20%)
- 🔴 Severe (deviation >20%)
- ✅ Early Warning Handling Flow: Confirm / Ignore / Statistical Analysis
- ✅ Large Screen Display: Minimalist style real-time monitoring interface (/alerts/board)
Real Case:
Scenario: Compressor Temperature Monitoring - Traditional Solution: Set threshold 85°C, alarm if exceeded → Problem: Normal operating temperature in summer is 83°C, frequent false alarms - AI Solution: Based on historical trends, current prediction should be 78°C, actual collection 82°C → Deviation 5.1%, did not exceed threshold, no alarm (accurate judgment) Next day: Predict 79°C, actual collection 88°C → Deviation 11.4%, triggers early warning, detects bearing wear in advance (successfully prevents downtime)
Capability 4: Efficient Data Storage
Advantages:├─ High performance: Optimized for time series data, millions of throughput├─ High compression ratio: Data compression ratio reaches 10:1├─ TTL management: Automatically cleans up expired data (e.g., keep for 7 days)└─ Applicable scenarios: Large-scale production environments, massive point collection
Capability 5: Developer-Friendly Full-Stack Experience
Web Visualization Interface:
- 📊 Real-time data dashboard (/data): Device status, point values, connection status
- 📈 Historical trend charts: Supports custom time window queries
- 🔮 Prediction curve comparison: Historical data vs predicted data dual curves
- 🚨 Early warning monitoring dashboard (/alerts/board): Active warnings, statistical summary
REST API:
- 🔌 Complete CRUD interfaces (devices, tags, history, predictions, warnings)
- 📝 OpenAPI/Swagger documentation (/swagger-ui/index.html)
- 🔧 Supports curl, Postman, automated script calls
Environment Variable Configuration:
Design Philosophy: 12-Factor App├─ 30+ configuration items can be overridden by environment variables├─ No need to modify code or configuration files├─ Perfectly compatible with Docker, K8s, cloud platforms└─ Example: AVC_SERVER_PORT=9090 AVC_PREDICT_API_URL=http://ip:50000/predict AVC_ALERT_DEVIATION_PERCENT_THRESHOLD=15
3. Technical Implementation: Design Details Worth Learning
3.1 Overall Architecture Design
┌─────────────────────────────────────────────────────────────┐│ AIoT Vision Collector │├─────────────────────────────────────────────────────────────┤│ Presentation Layer │ Thymeleaf Web UI + REST API + Swagger UI │├─────────────────────────────────────────────────────────────┤│ Business Layer │ Device Management │ Data Collection │ Prediction Service │ Alarm Engine │├─────────────────────────────────────────────────────────────┤│ Data Layer │ Spring Data JPA + H2/IoTDB │├─────────────────────────────────────────────────────────────┤│ Protocol Layer │ Eclipse Milo OPC UA Client │└─────────────────────────────────────────────────────────────┘
Technology Stack:
- Core Framework: Spring Boot 3.5.6 (latest stable version)
- Programming Language: Java 17 (LTS long-term support version)
- Industrial Protocol: Eclipse Milo (Apache 2.0 open source license)
- Time Series Storage: IoTDB Session Client (Apache 2.0 open source license)
- Frontend Technology: Native JavaScript + CSS (no complex dependencies)
3.2 Key Innovations
Innovation 1: Decoupled Design of Prediction Service
// Prediction service interface abstractionPredictService (interface)├─ HttpPredictService (HTTP remote call)├─ LocalPredictService (local model inference - extension)└─ MockPredictService (test mock - development)// Configuration switch:AVC_PREDICT_API_URL=http://192.168.1.4:50000/predict # RemoteAVC_PREDICT_API_URL=local://model # Local (future support)
Innovation 2: Three-Level Prediction Cache Strategy
L1: Memory Cache├─ Structure: Map<TagId, TreeMap<Timestamp, PredictValue>>├─ Capacity: Up to 5000 points per Tag (configurable)└─ Elimination: FIFO first in first outL2: Scheduled Prefetch├─ Interval: 30 seconds (configurable)├─ Coverage: 2 minutes in advance (configurable)└─ Strategy: Each Tag predicts independently, failure does not affect othersL3: Degradation Mechanism├─ Cache miss → Real-time call to prediction service├─ Prediction service exception → Return empty result (non-blocking business)└─ Timeout control: 5 seconds (to avoid long waits)
Innovation 3: Early Warning Deduplication Algorithm
// Core logic pseudocodeif (current deviation > threshold) { lastAlert = query last warning (device ID, TagID); if (lastAlert == null || time since last alert > 5 minutes) { create new alert(); } else { ignore (avoid duplication); }}// Configuration item:AVC_ALERT_DUP_SUPPRESS_MINUTES=5 // Duplication suppression time
4. Quick Start: From 0 to 1 in Just 10 Minutes
4.1 One-Click Deployment with Docker (Recommended)
Step 1: Install DockerEnsure that Docker is installed in your environment (latest version recommended, supports docker compose command; older versions use docker-compose).
Step 2: Download Configuration FileDownload the docker-compose.yml file from the GitHub repository:https://github.com/Mark7766/aiot-vision-labs/blob/main/aiot-vision-collector-deploy/docker-compose.yml to your local directory.
# Use the provided script (Linux/Mac)wget https://github.com/Mark7766/aiot-vision-labs/blob/main/aiot-vision-collector-deploy/docker-compose.yml
Step 3: Start the Service
# Execute the command in this directorydocker compose up -d
Step 4: Verify
# Access http://localhost:8080/data in the browser# View logsdocker logs -f avc-server
4.2 Local Development Deployment
Prerequisites:
- JDK 17+
- Maven 3.9+
Steps:
# Clone the codegit clone https://github.com/Mark7766/aiot-vision-labscd aiot-vision-labs/aiot-vision-collector# Compile and runmvn clean package -DskipTestsjava -jar target/aiot-vision-collector-0.0.1-SNAPSHOT.jar# Or in development modemvn spring-boot:run
4.3 Core Configuration Explanation
Scenario 1: Modify Port
# Windows PowerShell$env:AVC_SERVER_PORT=9090mvn spring-boot:run
Scenario 2: Connect to Real OPC UA Server
# No configuration needed, just add devices through the web interface# Example: Prosys OPC UA Simulation Serveropc.tcp://127.0.0.1:53530/OPCUA/SimulationServer
Scenario 3: Adjust Early Warning Sensitivity
# Increase threshold (reduce sensitivity, decrease false alarms)AVC_ALERT_DEVIATION_PERCENT_THRESHOLD=20# Shorten suppression time (increase response speed)AVC_ALERT_DUP_SUPPRESS_MINUTES=3
5. Typical Application Scenarios
This project can be applied in various industrial scenarios, here are a few typical use cases:
Scenario 1: Vibration Monitoring of Rotating Equipment
Applicable Objects: Compressors, fans, pumps, motors, and other rotating equipment
Application Features:
- Vibration values change dynamically with load, making static thresholds difficult to configure
- Requires simultaneous monitoring of multiple axes (X, Y, Z axes)
- Anomalies often occur as gradual processes, requiring early warnings
Deployment Recommendations:
Recommended Configuration:├─ Monitoring Points: Vibration_X axis, Vibration_Y axis, Vibration_Z axis, Temperature├─ Collection Cycle: 1-5 seconds├─ Prediction Configuration:│ ├─ Historical Window: 300 points (5 minutes of historical data)│ └─ Prediction Window: 60 points (1 minute future trend)└─ Early Warning Configuration: ├─ Deviation Threshold: 10-15% (adjust based on equipment accuracy) └─ Suppression Time: 5 minutes (to avoid repeated alarms)
Value Realization:
- ✅ Adaptive to vibration characteristics under different loads
- ✅ Early detection of bearing wear, imbalance, and other hazards
- ✅ Significantly reduce false alarm rates (compared to fixed thresholds)
Scenario 2: Precision Monitoring of Temperature Control Equipment
Applicable Objects: Injection molding machines, extruders, reactors, ovens, and other temperature-sensitive equipment
Application Features:
- High precision requirements for temperature control
- Different products/processes have different temperature settings
- Temperature drift is often a slow process
Deployment Recommendations:
Recommended Configuration:├─ Monitoring Points: Temperatures of each heating zone, cooling water temperature├─ Collection Cycle: 10-30 seconds├─ Prediction Window: 120 points (20-40 minutes)├─ Early Warning Threshold: 5-8% (temperature-sensitive scenarios)└─ Special Handling: ├─ Filter temperature fluctuations during startup/switching phases └─ Distinguish between normal process fluctuations and abnormal drifts
Value Realization:
- ✅ Early detection of aging heating elements
- ✅ Timely identification of temperature control system anomalies
- ✅ Reduce product scrap due to temperature issues
Scenario 3: Pressure/Flow Monitoring on Production Lines
Applicable Objects: Hydraulic systems, pneumatic systems, fluid transport pipelines
Application Features:
- Frequent fluctuations in pressure/flow
- Leaks often manifest as slow declines
- Need to distinguish between normal condition switches and abnormal changes
Deployment Recommendations:
Recommended Configuration:├─ Monitoring Points: Mainline pressure, branch flow, system temperature├─ Collection Cycle: 5-10 seconds├─ Prediction Window: 60-120 points├─ Early Warning Threshold: 10-20% (based on system stability)└─ Correlation Analysis: └─ Joint judgment of multiple points (pressure drop + flow anomaly)
Value Realization:
- ✅ Early detection of leak points
- ✅ Prevent safety incidents caused by pressure anomalies
- ✅ Optimize system operating efficiency
Scenario 4: Independent Deployment on the Edge
Applicable Objects: Scenarios with workshop network isolation, no internet access, and high data security requirements
Application Features:
- Data cannot be uploaded to the cloud or transmitted externally
- Requires a localized complete solution
- Limited hardware resources (industrial computers, edge gateways)
Deployment Recommendations:
Hardware Configuration:├─ CPU: 4 cores or more (e.g., Intel J1900, Raspberry Pi 4B)├─ Memory: 4-8GB├─ Storage: 32GB+ (SSD recommended)└─ Network: Local area network is sufficientSoftware Deployment:├─ Docker containerized deployment├─ Local IoTDB for data├─ Local deployment of prediction service└─ Offline operation, no external network required
Value Realization:
- ✅ Meets data security and compliance requirements
- ✅ Reduces network dependency and cloud service costs
- ✅ Quick response, local decision-making
Scenario 5: Small-Scale POC Validation
Applicable Objects: Project validation, technology assessment, proof of concept stage
Application Features:
- Need to quickly set up a demonstration environment
- Limited budget, cannot invest large resources
- Need to fully demonstrate end-to-end capabilities
Deployment Recommendations:
Minimal Configuration:├─ Hardware: Personal laptop is sufficient├─ Device: Use OPC UA simulation server (e.g., Prosys Simulator)├─ Deployment: One-click start with Docker└─ Time: Complete deployment in 15 minutes Demonstration Content:├─ Real-time data collection display├─ Historical trend query├─ AI prediction curve comparison└─ Early warning trigger and handling process
Value Realization:
- ✅ Zero-cost rapid validation of feasibility
- ✅ Fully demonstrate system capabilities
- ✅ Provide reference for subsequent large-scale deployment
6. Open Source Ecosystem: Together to Push the Boundaries of Industrial Intelligence
6.1 Project Information
Open Source License: Apache 2.0 (business-friendly) Project Address:https://github.com/Mark7766/aiot-vision-labs Documentation Language: Chinese + English (README.md, README_zh.md) Maintenance Status: Actively developed (PRs and Issues welcome)
6.2 Why Choose Open Source?
We firmly believe:
Industrial intelligence should not be the privilege of a few, but a tool accessible to every engineer.
Value of Open Source:
- Lowering the threshold: Allowing small and medium-sized enterprises to use AI prediction
- Knowledge sharing: Enabling more people to learn, improve, and innovate
- Building an ecosystem: The power of the community is far greater than that of a single team
- Transparency and trust: Open code, no black box, auditable
6.3 How to Participate?
Method 1: Usage Feedback
- ⭐ Star the project (to let more people see it)
- 🐛 Report bugs (to help us improve)
- 💡 Suggest requirements (tell us what you want)
Method 2: Code Contribution
- 🔧 Fix bugs (submit PR)
- ✨ Add new features (extend capabilities)
- 📝 Improve documentation (help newcomers)
Method 3: Ecosystem Building
- 📹 Record tutorials (videos, blogs)
- 🎤 Share experiences (conferences, communities)
- 🤝 Corporate cooperation (commercial consulting)
7. Conclusion: A Complete Path from Learning to Practice
Through this article, we hope to provide developers with a complete learning path:From understanding problems to mastering technology, from getting started quickly to deep development.
7.1 What This Project Brings You
Learning Value:
- 📚 Complete industrial IoT project architecture design
- 📚 Practical application cases of the OPC UA protocol
- 📚 Implementation methods for time series data processing and prediction
- 📚 Spring Boot enterprise application development practices
- 📚 Best practices for Docker containerized deployment
Practical Value:
- 🛠️ Out-of-the-box edge AI prediction solution
- 🛠️ Production-level code ready for deployment
- 🛠️ Flexible secondary development interfaces
- 🛠️ Complete API documentation and usage examples
- 🛠️ Low-cost hardware deployment solutions
7.2 Start Your Industrial AI Journey Here
If you are a beginner:
- 👉 Start with quick deployment using Docker, get the system running first
- 👉 Understand the complete business process through the web interface
- 👉 Read the code to learn the implementation principles of each module
- 👉 Modify configuration parameters and observe changes in system behavior
If you are a developer:
- 👉 Study the architecture design, learn how to build industrial-grade applications
- 👉 Understand key algorithms like prediction caching and early warning deduplication
- 👉 Conduct secondary development and integration through the REST API
- 👉 Expand new features based on actual needs (e.g., support for new protocols)
If you are a project leader:
- 👉 Use for POC validation, quickly demonstrate AI prediction capabilities
- 👉 Serve as a reference solution for technology selection
- 👉 Customize development based on open-source code
- 👉 Reduce project risks and development costs
7.3 Our Original Intention
We believe: The value of technology lies in solving practical problems, not in showmanship.
We believe: A good open-source project should lower barriers, not create them.
We believe: The power of knowledge sharing can benefit more people.
This is why we integrated the two projects, reorganized the documentation, with the sole goal of:Making it easier for developers to learn, understand, and use this project.
7.4 Take Your First Step
Start now:
- ⭐ Star the project: https://github.com/Mark7766/aiot-vision-labs
- 📖 Read the documentation: README_zh.md (5-minute quick overview)
- 🚀 Quick experience: One-click deployment with Docker (15 minutes to get started)
- 💻 Study the code: Understand design ideas and implementation details
- 🔧 Secondary development: Extend your own functionality based on the REST API
- 💬 Communication and discussion: Leave comments to share your experiences and suggestions
Conclusion: The Meaning of Open Source
Our original intention in developing this project is simple:
- Three years ago, we encountered the challenge of equipment prediction in industrial sites
- Two years ago, we began to explore AI methods to solve the problem
- One year ago, we decided to open-source the solution to benefit more people
- Today, we have integrated all functions into one project, lowering the usage threshold
This is not the end, but a new beginning.
We look forward to:
- More developers learning industrial IoT technology through this project
- More scenarios solving practical problems through this solution
- More peers improving and refining this open-source project together
- More knowledge being disseminated and shared through open source
The future of industrial intelligence requires the participation and contribution of each of us.
👇 Welcome to leave comments for discussion:
- What difficulties have you encountered while learning industrial IoT?
- What suggestions or thoughts do you have about this project?
- In what scenarios do you want to apply this project?
📧 Get more resources:
- Complete deployment manual
- Source code for prediction service
- Technical communication and Q&A
Let us work together to make industrial intelligence technology easier to learn and use! 🚀