Network intention recognition and translation method and device based on large language model and medium

By employing topic modeling and retrieval-enhanced generation techniques, combined with large language model reasoning, the problem of accurately understanding user intent in intent-driven network architectures has been solved. This enables precise translation from natural language to network configuration commands, improving operational efficiency and intelligence.

CN121706773APending Publication Date: 2026-03-20BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511541298.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively handle diverse natural language input from users in intent-driven network architectures, resulting in inefficient network configuration, high technical barriers, and susceptibility to errors. They also lack natural language interaction capabilities and have shortcomings in semantic understanding, domain adaptation, and result verification.

Method used

By combining topic modeling, retrieval enhancement generation, and large language model inference, a network intent recognition translation method is constructed. The method utilizes synonym expansion and domain terminology mapping for topic enhancement, and combines hybrid retrieval indexes and structured verification to achieve accurate translation from natural language to network configuration commands.

Benefits of technology

It achieves accurate end-to-end translation from natural language to network configuration commands, improving operation and maintenance efficiency, lowering the technical threshold, adapting to the needs of different network environments, and possessing good scalability and intelligence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121706773A_ABST
    Figure CN121706773A_ABST
Patent Text Reader

Abstract

The invention provides a network intention recognition and translation method and device based on a large language model and a medium, user network intention theme recognition is assisted by introducing theme modeling, related configuration documents are dynamically acquired from a professional network knowledge base in combination with an RAG mechanism to serve as context reference, structured network configuration suggestions are generated by using the large language model, and the user network intention recognition and translation efficiency is improved. And the intellectualization and automation level of network intention processing is improved. The end-to-end processing normal form remarkably improves the intelligent level of the network planning process, so that a user of a non-professional network engineer can also obtain a professional network configuration scheme through a natural language interaction mode. The method is suitable for novel network architectures such as a software defined network and cloud network convergence, and provides key technical support for intelligent evolution of a next-generation network management system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of large language model reasoning technology, and in particular to a method, device and medium for network intent recognition and translation based on a large language model. Background Technology

[0002] In scenarios such as intent-driven network architecture and intelligent network operation and maintenance platforms, translating diverse user natural language into structured network configuration commands presents challenges. Directly applying general-purpose large language models to these scenarios can lead to illusions or formatting errors due to a lack of domain-specific knowledge. Current network configuration technologies primarily rely on manual command-line input or graphical interfaces, resulting in inefficiency, high technical barriers, and susceptibility to errors. While traditional automation tools can simplify some processes through scripts or templates, they lack natural language interaction capabilities and struggle to adapt to diverse user expressions. In recent years, large language models have demonstrated significant potential in natural language understanding and generation, offering new possibilities for the intelligent translation of network intents. However, existing technologies still have significant limitations, necessitating more optimized solutions. Summary of the Invention

[0003] In view of this, the purpose of this application is to propose a network intent recognition translation method, device and medium based on a large language model. By combining topic modeling, retrieval enhancement generation and structured verification, it achieves accurate translation from natural language to high-confidence network configuration commands.

[0004] To achieve the above objectives, this application provides a network intent recognition and translation method based on a large language model, comprising: Determine the initial natural language input by the user, and perform topic enhancement on the initial natural language through synonym expansion and domain term mapping to obtain the current topic data; A hybrid retrieval index is constructed based on the current topic data and the preset network configuration knowledge base, and contextual retrieval is performed in the network configuration knowledge base based on the hybrid retrieval index to obtain the retrieved documents; Based on the current topic data and the preset example set, relevant configuration examples are determined, and the recalled document is concatenated with the relevant configuration examples to form a prompt word; Based on the prompt words, the large language model is invoked to determine the initial network configuration policy text output by the large language model. The initial network configuration policy text is then subjected to structured policy verification to obtain a network policy that passes the structured policy verification. The network policy is then formatted and standardized to obtain a network configuration command that conforms to the device configuration specification.

[0005] Optionally, the step of performing topic enhancement on the initial natural language through synonym expansion and domain term mapping to obtain current topic data includes: The extended text is obtained by expanding synonyms based on the sequence of the initial natural language. The probability distribution of the extended text belonging to each topic in the preset topic space is calculated by the domain terminology mapping, and at least one topic with the highest probability is identified as a key topic. The weight of each key topic is determined to obtain the topic weight vector. Extract the most representative keywords from the key topics, and concatenate the keywords with the initial natural language to obtain the query text; The current topic data is obtained by integrating the key topic, the query text, and the topic weight vector.

[0006] Optionally, the step of constructing a hybrid retrieval index based on the current topic data and a preset network configuration knowledge base includes: Calculate the cosine similarity between the query text in the current topic data and each document vector in the preset network configuration knowledge base; Based on the topic weight vector in the current topic data and the topic similarity between each document vector in the preset network configuration knowledge base; The weighted score of the cosine similarity and the topic similarity is calculated based on a preset balance factor to obtain the hybrid retrieval index.

[0007] Optionally, the step of performing contextual recall in the network configuration knowledge base based on the hybrid retrieval index to obtain the recalled document includes: The hybrid retrieval index is sorted sequentially according to the weighted score to obtain the index sequence; The retrieved documents are obtained by sorting and searching according to the index sequence and the preset maximum recall.

[0008] Optionally, calculating the cosine similarity between the query text in the current topic data and each document vector in the preset network configuration knowledge base includes: Generate a query text embedding vector corresponding to the query text and a document embedding vector corresponding to each document vector; The cosine similarity is calculated by performing a cosine similarity calculation on the query text embedding vector and the document embedding vector.

[0009] Optionally, the step of determining the topic similarity between the topic weight vector in the current topic data and each document vector in the preset network configuration knowledge base includes: Determine the document topic vector corresponding to each document vector; The topic similarity is determined by multiplying the topic weight vector and the document topic vector.

[0010] Optionally, determining the relevant configuration examples based on the current topic data and a preset example set includes: Calculate the semantic similarity between the query text in the current topic data and each configuration example in the preset example set; The relevant configuration examples are obtained by selecting examples based on the semantic similarity and the preset selection number.

[0011] Optionally, the step of performing structured policy validation on the initial network configuration policy text to obtain a network policy that passes the structured policy validation includes: Calculate the confidence score of the initial network configuration policy text, and assign an evaluation index to each configuration block of the initial network configuration policy text according to the confidence score and the preset definition tag, to obtain a tag sequence; The tag sequence is subjected to execution parameter type checks, numerical range verification, and policy dependency review based on a preset network policy rule base. The initial network configuration policy text corresponding to the label sequence obtained by performing parameter type checks, numerical range verification, and policy dependency review is determined as the network policy.

[0012] Based on the same inventive concept, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described above when executing the computer program.

[0013] Based on the same inventive concept, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing a computer to perform the method described above.

[0014] As described above, the network intent recognition and translation method, device, and medium based on a large language model provided in this application construct a complete intent recognition and configuration generation chain by organically combining topic modeling, retrieval enhancement generation, and large language model inference. Topic modeling technology performs preliminary classification of the initial natural language input by the user, providing precise scope limitation for subsequent retrieval; the retrieval enhancement mechanism extracts relevant configuration templates from a structured knowledge base to obtain recall documents, ensuring that the generated content conforms to network domain specifications; and the conditional random field is used to perform structured verification of the recall documents, significantly improving the credibility of the generated results. This not only solves the shortcomings in semantic understanding, domain adaptation, and result verification, but also has strong generalization capabilities and can be widely applied to various network configuration scenarios. Through multi-technology collaboration, it achieves end-to-end accurate translation from natural language to network configuration commands. The introduction of a structured verification mechanism ensures the reliability of the generated results, and the modular design gives the system good scalability, enabling it to adapt to the needs of different network environments. While improving operational efficiency, it lowers the technical threshold, providing a new technical path for automated network management. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies 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 these drawings without creative effort.

[0016] Figure 1 This is a flowchart illustrating the network intent recognition and translation method based on a large language model, as described in this application. Figure 2 A flowchart illustrating the subject matter analysis of the embodiments of this application; Figure 3 A flowchart for constructing a hybrid retrieval system according to embodiments of this application; Figure 4 Enhanced flowcharts were generated for the embodiments of this application; Figure 5 A flowchart for determining configuration examples in embodiments of this application; Figure 6 This is a schematic diagram of the structured strategy verification in an embodiment of this application; Figure 7a This is a schematic diagram of a network intent recognition and translation device based on a large language model, as described in an embodiment of this application. Figure 7b This is a schematic diagram illustrating the operation of the network intent recognition and translation method based on a large language model, as described in an embodiment of this application. Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0018] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0019] In this article, it is important to understand that any number of elements in the accompanying figures is for illustrative purposes and not for limitation, and any naming is for distinction only and has no limiting meaning.

[0020] Based on the above background description, the following situations also exist in the related technologies: When translating user intent in related technologies, a single technical approach is typically employed, making it difficult to comprehensively address the key issues in network configuration generation. While general-purpose large language models possess powerful text generation capabilities, their lack of domain-specific knowledge often results in semantic biases or configuration commands that do not conform to network specifications. Although retrieval-enhanced generation techniques can improve generation accuracy through external knowledge bases, in network configuration scenarios, relying solely on vector retrieval can easily lead to insufficient matching between recalled content and user intent. Furthermore, existing methods generally lack structured verification mechanisms for the generated results, failing to effectively guarantee the credibility and executability of configuration commands.

[0021] The following are separate technical solutions for translating user intent in related technologies: Intent-Based Networking (IBN) is a closed-loop network architecture that uses "intent" as its core driver to automatically build and operate the network. IBN abstracts user needs into intents without requiring explanation of how to implement them. The network automatically analyzes user intents, validates policies, implements self-optimization strategies, and deploys strategies. After an intent is fulfilled, it continuously monitors the network status and automatically adjusts network strategies in case of anomalies, ensuring the network consistently meets user intents. Current IBN technologies rely on formal modeling languages ​​or domain-specific languages, lacking the ability to process natural language input and thus limiting their intelligence. To make Intent-Based Networking accessible to both technical and non-technical users, expressing intents in natural language makes it easier to operate.

[0022] Bidirectional Encoder Representations from Transformers (BERT), based on the Transformer architecture, is one of the mainstream technologies for natural language processing intent recognition tasks. This model acquires deep semantic representation capabilities through large-scale corpus pre-training, effectively completes intent classification tasks using fine-tuning mechanisms, and captures contextual semantic relationships using bidirectional attention mechanisms, significantly improving the recognition accuracy of traditional classification models in closed-domain scenarios. However, this discriminative learning-based encoder architecture has significant application limitations: it struggles to maintain coherent contextual representations in multi-turn dialogue scenarios, lacks sufficient reasoning ability for implicit intents, and its structured output capability is significantly weaker than generative models when handling network configuration translation tasks requiring complex logical reasoning. The BERT model heavily relies on labeled data for supervised training, and its performance significantly declines in zero-shot and few-shot scenarios, belonging to a static representation learning paradigm, which limits its dynamic reasoning ability in user network intent recognition environments.

[0023] Latent Dirichlet Allocation (LDA) is a typical unsupervised topic modeling method that uses probabilistic graphical models to mine latent topics in text. Based on the bag-of-words hypothesis, LDA constructs a three-layer Bayesian generative model of document-topic-word, demonstrating theoretical advantages in traditional natural language processing tasks such as document clustering and information retrieval. In the field of intent recognition, LDA can assist in preliminary semantic feature extraction and achieve coarse-grained partitioning of the sample space through topic probability distribution. However, LDA's modeling capabilities are limited. Its reliance on the statistical characteristics of word co-occurrence prevents it from capturing context-related semantic information, resulting in insufficient ability to analyze complex linguistic phenomena. Furthermore, the model exhibits bias in inferring topics from short text data, directly impacting its application performance in typical scenarios such as dialogue systems and failing to meet the precise classification requirements of intent recognition.

[0024] Retrieval-Augmented Generation (RAG) learns knowledge from data using pre-trained language models, directly serving as a parameterized implicit knowledge base without accessing external knowledge bases. However, it also has drawbacks: the model cannot extend or modify knowledge; for example, a model pre-trained on data from a previous day cannot directly answer questions about events that occurred after that day. Furthermore, the model may generate "illusions," such as providing answers inconsistent with the facts. RAG can mitigate these illusions to some extent, while offering highly transparent answers by referencing external information sources during answer generation, increasing credibility and traceability. By expanding the knowledge base, RAG can access the latest external information, maintaining the timeliness of knowledge. RAG is highly versatile and performs excellently in applications such as question-answering systems, intelligent knowledge assistants, document generation and automatic summarization, and information retrieval.

[0025] Prompt engineering, also known as in-context prompting, refers to refining prompts using structured text and other methods to guide Large Language Models (LLMs) to output the desired results. Prompts are typically not hard-coded strings but rather combinations of templates, examples, and user input. Prompt engineering allows LLMs to be seamlessly integrated into downstream tasks without updating model weights. It relies heavily on experience, and the effectiveness of prompt engineering methods can vary significantly across different models, requiring extensive experimentation and exploration. Prompt engineering is suitable for low-cost projects, requiring no additional datasets or computational resources. Well-designed prompts can activate more knowledge and potential in AI models. However, prompt engineering is easily limited by the LLM context window, struggles with extremely long texts, and relying solely on prompt engineering to adjust large models results in a black-box inference process, leading to answers lacking interpretability.

[0026] In summary, related technologies suffer from problems such as static knowledge, fragmented semantic understanding, and weak domain adaptability in network intent translation scenarios. IBN has not yet achieved large-scale implementation from natural language to network configuration; most research and implementation still rely on formal modeling languages ​​or domain-specific languages, lacking the ability to process natural language input, and is highly specialized and has a high barrier to entry. Fine-tuning of pre-trained models such as BERT relies on a large amount of labeled data, making cold start difficult. Compared to open-domain intent recognition scenarios, it is more suitable for recognition in closed-domain scenarios, is sensitive to the domain, and cannot dynamically integrate external knowledge. LDA can capture shallow word co-occurrence but cannot understand deep semantics and contextual relationships. Prompt word engineering is difficult to design prompts for complex tasks, and the generated answers lack reasoning interpretability.

[0027] The network intent recognition and translation method, device, and medium based on a large language model provided in this application construct a complete intent recognition and configuration generation chain by organically combining topic modeling, retrieval enhancement generation, and large language model inference. Topic modeling technology performs preliminary classification of the initial natural language input by the user, providing precise scope limitation for subsequent retrieval; the retrieval enhancement mechanism extracts relevant configuration templates from a structured knowledge base to obtain recall documents, ensuring that the generated content conforms to network domain specifications; and the recall documents are structurally verified through conditional random fields, significantly improving the credibility of the generated results. This not only solves the shortcomings in semantic understanding, domain adaptation, and result verification, but also has strong generalization capabilities and can be widely applied to various network configuration scenarios. Through multi-technology collaboration, it achieves end-to-end accurate translation from natural language to network configuration commands. The introduction of a structured verification mechanism ensures the reliability of the generated results, and the modular design gives the system good scalability, enabling it to adapt to the needs of different network environments. While improving operational efficiency, it lowers the technical threshold and provides a new technical path for automated network management.

[0028] The network intent recognition and translation method, device, and medium based on a large language model provided in this application can solve problems such as the difficulty in accurately understanding user intent in complex network environments, the limitation of semantic understanding capabilities to predefined label systems, the reliance on expert experience for configuration suggestions, the inability to automatically generate structured network configurations, and the difficulty in adapting to the complexity and diversity of natural language expressions. By introducing topic modeling to assist in identifying user network intent topics, and combining the RAG mechanism to dynamically obtain relevant configuration documents from a professional network knowledge base as contextual references, the invention utilizes a large language model to generate structured network configuration suggestions, thereby improving the intelligence and automation level of network intent processing. This end-to-end processing paradigm significantly improves the intelligence level of the network planning process, enabling non-professional network engineers to obtain professional-grade network configuration solutions through natural language interaction. This invention is applicable to new network architectures such as software-defined networking and cloud-network convergence, providing key technical support for the intelligent evolution of next-generation network management systems.

[0029] In summary, this application aims to construct a network intelligent configuration reasoning framework oriented towards natural language input, in order to meet the application requirements of automatically understanding user needs and generating personalized configuration schemes in network planning.

[0030] The following describes in detail, with reference to the accompanying drawings, the network intent recognition and translation method based on a large language model provided by the embodiments of this application.

[0031] In some embodiments, such as Figure 1 As shown, the network intent recognition and translation method based on a large language model includes: Step 101: Determine the initial natural language input by the user, and perform topic enhancement on the initial natural language through synonym expansion and domain term mapping to obtain the current topic data.

[0032] In practical implementation, a query reconstruction mechanism based on topic modeling is designed to achieve explicit and structured representation of user intent in short texts. The initial natural language query from the user is deeply parsed and reconstructed to address semantic sparsity and generate enhanced text with higher semantic density. The LDA model is pre-trained on a large-scale network configuration document corpus, whose topic space is defined as a series of network configuration intent categories. The model calculates the probability distribution of the query text belonging to each topic through inference and identifies one or more key topics with the highest probability. The most representative topic words corresponding to these key topics are extracted from the LDA model, and these topic words are concatenated with the user's original query text to form a new query text with richer semantic information and domain pre-classification, thus obtaining the current topic data. This design extends the unsupervised topic model from a traditional document classifier to an intent expliciter and query enhancer, providing high-quality query input with both the user's original intent and domain prior knowledge for subsequent retrieval processes, fundamentally improving the recall and accuracy of short texts in professional domain retrieval.

[0033] Step 102: Construct a hybrid retrieval index based on the current topic data and the preset network configuration knowledge base, and perform contextual retrieval in the network configuration knowledge base based on the hybrid retrieval index to obtain the retrieved documents.

[0034] In practical implementation, a semantic and topic-driven precision retrieval scoring mechanism is designed to efficiently retrieve relevant contextual information from a large-scale network configuration knowledge base. The current topic data (also known as the new query text) is encoded into a high-dimensional dense vector using an advanced embedding model. The retrieval process takes place in a high-performance network configuration knowledge base storing massive amounts of network configuration strategy documents. The cosine similarity and subject similarity between the new query text vector and all document vectors in the network configuration knowledge base are calculated, and a highly efficient index structure is used to achieve millisecond-level Top-K most relevant document retrieval. The retrieval module adopts a hybrid scoring function that deeply integrates two key pieces of information from step 101: first, the global semantic information of the current topic data after topic enhancement; and second, the local topic focusing information provided by the LDA topic model that generates the current topic data. This constructs a dual-path evaluation system that leverages the powerful capabilities of dense vectors in generalized semantic matching while applying precise domain constraints through an independent topic consistency channel, effectively filtering out semantically relevant but topically off-topic noisy documents. The hybrid scoring mechanism allows for dynamic adjustment of the weighting coefficients of semantic similarity and topic similarity to balance recall and precision. The weighting coefficients are used to weigh the different importance of generalized semantic matching and domain topic focus in different scenarios.

[0035] Step 103: Determine relevant configuration examples based on the current topic data and the preset example set, and concatenate the recall document with the relevant configuration examples to form a prompt word.

[0036] In practical implementation, a context-aware and structure-guided dynamic prompt word engineering framework is constructed to achieve precise control and guidance of the large language model generation process. This application proposes a dynamic and adaptive prompt word construction framework. This framework uses the Top-K strategy documents recalled by the retrieval enhancement mechanism as the core context. Simultaneously, based on the explicit topic information injected in step 101 contained in the current topic data (also known as the new query text), it dynamically selects the most relevant few-sample examples from a structured example library as related configuration examples. The dynamic prompt word engineering framework assembles the user's initial natural language, the retrieved context documents (recalled documents), and the selected few-sample examples (related configuration examples) according to a predefined, output-structured template to obtain the prompt words input to the large language model. This template explicitly instructs the large language model to output according to specific formats, parameter naming conventions, and logical structures. By indirectly transforming topic information into higher-quality search results and example selections through current topic data (also known as new query text), these high-quality contexts and clear output specifications are then integrated into a unified prompt, resulting in prompt words input into the large language model. This plays a role in context injection and structural guidance, significantly reducing the probability of the large language model generating illusions.

[0037] Step 104: Invoke the large language model based on the prompt words to determine the initial network configuration strategy text output by the large language model.

[0038] In practical implementation, multi-strategy configuration generation and confidence quantification based on a large language model produce preliminary configuration schemes and their reliability assessments. After obtaining carefully constructed prompts, this application calls the large language model for inference generation through a standardized model interface. To balance the creativity and determinism of the output, this application introduces adjustable temperature parameters and kernel sampling strategies. The generation process is autoregressive, producing a text sequence that conforms to the network configuration syntax. Then, by calculating the generation probability of each token in the output sequence and aggregating it into a confidence score for the overall sequence, a reliability index is assigned to each generated configuration block. This confidence score is an important input for the subsequent structured verification stage. This step transforms the large language model from a general text generator into a strategy generation component capable of quantifying the uncertainty of its output, realizing a paradigm shift in network configuration generation.

[0039] In large language models, the tokens in the output sequence refer to the smallest text units that the model generates one by one based on your input and the current dialogue context, and ultimately combines to form a complete response. You can think of them as the "characters" or "words" output by the model. The sum of the number of tokens in the output sequence and the number of tokens in the input prompt words cannot exceed the limit of the model's context window. For example, if a model's context window is 64K tokens, and you input 60K tokens of prompt words, requesting the output of the initial network configuration policy text, then the model can only generate a maximum of approximately 4K tokens of initial network configuration policy text.

[0040] In multi-turn long dialogues, if the accumulated dialogue content (historical input + all historical output) exceeds the context window, the model typically employs a "context truncation" strategy. This involves discarding some of the earliest dialogue content (tokens) to make room for new input. This is why the model sometimes "forgets" the roles or requirements set at the beginning of the dialogue, because the context on which the model generates the current response no longer contains that earlier information.

[0041] Step 105: Perform structured policy validation on the initial network configuration policy text to obtain network policies that pass the structured policy validation. Format and standardize the network policies to obtain network configuration commands that conform to the device configuration specifications.

[0042] In practical implementation, a structured strategy verification and closed-loop correction strategy based on Conditional Random Fields (CRFs) and domain constraints is adopted to ensure the logical compliance and executability of the output configuration. This application introduces a machine learning-based structured verification and correction closed-loop strategy. The initial network configuration strategy text generated by the large language model is parsed into a token sequence. A Conditional Random Field (CRF) model pre-trained on labeled network configuration data is used to sequence-label the sequence, assigning a semantic role label to each lexical. By learning the transition constraints between labels, the CRF model can effectively capture and enforce the logical structure of the configuration command. Based on this, the specific parameter values ​​(confidence scores) corresponding to the "VALUE" label labeled by the CRF are compared with a predefined network strategy rule base to perform parameter type checks, numerical range verification, and policy dependency review. When verification fails or constraint conflicts are detected, a closed-loop error correction process is triggered: re-injecting the prompt word module for iterative generation, adjusting the retrieval strategy, and switching the backup model until a standardized network configuration command that meets the constraints is generated.

[0043] This application establishes a system-level adaptive mechanism that supports continuous evolution and multi-model collaboration. It enables online, incremental updates to topic models, vector knowledge bases, and few-shot example libraries, ensuring compatibility with new network protocols, device models, and technical terminology without requiring a complete system refactoring. A standardized model adaptation interface is provided, encapsulating the calling interfaces of various mainstream language models. This allows the system to dynamically select or switch between primary and backup models based on strategies such as response latency, generation cost, task type, and confidence threshold. Furthermore, a workflow with dynamic optimization capabilities is constructed, which not only executes predetermined processes but also drives knowledge base updates and autonomous strategy exploration, ultimately ensuring its long-term robustness and adaptability in real-world operating environments.

[0044] In summary, the network intent recognition and translation method based on a large language model provided by this invention, combining topic modeling, retrieval enhancement generation, prompt word engineering, and sequence structure verification, achieves intelligent translation from natural language to network configuration, suitable for intent-driven network architectures. This invention fully leverages the deep semantic understanding advantages of large language models by integrating LDA topic recognition algorithms with RAG retrieval enhancement generation mechanisms, improving the accuracy and robustness of network intent parsing. The system adopts an advanced few-shot learning paradigm, significantly reducing the cost of labeled data; high performance can be achieved with a small amount of structured data, while supporting dynamic intent expansion in open-domain scenarios, possessing excellent domain adaptability. The RAG module injects domain knowledge through an external knowledge base, eliminating the need for costly fine-tuning of the large model, adapting to diverse network devices and scenarios, and allowing for dynamic updates to the knowledge base. This invention constructs a complete end-to-end structured configuration generation framework, realizing fully automated processing from natural language input to executable network configuration. It effectively solves the bottleneck problem of traditional methods relying on manual translation, effectively achieving the goal of "low threshold, transferable, and structured" intelligent network configuration. It seamlessly embeds the front-end module of intent-driven networks, providing a feasible approach for natural language to configuration translation technology and promoting intelligent network management.

[0045] In some embodiments, such as Figure 2 As shown, topic enhancement is performed on the initial natural language through synonym expansion and domain term mapping to obtain the current topic data, including: Step 201: Expand the text using synonyms based on the sequence of the initial natural language to obtain the expanded text; Step 202: Calculate the probability distribution of the extended text belonging to each topic in the preset topic space through domain terminology mapping, identify at least one topic with the highest probability as a key topic, determine the weight of each key topic, and obtain a topic weight vector; Step 203: Extract the most representative keywords from the key topics, and concatenate the keywords with the initial natural language to obtain the query text; Step 204: Integrate key topics, query text, and topic weight vectors to obtain the current topic data.

[0046] In practice, this step first expands the semantic features of the short text and then uses LDA for topic modeling.

[0047] The initial natural language input by the user is denoted as query, and we need to extract network configuration-related topics from the user query.

[0048] Define a topic space Z, where Z is the set of all possible network configuration intentions: , Where z can take values ​​including: QoS policy, security rules, routing configuration, load balancing, fault recovery, resource allocation, protocol selection, etc. Where K is the total number of topics, determined through model training. Topic set The layout can be dynamically expanded to meet user needs.

[0049] Given a word sequence W={w1,w2,...,wn} of a user query, perform synonym expansion on the user query: , For the expanded text Calculate topic distribution: , in, For the word-topic distribution of LDA, The prior probability of the topic.

[0050] The topic that best matches the semantics of the query is selected as the key topic, and the optimal topic (key topic) is denoted as . : ; in, The index used to find the maximum value in a given function indicates that, under a given probability distribution, the topic that maximizes the probability value is selected as the optimal topic.

[0051] Output topic weight vector: , , Finally, the key topics, query text, and topic weight vectors are integrated to obtain the current topic data.

[0052] In some embodiments, such as Figure 3 As shown, a hybrid search index is constructed based on the current topic data and the preset network configuration knowledge base, including: Step 301: Calculate the cosine similarity between the query text in the current topic data and each document vector in the preset network configuration knowledge base; Step 302: Determine the topic similarity between the topic weight vector in the current topic data and each document vector in the preset network configuration knowledge base; Step 303: Calculate the weighted score of cosine similarity and topic similarity based on the preset balance factor to obtain the hybrid search index.

[0053] The calculation of the cosine similarity between the query text in the current topic data and each document vector in the preset network configuration knowledge base includes: Generate a query text embedding vector corresponding to the query text and a document embedding vector corresponding to each document vector; The cosine similarity is calculated by performing cosine similarity calculation on the query text embedding vector and the document embedding vector.

[0054] This includes determining the topic similarity between the topic weight vector in the current topic data and each document vector in the preset network configuration knowledge base, including: Determine the document topic vector corresponding to each document vector; The topic similarity is determined by multiplying the topic weight vector and the document topic vector.

[0055] In practice, the retrieval enhancement process uses the BGE-M3 model to generate dense vectors between queries and documents. Millisecond-level retrieval is achieved through the ChromaDB IVF_PQ index, and LDA topic similarity weighting is combined to address the domain bias problem inherent in single semantic matching. The BGE-M3 model supports over 100 languages, making it suitable for scenarios requiring multilingual text processing.

[0056] Based on LDA topic and semantic similarity, the optimal strategy is retrieved from the network configuration knowledge base. Document and query embedding generation: The word sequence W of the user query and the knowledge base documents Generate embedding vectors respectively: , , in, , BGE-M3 is trained on multiple languages, making it suitable for internationalized network configurations. In the Massive Text Embedding Benchmark (MTEB), a large-scale benchmark platform for comprehensively evaluating text embedding model performance, BGE-M3 ranks among the top 3 in both retrieval tasks and cross-language retrieval, significantly outperforming general-purpose models. Using BGE-M3 as the embedding model ensures accurate matching between cross-language user requests and policy documents.

[0057] Hybrid retrieval scoring function: Combining semantic similarity and LDA topic similarity, a weighted score is constructed as a hybrid retrieval index.

[0058] , in, , is the balance factor. The topic weight vector output by LDA. The topic vector preserves the accuracy of the user's original input and avoids amplified noise.

[0059] This paper selects the ChromaDB vector database to store dense vectors of policy documents, ensuring the timeliness of configuration generation through real-time retrieval. ChromaDB is an open-source vector database designed to provide an efficient, scalable, and flexible way to store and search embeddings. Its main purpose is to save embeddings and metadata for use by large language models. ChromaDB supports millisecond-level vector similarity search, making it suitable for high-concurrency scenarios. It also supports multimodal operations, can store embedding vectors of text, images, etc., allows dynamic updates, online document insertion or deletion, and is compatible with dynamic policy libraries. Related technical solutions rely on relational databases or full-text search, which cannot efficiently handle vectorized semantic queries. This application achieves second-level knowledge retrieval of network policies through a dedicated vector architecture using the ChromaDB vector database and Inverted File with Product Quantization (IVF_PQ).

[0060] In some embodiments, such as Figure 4 As shown, contextual recall is performed in the network configuration knowledge base based on the hybrid retrieval index to obtain the recalled documents, including: Step 401: Sort the hybrid retrieval index sequentially according to the weighted score to obtain the index sequence; Step 402: Sort and retrieve documents according to the index sequence and the preset maximum recall to obtain the recalled documents.

[0061] In practice, to accelerate Top-K retrieval, a hybrid retrieval index is used in ChromaDB to retrieve the recalled documents. , , Specifically, the IVF_PQ index is used to accelerate retrieval and return the original text set of the recalled documents. .

[0062] IVF_PQ indexing is an efficient vector retrieval technique that accelerates Top-K retrieval with mixed scoring, achieving a balance between accuracy and efficiency. IVF_PQ is a hybrid approach combining indexing and compression for efficient vector search and retrieval. It utilizes two core components: inverted file and product quantization. IVF_PQ transforms the representation of a vector field into a probability distribution representation by dividing a high-dimensional space into regions and using probability distributions to represent vectors in each region. Compared to graph-based methods, it requires significantly less memory, making it a practical choice for large datasets.

[0063] Finally, the search results are concatenated into the input context of the LLM: , in, This indicates context splicing.

[0064] In some embodiments, such as Figure 5 As shown, relevant configuration examples are determined based on the current topic data and the preset example set, including: Step 501: Calculate the semantic similarity between the query text in the current topic data and each configuration example in the preset example set; Step 502: Select examples based on semantic similarity and the preset selection quantity to obtain relevant configuration examples.

[0065] In practice, the prompt word generation process dynamically selects a few-shot example (related configuration example) and concatenates it with RAG search results (recall documents) to build a domain-adaptive instruction template. At the same time, it injects LDA topic weights to guide LLM to prioritize key parameters, thus solving the problem of traditional prompt word engineering relying on manual debugging.

[0066] Construct prompts containing few-shot examples and RAG search results to guide LLM in generating structured configurations. Few-shot learning refers to improving model performance using only a very small number of labeled samples during model training. Its core goal is to enable the model to quickly grasp task characteristics with a limited number of samples, thereby achieving superior performance on new data.

[0067] Let the set of Few-shot examples be: , Query-based word sequence Based on semantic similarity with the configuration examples, dynamically select the n most relevant configuration examples: , , in, yes A subset of.

[0068] Combine the RAG results with the Few-shot example using a template to create a prompt. : , , Among them, ⊕ is a text concatenation character that integrates the user's original requirements and ensures the integrity of the semantics.

[0069] Domain weight injection: Injecting LDA topic weights Inject prompts in natural language .

[0070] .

[0071] Then, a preliminary network configuration strategy is generated based on the prompt words, and candidate results are output for subsequent CRF verification. The LLM inference module generates configurations through standardized API calls, supports on-demand switching between various models such as DeepSeek, Qwen, and GPT series, and combines lightweight design with flexibility.

[0072] Calling LLM based on input prompt words Generate configuration The conditional probability distribution.

[0073] , in, It is a partially generated sequence.

[0074] , Where m is the model selection, τ is the temperature coefficient (default 0.3), and Tmax is the maximum number of tokens generated.

[0075] In some embodiments, such as Figure 6 As shown, the initial network configuration policy text undergoes structured policy validation to obtain network policies that pass the structured policy validation, including: Step 601: Calculate the confidence score of the initial network configuration policy text, and assign an evaluation index to each configuration block of the initial network configuration policy text according to the confidence score and the preset definition tag, to obtain the tag sequence; Step 602: Perform execution parameter type checks, numerical range verification, and policy dependency reviews on the tag sequence based on the preset network policy rule base; Step 603: Determine the initial network configuration policy text corresponding to the tag sequence that has passed parameter type checking, numerical range verification, and policy dependency review as the network policy.

[0076] In practice, a structured policy verification module based on Conditional Random Field (CRF) performs sequence labeling on the configuration generated by LLM, enforces parameter logic compliance through the label transition matrix, and outputs a final policy that conforms to network specifications. CRF is a fundamental model in natural language processing and is widely used in annotation scenarios such as Chinese word segmentation, named entity recognition, and part-of-speech tagging.

[0077] Input sequence labels, convert the LLM-generated configuration into a token sequence, and label the semantic role of each token.

[0078] Input configuration: , Define a tag set:

[0079] The VALUE label represents the corresponding confidence score. Optionally, configuration strategies with confidence scores greater than or equal to a score threshold can be retained and added to the defined label set for subsequent verification. Configuration strategies with confidence scores less than the score threshold can be discarded directly, i.e., no VALUE label is added, and no subsequent verification is performed. Optionally, the confidence score can also be directly used as the parameter value for the VALUE label.

[0080] CRF probabilistic modeling: , in, Represents the normalization factor. Represents the state characteristic function. Represents the transition characteristic function, , Represents trainable weights. The joint probability of the label sequence is modeled using the transition matrix and state features. .

[0081] Viterbi Decoding Optimal Sequences: Dynamic Programming for Solving Optimal Label Sequences This satisfies network policy constraints.

[0082]

[0083] Among them, the Viterbi algorithm is a dynamic programming algorithm used to find the Viterbi path-hidden state sequence that is most likely to produce the observed time series, especially in the context of Markov information sources, Hidden Markov Models, and Conditional Random Fields.

[0084] Parameter range validation and correction: Constrain the range of values ​​for the VALUE tag.

[0085] , The text configuration generated by LLM is converted into a label sequence that conforms to network specifications, and parameter out-of-bounds issues are dynamically corrected, thus solving the problem of insufficient coverage in traditional manual rule validation.

[0086] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.

[0087] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0088] Based on the same inventive concept, and corresponding to any of the above embodiments, this application also provides a network intent recognition and translation device based on a large language model.

[0089] refer to Figure 7a The network intent recognition and translation device based on a large language model includes: The topic analysis module 10 is configured to: determine the initial natural language input by the user, perform topic enhancement on the initial natural language through synonym expansion and domain term mapping, and obtain current topic data; The retrieval enhancement generation module 20 is configured to: construct a hybrid retrieval index based on the current topic data and a preset network configuration knowledge base, and perform contextual retrieval in the network configuration knowledge base based on the hybrid retrieval index to obtain the retrieved document; The prompt word engineering module 30 is configured to: determine relevant configuration examples based on the current topic data and a preset example set, and concatenate the recalled document with the relevant configuration examples to form a prompt word; The large language model inference module 40 is configured to: invoke the large language model based on the prompt word and determine the initial network configuration strategy text output by the large language model; The structured policy verification module 50 is configured to: perform structured policy verification on the initial network configuration policy text to obtain a network policy that passes the structured policy verification; and perform formatting and standardization processing on the network policy to obtain a network configuration command that conforms to the device configuration specification.

[0090] The process of data interaction between modules is as follows Figure 7b As shown: The intent acquisition module (not shown in the figure) receives the user's natural language input and forwards the user's original network policy intent input to the semantic enhancement and topic modeling module.

[0091] The topic analysis module 10 constructs a high-density semantic representation by expanding the intent text with synonyms and mapping it to domain terms. It then uses an LDA model to identify the latent main distribution corresponding to the text. The output topic weight vector is used to determine the domain direction and semantic features of new intents, thereby alleviating the sparsity problem of short texts.

[0092] The retrieval enhancement generation module 20 vectorizes the input intent and knowledge base documents, calculates semantic similarity and topic similarity, and sorts and retrieves the configuration examples most relevant to the current topic based on a weighted scoring function, providing interpretable domain knowledge support for the subsequent generation stage.

[0093] The prompt word engineering module 30 dynamic prompt construction module constructs structured prompt input based on search results and topic information. It combines the recalled document content, topic keywords and related configuration examples into a unified input template, so that the generation process has context constraints and structural guidance capabilities, thereby improving the controllability and accuracy of the generated content.

[0094] Based on dynamic prompts, the large language model inference module 40 outputs commands or configuration statements through conditional generation and calculates the confidence score of the generated sequence to measure the reliability of the generated results and provide a reference for subsequent verification.

[0095] The structured strategy verification module 50 performs syntax and logic consistency verification on the generated strategy text. It uses a CRF model for tag recognition and structured parsing to check whether the command format, parameter matching relationship and value range conform to the specifications. When a syntax conflict or logical error is found, it returns to the upstream module for correction.

[0096] The network policy output module (not shown in the figure) formats and standardizes the structured verified network policy, and outputs the final command or policy file that conforms to the device configuration specification. It is the system's output end, ensuring that the generated configuration can be directly used for network devices or system calls.

[0097] The specific execution process is as follows: The topic analysis module 10 first expands the semantic features of short texts and then uses LDA for topic modeling.

[0098] The initial natural language input by the user is denoted as query, and we need to extract network configuration-related topics from the user query.

[0099] Define a topic space Z, where Z is the set of all possible network configuration intentions: , Where z can take values ​​including: QoS policy, security rules, routing configuration, load balancing, fault recovery, resource allocation, protocol selection, etc. Where K is the total number of topics, determined through model training. Topic set The layout can be dynamically expanded to meet user needs.

[0100] Given a word sequence W={w1,w2,...,wn} of a user query, perform synonym expansion on the user query: , For the expanded text Calculate topic distribution: , in, For the word-topic distribution of LDA, The prior probability of the topic.

[0101] The topic that best matches the semantics of the query is selected as the key topic, and the optimal topic (key topic) is denoted as . : ; in, The index used to find the maximum value in a given function indicates that, under a given probability distribution, the topic that maximizes the probability value is selected as the optimal topic.

[0102] Output topic weight vector: , , Finally, the key topics, query text, and topic weight vectors are integrated to obtain the current topic data.

[0103] The retrieval enhancement generation module 20 uses the BGE-M3 model to generate dense vectors between queries and documents. It achieves millisecond-level retrieval through the ChromaDB IVF_PQ index and combines LDA topic similarity weighting to address the domain bias problem of single semantic matching. The BGE-M3 model supports over 100 languages, making it suitable for scenarios requiring multilingual text processing.

[0104] Based on LDA topic and semantic similarity, the optimal strategy is retrieved from the network configuration knowledge base. Document and query embedding generation: The word sequence W of the user query and the knowledge base documents Generate embedding vectors respectively: , , in, , BGE-M3 is trained on multiple languages, making it suitable for internationalized network configurations. In the Massive Text Embedding Benchmark (MTEB), a large-scale benchmark platform for comprehensively evaluating text embedding model performance, BGE-M3 ranks among the top 3 in both retrieval tasks and cross-language retrieval, significantly outperforming general-purpose models. Using BGE-M3 as the embedding model ensures accurate matching between cross-language user requests and policy documents.

[0105] Hybrid retrieval scoring function: Combining semantic similarity and LDA topic similarity, a weighted score is constructed as a hybrid retrieval index.

[0106] , in, , is the balance factor. The topic weight vector output by LDA. The topic vector preserves the accuracy of the user's original input and avoids amplified noise.

[0107] This paper selects the ChromaDB vector database to store dense vectors of policy documents, ensuring the timeliness of configuration generation through real-time retrieval. ChromaDB is an open-source vector database designed to provide an efficient, scalable, and flexible way to store and search embeddings. Its main purpose is to save embeddings and metadata for use by large language models. ChromaDB supports millisecond-level vector similarity search, making it suitable for high-concurrency scenarios. It also supports multimodal operations, can store embedding vectors of text, images, etc., allows dynamic updates, online document insertion or deletion, and is compatible with dynamic policy libraries. Related technical solutions rely on relational databases or full-text search, which cannot efficiently handle vectorized semantic queries. This application achieves second-level knowledge retrieval of network policies through a dedicated vector architecture using the ChromaDB vector database and Inverted File with Product Quantization (IVF_PQ).

[0108] To accelerate Top-K retrieval, a hybrid retrieval index is used in ChromaDB to retrieve recalled documents: , , Specifically, the IVF_PQ index is used to accelerate retrieval and return the original text set of the recalled documents. .

[0109] IVF_PQ indexing is an efficient vector retrieval technique that accelerates Top-K retrieval with mixed scoring, achieving a balance between accuracy and efficiency. IVF_PQ is a hybrid approach combining indexing and compression for efficient vector search and retrieval. It utilizes two core components: inverted file and product quantization. IVF_PQ transforms the representation of a vector field into a probability distribution representation by dividing a high-dimensional space into regions and using probability distributions to represent vectors in each region. Compared to graph-based methods, it requires significantly less memory, making it a practical choice for large datasets.

[0110] Finally, the search results are concatenated into the input context of the LLM: , in, This indicates context splicing.

[0111] The prompt word engineering module 30 dynamically selects Few-shot examples (related configuration examples) and concatenates RAG search results (recall documents) to build domain-adaptive instruction templates. At the same time, it injects LDA topic weights to guide LLM to prioritize key parameters, thus solving the problem of traditional prompt word engineering relying on manual debugging.

[0112] Construct prompts containing few-shot examples and RAG search results to guide LLM in generating structured configurations. Few-shot learning refers to improving model performance using only a very small number of labeled samples during model training. Its core goal is to enable the model to quickly grasp task characteristics with a limited number of samples, thereby achieving superior performance on new data.

[0113] Let the set of Few-shot examples be: , Query-based word sequence Based on semantic similarity with the configuration examples, dynamically select the n most relevant configuration examples: , , in, yes A subset of.

[0114] Combine the RAG results with the Few-shot example using a template to create a prompt. : , , Among them, ⊕ is a text concatenation character that integrates the user's original requirements and ensures the integrity of the semantics.

[0115] Domain weight injection: Injecting LDA topic weights Inject prompts in natural language .

[0116]

[0117] The Large Language Model Inference Module 40 generates a preliminary network configuration strategy based on prompt words and outputs candidate results for subsequent CRF verification. The LLM inference module generates configurations through standardized API calls, supports on-demand switching between multiple models such as DeepSeek, Qwen, and GPT series, and combines lightweight design with flexibility.

[0118] Calling LLM based on input prompt words Generate configuration The conditional probability distribution.

[0119] , in, It is a partially generated sequence.

[0120] , Where m is the model selection, τ is the temperature coefficient (default 0.3), and Tmax is the maximum number of tokens generated.

[0121] The structured policy verification module 50, based on Conditional Random Field (CRF), performs sequence labeling on the configuration generated by LLM, enforces parameter logic compliance through the label transition matrix, and outputs a final policy that conforms to network specifications. CRF is a fundamental model in natural language processing and is widely used in annotation scenarios such as Chinese word segmentation, named entity recognition, and part-of-speech tagging.

[0122] Input sequence labels, convert the LLM-generated configuration into a token sequence, and label the semantic role of each token.

[0123] Input configuration: , Define a tag set:

[0124] The VALUE label represents the corresponding confidence score. Optionally, configuration strategies with confidence scores greater than or equal to a score threshold can be retained and added to the defined label set for subsequent verification. Configuration strategies with confidence scores less than the score threshold can be discarded directly, i.e., no VALUE label is added, and no subsequent verification is performed. Optionally, the confidence score can also be directly used as the parameter value for the VALUE label.

[0125] CRF probabilistic modeling: , in, Represents the normalization factor. Represents the state characteristic function. Represents the transition characteristic function, , Represents trainable weights. The joint probability of the label sequence is modeled using the transition matrix and state features. .

[0126] Viterbi Decoding Optimal Sequences: Dynamic Programming for Solving Optimal Label Sequences This satisfies network policy constraints.

[0127]

[0128] Among them, the Viterbi algorithm is a dynamic programming algorithm used to find the Viterbi path-hidden state sequence that is most likely to produce the observed time series, especially in the context of Markov information sources, Hidden Markov Models, and Conditional Random Fields.

[0129] Parameter range validation and correction: Constrain the range of values ​​for the VALUE tag.

[0130] , The text configuration generated by LLM is converted into a label sequence that conforms to network specifications, and parameter out-of-bounds issues are dynamically corrected, thus solving the problem of insufficient coverage in traditional manual rule validation.

[0131] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.

[0132] The apparatus of the above embodiments is used to implement the corresponding network intent recognition and translation method based on the large language model in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0133] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the network intent recognition and translation method based on a large language model as described in any of the above embodiments.

[0134] Figure 8This embodiment illustrates a more specific hardware structure of an electronic device. The device may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.

[0135] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0136] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0137] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0138] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0139] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.

[0140] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0141] The electronic devices described above are used to implement the corresponding network intent recognition and translation methods based on large language models in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0142] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the network intent recognition and translation method based on a large language model as described in any of the above embodiments.

[0143] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0144] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the network intent recognition and translation method based on the large language model as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0145] It is understood that before using the technical solutions of the various embodiments in this application, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.

[0146] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations described in this application.

[0147] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0148] It is understood that the above notification and user authorization process is merely illustrative and does not limit the implementation of this application. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this application.

[0149] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in detail for the sake of brevity.

[0150] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0151] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0152] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the claims of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A network intent recognition and translation method based on a large language model, characterized in that, include: Determine the initial natural language input by the user, and perform topic enhancement on the initial natural language through synonym expansion and domain term mapping to obtain the current topic data; A hybrid retrieval index is constructed based on the current topic data and the preset network configuration knowledge base, and contextual retrieval is performed in the network configuration knowledge base based on the hybrid retrieval index to obtain the retrieved documents; Based on the current topic data and the preset example set, relevant configuration examples are determined, and the recalled document is concatenated with the relevant configuration examples to form a prompt word; Based on the prompt words, the large language model is invoked to determine the initial network configuration strategy text output by the large language model; The initial network configuration policy text is subjected to structured policy validation to obtain a network policy that passes the structured policy validation. The network policy is then formatted and standardized to obtain a network configuration command that conforms to the device configuration specification.

2. The network intent recognition and translation based on a large language model according to claim 1, characterized in that, The process of performing topic enhancement on the initial natural language through synonym expansion and domain term mapping to obtain current topic data includes: The extended text is obtained by expanding synonyms based on the sequence of the initial natural language. The probability distribution of the extended text belonging to each topic in the preset topic space is calculated by the domain terminology mapping, and at least one topic with the highest probability is identified as a key topic. The weight of each key topic is determined to obtain the topic weight vector. Extract the most representative keywords from the key topics, and concatenate the keywords with the initial natural language to obtain the query text; The current topic data is obtained by integrating the key topic, the query text, and the topic weight vector.

3. The network intent recognition and translation based on a large language model according to claim 1, characterized in that, The step of constructing a hybrid retrieval index based on the current topic data and a preset network configuration knowledge base includes: Calculate the cosine similarity between the query text in the current topic data and each document vector in the preset network configuration knowledge base; Based on the topic weight vector in the current topic data and the topic similarity between each document vector in the preset network configuration knowledge base; The weighted score of the cosine similarity and the topic similarity is calculated based on a preset balance factor to obtain the hybrid retrieval index.

4. The network intent recognition and translation based on a large language model according to claim 1, characterized in that, The step of performing contextual recall in the network configuration knowledge base based on the hybrid retrieval index to obtain the recalled documents includes: The hybrid retrieval index is sorted sequentially according to the weighted score to obtain the index sequence; The retrieved documents are obtained by sorting and searching according to the index sequence and the preset maximum recall.

5. The network intent recognition and translation based on a large language model according to claim 3, characterized in that, The calculation of the cosine similarity between the query text in the current topic data and each document vector in the preset network configuration knowledge base includes: Generate a query text embedding vector corresponding to the query text and a document embedding vector corresponding to each document vector; The cosine similarity is calculated by performing a cosine similarity calculation on the query text embedding vector and the document embedding vector.

6. The network intent recognition and translation based on a large language model according to claim 3, characterized in that, The step of determining the topic similarity between the topic weight vector in the current topic data and each document vector in the preset network configuration knowledge base includes: Determine the document topic vector corresponding to each document vector; The topic similarity is determined by multiplying the topic weight vector and the document topic vector.

7. The network intent recognition and translation based on a large language model according to claim 1, characterized in that, The step of determining relevant configuration examples based on the current topic data and a preset example set includes: Calculate the semantic similarity between the query text in the current topic data and each configuration example in the preset example set; The relevant configuration examples are obtained by selecting examples based on the semantic similarity and the preset selection number.

8. The network intent recognition and translation based on a large language model according to claim 1, characterized in that, The step of performing structured policy validation on the initial network configuration policy text to obtain a network policy that passes the structured policy validation includes: Calculate the confidence score of the initial network configuration policy text, and assign an evaluation index to each configuration block of the initial network configuration policy text according to the confidence score and the preset definition tag, to obtain a tag sequence; The tag sequence is subjected to execution parameter type checks, numerical range verification, and policy dependency review based on a preset network policy rule base. The initial network configuration policy text corresponding to the label sequence obtained by performing parameter type checks, numerical range verification, and policy dependency review is determined as the network policy.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 8.