Files
HF-MES-manual/en/integration/data-integration.md
2026-05-12 01:46:34 +08:00

289 lines
12 KiB
Markdown

# Data and Integration
## 1. Function Overview
The Data and Integration module enables data connectivity between the MES system and ERP, SCADA, PLC, and other systems, breaking down enterprise information silos and enabling data sharing and business collaboration.
**Core Functions:**
| Function | Description |
|----------|-------------|
| Interface Management | Interface configuration and monitoring |
| Data Synchronization | Master data synchronization |
| Message Integration | Message queue integration |
| File Transfer | File data exchange |
## 2. System Integration Architecture
### 2.1 Integration Architecture Diagram
```
┌─────────────────────────────────────────────────────────────┐
│ Enterprise Application Integration │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ │
│ │ ERP │ ─────────────────────────────────────────▶ │
│ │ SAP/Ufida│ Material Master Data, Purchase Orders, Production Plans, Sales Orders │
│ └────┬────┘ │
│ │ │
│ │ ◀───────────────────────────────────────── │
│ │ Work Order Completion, Quality Data, Inventory Data │
│ ▼ │
│ ┌─────────┐ │
│ │ MES │ │
│ │ MES │ ──────────────────────────────────────────▶ │
│ └────┬────┘ Work Order Execution, Production Data, Quality Data │
│ │ │
│ │ ◀───────────────────────────────────────── │
│ │ Equipment Operation Parameters, Status Data │
│ ▼ │
│ ┌─────────┐ │
│ │ SCADA │ ──────────────────────────────────────────▶ │
│ │ PLC/RTU │ Equipment Data Collection, Real-time Monitoring │
│ └─────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Integration Middleware │ │
│ │ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │ │
│ │ │Message Queue│ │Data Bus│ │File Transfer│ │API Gateway│ │ │
│ │ └────────┘ └────────┘ └────────┘ └────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
```
### 2.2 Integration Method Comparison
| Integration Method | Real-time | Complexity | Data Volume | Applicable Scenarios |
|-------------------|-----------|------------|-------------|---------------------|
| API Interface | High | Medium | Medium | Real-time interaction |
| Intermediate Database | Low | Low | Large | Batch synchronization |
| Message Queue | Medium | Medium | Medium | Asynchronous messaging |
| File Exchange | Low | Low | Large | Batch data |
## 3. Interface Management
### 3.1 Interface Types
| Interface Type | Description | Direction |
|----------------|-------------|-----------|
| Upstream Interface | Get data from other systems | ERP→MES |
| Downstream Interface | Push data to other systems | MES→ERP |
| Bidirectional Interface | Bidirectional data exchange | ↔ |
### 3.2 Common Interfaces
**Integration with ERP System:**
| Interface Name | Direction | Data Content |
|----------------|-----------|--------------|
| Material Master Data | ERP→MES | Material information, BOM, processes |
| Supplier Master Data | ERP→MES | Supplier information |
| Customer Master Data | ERP→MES | Customer information |
| Purchase Order | ERP→MES | Purchase arrival information |
| Production Work Order | ERP→MES | Production work order |
| Completion Report | MES→ERP | Work order completion information |
| Quality Data | MES→ERP | Inspection data |
| Inventory Data | MES→ERP | Inventory data |
**Integration with SCADA System:**
| Interface Name | Direction | Data Content |
|----------------|-----------|--------------|
| Equipment Status | SCADA→MES | Equipment operating status |
| Production Data | SCADA→MES | Real-time production volume |
| Process Parameters | SCADA→MES | Temperature, pressure, etc. |
| Alarm Information | SCADA→MES | Equipment alarms |
| Production Command | MES→SCADA | Production control commands |
### 3.3 Interface Configuration
**Interface Configuration Elements:**
| Configuration Item | Description |
|-------------------|-------------|
| Interface Code | Unique interface identifier |
| Interface Name | Interface name |
| Interface Type | API/Middleware/Message |
| Source System | Data source system |
| Target System | Data target system |
| Interface Address | API address or database connection |
| Authentication Method | Authentication type and credentials |
| Data Format | JSON/XML/DB |
**Interface Configuration Example:**
| Interface Item | Configuration Value |
|----------------|---------------------|
| Interface Code | INT-001 |
| Interface Name | Material Master Data Sync |
| Interface Type | API |
| Source System | ERP |
| Target System | MES |
| Interface Address | http://erp-api/mdm/materials |
| Authentication Method | Token Authentication |
| Call Frequency | Daily full sync + Real-time incremental |
## 4. Data Synchronization
### 4.1 Synchronization Strategies
| Synchronization Strategy | Description | Trigger Method |
|-------------------------|-------------|----------------|
| Real-time Sync | Data changes synchronized immediately | Event triggered |
| Scheduled Sync | Synchronized according to schedule | Scheduled task |
| Manual Sync | Manual trigger synchronization | Manual operation |
| Full Sync | All data synchronized | Scheduled/Manual |
| Incremental Sync | Only changed data synchronized | Event/Scheduled |
### 4.2 Master Data Synchronization
**Material Data Synchronization:**
| Synchronized Field | Description | Required |
|-------------------|-------------|----------|
| Material Code | Unique material identifier | ✓ |
| Material Name | Material name | ✓ |
| Specification | Specification/model | - |
| Unit of Measure | Unit of measure | ✓ |
| Material Category | Material category | - |
| Safety Stock | Safety stock quantity | - |
| Lead Time | Purchase lead time | - |
**BOM Data Synchronization:**
| Synchronized Field | Description | Required |
|-------------------|-------------|----------|
| Product Code | Parent item material code | ✓ |
| Material Code | Child item material code | ✓ |
| Quantity | Material quantity | ✓ |
| Scrap Rate | Scrap percentage | - |
| Process Sequence | Process using the material | - |
### 4.3 Business Data Synchronization
**Work Order Data Synchronization:**
| Sync Direction | Data Content |
|----------------|--------------|
| ERP→MES | Work order number, product, quantity, planned date |
| MES→ERP | Completed quantity, completion time, defective quantity |
**Inventory Data Synchronization:**
| Sync Direction | Data Content |
|----------------|--------------|
| MES→ERP | Received quantity, issued quantity, inventory quantity |
## 5. Message Integration
### 5.1 Message Types
| Message Type | Description | Usage |
|--------------|-------------|-------|
| Production Message | Production-related events | Work order start, completion, etc. |
| Quality Message | Quality-related events | Inspection completion, defect occurrence, etc. |
| Equipment Message | Equipment-related events | Equipment failure, alarms, etc. |
| Inventory Message | Inventory-related events | Receiving, issuing, etc. |
### 5.2 Message Format
**Standard Message Format:**
```json
{
"messageId": "MSG-20260410-001",
"messageType": "PRODUCTION_START",
"sourceSystem": "MES",
"targetSystem": "ERP",
"timestamp": "2026-04-10 10:00:00",
"data": {
"workOrderId": "WO-001",
"productId": "P001",
"quantity": 1000,
"startTime": "2026-04-10 10:00:00"
}
}
```
### 5.3 Message Processing
| Processing Mode | Description | Features |
|-----------------|-------------|----------|
| Immediate Processing | Messages processed immediately | Low latency |
| Asynchronous Processing | Messages buffered in queue | High throughput |
| Batch Processing | Messages processed in batches | High efficiency |
## 6. Interface Monitoring
### 6.1 Monitoring Metrics
| Metric | Description | Monitoring Content |
|--------|-------------|--------------------|
| Interface Call Count | Interface call statistics | Success/failure count |
| Interface Response Time | Interface response speed | Average/max response time |
| Interface Success Rate | Interface availability | Success/total calls |
| Data Sync Timeliness | Data synchronization timeliness | Delay time |
### 6.2 Interface Logs
| Log Type | Description | Retention Period |
|----------|-------------|------------------|
| Call Log | Interface call records | 6 months |
| Request Log | Request message records | 3 months |
| Response Log | Response message records | 3 months |
| Error Log | Error information records | 12 months |
### 6.3 Exception Handling
| Exception Type | Handling Method |
|----------------|-----------------|
| Network Exception | Auto retry (3 times) |
| Timeout Exception | Increase timeout period |
| Authentication Exception | Re-acquire Token |
| Data Exception | Record exception, manual handling |
## 7. Data Transformation
### 7.1 Data Mapping
**Field Mapping Configuration:**
| Source Field | Target Field | Transformation Rule |
|--------------|--------------|---------------------|
| material_code | mat_code | Direct mapping |
| unit_price | cost | Unit conversion (Yuan→Ten Thousand Yuan) |
| create_time | createDate | Time format conversion |
### 7.2 Data Validation
| Validation Rule | Description |
|-----------------|-------------|
| Required Field Check | Required fields cannot be empty |
| Format Check | Data format must be correct |
| Length Check | Field length cannot exceed limit |
| Business Rule Check | Must comply with business rules |
## 8. Integration Security
### 8.1 Authentication Methods
| Authentication Method | Description | Security Level |
|----------------------|-------------|----------------|
| Username/Password | Basic authentication | Medium |
| API Key | Interface key | Medium |
| Token Authentication | OAuth2.0 | High |
| Digital Certificate | SSL certificate | High |
### 8.2 Transmission Security
| Security Measure | Description |
|------------------|-------------|
| HTTPS | Data transmission encryption |
| Data Signature | Data integrity verification |
| Data Masking | Sensitive data protection |
---
**End of Data and Integration**