A method for power distribution internet of things protocol conversion

By constructing a protocol conversion knowledge base and utilizing the Trans-DeepSeek model, intelligent conversion of multiple protocols in the power distribution Internet of Things (IoT) was achieved, solving the problem of device interconnection and interoperability, reducing system integration complexity, and providing efficient and intelligent technical support for new power distribution systems.

CN122137900APending Publication Date: 2026-06-02WUHAN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHAN UNIV
Filing Date
2026-03-16
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

The coexistence of multiple protocols in the power distribution Internet of Things (IoT) poses challenges to device interconnection and interoperability. Traditional protocol conversion methods have long development cycles, high maintenance costs, and are difficult to adapt to the dynamic changes of numerous protocol types and rapid version updates, and the system response capability is insufficient.

Method used

A protocol conversion knowledge base is constructed, decoupling feature information is obtained through protocol parsing, and end-to-end intelligent protocol conversion is achieved using the Trans-DeepSeek model. The understanding and generation capabilities of a large language model are integrated to generate target message fields.

Benefits of technology

It achieves efficient and intelligent protocol conversion, reduces the development cost and maintenance workload of manually writing conversion rules, solves the interconnection and interoperability problem caused by protocol differences between different manufacturers' equipment, and provides efficient technical support for new power distribution systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122137900A_ABST
    Figure CN122137900A_ABST
Patent Text Reader

Abstract

This invention provides a method for protocol conversion in power distribution IoT. The method includes: constructing a protocol conversion knowledge base, the external knowledge base including protocol standard data, protocol conversion instance data, and device information data; acquiring the protocol message to be converted and parsing it to obtain decoupling feature information; based on the decoupling feature information, retrieving conversion rules and instance information associated with the current protocol conversion task from the protocol conversion knowledge base; converting the conversion rules and instance information to generate a first prompt message, and fusing the protocol message to be converted and the first prompt message to obtain a second prompt message; inputting the second prompt message into a pre-trained Trans-DeepSeek model to generate target message fields. This invention effectively solves the interoperability problem caused by protocol differences between devices from different manufacturers, reduces system integration complexity, and provides efficient and intelligent technical support for the coordinated operation of massive heterogeneous terminals in new power distribution systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of protocol conversion technology, and in particular to a method for protocol conversion in power distribution Internet of Things (IoT) applications. Background Technology

[0002] With the advancement of new power system construction, a large number of new grid-connected entities such as charging piles and energy storage devices are being connected to the distribution network, leading to an increasingly complex communication environment for the distribution Internet of Things (IoT). Currently, multiple communication protocols coexist in distribution sites, with traditional protocols such as Modbus and IEC 60870-5-101 / 104 coexisting with emerging standards such as IEC 61850. In addition, various vendor-specific proprietary protocols have created a heterogeneous environment with numerous protocols.

[0003] This coexistence of multiple protocols presents numerous technical challenges to power distribution network operation: equipment from different manufacturers is difficult to interconnect due to protocol differences, resulting in data silos; existing protocol conversions largely rely on manual parsing and fixed rule writing, leading to long development cycles, high maintenance costs, and difficulty in adapting to the dynamic changes of numerous protocol types and rapid version updates; massive terminal access leads to a surge in data processing pressure, and traditional conversion equipment has insufficient response capabilities; system integration requires the deployment of multiple conversion devices, significantly increasing construction costs and operation and maintenance difficulties.

[0004] Therefore, there is an urgent need for an intelligent, flexible, and efficient protocol conversion method that can automatically identify and adapt to various protocol messages, realize unified access and data interoperability of heterogeneous devices, and provide technical support for the coordinated operation of new power distribution systems. Summary of the Invention

[0005] The purpose of this invention is to provide a method for protocol conversion in power distribution Internet of Things (IoT), which effectively solves the problem of device interconnection and interoperability caused by the coexistence of multiple protocols in power distribution IoT, and provides efficient and intelligent technical support for the coordinated operation of massive heterogeneous terminals in new power distribution systems.

[0006] To achieve the above objectives, the present invention provides a method for protocol conversion in power distribution Internet of Things (IoT) systems, the method comprising: S11. Construct a protocol conversion knowledge base, wherein the external knowledge base includes protocol standard data, protocol conversion instance data, and device information data; S12. Obtain the protocol message to be forwarded and perform protocol parsing to obtain decoupling characteristic information; S13. Based on the decoupling feature information, retrieve the conversion rules and instance information associated with the current protocol conversion task from the protocol conversion knowledge base; S14. Convert the conversion rules and instance information to generate the first prompt information, and merge the protocol message to be converted and the first prompt information to obtain the second prompt information; S15. Input the second prompt information into the pre-trained Trans-DeepSeek model to generate the target message field.

[0007] Furthermore, a protocol conversion knowledge base is constructed, specifically including: S21. Obtain multi-source knowledge data related to protocol conversion, wherein the multi-source knowledge data includes protocol standard documents and actual protocol message data; S22. Preprocess the multi-source knowledge data, extract the protocol element entities, and semantically segment the multi-source knowledge data according to the protocol structure characteristics to obtain several knowledge text blocks. S23. Encode the knowledge text block into a semantic vector and establish an association index between the semantic vector and the knowledge text block and protocol element entities; S24. Store the semantic vectors and associated indexes into the vector database to construct the protocol conversion knowledge base.

[0008] Furthermore, protocol parsing is performed on the message to be converted, specifically including: S31. The structural features of the protocol message to be forwarded are obtained by performing structured segmentation using the field boundary recognition model; S32. Semantic annotation is performed on the segmented structural features using a large language model to obtain semantic features; S33. When there is an executable program corresponding to the protocol message to be forwarded, the program execution characteristics are extracted by analyzing the processing logic of the executable program on the message. S34. Integrate structural features, semantic features, and program execution features to generate decoupled feature information.

[0009] Furthermore, the conversion rules and instance information associated with the current protocol conversion task are retrieved from the protocol conversion knowledge base, specifically including: S41. Take the decoupling feature information of the current protocol conversion task as the original query, and use a pre-trained text encoding model to encode the original query into a query vector; S42. Perform a maximum inner product similarity search in the vector database of the protocol conversion knowledge base, and calculate the inner product similarity between the query vector and the vectors of each knowledge text block in the knowledge base. S43. Sort the text blocks from high to low according to the similarity score, recall the preset number of text blocks most relevant to the current query, and extract the conversion rules and instance information.

[0010] Furthermore, the conversion rules and instance information are transformed to generate the first prompt message, specifically including: S51. Use the retrieved conversion rules and instance information as a candidate document set; S52. Obtain the preference signal of the large language model for the candidate document set, and fine-tune the retrieval machine according to the preference signal; S53. During the fine-tuning process, a hard negative sample sampling strategy is used to construct a negative sample set, and the relevance scoring ability of the retrieval machine is optimized based on the cross-entropy loss function. S54. Based on the preset rules, the candidate document set is reordered using the fine-tuned retrieval tool, and the conversion rules and instance information are reselected. The documents are then formatted and assembled according to the preset prompt template to generate the first prompt information.

[0011] Furthermore, the pending protocol message and the first notification information are integrated, specifically including: S61. Perform structured parsing on the protocol message to be forwarded, identify key entity information, and obtain the entity set; S62. Perform post-retrieval processing on the first prompt information, wherein the post-retrieval processing includes information compression and document rearrangement; S63. Construct a masked entity sequence based on the entity set, wherein the masked entity sequence contains some key entities that are replaced by masked markers; S64. The processed first prompt information is merged with the protocol message to be forwarded containing the mask entity sequence, and the second prompt information is generated according to the preset prompt template.

[0012] Furthermore, the Trans-DeepSeek model includes: A multi-head self-attention module is used to determine the context-aware vector sequence of each text word in the target text; A shared expert unit is used to extract shared features from each vector in a context-aware vector sequence; The routing expert unit is used to extract routing features from each vector in the context-aware vector sequence.

[0013] Furthermore, the second cue information is input into the pre-trained Trans-DeepSeek model, specifically including: S71. Perform word segmentation and embedding representation on the second prompt information to obtain the input vector sequence; S72. The input vector sequence is encoded through a multi-head self-attention module, a shared expert unit, and a routing expert unit to obtain an enhanced representation; S73. Through autoregressive generation, with enhanced representation as a condition, the fields of the target message are generated one by one according to a preset order rule. During the generation process, the previously generated preceding fields are used as context input. S74. Introduce a protocol constraint decoding mechanism during the generation process to constrain the value range, length, or format of the generated fields according to the format specifications of the target protocol. S75. When the prediction confidence of the generated field is lower than the preset threshold, a dynamic retrieval mechanism is triggered. The current generation context and the characteristics of the message to be transferred are used as queries to retrieve relevant information from the protocol conversion knowledge base and integrate it into subsequent generation. S76. Concatenate the results generated field by field to obtain the target message field sequence.

[0014] Furthermore, the input vector sequence is processed through a multi-head self-attention module, specifically including: S81. The input vector sequence is compressed to low rank using a multi-head latent attention mechanism to obtain the compressed key-value latent vector and query latent vector. S82. During the inference process, only the key-value latent vector is cached, and the key and query used for attention calculation are reconstructed by the upprojection matrix; S83. Combining rotational position encoding, a rotation matrix is ​​generated based on the word position to perform rotational transformation on the reconstructed query and key, so that relative position information is incorporated into the attention calculation. S84. Calculate the attention weights based on the query and key after rotation transformation, and perform a weighted summation of the values ​​to obtain the context-aware vector sequence.

[0015] Furthermore, the input vector sequence is processed through a shared expert unit and a routing expert unit, specifically including: S91. Use multiple shared expert components to perform feedforward neural network calculations on each vector in the context-aware vector sequence to extract shared features; S92. Calculate the matching score of each vector with multiple routing expert components through a gating network. Select a preset number of expert components from the multiple routing expert components for each vector based on the score and activate them. Then, weight and fuse the outputs of the activated expert components according to their corresponding score weights to obtain the routing features. S93. The shared features and routing features are fused to obtain the enhanced representation.

[0016] Compared with the prior art, the beneficial effects of the present invention are: This invention provides a method for protocol conversion in power distribution IoT. It obtains decoupling feature information through protocol parsing, acquiring the structural features and semantic connotations of the protocol message to be converted. This overcomes the limitations of traditional methods that can only perform surface-level format conversion, laying the foundation for accurate protocol conversion. Based on the decoupling feature information, it retrieves associated conversion rules and instances from a knowledge base, combining a static knowledge base with dynamic conversion requirements. This allows the system to provide effective conversion references even when facing proprietary or variant protocols by retrieving similar instances. The retrieved information is converted into prompts and merged with the original message before being input into the Trans-DeepSeek model to generate target message fields. This fully leverages the understanding and generation capabilities of large language models, achieving end-to-end intelligent conversion and significantly reducing the development cost and maintenance workload of manually writing conversion rules. The Trans-DeepSeek model ensures conversion accuracy while meeting the real-time response requirements in power distribution scenarios. This invention effectively solves the interoperability problem caused by protocol differences between devices from different manufacturers, reduces system integration complexity, and provides efficient and intelligent technical support for the coordinated operation of massive heterogeneous terminals in new power distribution systems. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort. Figure 1 This is a schematic flowchart of a method for protocol conversion in power distribution Internet of Things (IoT) according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the process for constructing a protocol conversion knowledge base provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the protocol parsing process for the protocol message to be forwarded, provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of the protocol conversion knowledge base retrieval process provided in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the process of converting conversion rules and instance information to generate the first prompt information, provided in an embodiment of the present invention. Figure 6 This is a schematic diagram of the process of integrating the protocol message to be forwarded and the first prompt information provided in an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the process of inputting the second prompt information into a pre-trained Trans-DeepSeek model, as provided in an embodiment of the present invention. Figure 8This is a schematic diagram illustrating the process of processing an input vector sequence through a multi-head self-attention module, as provided in an embodiment of the present invention. Figure 9 This is a schematic diagram illustrating the process of processing an input vector sequence through a shared expert unit and a routing expert unit, as provided in an embodiment of the present invention. Detailed Implementation

[0018] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0019] Reference Figure 1 This embodiment provides a method for protocol conversion in power distribution Internet of Things (IoT) systems, the method comprising: S11. Construct a protocol conversion knowledge base, wherein the external knowledge base includes protocol standard data, protocol conversion instance data, and device information data.

[0020] S12. Obtain the protocol message to be forwarded and perform protocol parsing to obtain decoupling characteristic information.

[0021] S13. Based on the decoupling feature information, retrieve the conversion rules and instance information associated with the current protocol conversion task from the protocol conversion knowledge base.

[0022] S14. The conversion rules and instance information are converted to generate the first prompt information. The protocol message to be converted and the first prompt information are then merged to obtain the second prompt information.

[0023] S15. Input the second prompt information into the pre-trained Trans-DeepSeek model to generate the target message field.

[0024] In this embodiment, a protocol conversion knowledge base is first constructed, containing protocol standard data, protocol conversion instance data, and device information data. This provides multi-source knowledge support for subsequent intelligent conversion, enabling the system to reason based on real-world cases and standardized specifications rather than relying solely on static rules. Next, the protocol message to be converted is acquired and parsed to obtain decoupling feature information. By deeply mining the message's field structure, semantic features, and contextual relationships, the original binary or text-based message is transformed into a machine-understandable vector representation. Then, based on the decoupling feature information, conversion rules and instance information associated with the current protocol conversion task are retrieved from the protocol conversion knowledge base. This dynamic input is matched with static knowledge, providing effective references even for proprietary or variant protocols through similar instance retrieval, significantly improving the system's generalization ability and adaptability.

[0025] Subsequently, the conversion rules and instance information are transformed to generate the first prompt information, and then fused with the protocol message to be converted to obtain the second prompt information. Post-processing, such as information compression and document rearrangement, removes redundant content. Simultaneously, a masked entity prediction mechanism guides the model to focus on key fields, ensuring that the information input to the generator is both concise and complete. Finally, the second prompt information is input into a pre-trained Trans-DeepSeek model to generate the target message fields. The Trans-DeepSeek model integrates a multi-head self-attention mechanism and a hybrid expert structure, which can efficiently capture the dependencies between fields and dynamically allocate computing resources, significantly reducing the development cost of manually writing conversion rules. This effectively solves the problem of device interconnection and interoperability caused by the coexistence of multiple protocols in the distribution IoT, providing efficient and intelligent technical support for the coordinated operation of massive heterogeneous terminals in new distribution systems.

[0026] As a preferred embodiment, a protocol conversion knowledge base is constructed, specifically including: S21. Obtain multi-source knowledge data related to protocol conversion, including protocol standard documents and actual protocol message data.

[0027] S22. Preprocess the multi-source knowledge data, extract the protocol element entities, and semantically segment the multi-source knowledge data according to the protocol structure characteristics to obtain several knowledge text blocks.

[0028] S23. Encode the knowledge text block into a semantic vector and establish an association index between the semantic vector and the knowledge text block and protocol element entities.

[0029] S24. Store the semantic vectors and associated indexes into the vector database to construct the protocol conversion knowledge base.

[0030] In this embodiment, protocol knowledge exists in two forms: unstructured documents (such as standard PDFs) and structured data (such as message logs). By collecting data from multiple sources, the comprehensiveness of knowledge sources is ensured, providing a data foundation for subsequent processing. Protocol documents contain a large number of terms and logical relationships, such as the correspondence between function codes and message structures. If the entire document is directly vectorized, the key semantics of the long text will be diluted. Through semantic segmentation and entity extraction, knowledge is cut into semantically complete units, and key entities are extracted as anchors to provide a data foundation for subsequent accurate matching. In actual conversion tasks, users may query through field values ​​(structured) or natural language descriptions (unstructured). By establishing a vector-text-entity association index, a hybrid retrieval mode of vector semantic retrieval and structured entity query is realized. Vectors are stored in a dedicated database to decouple knowledge from the algorithm model. When the protocol standard is updated, only the knowledge base needs to be updated without retraining the model, ensuring the maintainability of the system.

[0031] Specifically, RAG relies on background knowledge related to user input, and the process of building a protocol conversion knowledge index is essentially the process of building a background knowledge vector database. The knowledge base constructed in this invention originates from relevant standards of the new grid-connected entity model, including protocol standard documents and actual protocol message data. First, these unstructured texts are cleaned. Then, a semantic-based sliding window method is used to segment the text into blocks, with a block size of 512 characters and an overlap of 50 characters to ensure contextual integrity. Finally, the text2vec-large-chinese model is used to encode each text block into a 768-dimensional vector, which is then stored in the ChromaDB vector database, thus completing the construction of the knowledge base for power protocol conversion in new distribution systems.

[0032] As a preferred embodiment, protocol parsing is performed on the protocol message to be converted, specifically including: S31. The structural features of the protocol message to be forwarded are obtained by using the field boundary recognition model to perform structured segmentation.

[0033] S32. Semantic features are obtained by semantically annotating the segmented structural features using a large language model.

[0034] S33. When there is an executable program corresponding to the protocol message to be forwarded, the program execution characteristics are extracted by analyzing the processing logic of the executable program on the message.

[0035] S34. Integrate structural features, semantic features, and program execution features to generate decoupled feature information.

[0036] In this embodiment, a field boundary recognition model is constructed using a Transformer-based sequence labeling model. The protocol byte stream is used as the input sequence, with each byte or term corresponding to an output label. The model is pre-trained on public protocol datasets and synthetic datasets to learn general patterns of field boundaries. Fine-tuning is then performed using a small amount of labeled target protocol data to complete the construction of the field boundary recognition model. The protocol message to be forwarded is input into the field boundary recognition model to obtain field location boundaries and preliminary classifications, such as length, address, and data fields, forming a set of structural features. The field sequence and its values ​​segmented by S31 are combined with contextual information from adjacent fields to construct a natural language description. A few-shot suggestion technique is used to provide several labeled examples of known protocol fields to the large language model, guiding the model to perform semantic inference on the current field. This yields the semantic label for each field and the overall message intent, forming a set of semantic features.

[0037] When the protocol message to be forwarded originates from a device with available firmware or binary programs, program execution features are extracted. First, the firmware is run in a simulated environment or on a real device, injecting the message to be parsed into the program as input, and tracing the program's processing path for that message. Second, it records which bytes are used for conditional judgments, memory copies, and arithmetic operations, extracting a data dependency graph and processing instruction sequences. Finally, an instruction embedding model is used to transform execution slices into execution semantic vectors, forming a set of program execution features. Structural features exist in sequence form, semantic features in text form, and execution features in vector form, all mapped to the same dimension through a unified embedding space. An attention fusion mechanism is employed to calculate the weights of the three types of features during the fusion process, dynamically determining the contribution of each feature based on the current context. Finally, decoupled feature information after fusion is generated, including field boundaries, field semantics, inter-field dependencies, and optional program behavior information.

[0038] As a preferred embodiment, conversion rules and instance information associated with the current protocol conversion task are retrieved from the protocol conversion knowledge base, specifically including: S41. Take the decoupled feature information of the current protocol conversion task as the original query, and use a pre-trained text encoding model to encode the original query into a query vector.

[0039] S42. Perform a maximum inner product similarity search in the vector database of the protocol conversion knowledge base, and calculate the inner product similarity between the query vector and the vectors of each knowledge text block in the knowledge base.

[0040] S43. Sort the text blocks from high to low according to the similarity score, recall the preset number of text blocks most relevant to the current query, and extract the conversion rules and instance information.

[0041] In this embodiment, when the model needs to generate a target protocol message, we use the current protocol message content or the generation task description as the original query. We encode the query into a vector using the text2vec-large-chinese model, and then perform a maximum inner product similarity search in the vector database to retrieve the top-3 text blocks most relevant to the query. Based on the selected text blocks, we read the corresponding original content from the knowledge base and parse out the transformation rules (such as preconditions and transformation actions) and instance information (such as the original message, target message, and transformation context) to form structured retrieval results for use by the subsequent generation module.

[0042] As a preferred embodiment, the conversion rules and instance information are converted to generate the first prompt information, specifically including: S51. Use the retrieved conversion rules and instance information as a candidate document set.

[0043] S52. Obtain the preference signal of the large language model for the candidate document set, and fine-tune the retrieval machine according to the preference signal.

[0044] S53. During the fine-tuning process, a hard negative sample sampling strategy is used to construct a negative sample set, and the relevance scoring capability of the retrieval machine is optimized based on the cross-entropy loss function.

[0045] S54. Based on the preset rules, the candidate document set is reordered using the fine-tuned retrieval tool, and the conversion rules and instance information are reselected. The documents are then formatted and assembled according to the preset prompt template to generate the first prompt information.

[0046] In this embodiment, to ensure the retrieval output better matches the user query, the embedding model is adjusted using feedback signals obtained from the LLM (Low-Level Model). A language model based on an encoder-decoder architecture provides supervision signals to the pre-trained retrieval engine. The retrieval engine uses "hard negative sample sampling" and cross-entropy loss methods to analyze documents favored by the language model, thereby fine-tuning the embedding model.

[0047] Specifically, in the process of converting search results into initial prompts, the conversion rules and instance information initially retrieved from the knowledge base are first integrated into a candidate document set. A large language model is then introduced to evaluate the quality of the candidate documents, obtaining their preference signals for document usefulness. This signal is used as a supervisory signal to fine-tune the retrieval tool. During fine-tuning, a hard negative sample sampling strategy is adopted, selecting documents that scored highly in the initial retrieval but did not actually contribute much to the large language model's generation as negative examples. The relevance scoring ability of the retrieval tool is optimized using contrastive learning, enabling it to not only identify semantic similarity but also distinguish the actual utility of documents for the generation task. After fine-tuning, the optimized retrieval tool is used to recalculate the relevance scores of the original candidate document set and sort them in descending order, selecting the rules and instance information that best match the current protocol conversion task. Finally, these selected contents are formatted and assembled according to a preset prompt template to generate the initial prompt, which is then used for subsequent integration with the protocol message to be converted.

[0048] As a preferred embodiment, the protocol message to be forwarded and the first prompt information are integrated, specifically including: S61. Perform structured parsing on the protocol message to be forwarded, identify key entity information, and obtain the entity set.

[0049] S62. Perform post-retrieval processing on the first prompt information. The post-retrieval processing includes information compression and document rearrangement. Information compression uses a trained information extractor to extract simplified context from the first prompt information based on the characteristics of the protocol message to be transferred. Document rearrangement prioritizes content that is highly relevant to the protocol message to be transferred and controls the total number of documents within a preset limit.

[0050] S63. Construct a masked entity sequence based on the entity set, wherein the masked entity sequence contains some key entities that are replaced by masked markers.

[0051] S64. The processed first prompt information is merged with the protocol message to be forwarded containing the mask entity sequence, and the second prompt information is generated according to the preset prompt template.

[0052] In this embodiment, the generation component in the RAG system converts the retrieved information into text, improving the accuracy and relevance of answers in question-and-answer sessions. The generation stage primarily involves post-retrieval processing and generator optimization to better adapt the generated results to the input data from the query and documents. Post-retrieval processing involves further processing, filtering, and optimizing the information after the retrieval tool retrieves relevant information from a large document database. This typically includes information compression and document reordering. During the context extraction stage, an information extractor is trained to generate an output sequence that represents a simplified version of the context within the input document, based on the given input text. The training objective is to make the output sequence as close as possible to the actual context. Information compression reduces noise, addresses context length limitations, and improves generation quality. Document reordering optimizes the set of documents retrieved by the retrieval tool, prioritizing highly relevant content and keeping the total number of documents within a certain range. This effectively alleviates the problem of expanding the context window during retrieval, significantly improving retrieval efficiency and response speed.

[0053] The optimized generator transforms retrieved information into text and outputs it. The goal of optimization is to effectively utilize the retrieved documents to generate fluent text, efficiently and accurately responding to user queries. Since protocol documents contain a large amount of structured data, entity recognition is first performed on this structured data. Then, masking is applied to the input of the generator's training data to train the generator's ability to predict the masked portion. In this way, the generator can be trained to understand the information in the structural semantic context of the text, revealing the masked entities and mapping them to relevant entities in the structured data. This allows the language model to effectively fill in the missing information and gain a deeper understanding of the entities' meanings.

[0054] Specifically, in the process of integrating the protocol message to be forwarded and the first prompt information, the protocol message to be forwarded is first subjected to structured parsing. Key entities are identified using a sequence labeling model, including protocol identifiers, function codes, address fields, data lengths, and payloads, forming a structured entity set. Subsequently, post-retrieval processing is performed on the first prompt information: on the one hand, a trained information extractor compresses the original retrieval results, removing redundant descriptions and retaining only the rule points and core instances most relevant to the conversion task; on the other hand, the compressed content is reordered, and a relevance score is calculated based on the characteristics of the current message to be forwarded. The top-ranked document fragments are then selected in descending order of score, keeping the total number of fragments within the model's processing capacity.

[0055] Based on this, a masked entity sequence is constructed from the identified entity set. Following a preset strategy, masked markers are applied to replace some key entities (such as function codes and data values), while other entities are retained as contextual clues, forming a message representation containing masked placeholders. Finally, the first prompt information, after post-retrieval processing, is fused and assembled with the protocol message to be forwarded containing the masked entity sequence according to a preset template, generating a second prompt information that simultaneously contains simplified knowledge, the original message structure, and the mask prediction task, serving as input for subsequent generation stages.

[0056] As a preferred embodiment, the Trans-DeepSeek model includes: A multi-head self-attention module is used to determine the context-aware vector sequence of each text word in the target text.

[0057] A shared expert unit is used to extract shared features from each vector in a context-aware vector sequence.

[0058] The routing expert unit is used to extract routing features from each vector in the context-aware vector sequence.

[0059] In this embodiment, complex inter-field dependencies exist within the protocol message. Multi-head self-attention effectively captures long-range dependencies between words at arbitrary distances by computing attention weights in parallel across different representation subspaces, generating vector representations that integrate global contextual information, laying the foundation for subsequent feature extraction. The protocol message contains numerous general patterns applicable to all input samples. Shared expert units are constantly activated, responsible for extracting these general basic features, ensuring the model possesses stable underlying representation capabilities. Different protocol types and vendor-specific protocols often have unique field definitions and data organization methods. The routing expert unit dynamically selects the most suitable expert for each input through a sparse activation mechanism, enabling the model to perform specialized feature extraction for specific protocol patterns, avoiding the limitation of a single expert's capacity in covering all protocol variants.

[0060] As a preferred embodiment, the second prompt information is input into the pre-trained Trans-DeepSeek model, specifically including: S71. The second prompt information is segmented and embedded to obtain the input vector sequence.

[0061] S72. The input vector sequence is encoded through a multi-head self-attention module, a shared expert unit, and a routing expert unit to obtain an enhanced representation.

[0062] S73. Through autoregressive generation, with enhanced representation as a condition, the fields of the target message are generated one by one according to a preset order rule. During the generation process, the previously generated preceding fields are used as context input.

[0063] S74. Introduce a protocol constraint decoding mechanism during the generation process to constrain the value range, length, or format of the generated fields according to the format specifications of the target protocol.

[0064] S75. When the prediction confidence of the generated field is lower than the preset threshold, a dynamic retrieval mechanism is triggered. The current generation context and the characteristics of the message to be transferred are used as queries to retrieve relevant information from the protocol conversion knowledge base and integrate it into subsequent generation.

[0065] S76. Concatenate the results generated field by field to obtain the target message field sequence.

[0066] In this embodiment, the second prompt information is first processed by protocol-adaptive word segmentation, retaining special symbols and continuous numerical values ​​as complete tokens. An embedding module then maps these tokens into a vector sequence that integrates field type and protocol type information. This sequence is subsequently input into a multi-head self-attention module, which captures global dependencies between fields through an attention mechanism, outputting a context-aware vector representation. Next, a shared expert unit performs full computation on all vectors to extract general protocol features, while a routing expert unit dynamically selects the best-matching expert for each vector using a gating network for sparse activation. These features are then fused to form a semantically rich enhanced representation.

[0067] During the generation phase, the model employs an autoregressive approach to generate fields one by one according to the target protocol specification, with each step using previously generated fields as contextual references. To ensure the generated results conform to the protocol specification, a protocol constraint decoding mechanism is introduced to perform real-time verification and correction of field value types, length ranges, and formats. When the model's prediction confidence for the current field falls below a preset threshold, a dynamic retrieval mechanism is triggered. Using the current generation context and original message features as queries, relevant rules or instance information are supplemented from the knowledge base and integrated into subsequent generation processes. Finally, all generated fields are concatenated according to the protocol format to output a complete sequence of target message fields.

[0068] As a preferred embodiment, the input vector sequence is processed through a multi-head self-attention module, specifically including: S81. The input vector sequence is compressed to low rank using a multi-head latent attention mechanism to obtain the compressed key-value latent vector and query latent vector.

[0069] S82. During inference, only the key-value latent vector is cached, and the key and query used for attention calculation are reconstructed by the upprojection matrix.

[0070] S83. Combining rotation position encoding, a rotation matrix is ​​generated based on the word position to perform rotation transformation on the reconstructed query and key, so that relative position information is incorporated into the attention calculation.

[0071] S84. Calculate the attention weights based on the query and key after rotation transformation, and perform a weighted summation of the values ​​to obtain the context-aware vector sequence.

[0072] In this embodiment, by fusing multi-head latent attention mechanism and rotational positional encoding, the problems of excessive key-value cache and low computational efficiency in long sequence inference scenarios are addressed, while ensuring that the model can accurately perceive the relative positional relationships of terms in the protocol text. The multi-head latent attention mechanism performs low-rank compression on the input vector sequence, mapping the original keys and values ​​to a low-dimensional latent space, resulting in compressed key-value latent vectors and query latent vectors, reducing the amount of cached data required during inference. When attention needs to be calculated, the compressed latent vectors are reconstructed into the actual keys and queries participating in the calculation using an up-projection matrix, thus achieving a balance between storage efficiency and computational accuracy. Combined with rotational positional encoding, a corresponding rotation matrix is ​​generated based on the position of each term in the sequence, and the reconstructed query and key are rotated. This ensures that the inner product of the query and key naturally contains the relative positional information between terms in the subsequent attention weight calculation, without the need for additional positional embedding. Finally, attention weights are calculated based on the rotated query and key, and the values ​​are weighted and summed to output a context-aware vector sequence that integrates global contextual information and relative positional relationships.

[0073] In a preferred embodiment, the input vector sequence is processed through a shared expert unit and a routing expert unit, specifically including: S91. Use multiple shared expert components to perform feedforward neural network calculations on each vector in the context-aware vector sequence to extract shared features.

[0074] S92. Calculate the matching score of each vector with multiple routing expert components through a gating network. Select a preset number of expert components from the multiple routing expert components for each vector based on the score and activate them. Then, weight and fuse the outputs of the activated expert components according to their corresponding score weights to obtain the routing features.

[0075] S93. The shared features and routing features are fused to obtain the enhanced representation.

[0076] In this embodiment, the shared expert unit consists of multiple constant-activation feedforward neural networks. It performs full computation on each context-aware vector output by the multi-head self-attention module, extracting common protocol features shared by all input samples, providing the model with stable and fundamental representation capabilities. The routing expert unit dynamically calculates the matching score between each input vector and multiple routing expert components through a gating network. Only a preset number of experts with the highest scores are selected for sparse activation, and the weighted fusion result of these experts' outputs is used as the routing feature. This allows the model to assign dedicated experts to handle different types of protocol modes. This design enables routing experts to focus on learning specialized features of specific protocol variants or field types, avoiding the problem that a single expert's limited capacity makes it difficult to cover all heterogeneous modes. Finally, the common features extracted by the shared experts are fused with the specialized features extracted by the routing experts to obtain an enhanced representation that includes both basic semantics and targeted expression.

[0077] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for protocol conversion in power distribution Internet of Things (IoT) systems, characterized in that, The method includes: S11. Construct a protocol conversion knowledge base, wherein the external knowledge base includes protocol standard data, protocol conversion instance data, and device information data; S12. Obtain the protocol message to be forwarded and perform protocol parsing to obtain decoupling characteristic information; S13. Based on the decoupling feature information, retrieve the conversion rules and instance information associated with the current protocol conversion task from the protocol conversion knowledge base; S14. Convert the conversion rules and instance information to generate the first prompt information, and merge the protocol message to be converted and the first prompt information to obtain the second prompt information; S15. Input the second prompt information into the pre-trained Trans-DeepSeek model to generate the target message field.

2. The method for protocol conversion in power distribution IoT according to claim 1, characterized in that, Constructing a protocol conversion knowledge base, specifically including: S21. Obtain multi-source knowledge data related to protocol conversion, wherein the multi-source knowledge data includes protocol standard documents and actual protocol message data; S22. Preprocess the multi-source knowledge data, extract the protocol element entities, and semantically segment the multi-source knowledge data according to the protocol structure characteristics to obtain several knowledge text blocks. S23. Encode the knowledge text block into a semantic vector and establish an association index between the semantic vector and the knowledge text block and protocol element entities; S24. Store the semantic vectors and associated indexes into the vector database to construct the protocol conversion knowledge base.

3. The method for protocol conversion in power distribution IoT according to claim 1, characterized in that, Protocol parsing of the message to be converted includes: S31. The structural features of the protocol message to be forwarded are obtained by performing structured segmentation using the field boundary recognition model; S32. Semantic annotation is performed on the segmented structural features using a large language model to obtain semantic features; S33. When there is an executable program corresponding to the protocol message to be forwarded, the program execution characteristics are extracted by analyzing the processing logic of the executable program on the message. S34. Integrate structural features, semantic features, and program execution features to generate decoupled feature information.

4. The method for protocol conversion in power distribution IoT according to claim 1, characterized in that, Retrieve conversion rules and instance information associated with the current protocol conversion task from the protocol conversion knowledge base, specifically including: S41. Take the decoupling feature information of the current protocol conversion task as the original query, and use a pre-trained text encoding model to encode the original query into a query vector; S42. Perform a maximum inner product similarity search in the vector database of the protocol conversion knowledge base, and calculate the inner product similarity between the query vector and the vectors of each knowledge text block in the knowledge base. S43. Sort the text blocks from high to low according to the similarity score, recall the preset number of text blocks most relevant to the current query, and extract the conversion rules and instance information.

5. The method for protocol conversion in power distribution IoT according to claim 1, characterized in that, The conversion rules and instance information are used to generate the first prompt message, which specifically includes: S51. Use the retrieved conversion rules and instance information as a candidate document set; S52. Obtain the preference signal of the large language model for the candidate document set, and fine-tune the retrieval machine according to the preference signal; S53. During the fine-tuning process, a hard negative sample sampling strategy is used to construct a negative sample set, and the relevance scoring ability of the retrieval machine is optimized based on the cross-entropy loss function. S54. Based on the preset rules, the candidate document set is reordered using the fine-tuned retrieval tool, and the conversion rules and instance information are reselected. The documents are then formatted and assembled according to the preset prompt template to generate the first prompt information.

6. The method for protocol conversion in power distribution Internet of Things according to claim 1, characterized in that, The message to be forwarded and the first notification information are integrated, specifically including: S61. Perform structured parsing on the protocol message to be forwarded, identify key entity information, and obtain the entity set; S62. Perform post-retrieval processing on the first prompt information, wherein the post-retrieval processing includes information compression and document rearrangement; S63. Construct a masked entity sequence based on the entity set, wherein the masked entity sequence contains some key entities that are replaced by masked markers; S64. The processed first prompt information is merged with the protocol message to be forwarded containing the mask entity sequence, and the second prompt information is generated according to the preset prompt template.

7. The method for protocol conversion in power distribution IoT according to claim 1, characterized in that, The Trans-DeepSeek model includes: A multi-head self-attention module is used to determine the context-aware vector sequence of each text word in the target text; A shared expert unit is used to extract shared features from each vector in a context-aware vector sequence; The routing expert unit is used to extract routing features from each vector in the context-aware vector sequence.

8. The method for protocol conversion in power distribution IoT according to claim 7, characterized in that, The second prompt information is input into the pre-trained Trans-DeepSeek model, specifically including: S71. Perform word segmentation and embedding representation on the second prompt information to obtain the input vector sequence; S72. The input vector sequence is encoded through a multi-head self-attention module, a shared expert unit, and a routing expert unit to obtain an enhanced representation; S73. Through autoregressive generation, with enhanced representation as a condition, the fields of the target message are generated one by one according to a preset order rule. During the generation process, the previously generated preceding fields are used as context input. S74. Introduce a protocol constraint decoding mechanism during the generation process to constrain the value range, length, or format of the generated fields according to the format specifications of the target protocol. S75. When the prediction confidence of the generated field is lower than the preset threshold, a dynamic retrieval mechanism is triggered. The current generation context and the characteristics of the message to be transferred are used as queries to retrieve relevant information from the protocol conversion knowledge base and integrate it into subsequent generation. S76. Concatenate the results generated field by field to obtain the target message field sequence.

9. The method for protocol conversion in power distribution Internet of Things according to claim 8, characterized in that, The input vector sequence is processed through a multi-head self-attention module, specifically including: S81. The input vector sequence is compressed to low rank using a multi-head latent attention mechanism to obtain the compressed key-value latent vector and query latent vector. S82. During the inference process, only the key-value latent vector is cached, and the key and query used for attention calculation are reconstructed by the upprojection matrix; S83. Combining rotational position encoding, a rotation matrix is ​​generated based on the word position to perform rotational transformation on the reconstructed query and key, so that relative position information is incorporated into the attention calculation. S84. Calculate the attention weights based on the query and key after rotation transformation, and perform a weighted summation of the values ​​to obtain the context-aware vector sequence.

10. The method for protocol conversion in power distribution Internet of Things according to claim 9, characterized in that, The input vector sequence is processed through a shared expert unit and a routing expert unit, specifically including: S91. Use multiple shared expert components to perform feedforward neural network calculations on each vector in the context-aware vector sequence to extract shared features; S92. Calculate the matching score of each vector with multiple routing expert components through a gating network. Select a preset number of expert components from the multiple routing expert components for each vector based on the score and activate them. Then, weight and fuse the outputs of the activated expert components according to their corresponding score weights to obtain the routing features. S93. The shared features and routing features are fused to obtain the enhanced representation.