Robot "One Device, One Code" Compliance: A Technical Implementation Guide

    This guide explains how to implement a unique product identity code for every robot, covering the four-segment code structure, the allocation and binding workflow, database and idempotency requirements, batch provisioning reliability, the full-lifecycle data model, validation and integration practices, and common risks with practical mitigation advice.

    1. Background and Problem Definition

    Robot products are moving from isolated single devices to large-scale deployments, and the regulatory focus is shifting accordingly—from “does the function work” to “can the identity be confirmed and can responsibility be traced.” A regulator has published draft rules on robot product identification code management for public comment, with the comment period ending December 5. The core idea is to assign a unique product identity code to every robot leaving the factory, covering all categories—industrial, service, and special-purpose—and to require that encoding and code application follow the corresponding national standards. The standard is planned for release in January 2026, under the responsibility of the national robot standardization technical committee. A full-lifecycle management service platform for humanoid robots is already in operation, using a 29-character, four-segment structure (country code, enterprise code, product code, serial code) and covering more than a hundred companies and over twenty thousand devices; the new rules extend the scope to all categories.

    For R&D and platform teams, this is not a simple field addition but an identity governance project spanning manufacturing execution, cloud asset management, operations monitoring, and after-sales systems. Four questions must be answered: where the code is generated, who allocates it, how uniqueness is guaranteed, and how state changes are written back.

    2. Technical Meaning of the Code Structure

    The four-segment structure (manufacturer code, product description code, product sequence code, other code) is essentially a hierarchical namespace:

    • Manufacturer code: identifies the responsible party and determines ownership and the audit boundary for all subsequent codes;
    • Product description code: describes the model, specification, or category so that different products from the same manufacturer can be distinguished;
    • Product sequence code: the key to per-device uniqueness, usually carried by a serial number or running number;
    • Other code: a reserved extension field for check digits, versions, or special purposes.

    In engineering terms, the identity code should be treated as a combination of “immutable primary key plus mutable state.” The identifier itself never changes once assigned, while activation, repair, scrapping, and recall are states that must be stored in a separate state table—avoid expressing business changes by modifying the code.

    3. Code Application Workflow and System Changes

    It is recommended to split code application into four steps, with idempotency constraints at each step:

    1. Request: triggered by a production line work order, carrying the manufacturer code, product description code, and batch information;
    2. Allocation: a code pool service generates candidate codes by segment and performs a uniqueness reservation before writing;
    3. Marking and binding: the code is written to the nameplate, QR code, or chip storage, then read back for verification;
    4. Activation: when the device first connects to the network, it reports the identity code and firmware version, and the platform transitions the state from “ex-works” to “activated.”

    Illustrative interfaces (semantic only, not real endpoints):

    1. POST /identity/allocate # Request a code segment; returns candidate identity codes (idempotency key = work order number)
    2. POST /identity/bind # Bind the value read on the production line; persisted after read-back verification passes
    3. POST /identity/activate # First-time device activation; writes activation time and firmware version
    4. GET /identity/{code}/state # Query current state and change history

    At the database level: create a unique index on the identity code column; use the same transaction or a local message table for request and binding to guarantee eventual consistency; record the operator, timestamp, and source system for every write operation to form a tamper-resistant audit trail.

    4. Uniqueness and Batch Provisioning

    Uniqueness must not rely on “collisions being improbable”—it needs to be enforced by constraints. Common approaches include segment pre-allocation (requesting a continuous range of sequence numbers each time to reduce load on the central node), retrying after unique index conflicts, and check digits in the code to reduce manual entry errors.

    Reliability essentials for batch scenarios:

    • Idempotency: use the work order number or batch number as the idempotency key so repeated submissions return the same result;
    • Resume from checkpoints: record row-level progress and rerun only the unfinished portion on failure;
    • Read-back verification: always read back and compare after writing to prevent “a code with no physical device” caused by nameplate printing or chip write failures;
    • Fault isolation: a single-device failure must not block the whole batch; it enters a pending queue and triggers an alert.

    5. Full-Lifecycle Data Model

    Five entity types are recommended around the identity code: product master data (model, specification, manufacturer), identity instances (identity code and current state), state events (ex-works, activation, repair, scrapping), runtime data index (references to device-reported metrics and logs), and service records (work orders and spare part replacements). The state machine should explicitly define legal transitions, for example “ex-works → activated → under repair → activated/scrapped”; illegal transitions are rejected outright and alerted.

    For privacy and security, public disclosure should expose only necessary fields; serial numbers can be masked or mapped through hashing; transmission and storage should be encrypted; access should be granted on a least-privilege basis by role, with all queries logged.

    6. Validation, Integration, and Joint Testing

    The validation capabilities offered externally should include three types: single-code lookup, batch validation, and state write-back. Batch validation should support pagination and partial-success semantics, returning per-item results rather than failing as a whole. When integrating with the regulatory side or an industry platform, use asynchronous messaging plus local persistence to decouple the systems and avoid production line blockage when the other party is unavailable; failures enter a retry queue with a maximum retry count and a threshold for manual intervention.

    Joint testing checklist: code segment request and recycling, idempotency of repeated submissions, read-back failure handling, activation timing, rejection of illegal state transitions, partial batch failures, and monitoring alert triggering.

    7. Common Risks and Implementation Advice

    Risks concentrate in four areas: duplicate or misprinted codes, state inconsistent with the physical device, historical data that cannot be backfilled, and over-exposure of public information. The corresponding advice: unique index plus read-back verification, separate tables for state and identity, a backfill channel that marks the data source, and a whitelist of fields for external exposure.

    For rollout pacing, pilot on a single production line first, close the loop from request to activation, then replicate horizontally; also bring the identity code into the unified observability system of monitoring, alerting, and logging. If built on the general capabilities of Baidu AI Cloud, a container platform can host the code service, a message queue can provide asynchronous decoupling, object storage can archive audit files, and logging plus monitoring and alerting can ensure observability—improving stability and compliance provability without changing business semantics.