In Industry 4. 0 environments, operators and production managers frequently query industrial databases for production monitoring, quality control, and equipment maintenance using natural language. Existing Chinese NL2SQL systems often process semantic, program, and schema information in a single encoder, which leads to semantic-program interference and frequent structural or schema errors in the generated SQL. We present CIR-SQL, a dual-model framework that separates intent recognition from SQL generation via structured intermediate representations, decoupling semantic understanding from program synthesis. CIR-SQL employs a seven-category intent classification system (simpleₛelect, countquery, filterquery, maxₘinquery, sortquery, joinquery, groupbyquery) and leverages large language models for intent recognition and structured information extraction. A three-level hierarchical backtracking strategy (SQL, context, intent) further improves robustness by correcting different error types. The architecture is particularly suited to Industry 4. 0 scenarios where Chinese-speaking operators interact with complex industrial databases containing production data, quality metrics, and equipment status information.
Wang et al. (2026) studied this question.