Truy xuất nguồn gốc & Blockchain
14 Models · 17 Enums · 25 APIs · 12 UI Components · EPCIS 2.0 · Merkle Tree Anchoring · AI Recall Advisor

Truy xuất Nguồn gốc & Blockchain cho Sản xuất
Module Truy xuất nguồn gốc & Blockchain của DBIZ là giải pháp toàn diện được xây dựng trên nền tảng Next.js 14 + Prisma + PostgreSQL + ethers.js v6 + merkletreejs. Cung cấp khả năng truy vết sản phẩm end-to-end tuân thủ chuẩn GS1 EPCIS 2.0, kết hợp neo dữ liệu lên blockchain tạo audit trail bất biến.
Hệ thống hỗ trợ giám sát chuỗi lạnh, quản lý thu hồi theo phân loại FDA, mã định danh GS1 quốc tế, và phân tích thu hồi bằng AI. Kiến trúc database sử dụng Oracle 26AI với thiết kế 4-schema-per-tenant (Foundation, Blockchain, Agentic AI, Data Lakehouse) đảm bảo cô lập dữ liệu hoàn toàn.
EPCIS 2.0 Compliance
Tuân thủ chuẩn GS1 EPCIS cho truy xuất nguồn gốc quốc tế
Merkle Root Anchoring
Gom entity hash → Merkle tree → Neo root lên blockchain bất biến
AI Recall Advisor
Claude AI phân tích rủi ro, đưa khuyến nghị thu hồi thông minh
Cold Chain Monitoring
Giám sát IoT real-time, auto-alert vi phạm ngưỡng
Consumer Trace (Public)
API công khai cho người tiêu dùng quét QR xác minh nguồn gốc
FDA Recall Classification
Thu hồi Class I-III + Voluntary theo quy chuẩn FDA
Màn hình Minh họa
Ảnh chụp thực tế từ module Blockchain & Truy xuất nguồn gốc DBIZ MES

Blockchain Dashboard — Pharma Demo
8 Tính năng Cốt lõi — Truy xuất & Blockchain
Truy xuất sản phẩm toàn diện từ nguồn gốc đến người tiêu dùng, được bảo chứng bởi blockchain

Tổng quan & Graph truy vết
Dashboard tổng hợp với đồ thị truy vết (nodes + edges). Tìm kiếm đa entity: WorkOrders, Products, SteelCoils, PurchaseOrders, SalesOrders. Hiển thị timeline sản xuất từ NVL → Thành phẩm → Khách hàng.
Kiến trúc 3 Tầng
Presentation → API (25 routes) → Service (1.360 LOC) → Data (14 models + PostgreSQL)
PRESENTATION LAYER
12 React Components — Truy xuất nguồn gốc (9 components) + Blockchain Dashboard (3 components)
API LAYER
25 API Routes — /api/trace (11), /api/blockchain (10), /api/traceability (3+1 public)
SERVICE LAYER
lib/blockchain/ — 6 files, 1.360 dòng code
Blockchain Engine — Merkle Tree & Anchoring
Keccak256 hashing, xây dựng Merkle tree, EVM chain gateway với 0-value self-transaction
Merkle Tree & Keccak256
Entity data hash bằng keccak256 (tương thích Ethereum). Build Merkle tree với sortPairs: true. Verification off-chain (nhanh) + on-chain (authoritative).
Chain Gateway (EVM)
0-value self-transaction với Merkle root làm calldata. Chi phí thấp nhất, không cần deploy smart contract. Hash lưu vĩnh viễn trong tx input data.
Queue & Auto-Anchor
Gom entity hash chưa anchor thành batch (min 10). Tự động confirm pending transactions. Process queue: confirm → check → anchor khi đủ batch size.
8 Event Hooks
Fire-and-forget hooks: WorkOrder status change, QC complete, Material handover, Production step, Pallet created, Shipment change, Maintenance complete, WMS inbound.
hubMạng Blockchain Hỗ trợ
Polygon Amoy
Chain ID: 80002
Testnet (mặc định)
Polygon Mainnet
Chain ID: 137
Production
Ethereum
Chain ID: 1
Production (chi phí cao)
BSC
Chain ID: 56/97
Alternative
Custom
Chain ID: -
Mạng riêng
14 Database Models — 3 Giai đoạn
5 Blockchain Core + 5 Trace Engine Phase 1 & 2 + 4 Phase 3 Compliance
Phase 1: Blockchain Core
5 modelsBcNetwork, BcWallet, BcTransaction, BcAuditAnchor, BcEntityHash — Nền tảng blockchain, Merkle tree anchoring, chain gateway
Phase 2: Trace Engine
5 modelsBcChainActor, BcProductUid, BcTraceEvent, BcColdChainLog, BcColdChainAlert — EPCIS events, cold chain, chuỗi cung ứng
Phase 3: Compliance & AI
4 modelsBcRecall, BcRecallBatch, BcCertificate, BcGS1Identifier — Thu hồi sản phẩm, chứng nhận, GS1, AI Recall Advisor
bc_networks
Cấu hình mạng blockchain (Ethereum, Polygon, BSC, Custom)
bc_wallets
Quản lý ví blockchain (HOT/COLD/CUSTODIAL)
bc_transactions
Giao dịch on-chain với retry & confirmation
bc_audit_anchors
Batch neo Merkle Root lên blockchain
bc_entity_hashes
Hash từng entity (lá trong Merkle tree)
bc_chain_actors
Tác nhân chuỗi cung ứng (NCC, NSX, PP, Bán lẻ)
bc_product_uids
Định danh sản phẩm duy nhất (GS1 compliant)
bc_trace_events
Sự kiện truy vết (HARVEST→PROCESS→PACK→SHIP→SELL)
bc_cold_chain_logs
Đo lường nhiệt độ, độ ẩm, áp suất
bc_cold_chain_alerts
Cảnh báo vi phạm ngưỡng (INFO→WARNING→CRITICAL→EMERGENCY)
bc_recalls
Thu hồi sản phẩm theo FDA (Class I-III)
bc_recall_batches
Liên kết recall với batch sản phẩm
bc_certificates
Chứng nhận (COA, GMP, HACCP, ISO, HALAL, FDA...)
bc_gs1_identifiers
Mã GS1 quốc tế (GTIN, SSCC, GLN, SGTIN)
Oracle 26AI — Kiến trúc Database
1 Database per Tenant × 4 Schemas — Foundation, Blockchain, Agentic AI, Data Lakehouse
Blockchain Tables
BLOCKCHAIN
Immutable ledger, tamper-proof transaction log
JSON Relational Duality
BLOCKCHAIN, AI
Truy cập data đồng thời qua JSON và relational
AI Vector Search (HNSW)
AGENTIC_AI
Similarity search cho RAG, agent memory
In-Database ML (OML)
DATA_LAKEHOUSE
Train & inference ML trực tiếp trong DB
Oracle Data Guard
CDB level
RPO: 0 (zero data loss), RTO: < 30s
Resource Manager
All schemas
Foundation 25%, Blockchain 20%, AI 25%, Lakehouse 30%
FOUNDATION
Users, Auth, Roles, Workflow, Master Data, Audit Log
BLOCKCHAIN
Ledger, Blocks, Transactions, Smart Contracts, Digital Signatures
AGENTIC_AI
AI Agents, Prompts, Vector Store, RAG, Model Registry
DATA_LAKEHOUSE
Bronze/Silver/Gold, ETL Jobs, Metadata Catalog
Kiến trúc Bảo mật
Bảo mật đa tầng: Quản lý private key, cô lập database, tính năng bảo mật Oracle
Private Key — XOR + Vault
Production: KMS/Vault (AES-256-GCM). Testnet: XOR encryption với BC_WALLET_SECRET. TUYỆT ĐỐI không lưu key trong DB plaintext.
Database-per-Tenant
Oracle PDB riêng cho mỗi tenant. 4 schema tách biệt: Foundation, Blockchain, Agentic AI, Data Lakehouse. DOUBLE PROTECTION.
Simulation Mode
Khi wallet là placeholder: simulated tx hash = keccak256(root + timestamp), auto-confirm. Phù hợp demo/testnet không có token.
Oracle 26AI Security
TDE (AES-256 at-rest), DB Vault (DBA isolation), VPD (row-level), Unified Audit. Blockchain Tables = immutable, tamper-proof.
warningBảo mật Private Key — Quy tắc nghiêm ngặt
Truy xuất Người tiêu dùng — Quét QR Công khai
API công khai (không cần đăng nhập) cho người tiêu dùng quét QR xác minh nguồn gốc
Quét mã QR trên sản phẩm
Hệ thống tra cứu thông tin sản phẩm
Hiển thị nguồn gốc, NVL, NCC, timeline
Xác minh blockchain (txHash, explorer)
GET /api/public/consumer-trace?productCode=XXX&lot=YYY
Trả về: thông tin sản phẩm, NVL, timeline sản xuất, trạng thái xác minh blockchain
Sẵn sàng triển khai Truy xuất & Blockchain?
14 Models · 25 APIs · EPCIS 2.0 · Merkle Tree · AI Recall Advisor · Oracle 26AI — Cấp doanh nghiệp, sẵn sàng production.
Sản phẩm liên quan
Các giải pháp nền tảng khác