Protocol Adaptation Assistant
1. Introduction
The Protocol Adaptation Assistant helps with device protocol access. After a user uploads protocol documents, field tables, message samples, or packet captures in an AI chat, the system automatically recognizes the protocol parsing scenario and tries to extract the protocol structure, message types, field definitions, encoding/decoding rules, Thing Model mapping, and quality issues.
The current version does not require users to create protocol adaptation tasks manually. After protocol materials are uploaded, the system automatically creates an adaptation record in the background and advances the parsing flow. Users mainly view the processing status, parsing results, and next-step suggestions in the AI chat.
The Protocol Adaptation Assistant reduces the workload of protocol understanding and code generation, but it cannot replace real-device integration testing. Before a protocol goes live, developers still need to confirm fields, checksum algorithms, device authentication, uplink/downlink flows, and sample messages.
2. Operation Path
AI Empowerment > AI ChatAfter entering the AI chat, you can choose "Auto Detect" or switch to "Protocol Parsing" mode before uploading materials. Menu names may vary slightly between versions; refer to the actual admin console.
3. Preparation
Before using protocol adaptation, it is recommended to complete the following:
- A usable chat model has been configured and enabled.
- If you have protocol domain materials, maintain and publish a protocol knowledge base first.
- Prepare the original protocol documents, field tables, message samples, packet capture logs, or device manuals.
- Clarify the protocol encoding, byte order, checksum algorithm, device identifier, authentication flow, and uplink/downlink directions.
- Prepare real sample messages that can be used for verification.
Source protocol materials support common document and data files, such as .pdf, .doc, .docx, .txt, .md, .xls, .xlsx, .csv, .json.
4. Overall Flow
Users do not need to create tasks manually on the protocol adaptation page. After the chat upload, the system automatically saves the materials, runs protocol parsing, applies quality gates, and tries to generate a code package and validation results when conditions are met.
5. How To Upload Protocol Materials
- Open the AI chat.
- Select "Auto Detect" or "Protocol Parsing" mode.
- Upload protocol documents, field tables, message samples, or packet capture files.
- State the goal of this request in the question, for example, "Please parse this protocol and generate an adaptation code package."
- Wait for the AI chat to return processing progress and results.
If you use "Auto Detect", include keywords such as "protocol parsing", "protocol adaptation", "message", "codec", or "code package" in the question, so the system can route accurately to the protocol parsing capability.
Example questions:
Parse the message structure, field definitions, checksum rules, and Thing Model mapping from the uploaded protocol materials, and generate protocol adaptation suggestions.Analyze this Modbus register table and organize the fields, scaling factors, units, and platform Thing Model mapping.Generate a protocol adaptation code package from the uploaded protocol document, and list the issues that need manual confirmation.6. AI Chat Processing Stages
After protocol materials are uploaded, the system processes them in the following stages:
| Stage | Description |
|---|---|
| Save materials | Save the uploaded protocol documents, field tables, or sample messages |
| Automatic parsing | Extract analyzable text from the materials and generate a structured protocol DSL |
| Quality gate | Check whether the protocol overview, message types, fields, codec rules, and samples are complete |
| Code generation | Try to generate a protocol adaptation code package when the materials meet the conditions |
| Static validation | Check the generated package structure, key files, sample messages, and static rules |
| Return results | Return the status, summary, next-step suggestions, and related numbers in the AI chat |
The adaptation records generated in the background are mainly used to save materials, processing progress, and generation results. Ordinary users only need to focus on the status and suggestions returned in the AI chat.
7. How To Read Chat Results
The AI chat usually returns the uploaded files, processing status, current stage, adaptation record number, generation record number, and next-step suggestions. Common statuses:
| Status | Meaning | Suggested Handling |
|---|---|---|
| Completed | Parsing, validation, and generation are basically complete | Review the results and proceed to manual review and integration testing |
| Completed with warnings | Results were generated, but there are missing or uncertain items | Add materials or confirm manually according to the next-step suggestions |
| Review required | Materials are insufficient or the quality gate did not fully pass | Add field tables, sample messages, and checksum rules, then upload again |
| Failed | File parsing, model invocation, or the generation flow encountered an error | Check the failure reason, adjust the files, or retry later |
If "next-step suggestions" appear in the chat results, fill in the missing information according to the suggestions first. Common suggestions include adding sample messages, clarifying the checksum algorithm, confirming the byte order, and improving the Thing Model mapping.
8. What AI May Generate
Depending on the completeness of the materials, AI may output the following:
| Content | Description |
|---|---|
| Protocol structure summary | Protocol name, transport method, encoding, authentication flow, uplink/downlink flow |
| Message types | Registration, heartbeat, property reporting, events, control delivery, responses, and other message types |
| Field definitions | Field name, byte range, type, scaling factor, unit, enums, and description |
| Codec rules | Byte order, length, checksum, escaping, packet splitting and sticking rules |
| Thing Model mapping | Mapping suggestions from protocol fields to platform Thing Model properties, events, or functions |
| Quality issues | Missing items, risk items, and manual-confirmation items identified by AI |
| Generation results | Protocol adaptation code packages, manifests, or test reports generated when conditions are met |
When materials are incomplete, AI prioritizes analysis results and supplementary suggestions, and may not be able to complete code package generation directly.
9. Material Quality Checklist
Before uploading materials, confirm the following:
- Whether message directions are clear: device reporting, platform delivery, or device response.
- Whether the frame header, length, command word, serial number, device identifier, and checksum are complete.
- Whether the byte order is big-endian or little-endian.
- Whether field types are signed or unsigned, and whether special encodings such as BCD, bitmaps, strings, or JSON exist.
- Whether scaling factors, units, precision, and value ranges are clear.
- Whether enum values are complete, such as online status, alarm types, and device status.
- Whether checksum algorithms, escaping rules, and packet splitting/sticking rules are clear.
- Whether the registration, authentication, heartbeat, data reporting, control delivery, and response flows are complete.
- Whether sample messages can be mapped to field explanations.
- Whether Thing Model identifiers comply with the platform naming conventions.
10. FAQ
1. Why is there no "Create Task" entry
In the current version, protocol adaptation is triggered by uploading materials in an AI chat. The system automatically creates an adaptation record in the background, so users do not need to create tasks manually.
2. Protocol parsing did not start after uploading
Switch to "Protocol Parsing" mode before uploading, or explicitly include keywords such as "protocol parsing", "protocol adaptation", "message", "codec", or "code package" in the question.
3. Fields are missing from the AI parsing results
This usually means the field table in the protocol materials is incomplete, or the message samples are not annotated with directions and meanings. Add the field table, sample messages, and parsing results, then upload again.
4. It prompts that review is required or materials are insufficient
This means key structures required for generation are missing, such as basic protocol information, message types, field definitions, codec rules, or sample messages. Complete the materials according to the next-step suggestions in the chat, then upload again.
5. Code package generation failed
Check whether the protocol materials include the protocol encoding, field definitions, codec rules, checksum algorithm, and sample messages. Code package generation depends on a complete DSL; when materials are missing, only analysis suggestions may be produced.
6. Can the results go live directly
No. The Protocol Adaptation Assistant produces supporting artifacts. Before going live, code review, compilation, unit testing, real-device integration testing, and business acceptance must be completed.

