Label Encyclopedia

How to Make Serial Number Labels? 3-Layer Architecture: Database + Printing + Scanning

📅 2026-07-15 ✍️ Wuxi Lexiang Printing & Packaging ⏱ 7min read

💡 💡 At a Glance

Variable data printing achieves a unique serial number output for each label through data stream + RIP processing, with no plate-making fee and supporting small batches.

Last week, a client dealing with electronics product traceability asked me: "I want to put a unique serial number label on every product. How should I do it?"

I said: "**3-layer architecture** — database + printing + scanning, all three are essential."

I said: "**A serial number is not just a simple number** — it relies on the coordination of a database + printing system + scanning system. This article won't explain 'what a serial number is' — instead, it covers the 3-layer architecture + 5 encoding formats + 7-step implementation + 3 application categories."

3-Layer Architecture

Layer 1: Database Layer

**3 Core Functions**:

Database Table Design
├─ id (auto-increment primary key)
├─ serial (serial number, unique index)
├─ product_id (product ID)
├─ batch (batch number)
├─ created_at (production time)
└─ status (status: unsold / sold / activated)

**3 Core Requirements**:

  • Uniqueness (add unique index to serial)
  • Encryption (encrypt sensitive fields)
  • Backup (daily incremental backup)

Layer 2: Printing Layer

**3 Core Functions**:

Variable Data Printing
├─ Digital Printing (under 1,000 sheets)
├─ Flexographic Printing (5,000+ sheets)
└─ Inkjet Printer (production line)

**3 Core Requirements**:

  • Unique per piece (no duplication)
  • Traceable (linked to database)
  • Verifiable (scan code to query)

Layer 3: Scanning Layer

**3 Core Functions**:

Consumer Scanning
├─ H5 / Mini Program
├─ Cloud Query (anti-counterfeit / loyalty points)
└─ Data Feedback (consumer behavior)

**3 Core Requirements**:

  • 1-second scan (no lag)
  • Authenticity check (instant result)
  • Interaction (red packets / coupons)
## 5 Encoding Formats ### Format 1: Code128 (1D, Most Common) **3 Features**:

  • Variable length (1–48 characters)
  • Numbers + letters + control characters
  • High density (2–3 times more data than Code39)
**3 Application Categories**:

  • Industrial traceability
  • Warehouse management
  • Logistics labels
### Format 2: Code39 (1D, Early Generation) **3 Features**:

  • Variable length (1–43 characters)
  • Numbers + uppercase letters + 5 special characters
  • Broad compatibility (readable by any scanner)
**3 Application Categories**:

  • Automotive manufacturing
  • Defense and military industry
  • Medical devices
### Format 3: DataMatrix (2D, Small Size) **3 Features**:

  • Square matrix (black and white modules)
  • Can be as small as 2.5mm × 2.5mm
  • High density (up to 2,335 characters)
**3 Application Categories**:

  • Small electronic components
  • PCB board traceability
  • Medical devices
### Format 4: QR Code (2D, Consumer Scenarios) **3 Features**:

  • Can contain URL (scan to open webpage)
  • 3 finder patterns (easy to recognize)
  • 4 error correction levels (L/M/Q/H)
**3 Application Categories**:

  • Anti-counterfeit query
  • Marketing campaigns
  • Consumer interaction
### Format 5: Dual-Code Redundancy **3 Features**:

  • Code128 + DataMatrix dual codes
  • If one scan fails, the other serves as backup
  • Compatible with both industrial and consumer use
**3 Application Categories**:

  • High-security scenarios
  • Multi-scenario scanning
  • Traceability and anti-counterfeit
## 7-Step Implementation Process ### Step 1: Select Encoding Format **3 Options, Choose 1**:

  • Industrial traceability — Code128
  • Anti-counterfeit + consumer — DataMatrix or QR
  • High security — dual-code redundancy
### Step 2: Generate Code Database **3-Step Operation**:

  • Select prefix (manufacturer code + product code)
  • Generate continuous serial numbers (0001–9999)
  • Import into database (unique index)
### Step 3: Printing and Labeling **3 Printing Methods**:

  • Digital printing (under 1,000 sheets)
  • Flexographic printing (5,000+ sheets)
  • Inkjet printer (production line)
### Step 4: Factory Scan and Binding **3-Step Operation**:

  • Scan each product before leaving the factory
  • Bind to order / customer
  • Change status from "unsold" to "sold"
### Step 5: Inbound Scanning **3-Step Operation**:

  • Distributor scans upon inbound
  • Bind distributor + region
  • Update inventory
### Step 6: Consumer Scanning **3-Step Operation**:

  • Consumer scans with phone
  • H5 displays authenticity + information
  • Can participate in marketing campaigns
### Step 7: Data Feedback **3-Step Operation**:

  • Scan data feeds back into database
  • Generate anti-counterfeit / marketing reports
  • Data-driven decision making
## 3 Application Scenarios ### Scenario 1: Electronic Product Traceability **3 Features**:

  • Unique per piece (anti-counterfeit)
  • PCB board-level traceability
  • Industrial scanner
**Recommendation**: Code128 + PI label (high-temperature resistant) ### Scenario 2: Consumer Goods Anti-Counterfeit **3 Features**:

  • Unique per piece
  • Consumer scanning
  • H5 anti-counterfeit query
**Recommendation**: DataMatrix + synthetic paper ### Scenario 3: Logistics Management **3 Features**:

  • Unique per piece
  • Batch inbound and outbound
  • WMS system integration
**Recommendation**: Code128 + thermal transfer ## 3 Production Line Integration Types ### Integration 1: Sequential **Process**: Inkjet → Labeling → Scanning **Advantage**: Simple equipment + low investment ### Integration 2: Parallel **Process**: Inkjet + Labeling → Scanning **Advantage**: High efficiency + consistency ### Integration 3: Integrated **Process**: Inkjet + Labeling + Scanning all-in-one machine **Advantage**: Highest efficiency + data synchronization

To learn more about the one-product-one-code system — refer to the One-Product-One-Code Label Traceability System, or directly contact a LeXiang Packaging consultant, and receive a serial number solution + system integration recommendation within 24 hours.

#Serial Number #Serial Number Label #SN Label #Encoding Format #Code128 #DataMatrix #Database #Scan Code Traceability #Production Line Integration #Batch Printing #Serial Number Generation #LeXiang Packaging

FAQ

How to make serial number labels?

3-layer architecture + 7-step implementation: (1) Database layer—generate serial numbers + store in database + encrypt; (2) Printing layer—variable data printing (digital/flexo) + code binding; (3) Scanning layer—consumer scan + anti-counterfeit query + data feedback. 7-step process: (1) Select encoding format; (2) Generate code library; (3) Print and label; (4) Factory scan binding; (5) Inbound scan; (6) Consumer scan; (7) Data feedback. 3 keys: (1) Uniqueness—each label unique; (2) Readability—100% scan recognition; (3) Traceability—full database recording.

How many serial number encoding formats are there?

5 common encoding formats: (1) 1D barcode—Code128 (most common, variable-length digits + letters, high density); (2) 1D barcode—Code39 (early format, letters + digits + a few symbols); (3) 2D barcode—DataMatrix (small size, matrix type, suitable for small labels); (4) 2D barcode—QR Code (consumer scenarios, can contain URL); (5) Hybrid—Code128 + DataMatrix dual code. 3 selection categories: (1) Industrial traceability—Code128; (2) Anti-counterfeit + consumer scan—DataMatrix or QR; (3) High security—dual code redundancy.

How to build a serial number label database?

3 steps to build the database: (1) Table design—product ID + serial number + production date + batch + status + related order; (2) Unique index—add unique index on serial number field (prevent duplicates); (3) Encryption—encrypt sensitive data storage (prevent leakage). 3 field categories: (1) Required—id / serial / product_id / created_at / status; (2) Optional—batch / lot / related order; (3) Index—serial (high-frequency query) + product_id. 3 tools: MySQL (most common) / PostgreSQL (advanced) / SQL Server (enterprise). Recommend a separate table for each product + unique serial number index.

How to integrate serial number labels with the production line?

5-step production line integration: (1) Production line scanner—install scanning equipment (read serial numbers); (2) ERP interface—ERP provides API (order/inventory/logistics); (3) Database integration—serial number system + ERP bidirectional sync; (4) Inkjet printer—inkjet at end of production line (unique per item); (5) Packaging line—labeling + scanning + order association. 3 integration methods: (1) Sequential—inkjet → labeling → scanning; (2) Parallel—inkjet + labeling → scanning; (3) Integrated—inkjet + labeling + scanning all-in-one machine. 3 investment categories: scanner 500-3000 RMB/unit + inkjet printer 10,000-50,000 RMB/unit + software 50,000-200,000 RMB.

How to ensure serial number label scan rate?

3 steps to ensure scan rate: (1) Print quality—300 DPI minimum (ensure barcode clarity); (2) Testing—print 100 sheets, sample 100 scans (100% recognition rate); (3) Monitoring—test scan rate with every new ink batch. 3 factors affecting scan rate: (1) Barcode clarity—bar width ≥ 0.19mm; (2) Quiet zone—≥ 10 times bar width; (3) Color contrast—PCS ≥ 75%. 3 failure causes: (1) Ink too light (density < 1.3); (2) Label wrinkling (die-cutting deformation); (3) Scanner distance (5-30 cm + angle < 30°). Recommend testing every new ink batch.

Need a Custom Packaging Solution?

Learn more about packaging, or consult directly for a custom solution and quote