Intelligent generation system and method for collecting communication codes among multiple platforms and multiple systems

By transforming industrial communication protocol documents into a unified description and automatically generating adaptation code, an intelligent system solves the "protocol silo" problem caused by protocol differences between industrial field devices, and achieves efficient data interconnection and system integration.

CN121997899APending Publication Date: 2026-05-08TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANJIN UNIV
Filing Date
2026-01-22
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In existing technologies, differences in communication protocols between industrial field devices lead to the problem of "protocol silos," which makes data interconnection and interoperability difficult, resulting in long development cycles, high costs, and high risks. Traditional methods are also unable to process unstructured protocol documents and generate effective communication code.

Method used

By employing protocol document preprocessing and standardized intelligent agents, unstructured or semi-structured industrial communication protocol documents are transformed into unified protocol description documents. Combined with multi-platform acquisition component code generation intelligent agents, communication code adapted to different hardware architectures and operating systems is automatically generated, and knowledge support is provided using a communication protocol knowledge base.

Benefits of technology

It significantly improves the efficiency of industrial data interconnection, reduces development cycle and manual intervention costs, enhances system stability and development efficiency, and simplifies protocol parsing and adaptation processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121997899A_ABST
    Figure CN121997899A_ABST
Patent Text Reader

Abstract

The invention relates to intelligent generation of collected communication codes among multiple platforms and multiple systems, in particular to an intelligent generation system and method for collected communication codes among multiple platforms and multiple systems. The invention discloses an intelligent generation system for collecting communication codes among multiple platforms and multiple systems. The intelligent generation system comprises a protocol document preprocessing and standardization agent; collecting component codes by multiple platforms to generate an intelligent agent; and a communication protocol knowledge base. The invention provides an intelligent generation system for collecting communication codes among multiple platforms and multiple systems, and aims to solve the problem of'protocol island 'caused by protocol difference among equipment in an industrial field and improve the interconnection and interworking and system integration efficiency of industrial data. By introducing a protocol document preprocessing and standardization agent, an unstructured or semi-structured industrial communication protocol document can be converted into a unified protocol description document, so that the complexity of protocol analysis is simplified. Communication codes adaptive to different hardware architectures and operating systems can be generated by combining a multi-platform collection component code generation agent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the intelligent generation of acquisition and communication codes between multiple platforms and systems, and more particularly to an intelligent generation system and method for acquisition and communication codes between multiple platforms and systems. Background Technology

[0002] With the continuous development of the Industrial Internet and intelligent manufacturing, the types and numbers of equipment in industrial sites are constantly increasing. The communication protocols used between different devices are diverse, including general industrial protocols such as Modbus, CAN, and Profinet, as well as numerous proprietary protocols developed by various manufacturers based on standard protocols. Due to differences in syntax, data semantics, and interaction mechanisms, these protocols easily form isolated "protocol islands," severely hindering the interconnection and system integration of industrial data. Existing data acquisition system development mainly relies on manual methods. Engineers need to thoroughly study complex protocol documents and manually write parsing and communication code for different protocols. This not only results in long development cycles and low efficiency but also high costs and risks during protocol adaptation, maintenance, and upgrades. Furthermore, protocol documents are often in unstructured forms such as PDF scans, complex tables, and timing diagrams, which traditional optical character recognition and parsing technologies struggle to process accurately, still requiring extensive manual proofreading and organization. Although general-purpose large-scale language models have certain code generation capabilities, due to a lack of professional knowledge in the field of industrial communication protocols, they are unable to accurately understand the complex semantics and contextual logic in protocol documents, and cannot effectively handle low-level adaptation issues related to specific hardware platforms and operating systems. Therefore, they are unable to directly meet the practical application needs of industrial data acquisition and protocol parsing. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide an intelligent generation system and method for collecting communication codes between multiple platforms and systems.

[0004] This invention is achieved through the following technical solution:

[0005] A smart generation system for acquiring communication codes across multiple platforms and systems, characterized in that it includes:

[0006] Protocol document preprocessing and standardization intelligent agents are used to transform unstructured or semi-structured industrial communication protocol documents into unified protocol description documents.

[0007] A multi-platform data acquisition component code generation intelligent agent is used to generate source code for industrial data acquisition and communication components that are adapted to various hardware architectures and operating systems, based on the unified protocol description document.

[0008] A communication protocol knowledge base is used to provide knowledge and data support for the protocol document preprocessing and standardization agent, as well as the code generation agent of the multi-platform acquisition component.

[0009] Preferably, the protocol document preprocessing and standardization intelligent agent includes:

[0010] The multimodal parsing module is used to generate intermediate representations with clear hierarchical relationships and semantic associations based on industrial communication protocol documents;

[0011] The deep semantic understanding module is used to generate a protocol semantic representation based on the intermediate representation;

[0012] The structured output module is used to generate standardized structured protocol description documents based on the above protocol semantic representation.

[0013] Preferably, the multimodal parsing module includes a document format unification processing unit, an optical character recognition unit, a document layout analysis unit, a table structure modeling unit, a mathematical formula recognition and conversion unit, a sequence diagram / flowchart parsing unit, and a multimodal joint modeling unit.

[0014] Preferably, the deep semantic understanding module includes a key term identification unit, a protocol ontology alignment unit, a relation extraction and semantic graph construction unit, a communication process reconstruction unit, a context reasoning and semantic aggregation unit, a version evolution identification unit, a long text semantic modeling unit, and a few-shot learning and semantic enhancement unit.

[0015] Preferably, the structured output module includes a protocol metadata generation unit, a communication basic information generation unit, a message structure definition unit, a unique identifier and data point definition unit, and an error code and exception handling description unit.

[0016] Preferably, the multi-platform acquisition component code generation agent includes:

[0017] The protocol analysis module is used to generate a communication logic model required to implement communication based on the structured protocol description document;

[0018] The platform adaptation module is used to map the communication logic model to the target hardware architecture and operating system environment;

[0019] The code synthesis and optimization module is used to generate compilable source code for the acquisition components.

[0020] Preferably, the protocol analysis module includes a protocol field parsing unit, a message assembly and parsing logic generation unit, a verification rule generation unit, and a communication timing parsing unit.

[0021] Preferably, the platform adaptation module includes a platform parameter parsing unit, a platform abstraction layer mapping unit, a driver interface adaptation unit, and a toolchain and compilation configuration unit; and / or

[0022] The code synthesis and optimization module includes a code template filling unit, a complete source code project generation unit, a memory and performance optimization unit, a resource constraint optimization unit, a model lightweighting and quantization unit, a security mechanism injection unit, and a static code analysis and vulnerability repair unit.

[0023] Preferably, the communication protocol knowledge base includes:

[0024] A structured protocol library is used to store the unified structured protocol description documents generated by the preprocessing of the protocol documents and the standardized intelligent agents;

[0025] Protocol knowledge graphs are used to organize and express semantic relationships related to industrial communication protocols in a graph structure.

[0026] Code templates and component library, used to store and manage reusable data acquisition and communication code templates and functional components;

[0027] The test case library stores test cases for various industrial communication protocols, communication scenarios, and abnormal conditions.

[0028] A method for intelligently generating communication codes across multiple platforms and systems, wherein the intelligent generation method is applied to the aforementioned intelligent generation system, and the intelligent generation method includes the following steps:

[0029] S1 uses multimodal parsing technology to uniformly process protocol documents of different formats, extract key information and perform standardized processing;

[0030] S2, through deep semantic analysis and knowledge graph mapping, performs named entity recognition, relation extraction and semantic association on the extracted information, and formats the results into a unified protocol description document;

[0031] S3, based on the target platform's hardware architecture and operating system, parse the protocol description document and call the corresponding code template to automatically generate communication code corresponding to the target platform;

[0032] S4 automatically adds security checks and exception handling mechanisms to the generated source code, and improves the security and performance of the code through static analysis and optimization techniques.

[0033] S5, store the communication code in the knowledge base.

[0034] The beneficial effects of this invention are as follows: This invention proposes an intelligent generation system for acquiring communication codes across multiple platforms and systems, aiming to solve the "protocol silo" problem caused by protocol differences between devices in industrial settings, and improve the efficiency of industrial data interconnection and system integration. By introducing protocol document preprocessing and standardized intelligent agents, unstructured or semi-structured industrial communication protocol documents can be transformed into unified protocol description documents, thereby simplifying the complexity of protocol parsing. Combined with intelligent agents that generate code from multi-platform acquisition components, communication codes adapted to different hardware architectures and operating systems can be automatically generated, significantly reducing development cycles and manual intervention costs. In addition, the system provides comprehensive knowledge support for intelligent agents through a communication protocol knowledge base, solving the high cost and high risk problems faced by protocol adaptation, maintenance, and upgrades in traditional methods, and improving development efficiency and system stability.

[0035] Furthermore, the protocol document preprocessing and standardization intelligent agent in this invention effectively solves the complexity problem in industrial communication protocol document processing through the collaborative work of a multimodal parsing module, a deep semantic understanding module, and a structured output module. The multimodal parsing module transforms industrial communication protocol documents into intermediate representations with clear hierarchical relationships and semantic connections. The deep semantic understanding module further parses and generates the semantic representation of the protocol, ensuring accurate understanding and expression of the protocol content. The structured output module generates standardized structured protocol description documents based on the protocol semantic representation, thereby greatly improving the readability and automated processing capabilities of the protocol documents and providing an accurate and unified foundation for subsequent protocol parsing and code generation. This system significantly reduces the complexity and error rate of manual processing and improves the efficiency of industrial protocol adaptation and development.

[0036] Furthermore, the multimodal parsing module in this invention comprehensively enhances the processing capabilities of industrial communication protocol documents by integrating multiple functional units, including unified document format processing, optical character recognition, document layout analysis, table structure modeling, mathematical formula recognition and conversion, sequence diagram / flowchart parsing, and multimodal joint modeling. The collaborative work of these units enables accurate identification and processing of different document content formats, such as text, tables, charts, and formulas, thereby transforming complex, unstructured, or semi-structured documents into intermediate representations suitable for further processing. This comprehensive multimodal parsing technology significantly improves the processing efficiency and accuracy of protocol documents, reduces manual intervention, and lays a solid foundation for subsequent protocol standardization and code generation, significantly enhancing the automation level of protocol adaptation and system integration.

[0037] Furthermore, the deep semantic understanding module in this invention, through the synergistic effect of multiple units such as key term identification, protocol ontology alignment, relation extraction, and semantic graph construction, can deeply understand and parse the complex semantic information in industrial communication protocols. This module effectively captures the contextual relationships and dynamic changes in protocol documents through technologies such as communication flow reconstruction and contextual reasoning, supporting the identification and management of protocol version evolution. Simultaneously, long-text semantic modeling and few-shot learning enhance the processing capability for complex protocol content, making the semantic understanding of protocols more accurate and efficient. Through this module, the deep semantics of protocol documents are fully explored, providing accurate and comprehensive semantic support for subsequent protocol standardization and automated code generation, thereby significantly improving the intelligence level and system adaptability of protocol parsing.

[0038] Furthermore, the structured output module in this invention, through the collaborative work of functional units such as protocol metadata generation, communication basic information generation, message structure definition, unique identifier and data point definition, and error code and exception handling description, can efficiently transform the complex semantics of the protocol into a standardized structured protocol description document. These units ensure the clear definition and accurate mapping of each key element in the protocol, such as communication parameters, data formats, identifiers, and exception handling mechanisms, thereby providing clear and consistent data support for subsequent protocol parsing and automated code generation. Through this module, the structuring level of the protocol document is greatly improved, reducing the difficulty of manual interpretation and processing, significantly improving the efficiency of protocol adaptation, maintenance, and upgrades, while enhancing the stability and reliability of the system.

[0039] Furthermore, the multi-platform acquisition component code generation agent in this invention achieves automated conversion from protocol description to executable code through the organic cooperation of a protocol analysis module, a platform adaptation module, and a code synthesis and optimization module. The protocol analysis module generates a communication logic model based on the structured protocol description document, ensuring accurate protocol parsing and understanding; the platform adaptation module maps this communication logic model to different hardware architectures and operating system environments, guaranteeing cross-platform compatibility; and the code synthesis and optimization module generates efficient and compilable acquisition component source code according to requirements, greatly improving development efficiency and reducing errors and redundancy in manual coding. This system not only significantly reduces the development cycle but also effectively improves the flexibility of protocol adaptation and the execution efficiency of code, providing important technical support for the construction and maintenance of industrial data acquisition systems.

[0040] Furthermore, the protocol analysis module in this invention, through the synergistic action of functional units such as protocol field parsing, message assembly and parsing logic generation, verification rule generation, and communication timing analysis, can comprehensively analyze and understand all levels of industrial communication protocols. The protocol field parsing unit ensures the accurate identification and processing of each field in the protocol, while the message assembly and parsing logic generation unit is responsible for generating the corresponding communication logic to facilitate efficient data exchange. The verification rule generation unit and the communication timing analysis unit further guarantee the integrity and accuracy of the data and ensure that timing requirements during communication are handled appropriately. This module enables in-depth analysis and automated processing of complex protocols, significantly improving the accuracy and efficiency of protocol adaptation and data acquisition, reducing manual intervention and error risks, and providing solid technical support for the rapid development and stable operation of industrial data acquisition systems.

[0041] Furthermore, the platform adaptation module in this invention achieves efficient adaptation of communication logic to various hardware platforms and operating systems through the collaborative efforts of functional units such as platform parameter parsing, platform abstraction layer mapping, driver interface adaptation, and toolchain and compilation configuration. The platform parameter parsing unit ensures an accurate understanding of the target platform's hardware and system parameters, while the platform abstraction layer mapping unit seamlessly maps the communication logic model to different hardware architectures, guaranteeing cross-platform compatibility. The driver interface adaptation unit further ensures interface compatibility between various hardware platforms, while the toolchain and compilation configuration unit optimizes the code compilation and building process, improving system execution efficiency. This module effectively simplifies the adaptation work between different platforms, significantly improves development efficiency, and reduces the complexity of platform adaptation, providing strong technical support for the multi-platform deployment of industrial data acquisition systems.

[0042] Furthermore, the code synthesis and optimization module in this invention comprehensively improves the generation efficiency and quality of the source code for the acquisition components through multiple functional units, including code template filling, complete source code engineering generation, memory and performance optimization, resource constraint optimization, model lightweighting and quantization, security mechanism injection, and static code analysis and vulnerability repair. The code template filling and complete source code engineering generation units ensure automated code generation and structural integrity, while the memory and performance optimization unit significantly improves system operating efficiency and resource utilization efficiency through fine-tuning. The resource constraint optimization and model lightweighting and quantization units further ensure efficient operation on different hardware platforms, while security mechanism injection and static code analysis enhance code security and stability, reducing potential vulnerability risks. Overall, this module not only accelerates the development process but also improves code execution performance, security, and reliability, providing a strong guarantee for the efficient operation of industrial data acquisition systems.

[0043] Furthermore, the communication protocol knowledge base in this invention provides comprehensive knowledge support through the organic combination of a structured protocol library, a protocol knowledge graph, a code template and component library, and a test case library, significantly improving the intelligence level of protocol parsing and code generation. The structured protocol library effectively stores standardized protocol documents, ensuring the uniformity and accuracy of protocol information; the protocol knowledge graph organizes and expresses the semantic relationships of protocols in a graph structure, providing rich contextual information for in-depth protocol understanding. The code template and component library manages a large number of reusable data acquisition and communication code templates and functional components, reducing redundant development work and improving code standardization and maintainability; the test case library provides test cases for various protocols and scenarios, ensuring high reliability and accuracy in the protocol parsing and code generation process. Overall, the communication protocol knowledge base greatly improves development efficiency, reduces development risks, and enhances the system's scalability and stability. Attached Figure Description

[0044] Figure 1 This is a schematic diagram of the overall system structure provided by the present invention;

[0045] Figure 2 This is an internal workflow diagram of the protocol document preprocessing and standardized intelligent agent provided by the present invention;

[0046] Figure 3 This is an internal structure diagram of the multi-platform acquisition component code generation intelligent agent provided by the present invention;

[0047] Figure 4 This is a schematic diagram of the communication protocol knowledge base structure provided by the present invention. Detailed Implementation

[0048] To enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and preferred embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0049] In the description of the invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention.

[0050] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "setting," and "connection" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection, an indirect connection through an intermediate medium, or a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0051] This invention provides an intelligent generation system for acquiring communication codes across multiple platforms and systems. The system includes a protocol document preprocessing and standardization intelligent agent, a multi-platform acquisition component code generation intelligent agent, and a communication protocol knowledge base.

[0052] The protocol document preprocessing and standardization intelligent agent is used to automatically parse, understand, and standardize heterogeneous industrial communication protocol documents, transforming unstructured or semi-structured documents into a unified protocol description that can be understood by machines, and supporting automatic generation of cross-platform communication code. This intelligent agent includes modules for multimodal parsing, deep semantic understanding, and structured output.

[0053] The multimodal parsing module is used to perform unified information extraction and structural reconstruction of industrial communication protocol documents in various formats and carriers. It transforms scattered, unstructured information into intermediate representations with hierarchical relationships and semantic connections, providing high-fidelity, machine-understandable foundational data for deep semantic understanding and protocol standardization. This module includes units for document format unification processing, optical character recognition, document layout analysis, table structure modeling, mathematical formula recognition and conversion, time sequence diagram / flowchart parsing, and multimodal joint modeling. The document format unification processing unit standardizes protocol documents from different sources and formats. By parsing various formats such as PDF, Word, HTML, web pages, and scanned images, it unpacks the document content, unifies the encoding, and regularizes the page structure, transforming text, images, and metadata into a unified internal representation, providing standardized input for subsequent parsing and analysis. The Optical Character Recognition (OCR) unit is used to recognize and digitize the image-based text in protocol documents. By detecting and scanning text information in the document, it converts the text in the image into machine-processable character data. Simultaneously, it optimizes the recognition of symbols and special identifiers based on industrial protocol characteristics, ensuring the accuracy of basic text information and supporting subsequent layout analysis and semantic understanding. The document layout analysis unit automatically identifies and parses the document's page structure. By analyzing the distribution of page elements, it identifies structural information such as titles, paragraphs, chart areas, and annotations, reconstructing the document hierarchy and reading order. It associates text with corresponding layout positions and semantics, avoiding content misalignment caused by complex typesetting, and providing accurate structured information for table modeling and deep semantic understanding. The table structure modeling unit automatically reconstructs the logical structure of complex tables in the document, accurately identifying row and column boundaries, cell merging relationships, etc., and recovering the implicit protocol field definitions and parameter constraints within the table. Through topological relationship modeling and dynamic splicing technology, it solves problems such as cross-page tables and nested tables, providing a reliable data foundation for protocol semantic understanding and code generation. The mathematical formula recognition and conversion unit identifies mathematical formulas, verification algorithms, length calculations, and other expressions in documents, converting images or unstructured mathematical formulas into standardized mathematical expressions. This ensures that the verification rules and calculation logic in the protocol can be accurately understood, providing a basis for subsequent protocol modeling and automatic generation of parsing and verification code. The sequence diagram / flowchart parsing unit automatically parses sequence diagrams and flowcharts describing the communication process, identifying entities, message interaction sequences, conditional branches, and other relationships within the diagrams. It transforms graphical representations into structured timing logic or state machine models, thus providing an accurate semantic foundation for communication process reconstruction and automatic code generation.The multimodal joint modeling unit integrates information from multiple modalities, including text, images, table structures, and page layouts, to construct a cross-modal joint semantic representation. It establishes correspondences between text and charts, field definitions, and timing diagrams, eliminating the information fragmentation problems caused by single-modal parsing. This enables a holistic understanding of complex protocol documents, providing a complete multimodal semantic foundation for deep semantic understanding and standardized protocol output. Through the collaborative work of these units, the multimodal parsing module can comprehensively process various information in heterogeneous protocol documents, providing accurate and structured protocol data support and promoting subsequent automated protocol standardization and code generation processes.

[0054] The deep semantic understanding module performs high-level semantic modeling of industrial communication protocol documents based on multimodal parsing results. Utilizing natural language processing and large-scale language modeling techniques, it automatically identifies and abstracts key entities, field relationships, and functional dependencies in the protocol. Through semantic aggregation and contextual reasoning, it transforms fragmented protocol descriptions into a consistent, complete, and machine-understandable semantic representation. This module combines protocol domain ontology and knowledge graphs to complete terminology standardization, implicit rule completion, and version difference identification, providing an accurate and reliable semantic foundation for subsequent unified protocol description generation and automatic generation of cross-platform communication code. The deep semantic understanding module includes a key term identification unit, a protocol ontology alignment unit, a relationship extraction and semantic graph construction unit, a communication flow reconstruction unit, a contextual reasoning and semantic aggregation unit, a version evolution identification unit, a long text semantic modeling unit, and a few-shot learning and semantic enhancement unit. The key term identification unit uses named entity recognition and other technologies to automatically identify and extract core terms from the document parsing results, such as addresses, function codes, data types, and registers, and associates them with contextual content, providing clear semantic anchors for subsequent terminology semantic mapping, field relationship modeling, and communication logic parsing. The protocol ontology alignment unit semantically aligns the identified protocol fields with predefined protocol domain ontology. By comparing terminology differences across different protocols and vendor documents, it standardizes synonymous or equivalent concepts into standard protocol concepts, thereby eliminating semantic ambiguity caused by terminological heterogeneity and ensuring consistency of protocol fields across different documents, versions, and vendors. This provides a reliable foundation for protocol semantic understanding and cross-protocol reuse. The communication flow reconstruction unit integrates the scattered descriptions of communication steps into a complete and coherent flow or state machine model. By fusing the parsing results of text, tables, sequence diagrams, and flowcharts, it identifies the triggering conditions, request and response sequences, state transitions, and exception handling paths for each stage of communication. This transforms fragmented and non-linear protocol descriptions into executable flow logic, providing a clear and accurate flow semantic foundation for subsequent protocol behavior understanding and code generation. The contextual reasoning and semantic aggregation unit analyzes the protocol context to identify initial conditions, default parameters, and constraints that are not explicitly stated in the document but are implied in preceding and following chapters. It also performs semantic aggregation and consistency verification on descriptions of the same protocol element in different locations, completing and unifying protocol behavior definitions, avoiding misunderstandings caused by fragmented information, and supporting the accuracy of the protocol semantic model. The version evolution identification unit automatically identifies and analyzes changes in different versions of the protocol document. By comparing elements such as field definitions, function code behavior, and communication flows, it detects newly added, deleted, or modified protocol content and infers protocol evolution patterns by combining historical protocol data. This helps determine protocol version compatibility, supports upgrades and adaptations, and provides a clear basis for generating multi-version acquisition and communication code.The long-text semantic modeling unit overcomes the traditional model's length limitations on long texts by establishing logical segmentation and cross-chapter semantic associations, maintaining the consistency and coherence of protocol semantics throughout the document. This provides stable and reliable support for deep semantic understanding and protocol model construction. The few-shot learning and semantic enhancement unit addresses scenarios with scarce samples or proprietary protocols, improving the system's parsing capabilities. By constructing a few-shot learning mechanism, this unit enables the model to quickly adapt to new or non-mainstream protocols with only a few protocol samples. Combined with semantic enhancement techniques, it diversifies and expands existing protocol descriptions, generating equivalent or approximate training samples. This enhances the model's robustness to differences in proprietary protocol representations and improves the accuracy and generalization ability of protocol semantic understanding and standardization. Through the synergistic effect of these units, the deep semantic understanding module achieves a comprehensive and accurate understanding of industrial communication protocol documents, improving the standardization and automated processing capabilities of protocol semantics, and providing a reliable semantic foundation for the automatic generation of cross-platform protocols and communication code.

[0055] The structured output module unifies and standardizes the results of multimodal parsing and deep semantic understanding, organizing and generating standardized structured protocol description documents according to predefined protocol description models. It transforms previously scattered and unstructured protocol information into machine-understandable protocol models, facilitating subsequent automatic generation of cross-platform acquisition communication code and protocol reuse. This module generates a consistent and complete protocol description by extracting protocol metadata, basic communication parameters, message structure, field definitions, function commands, communication timing, and exception handling rules. The protocol metadata generation unit automatically extracts metadata such as protocol name, type, version number, and applicable devices or manufacturers from the protocol document parsing results, and performs standardization and consistency verification, providing a foundation for protocol version management and correct generation of multi-platform acquisition communication code. The basic communication information generation unit extracts the basic communication parameters required for protocol operation, identifies the protocol's transport layer type, connection method, and related configuration items, organizes basic information such as communication medium, port number, and connection establishment method, and outputs unified structured data, ensuring clear basis for subsequent communication connection management, platform adaptation, and automatic generation of acquisition communication code. The message structure definition unit abstracts and standardizes the composition of data messages in the protocol. By parsing the message format specifications in the protocol document, it defines elements such as the frame header, frame trailer, length field, function code location, data area structure, and checksum method, clarifying the field order, byte length, and parsing rules. This transforms the scattered or implicit message format in the protocol into a machine-parseable structured model, providing an accurate basis for subsequent message assembly, parsing, and code generation. The unique identifier and data point definition unit establishes the correspondence between data points and their unique identifiers by parsing identification elements such as addresses, indexes, register numbers, and tag names in the protocol. It also clarifies the access method, data type, and value meaning of data points, thus forming a standardized and reusable data point definition model that supports data mapping, read / write operations, and configuration management in subsequent acquisition and communication code. The function code and service command description unit standardizes and describes various operation instructions in the protocol, identifying operation types such as read, write, subscribe, control, and alarm confirmation, along with their corresponding request parameters, response formats, and execution conditions. This information is expressed in a structured form, clarifying the protocol's supported interactive capabilities and behavioral rules, providing a basis for the subsequent generation of instruction call logic and interactive processing flows in the acquisition and communication code. The error code and exception handling description unit models the error codes, exception types, and handling rules in the protocol, identifying the meaning, triggering conditions, and recommended handling methods for different error codes. This is structured into identifiable exception handling rules, providing a standardized basis for the automatic generation of subsequent error identification, exception capture, retry mechanisms, and fault recovery logic. Through these functional modules, the structured output module integrates the scattered information in the protocol document into a consistent and machine-processable protocol model, ensuring the automatic generation of subsequent communication code and the reusability of the protocol.This process greatly improves the operability, compatibility, and automation capabilities of protocol documents, making them suitable for the standardization and cross-platform application of various industrial communication protocols.

[0056] The multi-platform data acquisition component code generation agent automatically generates industrial data acquisition communication code adapted to different hardware architectures and operating systems based on a unified protocol description document. It parses the protocol's communication logic, message structure, and field definitions, decoupling the protocol logic from platform-related implementations within a platform abstraction layer framework. Combined with built-in multi-platform code templates and driver interface libraries, it automatically synthesizes complete data acquisition component source code that conforms to the target platform's compilation environment. This enables rapid deployment and reuse of industrial communication protocols on heterogeneous hardware such as ARM and x86, as well as in multi-system environments such as Linux, Windows, and RTOS, significantly reducing manual development and maintenance costs. The multi-platform data acquisition component code generation agent includes a protocol analysis module, a platform adaptation module, and a code synthesis and optimization module.

[0057] The protocol analysis module is used to parse and deconstruct the communication semantics in structured protocol description documents. By analyzing the protocol's communication methods, message structure, field definitions, function codes, and verification rules, it extracts and generates a core logical model, including message assembly and parsing processes, the correspondence between requests and responses, and exception handling conditions. This provides an executable protocol logic foundation for platform adaptation and the automatic generation of communication code. This module includes functions such as protocol field parsing, message assembly and parsing logic generation, verification rule generation, and communication timing analysis. The protocol field parsing unit refines the parsing of various field information in the protocol document, identifying the field's name, position, byte length, data type, and value meaning. It clarifies the hierarchical relationships and dependencies between fields, transforming abstract field definitions into concrete field models that can be used for message assembly and parsing, providing a basis for the automatic generation of subsequent data encoding, decoding, and field mapping logic. The message assembly and parsing logic generation unit constructs message generation and parsing rules based on the protocol field parsing results, determines the field arrangement order, encoding method, and length calculation method in the message, generates a logical model for request message assembly and response message parsing, and handles complex cases such as variable-length fields, conditional fields, and nested structures. This ensures that the acquisition communication code can correctly construct and send messages and accurately parse received data according to the protocol specifications. The verification rule generation unit transforms the verification methods and algorithms in the protocol description into executable verification logic, parses the protocol's verification types and calculation rules, automatically generates verification calculation and validation logic, and integrates it into the message assembly and parsing process. This ensures that the acquisition communication code can accurately complete data integrity verification during data sending and receiving, improving communication reliability and stability. The communication timing parsing unit parses and refines the communication flow in the protocol, analyzes the interaction sequence of requests and responses, timeout and retry conditions, and state transition rules, extracts the required timing control logic, and transforms it into an executable flow model. This provides a basis for the automatic generation of subsequent timing-related logic such as connection management, interaction control, and exception handling. Through these functions, the protocol analysis module provides a clear and accurate protocol logic foundation for the subsequent automatic generation of communication code, ensuring that the collected communication code conforms to the protocol specifications and runs stably.

[0058] The platform adaptation module maps the general communication logic obtained from protocol analysis to specific hardware architectures and operating system environments. By parsing the target platform's hardware type, operating system, and runtime environment parameters, it selects and calls the corresponding driver interfaces, system calls, and compilation configurations within the platform abstraction layer framework. This decouples and adapts platform-independent protocol logic from platform-related implementations, generating acquisition and communication code that can run stably on different hardware platforms and operating systems, enabling cross-platform deployment and portability. The platform parameter parsing unit receives and parses the target deployment platform information specified by the user, identifies the hardware architecture type, operating system category, and related runtime environment parameters, and organizes and standardizes the platform capabilities and constraints, providing clear parameter basis for subsequent adaptation processes. The platform abstraction layer mapping unit decouples protocol logic from platform implementation during the multi-platform acquisition component code generation process. It maps general communication logic to a unified platform abstraction interface and selects the corresponding implementation based on the target platform characteristics, enabling the same protocol logic to be reused under different hardware architectures and operating systems. This reduces the impact of platform differences on code generation and improves code portability and maintainability. The driver interface adaptation unit binds the communication and resource access interfaces defined by the platform abstraction layer to the underlying driver implementation of the target platform. By selecting and configuring network, serial port, or bus driver interfaces that match the target hardware and operating system, it generates corresponding interface call code and initialization logic, thereby ensuring that the acquisition and communication code can correctly access underlying communication resources and guaranteeing the stability and reliability of protocol communication in different platform environments. The toolchain and compilation configuration unit automatically generates a build environment configuration that matches the acquisition and communication code for the target platform. By parsing platform parameters and code generation requirements, it selects and configures the appropriate compiler, linker, and build tools, automatically generating compilation options, dependency library configurations, and system parameter settings. This ensures that the generated acquisition component source code can be successfully compiled, linked, and deployed in the target hardware architecture and operating system environment, reducing manual configuration errors. Through these functions, the platform adaptation module can effectively decouple and adapt the protocol logic from the platform-related implementation, ensuring the portability and stability of the acquisition and communication code across different platforms.

[0059] The code synthesis and optimization module automatically generates high-quality acquisition and communication code based on protocol analysis and platform adaptation. It combines the parsed protocol logic with code templates provided by the platform adaptation module to generate a complete, compilable acquisition component source code project, optimizing memory usage, execution efficiency, and resource utilization during the generation process. Simultaneously, the module introduces security checks and exception handling mechanisms to improve the performance, stability, and security of the generated code across different platform environments. This module includes several functional units. The code template filling unit embeds the specific communication logic, field definitions, and verification rules obtained from protocol analysis into predefined code templates. By matching and filling the protocol model with the template selected by the platform adaptation module, it generates code snippets that conform to the target platform specifications, thereby quickly implementing the protocol logic and ensuring consistency in structure and style of the generated code, reducing repetitive coding work. The complete source code project generation unit organizes and encapsulates the generated code results, automatically generating a complete, well-structured, and clearly defined acquisition and communication source code project, providing necessary build scripts and documentation for direct compilation, deployment, and integration, reducing manual organization and setup workload. The memory and performance optimization unit optimizes memory allocation, reduces redundant data structures, and lowers computational overhead by analyzing communication logic and operational characteristics. It also adjusts buffering mechanisms and execution flows for high-frequency communication scenarios, improving code efficiency and stability to meet the performance and memory requirements of embedded and resource-constrained platforms. The resource constraint optimization unit optimizes acquisition communication code for resource-constrained industrial equipment and embedded platforms. By analyzing the CPU, memory, and peripheral resource limitations of the target platform, it adjusts code structure and execution strategies, and introduces interrupt mechanisms and DMA transfers where feasible, reducing CPU usage and improving data transfer efficiency to ensure stable code operation in resource-constrained environments. The model lightweighting and quantization unit optimizes scenarios for locally deployed intelligent inference capabilities. By pruning and compressing model structures and using low-bit quantization, it reduces model parameter size and computational complexity, lowering memory usage and inference latency, enabling intelligent generation and optimization functions to operate efficiently in resource-constrained environments. The security mechanism injection unit automatically incorporates security measures during the generation process, embedding mechanisms such as identity authentication, data encryption, integrity verification, and abnormal access control. Combined with boundary checks and anomaly detection strategies, it enhances code security and resistance to attacks, ensuring the reliability and security of industrial data transmission. The static code analysis and vulnerability remediation unit performs automated security and quality checks on the generated source code. Through static analysis, it identifies issues such as memory out-of-bounds access, null pointer access, resource leaks, and unsafe function calls, and remediates or provides remediation suggestions based on preset rules or expert experience. This reduces security vulnerabilities and operational risks, improving the reliability and robustness of the generated code.In summary, the code synthesis and optimization module can not only generate high-quality acquisition and communication code that meets protocol and platform requirements, but also optimize resource usage, enhance security, and ensure the efficient, stable, and secure operation of the code.

[0060] The communication protocol knowledge base provides continuous and unified knowledge support for the intelligent generation of acquisition and communication codes across multiple platforms and systems. It centrally stores structured protocol descriptions, protocol terminology and relationships, cross-platform code templates, test cases, and expert rules, providing real-time query and reuse capabilities for each stage of protocol document parsing, semantic understanding, and code generation. As the system operates, the knowledge base continuously accumulates new protocols, versions, and practical experience, supporting iterative model optimization, improving the accuracy of protocol parsing and the quality of code generation, and promoting the long-term accumulation and intelligent evolution of industrial communication protocol knowledge. The structured protocol library centrally stores structured protocol description documents generated by protocol document preprocessing and standardized intelligent agents. It uses a standardized data model to save communication parameters, message structures, field definitions, function commands, and timing rules for different industrial communication protocols and their variants, ensuring efficient retrieval and reuse of protocol semantics, and providing reliable data support for automatic generation of acquisition and communication codes across multiple platforms, protocol version management, and cross-protocol comparative analysis. The protocol knowledge graph expresses the semantic relationships related to protocols in a graph structure, associating elements such as terms, field definitions, function codes, device types, and common issues. It constructs a relationship network within and between protocols, supporting term mapping, semantic reasoning, and relational queries. This provides reasonable support for protocol semantic understanding, cross-protocol alignment, anomaly localization, and the generation of data acquisition and communication code. The code template and component library centrally stores reusable data acquisition and communication code templates and functional components. These templates cover different communication modes, industrial protocol characteristics, and common code implementations under various hardware platforms and operating systems. They can be automatically invoked and populated during code generation, quickly achieving protocol logic and platform adaptation, reducing repetitive development work, and ensuring the standardization, reliability, and maintainability of the generated code. The test case library stores test cases for different protocols, communication scenarios, and abnormal conditions, providing standardized test data and verification rules covering normal communication, boundary conditions, and fault scenarios. It supports functional verification, compatibility testing, and stability assessment of the automatically generated code, identifying potential problems before deployment and improving the reliability and correctness of the generated code. The expert experience base stores expert knowledge and practical experience accumulated during the development of the protocol parsing and acquisition system. It records handling rules for common problems, solutions for abnormal scenarios, and optimization strategies, providing reusable experience support for protocol understanding, code generation, and fault diagnosis. This helps intelligent agents make more rational decisions when facing complex or non-standard protocols, thereby improving system stability and usability. In summary, the communication protocol knowledge base, through systematic knowledge management and intelligent reasoning, provides powerful support for cross-platform communication code generation, improves the efficiency and quality of protocol parsing and generation, and promotes the intelligent evolution of industrial communication protocols.

[0061] This invention also provides an intelligent generation method for acquiring communication codes between multiple platforms and systems based on the above-mentioned system. The method includes the following steps:

[0062] S1 uses multimodal parsing technology to uniformly process protocol documents of different formats, extract key information, and perform standardized processing.

[0063] S2, through deep semantic analysis and knowledge graph mapping, performs named entity recognition, relation extraction and semantic association on the extracted information, and formats the results into a unified protocol description document.

[0064] S3, based on the target platform's hardware architecture and operating system, parses the protocol description document and calls the corresponding code template to automatically generate communication code corresponding to the target platform.

[0065] S4 automatically adds security checks and exception handling mechanisms to the generated source code, and improves the security and performance of the code through static analysis and optimization techniques.

[0066] S5, store the communication code in the knowledge base.

[0067] Step S1 also includes the following steps:

[0068] S101 processes protocol documents of different formats in a unified manner using technologies such as optical character recognition, layout analysis, and table modeling to extract multimodal information such as text, images, and tables.

[0069] S102 improves the understanding and structured extraction of protocol document content by jointly modeling text, images, tables, and layout information in the document.

[0070] S103 automatically parses and reconstructs the sequence diagrams and image information in scanned documents through optical character recognition and automatic speech recognition technologies.

[0071] S104 utilizes graph neural network technology to reconstruct the topological structure of cross-page tables in a document, ensuring the complete splicing of table information.

[0072] Step S2 also includes the following steps:

[0073] S201 uses techniques such as named entity recognition, relation extraction, and terminology normalization to extract key entities and semantic information from protocol documents, providing structured data for subsequent analysis.

[0074] S202, through a finely tuned large language model combined with a protocol knowledge base, identifies and supplements the implicit initial conditions and constraint rules in the protocol, ensuring the integrity and consistency of the document content.

[0075] S203 standardizes and maps the terms in the document through the protocol ontology and knowledge graph, ensuring the consistency and semantic relevance of the protocol content at different levels.

[0076] S204, through a model-independent meta-learning algorithm, achieves rapid adaptation and accurate inference in the case of scarce data, thereby improving the generalization ability of the protocol parsing model.

[0077] S205 transforms the results of deep semantic understanding into a unified protocol description document, which includes protocol metadata, communication structure, data types, timing, and other content, facilitating subsequent processing and use.

[0078] Step S3 also includes the following steps:

[0079] S301 analyzes the characteristics and requirements of the target platform's hardware architecture and operating system, providing basic data support for subsequent protocol parsing and code generation.

[0080] S302 extracts key information such as communication logic, field definitions, and verification rules by parsing the protocol description document, providing structured protocol content for code generation.

[0081] S303, based on the characteristics of the target platform, calls the corresponding code template and driver interface to generate communication code that meets the platform requirements.

[0082] S304 generates complete C++ source code through multi-agent collaborative work and optimizes it to improve code efficiency and resource management.

[0083] Step S4 also includes the following steps:

[0084] S401 automatically incorporates security measures such as boundary checks, exception handling, and two-way authentication into the generated source code to ensure the security and stability of the communication process.

[0085] S402 uses static analysis tools to detect and fix potential vulnerabilities in code, thereby improving code security and reliability.

[0086] S403 reduces code size and resource consumption, and improves the performance and operating efficiency of embedded platforms through lightweight model pruning and 8-bit integer quantization technology.

[0087] Step S5 also includes the following steps:

[0088] S501 continuously collects and organizes structured data from protocol documents to form a unified protocol metadata library, supporting subsequent analysis and code generation.

[0089] S502 continuously collects and organizes code templates and the experience of domain experts to improve the communication protocol knowledge base, in order to support intelligent generation and platform adaptation.

[0090] S503 supports agents in continuously learning and improving their generation capabilities based on a knowledge base by continuously updating and optimizing protocol descriptions, code templates, and expert experience.

[0091] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An intelligent generation system for acquiring communication codes across multiple platforms and systems, characterized in that, include: Protocol document preprocessing and standardization intelligent agents are used to transform unstructured or semi-structured industrial communication protocol documents into unified protocol description documents. A multi-platform data acquisition component code generation intelligent agent is used to generate source code for industrial data acquisition and communication components that are compatible with various hardware architectures and operating systems, based on the unified protocol description document. A communication protocol knowledge base is used to provide knowledge and data support for the protocol document preprocessing and standardization agent, as well as the code generation agent of the multi-platform acquisition component.

2. The intelligent generation system for acquiring communication codes between multiple platforms and systems according to claim 1, characterized in that, The protocol document preprocessing and standardization agent includes: The multimodal parsing module is used to generate intermediate representations with clear hierarchical relationships and semantic associations based on industrial communication protocol documents; The deep semantic understanding module is used to generate a protocol semantic representation based on the intermediate representation; The structured output module is used to generate standardized structured protocol description documents based on the above protocol semantic representation.

3. The intelligent generation system for acquiring communication codes between multiple platforms and systems according to claim 2, characterized in that, The multimodal parsing module includes a document format unification processing unit, an optical character recognition unit, a document layout analysis unit, a table structure modeling unit, a mathematical formula recognition and conversion unit, a sequence diagram / flowchart parsing unit, and a multimodal joint modeling unit.

4. The intelligent generation system for acquiring communication codes between multiple platforms and systems according to claim 2, characterized in that, The deep semantic understanding module includes a key term identification unit, a protocol ontology alignment unit, a relation extraction and semantic graph construction unit, a communication process reconstruction unit, a context reasoning and semantic aggregation unit, a version evolution identification unit, a long text semantic modeling unit, and a few-shot learning and semantic enhancement unit.

5. The intelligent generation system for acquiring communication codes between multiple platforms and systems according to claim 2, characterized in that, The structured output module includes a protocol metadata generation unit, a communication basic information generation unit, a message structure definition unit, a unique identifier and data point definition unit, and an error code and exception handling description unit.

6. The intelligent generation system for acquiring communication codes between multiple platforms and systems according to claim 2, characterized in that, The multi-platform data acquisition component code generation agent includes: The protocol analysis module is used to generate a communication logic model required to implement communication based on the structured protocol description document; The platform adaptation module is used to map the communication logic model to the target hardware architecture and operating system environment; The code synthesis and optimization module is used to generate compilable source code for the acquisition components.

7. The intelligent generation system for acquiring communication codes between multiple platforms and systems according to claim 6, characterized in that, The protocol analysis module includes a protocol field parsing unit, a message assembly and parsing logic generation unit, a verification rule generation unit, and a communication timing parsing unit.

8. The intelligent generation system for acquiring communication codes between multiple platforms and systems according to claim 6, characterized in that, The platform adaptation module includes a platform parameter parsing unit, a platform abstraction layer mapping unit, a driver interface adaptation unit, and a toolchain and compilation configuration unit; and / or The code synthesis and optimization module includes a code template filling unit, a complete source code project generation unit, a memory and performance optimization unit, a resource constraint optimization unit, a model lightweighting and quantization unit, a security mechanism injection unit, and a static code analysis and vulnerability repair unit.

9. The intelligent generation system for acquiring communication codes between multiple platforms and systems according to claim 6, characterized in that, The communication protocol knowledge base includes: A structured protocol library is used to store the unified structured protocol description documents generated by the preprocessing of the protocol documents and the standardized intelligent agents; Protocol knowledge graphs are used to organize and express semantic relationships related to industrial communication protocols in a graph structure. Code templates and component library, used to store and manage reusable data acquisition and communication code templates and functional components; The test case library stores test cases for various industrial communication protocols, communication scenarios, and abnormal conditions.

10. A method for intelligently generating communication codes across multiple platforms and systems, characterized in that, The intelligent generation method is applied to the intelligent generation system as described in any one of claims 1-9, and the intelligent generation method includes the following steps: S1 uses multimodal parsing technology to uniformly process protocol documents of different formats, extract key information and perform standardized processing; S2, through deep semantic analysis and knowledge graph mapping, performs named entity recognition, relation extraction and semantic association on the extracted information, and formats the results into a unified protocol description document; S3, based on the target platform's hardware architecture and operating system, parse the protocol description document and call the corresponding code template to automatically generate communication code corresponding to the target platform; S4 automatically adds security checks and exception handling mechanisms to the generated source code, and improves the security and performance of the code through static analysis and optimization techniques. S5, store the communication code in the knowledge base.