Automatic internet of things protocol adaptation method and system based on large model
Through large-scale model technology, the IoT protocol knowledge base and generation protocol analysis framework are built, which solves the problems of strong programming dependence and long adaptation cycle during the IoT protocol adaptation process, and realizes automated protocol adaptation, improving efficiency and flexibility , reducing costs and complexity.
Patent Information
- Application Number
- CN202411377172.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-30
AI Technical Summary
The existing IoT protocol has strong programming dependency, long adaptation cycle and high cost during the adaptation process, making it difficult to adapt to rapidly changing protocol standards, and the existing adaptive methods have difficulties in dealing with complex multi-branch protocols.
Using large-scale model technology to build a communication protocol knowledge base, convert protocol documents into vector form through Word2Vec model, generate a protocol parsing framework, and provide it in plug-in form, supports multiple rounds of dialogue and context memory modules, and dynamically adjusts the parsing framework to achieve automated protocol adaptation match.
It significantly improves protocol adaptation efficiency and accuracy, enhances system flexibility and scalability, reduces development and maintenance costs, supports complex and changeable communication protocols, and improves user experience.
Smart Images

Figure CN119211393A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to an automated Internet of Things protocol adaptation method based on a large model. Background Art
[0002] With the rapid development of IoT technology, devices produced by different manufacturers often use their own proprietary communication protocols, making interoperability between devices a major challenge. In IoT application scenarios, there are many types of underlying device communication protocols. For different communication protocols, developers need to write specific code to parse data, which increases the complexity and workload of development. Writing specific adaptation code to achieve protocol conversion is not only labor-intensive and costly, but also difficult to adapt to rapidly changing protocol standards. To this end, developers have proposed an adaptive protocol adaptation method to reduce development workload.
[0003] For example, the Chinese patent document "Universal Standardized Access and Data Parsing System and Method for Heterogeneous IoT Devices" (Publication No. CN116156012A) proposes a universal protocol adaptation method, which converts the non-standard communication protocols of heterogeneous IoT devices into standard data formats through IoT device access proxy plug-ins, and pairs one type of device with one IoT device access proxy plug-in. The proxy plug-in template is in the form of "group + item", which parses the message in group order and fills the data content by item. When there are many types of non-standard devices, complex configuration files are required, and multiple access proxy plug-ins are required, which makes the configuration work cumbersome. The proxy plug-in is stored in XML format, and manual writing of XML files is prone to errors. The "group + item" uses a sequential structure for processing, and cannot handle multiple branches.
[0004] In addition, the Chinese patent document "Management Method of IoT Gateway Based on Multi-protocol Adaptation for Intelligent Perception of Devices" (Publication No. CN115988100A) proposes another adaptive protocol adaptation idea, which solidifies the protocol parsing code in the gateway in advance. After the gateway is powered on, it actively sends multiple protocol adaptation information to the terminal device, and scores according to the response information. The communication protocol with the highest score is used. The active data sending method is suitable for terminals that passively receive data. For terminals that actively push data, the data sent by the gateway cannot respond, and thus the type of communication protocol cannot be determined. Summary of the invention
[0005] The purpose of the present invention is to provide an automated IoT protocol adaptation method based on a large model to address the above-mentioned problems, so as to solve the problems of strong programming dependence, long adaptation cycle and high cost in the existing IoT protocol adaptation process, and to use large model technology to realize automatic adaptation of communication protocols between IoT devices, aiming to reduce the development cost and time of protocol adaptation and improve the flexibility and scalability of the IoT system.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is:
[0007] An automated Internet of Things protocol adaptation method based on a large model includes the following contents:
[0008] Step S1: Set up a knowledge base. The processing flow is as follows:
[0009] Step S1.1, building a communication protocol knowledge base; the specific processing flow of step S1.1 is as follows:
[0010] Step 11, communication protocol document collection and preprocessing: Collect all IoT communication protocol documents that need to be adapted; perform preprocessing and structural operations on the collected communication protocol documents, including data cleaning, removing meaningless characters or blank lines in the text content, removing irrelevant information, unifying the format and word segmentation operations, and extracting key information, including protocol name, protocol version, field name, field content length, field data type, interaction rules and field conversion method;
[0011] Step 12, build a vector library: convert the preprocessed communication protocol document text into vector form, use the Word2Vec model to map each word or phrase in the communication protocol document into a vector of fixed dimension; generate a communication protocol document vector representation through an aggregation method; extract protocol features from the communication protocol document vector library; organize and design an index structure based on protocol features based on hash tables, B-trees and inverted index data structures; store the communication protocol document vectors and their corresponding document identifiers in the index structure; set index update rules, and delete or modify the corresponding index if a communication protocol document is deleted or modified.
[0012] Step S1.2, construct a prompt word template with a clear hierarchical structure and logical relationship; the specific processing flow of step S1.2 is as follows:
[0013] Step 21, document prompt word template, as follows: top-level template: defines the basic properties and overview of the communication protocol, including the protocol name, version number and global information of the application scenario; middle-level template: divides the communication protocol into the core parts of message structure, field definition and interaction process, and designs each core part as a modular structure; bottom-level template: sets the specific parameter data conversion logic of a specific field or message type to obtain detailed guidance on the specific operations of data format conversion, checksum calculation and data encryption / decryption;
[0014] Step 22, node structure template: determine the constituent elements of the node, including node type, node identifier, data length, data type and next node address, and define the order and logical relationship between these elements;
[0015] Step 23: Interaction process template: describes the steps, sequence, conditions and possible exception handling mechanisms for the interactions between devices involved in the communication protocol.
[0016] Step S2: select a large model, load the knowledge base to integrate the preprocessed communication protocol into a queryable data structure, load the prompt word template to parse the prompt word template into a recognizable data structure, and generate a protocol analysis framework; wherein the specific process of generating the protocol analysis framework is as follows:
[0017] Step 21: Introduce a multi-round dialogue mechanism to conduct multiple interactions, gradually clarifying and refining the analysis requirements;
[0018] Step 22: configure a context memory module to store and manage parsing results and context information during the parsing process;
[0019] Step 23: dynamically adjust the content and structure of the prompt word template according to the real-time parsing feedback and context understanding of the large model;
[0020] Step 24, generate a protocol parsing framework, and represent the tree-shaped protocol parsing framework in the form of a json dictionary, each of which has a path pointing; wherein the protocol parsing framework is stored in the form of a json dictionary, and each of which contains a pointer to the next node; the framework nodes are divided into two types: direct nodes and branch nodes. The direct nodes are used to represent regular data fields in the communication protocol, while the branch nodes are used to represent branch functions or conditional logic in the communication protocol, and are configured to select an adaptive parsing path based on different input data; each node contains the data length, data type, conversion method, node description, node branch type, and access address of the next node occupied by the element in the data message.
[0021] Step S3: Generate a protocol parsing plug-in based on the protocol parsing framework, and configure it in the form of a plug-in on the Internet of Things platform as a basis for the platform to parse the communication protocol of the Internet of Things device; the protocol parsing plug-in is represented by the protocol name and stored in the database; wherein, the protocol parsing framework in the form of a json dictionary is loaded, and the tree structure is displayed in the form of a visual page through the front-end page, and each node displays the field detailed information in the form of attributes.
[0022] Step S4, complete communication protocol analysis: when there is a need for communication protocol analysis, query the protocol analysis plug-in content from the database, load it into the redis cache, perform call analysis, and output the analysis result; the specific processing flow of step S4 is as follows:
[0023] Step S4.1, set up support for multiple data channels to access IoT data, and bind the data channel to the protocol parsing plug-in through configuration items;
[0024] Step S4.2, receiving the data sent by the IoT device, and converting the data into a ByteBuf object;
[0025] Step S4.3, load the protocol parsing framework, and traverse and parse the data in ByteBuf according to the node definition in the framework;
[0026] Step S4.4, according to the description of the data length and data type of each node, use the reading method provided by ByteBuf to extract the byte sequence of corresponding length from the input data;
[0027] Step S4.5: Perform necessary format conversion and data processing on the byte sequence according to the data format and conversion rules defined by the node, and generate a communication protocol analysis result;
[0028] The parsing results are stored in KV format, with the node identifier of the node definition as K and the converted data as V, which are stored in Map<String,Object> property.
[0029] Based on the above scheme, in a preferred scheme, a variety of pre-trained large models are configured, Tongyi Lingma, GPT4, DeepSeek, and Kimi are connected through API interfaces, and the large model interface is switched through configuration items.
[0030] Based on the above scheme, in a preferred scheme, the node attribute value is adjusted and the link path of the node is modified through page editing, and the content of the protocol parsing framework is dynamically adjusted.
[0031] Due to the adoption of the above technical solution, the present invention has the following beneficial effects:
[0032] The present invention proposes an automated IoT protocol adaptation system and method based on a large model. The communication protocol document is uploaded through the IoT platform. The large model parses the interface document into a protocol parsing framework, generates a protocol parsing framework, and provides configuration in the form of a plug-in. The application program calls the parsing framework to automatically parse the device access data, and the device data parsing can be realized without coding. Compared with the prior art, the adaptation system and method have significant beneficial effects, which are specifically reflected in the following aspects:
[0033] 1. Significantly improve protocol adaptation efficiency: By introducing advanced deep learning algorithms to build a large model, it can automatically learn and analyze communication protocol documents and quickly generate a protocol parsing framework that meets the requirements. This process greatly reduces manual participation and error rates, and significantly improves the efficiency and accuracy of protocol adaptation.
[0034] 2. Enhance the flexibility and scalability of the system: The protocol adaptation system of the present invention adopts a plug-in design, and the protocol parsing framework is provided in the form of a plug-in. This design enables the system to easily expand and update the protocol parsing capabilities to adapt to the ever-changing communication protocols and device types. At the same time, users can flexibly adjust the protocol parsing framework through a visual editing interface to meet diverse application needs.
[0035] 3. Improve parsing accuracy and reliability: By constructing a prompt word template with a clear hierarchical structure and logical relationship, and adopting a tree-structured protocol parsing framework, the system of the present invention can accurately identify and parse each data node and interaction process in the communication protocol. This refined parsing method ensures the correctness and coherence of the data flow and improves the parsing accuracy and reliability.
[0036] 4. Reduce development and maintenance costs: Traditional IoT protocol adaptation methods often require a lot of development and maintenance work, but the present invention greatly reduces development and maintenance costs by automatically generating a protocol parsing framework and plug-in management. Users only need to upload a new protocol parsing plug-in to achieve the adaptation of the new protocol without the need for complex code writing and modification.
[0037] 5. Improve user experience: The IoT platform can accurately analyze and process the data of access devices by loading the generated protocol analysis framework plug-in. This provides users with a more stable and efficient IoT service experience and improves user satisfaction and loyalty.
[0038] 6. Support for complex and varied communication protocols: The system of the present invention can cope with various complex and varied communication protocols and device types. Through the tree-structured protocol parsing framework and flexible plug-in design, it ensures the system's comprehensive support and efficient processing of multiple protocols. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a method step diagram of the adaptation method of the present invention.
[0040] Figure 2 It is a processing flow chart of an example of the adaptation method of the present invention.
[0041] Figure 3 It is a flow chart of a document uploading knowledge base of an adaptation method example of the present invention.
[0042] Figure 4 It is a schematic diagram of a protocol parsing framework of an adaptation method example of the present invention. DETAILED DESCRIPTION
[0043] The specific implementation of the invention is further described below with reference to the accompanying drawings.
[0044] Example 1
[0045] See also Figure 1 As mentioned above, the large-model-based automated IoT protocol adaptation method includes steps S1 to S4. The present application has a basic solution and various improved solutions, based on which corresponding technical features can be screened to form a number of specific application instances; for example, step S2 of the basic solution instance configures a large model; for another example, step S2 of an improved solution instance configures a plurality of pre-trained large models and sets a large model interface for switching through configuration items; for another example, an improved solution instance sets an index update rule; for another example, an improved solution instance dynamically adjusts the content of the protocol parsing framework, etc.
[0046] Based on the large model-based automated IoT protocol adaptation method, an automated IoT protocol adaptation system based on a large model can be formed accordingly, and its functional modules include: a setting module: used to set the knowledge base; a generation module: used to select a large model, load the knowledge base to integrate the preprocessed communication protocol into a queryable data structure, load the prompt word template to parse the prompt word template into a recognizable data structure, and generate a protocol parsing framework; a plug-in module: used to generate a protocol parsing plug-in based on the protocol parsing framework, and configure it in the form of a plug-in on the IoT platform as a basis for the platform to parse the IoT device communication protocol; a parsing module: used to complete the communication protocol parsing: when there is a communication protocol parsing demand, query the protocol parsing plug-in content from the database, load it into the redis cache, call and parse it, and output the parsing result. For detailed descriptions, please refer to the above method step description and the following workflow description.
[0047] As mentioned above, the large-model-based automated IoT protocol adaptation method and system are stored in the memory of devices such as terminals and cloud servers and are configured to be executed by their processors. The relevant devices and their memories, processors, etc. all use existing technologies, which will not be described in detail here. The following will take the best large-model-based automated IoT protocol adaptation system example composed of all the technical features of the above basic solution and each improved solution as an example for explanation, and other examples will not be described one by one.
[0048] like Figure 1-Figure 4 As shown, the core of the large model-based automated IoT protocol adaptation system of this embodiment 1 includes key components such as communication protocol knowledge base, large model processing, prompt word design, protocol parsing framework generation and protocol parsing. The following is the workflow of the core components.
[0049] 1. Build a communication protocol knowledge base:
[0050] Large language models have limited context windows and cannot send all the content in the knowledge base to the large model. By segmenting the entire long text, and then recalling the most relevant paragraph content based on the user's question, the segmented TopK recall mode is adopted. When semantically matching user questions with text segments, the appropriate segment size helps to find the most relevant text content in the knowledge base and reduce information noise.
[0051] TopK: used to filter text segments with the highest similarity to user questions. The system will also dynamically adjust the number of segments based on the selected model context window size. The system default value is 3. The higher the value, the more text segments are expected to be recalled.
[0052] (1) Protocol document collection and preprocessing: Collect all IoT communication protocol documents that need to be adapted. The documents contain key information such as the protocol data format, field meaning, and interaction rules. Preprocess and structure the collected protocol documents, including data cleaning, removing meaningless characters or blank lines in the text content, removing irrelevant information, unifying the format, and performing word segmentation operations to extract key information such as protocol name, protocol version, field name, field content length, field data type, interaction rules, and field conversion method.
[0053] (2) Building a vector library
[0054] ① Text vectorization: Use natural language processing (NLP) technology to convert the preprocessed protocol document text into vector form, and use the Word2Vec model to map each word or phrase in the document into a vector of fixed dimension.
[0055] ② Document vector generation: For the entire protocol document, a vector representation of the entire document is generated by averaging, weighting, or more complex aggregation methods (such as Doc2Vec).
[0056] ③ Protocol feature extraction and index feature extraction: Extract key features of the protocol from the vector library, such as key fields, data types, message structures, etc. These features will be used for subsequent large model learning and analysis.
[0057] ④ Establish index: Design index structure to support fast retrieval. Index can be based on data structures such as hash table, B-tree, inverted index, etc., and organized according to the characteristics of document vector.
[0058] ⑤ Vector index storage: Store document vectors and their corresponding document identifiers (such as ID or name) in an index structure. The index should use an efficient ANN vector search algorithm to quickly find the document vector that is most similar to the query vector.
[0059] ⑥ Deletion and modification: If the protocol document in the knowledge base is deleted or modified, the corresponding index also needs to be updated to maintain the consistency of the index and the knowledge base.
[0060] 2. Structured and hierarchical prompt word design: To ensure that the big model can efficiently and accurately extract key information from the communication protocol document and generate a protocol parsing framework that meets the requirements, a prompt word template with a clear hierarchical structure and logical relationship is constructed to guide the big model to deeply understand the complex content in the protocol document.
[0061] (1) Prompt word template structure:
[0062] ① Top-level template: defines the basic properties and overview of the protocol, including global information such as protocol name, version number, application scenario, etc. This information provides a macro framework and background knowledge for subsequent detailed analysis.
[0063] ②Middle-level template: The middle-level template divides the protocol into multiple core parts, such as message structure, field definition, and interaction process. Each part is designed as a modular structure, allowing flexible customization and expansion according to the complexity and diversity of the specific protocol content.
[0064] ③ Bottom-level templates: Bottom-level templates focus on the specific parameter data conversion logic of specific fields or message types. Through bottom-level templates, the big model can obtain detailed guidance on specific operations such as data format conversion, checksum calculation, data encryption / decryption, etc., thereby providing necessary data support and guarantee for the middle-level templates and top-level templates.
[0065] (2) Node structure template: In order to more finely control the processing of data nodes in the protocol, the present invention introduces a node structure template. The template clarifies the components of the node, such as node type, node identifier, data length, data type, next node address, etc., and defines the order and logical relationship between these elements. Through the node structure template, the large model can accurately identify and parse each data node in the protocol to ensure the correctness and coherence of the data flow.
[0066] (3) Interaction process template: The present invention designs an interaction process template for the device interaction process involved in the protocol. The template describes in detail the steps, sequence, conditions, and possible exception handling mechanisms of the device interaction, ensuring that the large model can fully consider the actual application scenarios and interaction logic of the protocol when generating the protocol parsing framework.
[0067] 3. Large model processing:
[0068] In the IoT protocol adaptation system, large model processing is one of the core components. The system integrates a variety of pre-trained large language models, and connects Tongyi Lingma, GPT4, DeepSeek, and Kimi to the system through API interfaces. The large prediction model interface can be flexibly switched through configuration items. The selected large model combines the communication protocol knowledge base and structured prompt word templates to automatically generate an accurate protocol parsing framework. The following is a detailed workflow and key functions of this module.
[0069] (1) Loading the knowledge base: The system integrates the preprocessed communication protocol knowledge base (including document vector library, index structure, etc.) into an efficient and queryable data structure, ensuring that the large model can quickly access and understand the massive protocol information stored in the knowledge base.
[0070] (2) Loading prompt word templates: The system parses the structured and hierarchical prompt word templates (including top-level templates, middle-level templates, bottom-level templates, node structure templates, and interaction process templates) into data structures that can be recognized within the system. These templates provide guidance for parsing protocols for the large model, while ensuring the consistency and accuracy of the generated protocol parsing framework.
[0071] (3) Generate protocol parsing framework:
[0072] ① Multi-round dialogue mechanism: Introducing a multi-round dialogue mechanism allows the big model to interact with the user or system multiple times, gradually clarifying and refining the parsing requirements, allowing the big model to more accurately understand the context and potential requirements of the protocol document.
[0073] ②Context memory module: A dedicated context memory module is configured for the large model to store and manage key information and historical decisions during the parsing process. When generating the protocol parsing framework, the large model can refer to previous parsing results and context information to make more coherent and accurate decisions.
[0074] ③ Adaptive template adjustment: In the process of generating the protocol parsing framework, the content and structure of the prompt word template are dynamically adjusted according to the real-time parsing feedback and context understanding of the large model.
[0075] ④ Generate a tree-shaped protocol parsing framework: The tree-shaped protocol parsing framework is represented in the form of a JSON dictionary. Each node has a path pointing to it, ensuring that each node can be accessed from the root node through a unique path.
[0076] 4. Protocol parsing framework:
[0077] (1) Parsing framework structure: The protocol parsing framework is stored in the form of a JSON dictionary. Each node contains a pointer to the next node, and each node can be accessed from the root node through a unique path.
[0078] (2) Node type classification: Framework nodes are divided into two types: direct connection nodes and branch nodes. Direct connection nodes are used to represent regular data fields in communication protocols, while branch nodes are used to represent branch functions or conditional logic in communication protocols. Depending on the input data, the parsing path can be flexibly selected to achieve comprehensive support for complex communication protocols.
[0079] (3) Node detailed information definition: Each node contains detailed information such as the data length, data type, conversion method, node description, node branch type, and access address of the next node occupied by the element in the data message to ensure the accuracy and completeness of the protocol parsing.
[0080] (4) Generate a protocol parsing plug-in: The protocol parsing framework is provided to the IoT platform in the form of a plug-in as the basis for the platform to parse the communication protocol of IoT devices. This plug-in design enables the platform to easily expand and update the protocol parsing capabilities to adapt to the ever-changing communication protocols and device types.
[0081] (5) Protocol parsing plug-in optimization and adjustment: The system loads the protocol parsing framework in JSON format, and displays the tree structure in a visual page through the front-end page. Each node displays field details in the form of attributes. The system can adjust the node attribute value and modify the node link path through page editing, and dynamically adjust the content of the protocol parsing framework.
[0082] (6) Protocol parsing plug-in storage: The protocol parsing plug-in is represented by the protocol name and stored in the database. When there is a need for protocol parsing, the protocol parsing plug-in content is queried from the database, loaded into the redis cache, and provided for system calls.
[0083] 5. Protocol analysis:
[0084] (1) Data channel binding: The system supports multiple data channels to access IoT data, such as conventional TCP, MQTT, and HTTP. Through configuration items, data channels are bound to protocol parsing plug-ins. For example: TCP listening port binding to a specified plug-in, MQTT topic message binding to a specified plug-in, and HTTP specific URL request binding to a specified plug-in.
[0085] (2) Data processing: After receiving the data sent by the device, the IoT platform converts the data into a ByteBuf object for subsequent parsing. The platform loads the protocol parsing framework in the form of a plug-in, and traverses and parses the data in ByteBuf according to the node definition in the framework. During the parsing process, the system uses the reading method provided by ByteBuf to extract byte sequences of corresponding length from the input data based on the description of the data length and data type of each node. Then, according to the data format and conversion rules defined by the node, these byte sequences are subjected to necessary format conversion and data processing. The processed results are stored in KV format, with the node identifier defined by the node as K and the converted data as V, and stored in Map<String,Object> property.
[0086] Through this tree-structured protocol parsing method, the IoT platform can cope with a variety of complex and changing communication protocols and device types. At the same time, since the protocol parsing framework is provided in the form of a plug-in, the platform can also flexibly expand and update the parsing capabilities according to actual needs to adapt to new protocols and new devices that may appear in the future.
[0087] 6. Expansion and optimization:
[0088] In order to further enhance the flexibility and adaptability of the IoT platform, the protocol adaptation system of the present invention fully considers the scalability and optimization mechanism in its design.
[0089] (1) Visual editing interface: The IoT platform provides an intuitive visual editing interface that allows users to directly modify the tree structure of the protocol parsing framework by dragging, connecting, and other operations. The links between nodes are represented by dynamic arrows, which clearly show the hierarchical relationship and data flow. Users can easily adjust the node order, modify node properties (such as data type, length, description, etc.), and instantly preview the modified parsing effect.
[0090] (2) Real-time verification and feedback: During the editing process, the system verifies the changes made by the user in real time to ensure that all changes comply with the standards and requirements of the communication protocol.
[0091] (3) Plug-in management and rapid deployment: The protocol parsing framework is encapsulated and managed in the form of plug-ins, and each plug-in corresponds to a specific communication protocol. This architecture makes it very simple and quick to add or update protocol parsing capabilities. Users only need to upload a new protocol parsing plug-in to the platform, and the platform can automatically identify and load the plug-in without modifying the underlying code or restarting the service.
[0092] It should be pointed out that multiple examples of the above-mentioned embodiments use a set of illustrations of combined technical features, which will not be described one by one here.
[0093] The above descriptions are detailed descriptions and illustrations of the preferred embodiments of the present invention, but these descriptions are not intended to limit the scope of protection required by the present invention. All equivalent changes or modified modifications accomplished under the technical teachings suggested by the present invention should fall within the scope of patent protection covered by the present invention.
Claims
1. A large model-based automated Internet of Things protocol adaptation method, characterized in that: Includes the following: Step S1: Set up a knowledge base. The processing flow is as follows: Step S1.1, constructing a communication protocol knowledge base; Step S1.2, constructing a prompt word template with a clear hierarchical structure and logical relationship; Step S2, select a large model, load the knowledge base to integrate the preprocessed communication protocol into a queryable data structure, load the prompt word template to parse the prompt word template into a recognizable data structure, and generate a protocol parsing framework; Among them, the specific process of generating a protocol parsing framework is as follows: Step 21: Introduce a multi-round dialogue mechanism to conduct multiple interactions, gradually clarifying and refining the analysis requirements; Step 22: configure a context memory module to store and manage parsing results and context information during the parsing process; Step 23: dynamically adjust the content and structure of the prompt word template according to the real-time parsing feedback and context understanding of the large model; Step 24, generate a protocol parsing framework, and represent the tree-shaped protocol parsing framework in the form of a json dictionary, each of which has a path pointing; wherein the protocol parsing framework is stored in the form of a json dictionary, and each of which contains a pointer to the next node; the framework nodes are divided into two types: direct nodes and branch nodes, the direct nodes are used to represent regular data fields in the communication protocol, and the branch nodes are used to represent branch functions or conditional logic in the communication protocol, and are configured to select and adapt the parsing path according to different input data; each node contains the data length, data type, conversion method, node description, node branch type, and access address of the next node occupied by the element in the data message; Step S3: Generate a protocol parsing plug-in based on the protocol parsing framework, and configure it in the form of a plug-in on the Internet of Things platform as a basis for the platform to parse the communication protocol of the Internet of Things device; the protocol parsing plug-in is represented by the protocol name and stored in the database; Step S4, complete communication protocol analysis: when there is a need for communication protocol analysis, query the protocol analysis plug-in content from the database, load it into the redis cache, perform call analysis, and output the analysis result.
2. According to claim 1, a large model-based automated Internet of Things protocol adaptation method is characterized by: The specific processing flow of step S1.1 is as follows: Step 11, communication protocol document collection and preprocessing: Collect all IoT communication protocol documents that need to be adapted; perform preprocessing and structural operations on the collected communication protocol documents, including data cleaning, removing meaningless characters or blank lines in the text content, removing irrelevant information, unifying the format and word segmentation operations, and extracting key information, including protocol name, protocol version, field name, field content length, field data type, interaction rules and field conversion method; Step 12, build a vector library: convert the preprocessed communication protocol document text into vector form, use the Word2Vec model to map each word or phrase in the communication protocol document into a vector of fixed dimension; generate a communication protocol document vector representation through an aggregation method; extract protocol features from the communication protocol document vector library; organize and design an index structure based on protocol features based on hash tables, B-trees and inverted index data structures; store the communication protocol document vectors and their corresponding document identifiers in the index structure; set index update rules, and delete or modify the corresponding index if a communication protocol document is deleted or modified.
3. The large model-based automated Internet of Things protocol adaptation method according to claim 1, characterized in that: The specific processing flow of step S1.2 is as follows: Step 21, document prompt word template, as follows: top-level template: defines the basic properties and overview of the communication protocol, including the protocol name, version number and global information of the application scenario; middle-level template: divides the communication protocol into the core parts of message structure, field definition and interaction process, and designs each core part as a modular structure; bottom-level template: sets the specific parameter data conversion logic of a specific field or message type to obtain detailed guidance on the specific operations of data format conversion, checksum calculation and data encryption / decryption; Step 22, node structure template: determine the constituent elements of the node, including node type, node identifier, data length, data type and next node address, and define the order and logical relationship between these elements; Step 23: Interaction process template: describes the steps, sequence, conditions and possible exception handling mechanisms for the interactions between devices involved in the communication protocol.
4. The large model-based automated Internet of Things protocol adaptation method according to claim 1, characterized in that: In step S2, multiple pre-trained large models are configured, Tongyi Lingma, GPT4, DeepSeek, and Kimi are accessed through the API interface, and the large model interface is switched through the configuration item; In step S3, the protocol parsing framework in the form of a json dictionary is loaded, and the tree structure is displayed in the form of a visual page through the front-end page, and each node displays the field detailed information in the form of attributes; Adjust node attribute values and modify node link paths through page editing, and dynamically adjust the protocol parsing framework content.
5. The large model-based automated Internet of Things protocol adaptation method according to claim 1, characterized in that: The specific processing flow of step S4 is as follows: Step S4.1, set up support for multiple data channels to access IoT data, and bind the data channel to the protocol parsing plug-in through configuration items; Step S4.2, receiving the data sent by the IoT device, and converting the data into a ByteBuf object; Step S4.3, load the protocol parsing framework, and traverse and parse the data in ByteBuf according to the node definition in the framework; Step S4.4, according to the description of the data length and data type of each node, use the reading method provided by ByteBuf to extract the byte sequence of corresponding length from the input data; Step S4.5: Perform necessary format conversion and data processing on the byte sequence according to the data format and conversion rules defined by the node, and generate a communication protocol analysis result; The parsing results are stored in KV format, with the node identifier of the node definition as K and the converted data as V, which are stored in Map<String,Object> property.
6. An automated Internet of Things protocol adaptation system based on a large model, characterized in that: Includes the following: Setting module: used to set the knowledge base. The processing flow is as follows: Step S1.1, constructing a communication protocol knowledge base; Step S1.2, constructing a prompt word template with a clear hierarchical structure and logical relationship; Generation module: used to select a large model, load the knowledge base to integrate the preprocessed communication protocol into a queryable data structure, load the prompt word template to parse the prompt word template into a recognizable data structure, and generate a protocol parsing framework; Among them, the specific process of generating a protocol parsing framework is as follows: Step 21: Introduce a multi-round dialogue mechanism to conduct multiple interactions, gradually clarifying and refining the analysis requirements; Step 22: configure a context memory module to store and manage parsing results and context information during the parsing process; Step 23: dynamically adjust the content and structure of the prompt word template according to the real-time parsing feedback and context understanding of the large model; Step 24, generate a protocol parsing framework, and represent the tree-shaped protocol parsing framework in the form of a json dictionary, each of which has a path pointing; wherein the protocol parsing framework is stored in the form of a json dictionary, and each of which contains a pointer to the next node; the framework nodes are divided into two types: direct nodes and branch nodes, the direct nodes are used to represent regular data fields in the communication protocol, and the branch nodes are used to represent branch functions or conditional logic in the communication protocol, and are configured to select and adapt the parsing path according to different input data; each node contains the data length, data type, conversion method, node description, node branch type, and access address of the next node occupied by the element in the data message; Plug-in module: used to generate a protocol parsing plug-in based on the protocol parsing framework, which is configured in the form of a plug-in on the IoT platform as the basis for the platform to parse the communication protocol of the IoT device; the protocol parsing plug-in is represented by the protocol name and stored in the database; Parsing module: used to complete communication protocol parsing: when there is a need for communication protocol parsing, query the protocol parsing plug-in content from the database, load it into the redis cache, call the parsing, and output the parsing results.
7. The large model-based automated Internet of Things protocol adaptation system according to claim 1, characterized in that: The specific processing flow of step S1.1 is as follows: Step 11, communication protocol document collection and preprocessing: Collect all IoT communication protocol documents that need to be adapted; perform preprocessing and structural operations on the collected communication protocol documents, including data cleaning, removing meaningless characters or blank lines in the text content, removing irrelevant information, unifying the format and word segmentation operations, and extracting key information, including protocol name, protocol version, field name, field content length, field data type, interaction rules and field conversion method; Step 12, build a vector library: convert the preprocessed communication protocol document text into vector form, use the Word2Vec model to map each word or phrase in the communication protocol document into a vector of fixed dimension; generate a communication protocol document vector representation through an aggregation method; extract protocol features from the communication protocol document vector library; organize and design an index structure based on protocol features based on hash tables, B-trees and inverted index data structures; store the communication protocol document vectors and their corresponding document identifiers in the index structure; set index update rules, and delete or modify the corresponding index if a communication protocol document is deleted or modified.
8. The large model-based automated Internet of Things protocol adaptation system according to claim 1, characterized in that: The specific processing flow of step S1.2 is as follows: Step 21, document prompt word template, as follows: top-level template: defines the basic properties and overview of the communication protocol, including the protocol name, version number and global information of the application scenario; middle-level template: divides the communication protocol into the core parts of message structure, field definition and interaction process, and designs each core part as a modular structure; bottom-level template: sets the specific parameter data conversion logic of a specific field or message type to obtain detailed guidance on the specific operations of data format conversion, checksum calculation and data encryption / decryption; Step 22, node structure template: determine the constituent elements of the node, including node type, node identifier, data length, data type and next node address, and define the order and logical relationship between these elements; Step 23: Interaction process template: describes the steps, sequence, conditions and possible exception handling mechanisms for the interactions between devices involved in the communication protocol.
9. The large model-based automated Internet of Things protocol adaptation system according to claim 1, characterized in that: In step S2, multiple pre-trained large models are configured, Tongyi Lingma, GPT4, DeepSeek, and Kimi are accessed through the API interface, and the large model interface is switched through the configuration item; In the plug-in module, the protocol parsing framework in the form of a json dictionary is loaded, and the tree structure is displayed in the form of a visual page through the front-end page. Each node displays the field details in the form of attributes; Adjust node attribute values and modify node link paths through page editing, and dynamically adjust the protocol parsing framework content.
10. The large model-based automated Internet of Things protocol adaptation system according to claim 1, characterized in that: The specific processing flow of the analysis module is as follows: Step S4.1, set up support for multiple data channels to access IoT data, and bind the data channel to the protocol parsing plug-in through configuration items; Step S4.2, receiving the data sent by the IoT device, and converting the data into a ByteBuf object; Step S4.3, load the protocol parsing framework, and traverse and parse the data in ByteBuf according to the node definition in the framework; Step S4.4, according to the description of the data length and data type of each node, use the reading method provided by ByteBuf to extract the byte sequence of corresponding length from the input data; Step S4.5: Perform necessary format conversion and data processing on the byte sequence according to the data format and conversion rules defined by the node, and generate a communication protocol analysis result; The parsing results are stored in KV format, with the node identifier of the node definition as K and the converted data as V, which are stored in Map<String,Object> property.
Citation Information
Patent Citations
Sensor protocol adaptation method and device based on model hierarchical mapping
CN117614799A
Visual editing generation and dynamic analysis system for internet-of-things equipment model
CN118034673A
Method and device for automatically generating cross-platform application layer protocol parser
CN118283148A
System and method for processing resources and associated metadata in the metaverse using knowledge graphs
US12007963B1
Cited By
Method and system for generating forensic analysis plug-in based on large model
CN119645386A
A method and system for generating forensic analysis plug-in based on large model
CN119645386B
Internet of Things equipment message data analysis method, system and equipment based on large model, and medium
CN120017738A
Response information generation method and device, equipment, storage medium and product
CN120256171A
Multi-protocol Internet of Things sensing method and system based on remote management
CN120729917A