Configuration method and system of network configuration text and electronic equipment

Through identification, planning, retrieval and coding agents working together, extract and expand keywords in network configuration text, generate multiple configuration solutions, and integrate configuration code through code vector knowledge base, the problem of lack of flexibility and context perception in network configuration in the existing technology is solved, and more efficient and accurate network configuration is achieved.

CN120067291APending Publication Date: 2025-05-30BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510023708.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, network configuration relies on static template matching, lacks flexibility and context perception capabilities, it is difficult to obtain configuration codes that meet the requirements, and it is difficult to cope with complex network needs.

Method used

A network configuration text configuration method is proposed. By identifying the agent to receive user input, extract keywords, planning the agent to expand the keywords, forming a variety of configuration schemes, using the pre-constructed code vector knowledge base and searching the agent to determine the configuration code, encode the agent to integrate the configuration code, and generate the target configuration code.

Benefits of technology

It improves the accuracy and diversification of network configuration, can better respond to complex network needs, reduce manual intervention, and improve configuration efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067291A_ABST
    Figure CN120067291A_ABST
Patent Text Reader

Abstract

The invention provides a configuration method and system for a network configuration text and electronic equipment, and the method comprises the steps: receiving the network configuration text inputted by a user through an identification agent, and carrying out the keyword extraction of the network configuration text, and obtaining a plurality of first keywords; for each first keyword, expanding the first keyword by using the planning agent to obtain a second keyword corresponding to the first keyword; forming a plurality of configuration schemes of the network configuration text based on the plurality of first keywords and the plurality of second keywords; determining a first configuration code corresponding to each configuration scheme by using the retrieval agent through a pre-constructed code vector knowledge base; and integrating all the first configuration codes by using the coding agent to obtain a target configuration code corresponding to the network configuration text, thereby solving the technical problem of low configuration accuracy for the network configuration text in the prior art, and achieving the purpose of improving the intelligent level of network configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and in particular, to a configuration method, system, and electronic device for network configuration text. Background Art

[0002] In network configuration tasks, network routing and network construction are the core parts. In terms of network routing, network routing is like a traffic control system and is the key to enabling different network communications. It involves various routing protocol configurations. For example, static routing configured manually is suitable for simple and stable networks, and dynamic routing protocols such as RIP that determines paths by calculating the number of hops and OSPF that can calculate the shortest path more accurately are used for complex networks. In terms of network construction, first, the topological structure needs to be planned. For example, a star topology is often used for campus networks for easy management and maintenance. Devices such as routers, switches, firewalls, and wireless access points need to be selected and correctly connected according to network scale, functional requirements, and budget, etc. Redundancy of devices may need to be considered in enterprise networks to improve reliability.

[0003] In the prior art, network configuration has gradually developed into automated configuration. However, the automated methods for network location usually rely on static template matching, that is, using keywords in user requirements to directly match and obtain configuration codes. They lack flexibility and context awareness capabilities, making it difficult to obtain configuration codes that meet requirements and difficult to handle complex network requirements. Summary of the Invention

[0004] In view of this, the purpose of this application is to propose a configuration method, system, and electronic device for network configuration text to overcome all or part of the deficiencies in the prior art.

[0005] Based on the above purpose, this application provides a configuration method for network configuration text, which is applied to a configuration system. The configuration system includes an identification agent, a planning agent, a retrieval agent, and an encoding agent. The method includes: using the identification agent to receive the network configuration text input by the user, and extracting keywords from the network configuration text to obtain a plurality of first keywords; for each first keyword, using the planning agent to expand the first keyword to obtain a second keyword corresponding to the first keyword; based on the plurality of first keywords and the plurality of second keywords, forming multiple configuration schemes for the network configuration text; through a pre-constructed code vector knowledge base, using the retrieval agent to determine the first configuration code corresponding to each configuration scheme; using the encoding agent to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text.

[0006] Optionally, determining the first configuration code corresponding to each configuration scheme by using the retrieval agent through the pre-constructed code vector knowledge base includes: for each configuration scheme, encoding the first keyword and the second keyword that make up the configuration scheme respectively to obtain a plurality of keyword vectors; based on the plurality of keyword vectors and the initial weight corresponding to each predetermined retrieval method, performing at least one round of processing operations in the code vector knowledge base to obtain the target weight corresponding to each predetermined retrieval method; based on the plurality of keyword vectors and the target weight corresponding to each predetermined retrieval method, performing hybrid retrieval in the code vector knowledge base to obtain the first code vector; and parsing the first code vector to obtain the first configuration code.

[0007] Optionally, the performing at least one round of processing operations in the code vector knowledge base based on the plurality of keyword vectors and the initial weight corresponding to each predetermined retrieval method to obtain the target weight corresponding to each predetermined retrieval method includes: each round of processing operations is performed as follows: in response to determining that the cumulative time of the executed processing operations is less than the predetermined cumulative time, performing hybrid retrieval in the code vector knowledge base based on the plurality of keyword vectors and the initial weight corresponding to each predetermined retrieval method to obtain the second code vector corresponding to the configuration scheme; parsing the second code vector to obtain the second configuration code; calculating the retrieval adjustment factor corresponding to each predetermined retrieval method based on the network configuration text and the second configuration code; for each predetermined retrieval method, adjusting the initial weight by using the retrieval adjustment factor, and using the adjusted initial weight as the initial weight for the next round of processing operations; in response to determining that the cumulative time of the executed processing operations is greater than or equal to the predetermined cumulative time, exiting at least one round of processing operations, and determining the adjusted initial weight obtained in the previous round of processing operations as the target weight.

[0008] Optionally, calculating the retrieval adjustment factor corresponding to each predetermined retrieval method based on the network configuration text and the second configuration code includes: calculating the correlation score between the network configuration text and the second configuration code, and calculating the semantic similarity score between the network configuration text and the second configuration code; and calculating the retrieval adjustment factor corresponding to each predetermined retrieval method based on the correlation score and the semantic similarity score.

[0009] Optionally, using the recognition agent to extract keywords from the network configuration text to obtain a plurality of keywords includes: using the recognition agent to parse the network configuration text to obtain a plurality of initial keywords; and using the recognition agent to perform a correction operation on each initial keyword to obtain the plurality of keywords.

[0010] Optionally, the multiple configuration schemes for composing the network configuration text based on multiple first keywords and multiple second keywords include: replacing each first keyword in the multiple first keywords with its corresponding second keyword to generate multiple configuration schemes.

[0011] Optionally, the step of using the encoding agent to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text includes: summarizing and screening all the first configuration codes according to the predetermined requirements corresponding to the network configuration text; performing syntax correction and logic improvement on the first configuration codes obtained after the summarizing and screening according to the predetermined programming specifications to obtain the target configuration code.

[0012] Optionally, the configuration system further includes a large language model; the method for constructing the code vector knowledge base includes: obtaining code documents of multiple network configuration texts, and splitting each code document to obtain multiple segments of initial configuration codes and keywords corresponding to each segment of the initial configuration codes; using the large language model to perform semantic enhancement on the initial configuration codes to obtain configuration codes; encoding the configuration codes to obtain code vectors, and encoding the keywords corresponding to the configuration codes to obtain keyword vectors; associatively storing the code vectors corresponding to the configuration codes and the corresponding keyword vectors to obtain the code vector knowledge base.

[0013] Based on the same inventive concept, the present application further provides a configuration system for a network configuration text, applied to a configuration system. The configuration system includes an identification agent, a planning agent, a retrieval agent, and an encoding agent. The system includes: the identification agent, configured to receive a network configuration text input by a user, and extract keywords from the network configuration text to obtain multiple first keywords; the planning agent, configured to expand each first keyword to obtain a second keyword corresponding to the first keyword; based on the multiple first keywords and the multiple second keywords, composing multiple configuration schemes for the network configuration text; the retrieval agent, configured to determine the first configuration code corresponding to each configuration scheme through a pre-constructed code vector knowledge base; and the encoding agent, configured to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text.

[0014] Based on the same inventive concept, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable by the processor. The processor implements the method as described above when executing the computer program.

[0015] As can be seen from the above, for the configuration method, system and electronic device of the network configuration text provided by this application, the method includes using the recognition agent to receive the network configuration text input by the user, and extracting keywords from the network configuration text to obtain multiple first keywords, achieving the purpose of accurately extracting the specific intention that the user wants to achieve. For each first keyword, using the planning agent to expand the first keyword to obtain a second keyword corresponding to the first keyword, ensuring that the first keyword is richer on the basis of understanding the user's intention. Based on multiple first keywords and multiple second keywords, multiple configuration schemes of the network configuration text are formed, making the configuration method of the network configuration text diversified. Through the pre-constructed code vector knowledge base, using the retrieval agent to determine the first configuration code corresponding to each configuration scheme, making the determined first configuration code corresponding to each configuration scheme rich. Using the encoding agent to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text, and being able to screen out the configuration code that most conforms to the network configuration text from all the first configuration codes, improving the configuration accuracy of the network configuration text. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in this application or related technologies, the following will briefly introduce the drawings required for use in the embodiments or related technology descriptions. Obviously, the drawings in the following description are only the embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0017] Figure 1 It is a flowchart of the configuration method of the network configuration text according to the embodiment of this application;

[0018] Figure 2 It is a flowchart of the configuration method of the network configuration text according to another embodiment of this application;

[0019] Figure 3 It is a schematic structural diagram of the configuration system of the network configuration text according to the embodiment of this application;

[0020] Figure 4 It is a schematic diagram of the hardware structure of the electronic device according to the embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0021] To make the purpose, technical solutions and advantages of this application clearer, the following will further describe this application in detail with reference to specific embodiments and the accompanying drawings.

[0022] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of this application should have the ordinary meanings understood by those with ordinary skills in the field to which this application belongs. The "first", "second" and similar words used in the embodiments of this application do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "including" or "comprising" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connected" or "linked" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right", etc. are only used to represent relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.

[0023] As described in the background art section, in the network configuration generation task, network routing and network construction are the core parts. In terms of network routing, network routing is like a traffic command system and is the key to realizing different network communications, involving various routing protocol configurations. For example, static routing configured manually is suitable for simple and stable networks, and there are also dynamic routing protocols such as RIP that determines the path by calculating the number of hops and OSPF that can calculate the shortest path more accurately for complex networks. Routing configuration also includes adjusting strategies to optimize performance, such as configuring routing priorities to ensure the priority transmission of important service data, using access control lists for routing filtering to ensure network security and prevent illegal intrusion. When the network expands, reasonably configuring dynamic routing protocols is conducive to the addition of new nodes, and configuring VPN routing can ensure the secure access of remote users to the enterprise internal network. In terms of network construction, first, the topological structure needs to be planned. For example, the star topology is often adopted for campus networks for easy management and maintenance. Devices such as routers, switches, firewalls, and wireless access points need to be selected and correctly connected according to the network scale, functional requirements, budget, etc. Enterprise networks may need to consider device redundancy to improve reliability. At the same time, network construction includes network address allocation, determining information such as IP addresses, subnet masks, gateways, etc., and dividing VLANs to divide the physical network into logical networks, enhancing security, reducing the impact of broadcast storms, and facilitating management. Communication between different VLANs needs to be forwarded through three-layer devices.

[0024] In the prior art, network configuration has gradually developed into automated configuration. However, the automated method for network location usually relies on static template matching, that is, directly matching keywords in user requirements to obtain configuration codes, lacking flexibility and context awareness capabilities, making it difficult to obtain configuration codes that meet requirements and difficult to handle complex network requirements.

[0025] In view of this, the embodiments of this application propose a configuration method for network configuration texts, referring to Figure 1, applied to a configuration system, the configuration system includes an identification agent, a planning agent, a retrieval agent, and an encoding agent, and the method includes the following steps:

[0026] Step 101, use the identification agent to receive the network configuration text input by the user, and extract keywords from the network configuration text to obtain a plurality of first keywords.

[0027] In this step, when the user has a network configuration requirement, the user inputs the network configuration text to the configuration system. Exemplarily, the network configuration text can be "I want to build a network environment that can achieve file sharing within the department and ensure secure access, and at the same time support remote work". Use the identification agent to receive the network configuration text input by the user. Among them, the identification agent is the starting link of the entire configuration process, mainly responsible for comprehensively and deeply analyzing and understanding the natural language input by the user. Its core lies in leveraging the powerful language processing ability of the large language model to accurately dig out the true intention hidden behind the user's natural language expression, and optimize the original input content to make it more compliant with the processing requirements of subsequent processes. In order to accurately understand the network text, extract keywords from the network configuration text to obtain a plurality of first keywords. Exemplarily, in the case where the network configuration text is the aforementioned example, the plurality of first keywords include "build a network environment", "file sharing within the department", "secure access", and "support remote work", etc. By extracting keywords from the network configuration text, the purpose of accurately extracting the specific intentions that the user wants to achieve is achieved.

[0028] It should be noted that an intelligent agent (AI Agent), also known as an intelligent proxy or Agent, usually relies on a large language model (LLMs) as its core decision-making and processing unit, and has the ability to think independently and call tools to gradually complete a given goal. An intelligent agent can have various capabilities such as understanding natural language, reasoning, and planning based on the capabilities of the large language model, so as to flexibly complete various language-related tasks. In the scope of the large language model, an intelligent agent is an autonomous and interactive entity. It can perceive the environment, where the environment includes user input, context information, etc., and process the perceived information according to its own strategy and the knowledge it has learned, and then take actions, such as generating text responses. An intelligent agent can have various capabilities such as understanding natural language, reasoning, and planning based on the capabilities of the large language model, so as to flexibly complete various language-related tasks. The intelligent agent has a high degree of autonomy, can make autonomous decisions and actions, significantly improve work efficiency; its powerful learning ability enables it to continuously optimize its behavior to adapt to different task requirements; at the same time, the intelligent agent can also quickly process a large amount of data and provide personalized services to meet the diverse needs of users.

[0029] The configuration system is a system composed of multiple agents. These agents can cooperate with each other. Each agent has its unique function and perspective. They complete complex tasks together through information sharing and coordinated actions. In the configuration system, the interaction methods and cooperation strategies among agents are diverse. For example, some agents are responsible for collecting information, some for analysis, and some for integrating results. Their coordinated cooperation enables the large language model to demonstrate more powerful and efficient processing capabilities when facing complex scenarios and diverse requirements, expanding the application potential of the large language model in multi-domain complex tasks.

[0030] In the context of LLMs, the configuration system can be used to simulate complex interaction scenarios, such as dialogue systems, collaborative writing, role-playing games, etc. Each agent can represent different roles or viewpoints, and they solve problems or complete tasks together through dialogue and interaction. This method can improve the flexibility and adaptability of the model, enabling it to better handle complex tasks and diverse user requirements. The configuration system can also be used to enhance the interpretability and transparency of LLMs. By having different agents responsible for different tasks or knowledge domains, the decision-making process of the model can be traced more clearly, improving users' trust in the model output. The configuration system in this application uses multiple types of agents, making network configuration more intelligent.

[0031] Step 102: For each first keyword, use the planning agent to expand the first keyword to obtain a second keyword corresponding to the first keyword.

[0032] In this step, after receiving multiple first keywords processed by the recognition agent, the planning agent starts to play its role. It carefully constructs a dedicated planning scheme based on the clear user intention. The above-mentioned planning scheme mainly focuses on clarifying the keywords to be retrieved. On the basis of understanding the user intention, in order to make the keywords more abundant and thus improve the quality of the subsequent configured code, for each first keyword, the context awareness ability of the planning agent is used to expand the first keyword to obtain a second keyword corresponding to the first keyword. It should be noted that the first keyword is expanded using predetermined qualifiers. Exemplarily, the predetermined qualifiers are "efficient", "safe", "convenient", etc. For example, when the first keyword is "building a network environment", the corresponding second keyword is "efficiently building a network environment" or "safely building a network environment"; when the first keyword is "file sharing within the department", the corresponding second keyword is "efficient file sharing within the department" or "safe file sharing within the department"; when the first keyword is "access security", the corresponding second keyword is "efficient access security"; when the first keyword is "supporting remote work", the corresponding second keyword is "efficiently supporting remote work" or "safely supporting remote work" or "conveniently supporting remote work", etc. It should also be noted that in response to determining that all the keywords in the pre-constructed code vector knowledge base exist in the predetermined vocabulary, based on the predetermined vocabulary, a supplementary operation is performed on the first keyword and the second keyword. Exemplarily, the predetermined vocabulary is "related settings" or "related configurations", and "file sharing within the department" is supplemented to "file sharing within the department related configurations". By expanding the first keyword, it is ensured that on the basis of understanding the user intention, the first keyword becomes more abundant.

[0033] Step 103, based on the multiple first keywords and the multiple second keywords, form multiple configuration schemes of the network configuration text.

[0034] In this step, the planning scheme in the planning agent also focuses on determining the general framework of the configuration scheme and giving multiple (for example, 5) configuration schemes for subsequent reference and selection according to the default rules. Based on multiple first keywords and multiple second keywords, multiple configuration schemes of the network configuration text are formed. Among them, the configuration scheme includes a framework structure. For example, for network environment construction, it may be planned to include framework contents such as network topology structure selection (such as star, bus, etc.), network device selection (such as routers, switches, etc.), security protection mechanisms (such as firewall settings, access control, etc.). On the basis of determining the framework, combined with relevant network knowledge and experience, specific configuration schemes with different focuses or different implementation methods are generated. For example, Scheme 1 may focus on configurations that are simple to use but have slightly lower security, and Scheme 2 may pay more attention to the convenience of remote work on the basis of ensuring a certain level of security. By multiple first keywords and multiple second keywords, multiple configuration schemes of the network configuration text are formed, making the configuration methods of the network configuration text diversified.

[0035] Step 104, through the pre-constructed code vector knowledge base, use the retrieval agent to determine the first configuration code corresponding to each configuration scheme.

[0036] In this step, the main task of the retrieval agent is to search for configuration codes related to the configuration scheme determined by the planning agent in the pre-constructed code vector knowledge base. Among them, the configuration code includes a configuration template and a code snippet. In the prior art, keywords extracted directly from the network configuration text are usually used for retrieval to obtain the configuration code corresponding to the keywords. In this case, the source of the keywords lacks flexibility, making the keywords single, and thus resulting in the singleness of the configuration code corresponding to the keywords. In this application, through the pre-constructed code vector knowledge base, the retrieval agent is used to determine the first configuration code corresponding to each configuration scheme, making the configuration code rich. It should be noted that the code vector knowledge base can be externally connected to an external knowledge base, where the external knowledge base includes knowledge on the Internet. In response to determining that there is no code vector corresponding to the first keyword and / or the second keyword that makes up the configuration scheme in the code vector knowledge base, the code vector corresponding to the above first keyword and / or the code vector corresponding to the above second keyword is retrieved in the external knowledge base externally connected to the code vector knowledge base, and the above first keyword and its corresponding code vector are stored in the code vector knowledge base, and / or the above second keyword and its corresponding code vector are stored in the code vector knowledge base. For example, use the Retrieval-Augmented Generation (RAG) technology to retrieve in the external knowledge base. Multiple configuration schemes can reflect the diversity of the configuration of the network configuration text, making the first configuration code corresponding to each determined configuration scheme rich.

[0037] Step 105: Use the encoding agent to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text.

[0038] In this step, based on the first configuration codes corresponding to each configuration scheme provided by the retrieval agent, the encoding agent integrates all the first configuration codes and is responsible for generating the target configuration code that meets the network configuration requirements. By integrating all the first configuration codes from multiple configuration schemes, the first configuration codes are rich, and the configuration code that best matches the network configuration text can be selected from all the first configuration codes, improving the configuration accuracy of the network configuration text. It should be noted that the obtained target configuration code can be directly sent to network devices such as routers in the form of a yang (Yet Another Next Generation, data modeling language) model to achieve automated and rapid deployment.

[0039] The method for the configuration system in this application to achieve network configuration automation integrates artificial intelligence, natural language processing, network management, and automation technologies, aiming to improve the intelligence level, efficiency, and accuracy of network configuration. The entire process is closely linked, from user intention recognition to target configuration code generation and deployment, achieving full automation and improving the efficiency and accuracy of network configuration. Through the collaborative work of various types of agents in the form of a pipeline, the network configuration task can be completed efficiently and accurately, meeting the diverse needs of users. Through the configuration system, the user's network requirements are automatically configured, reducing manual intervention and improving the configuration efficiency. Exemplarily, through collaborative work, the configuration system constructs a NETCONF YANG file, realizing the full process automation from user intention recognition to configuration code generation, automatically generating the target configuration code that meets the requirements of network devices using a large language model, reducing manual configuration operations, and improving the configuration accuracy. Especially when dealing with complex network environments and requirements, errors and configuration deviations can be reduced.

[0040] This application can be configured by generating and distributing in the form of generating NETCONF (a working group established based on the XML-based network configuration protocol), generating an XML file of NETCONF, and combining it with a Python script to directly distribute the generated target configuration code to network devices such as routers and switches to achieve fully automated configuration. NETCONF is an XML-based network management protocol that can provide programmable network device configuration and management methods. Users can use this to set, obtain parameters, statistical information, etc. Its messages are in XML format, with strong filtering capabilities. The data items have fixed element names and positions, enabling the same access and result presentation methods for different devices of the same manufacturer and devices of different manufacturers through XML mapping, facilitating third-party software development of customized network management software. With the assistance of such software, NETCONF can make the network device configuration management work simpler and more efficient.

[0041] Through the above solution, the recognition agent is used to receive the network configuration text input by the user, and extract keywords from the network configuration text to obtain multiple first keywords, achieving the purpose of accurately extracting the specific intentions that the user wants to achieve. For each first keyword, the planning agent is used to expand the first keyword to obtain a second keyword corresponding to the first keyword, ensuring that the first keyword is more abundant on the basis of understanding the user's intention. Based on multiple first keywords and multiple second keywords, multiple configuration schemes of the network configuration text are formed, making the configuration methods of the network configuration text diversified. Through a pre-constructed code vector knowledge base, the retrieval agent is used to determine the first configuration code corresponding to each configuration scheme, making the determined first configuration code corresponding to each configuration scheme rich. The encoding agent is used to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text, and the configuration code that best matches the network configuration text can be selected from all the first configuration codes, improving the configuration accuracy of the network configuration text.

[0042] In some embodiments, the step of using the retrieval agent to determine the first configuration code corresponding to each configuration scheme through a pre-constructed code vector knowledge base includes: for each configuration scheme, encoding the first keywords and second keywords that make up the configuration scheme respectively to obtain multiple keyword vectors; based on the multiple keyword vectors and the initial weights corresponding to each predetermined retrieval method, performing at least one round of processing operations in the code vector knowledge base to obtain the target weights corresponding to each predetermined retrieval method; based on the multiple keyword vectors and the target weights corresponding to each predetermined retrieval method, performing hybrid retrieval in the code vector knowledge base to obtain a first code vector; and parsing the first code vector to obtain the first configuration code.

[0043] In this embodiment, since the keywords stored in the code vector knowledge base exist in the form of vectors, before retrieving the first keyword and the second keyword in the code vector knowledge base by using the composition configuration scheme, it is necessary to perform encoding processing on the first keyword and the second keyword to obtain multiple keyword vectors. A single retrieval method has limitations and cannot combine the advantages of multiple retrieval methods, which may lead to inaccurate retrieval results in the code vector knowledge base. To eliminate the above problems, this embodiment uses multiple predetermined retrieval methods to perform retrieval in the code vector knowledge base, thus integrating the advantages of multiple predetermined retrieval methods. Exemplarily, the multiple predetermined retrieval methods are sparse retrieval and dense retrieval. Among them, sparse retrieval features efficient processing of large-scale data. By focusing on key features rather than comprehensive analysis, it significantly improves the computational efficiency. When dealing with sparse data containing a large number of zero elements, sparse retrieval can simplify the operation complexity and achieve fast and accurate retrieval results, which is particularly suitable for information search tasks in modern big data environments. The advantage of dense retrieval is that it can capture the deep semantic information of the text and improve the relevance of the retrieval. By converting the text into a continuous vector representation in a high-dimensional space and using vector similarity to retrieve relevant documents, it is applicable to scenarios that require understanding complex semantics, such as natural language understanding and intelligent question-answering systems. For example, sparse retrieval can be specifically BM25 (Best Matching 25); dense retrieval can be specifically BGE-M3 (BAAI General Embedding-Multi-Linguality3).

[0044] To determine the retrieval participation ratio of each predetermined retrieval method, it is necessary to determine the target weight corresponding to each predetermined retrieval method. For each configuration scheme, based on multiple keyword vectors and the initial weight corresponding to each predetermined retrieval method, at least one round of processing operations is performed in the code vector knowledge base to obtain the target weight corresponding to each predetermined retrieval method, where the initial weight is determined according to historical experience. After obtaining the target weight corresponding to each predetermined retrieval method, based on multiple keyword vectors and the target weight corresponding to each predetermined retrieval method, hybrid retrieval is performed in the code vector knowledge base to obtain the first code vector. Exemplarily, according to the determined target weight, sparse retrieval and dense retrieval are simultaneously started in the constructed code vector knowledge base. For sparse retrieval, according to its established algorithms and rules, keyword matching and other methods are used to retrieve the vector data in the code vector knowledge base; for dense retrieval, the characteristics of its vector space model are used to perform similarity matching retrieval on the vector data in the code vector knowledge base. Since the configuration codes stored in the code vector knowledge base exist in an encoded form, to ensure the usability of the retrieval results, it is also necessary to parse the first code vector to obtain the first configuration code.

[0045] By determining the weights of each predetermined retrieval method, an optimal retrieval effect is achieved. A flexible weight allocation strategy can ensure that relevant code vectors can be quickly and accurately found under different network configuration scenarios, providing strong support for obtaining the target configuration code corresponding to the network configuration text. When retrieving code vectors, some seemingly reasonable but actually incorrect outputs may occur, that is, the hallucination problem. By enhancing the retrieval algorithm, the hallucination problem during code vector retrieval is reduced, and the accuracy of retrieved code vectors is improved.

[0046] In some embodiments, based on the multiple keyword vectors and the initial weights corresponding to each predetermined retrieval method, at least one round of processing operations is performed in the code vector knowledge base to obtain the target weights corresponding to each predetermined retrieval method, including: Each round of processing operations is performed as follows: In response to determining that the cumulative time of the executed processing operations is less than a predetermined cumulative time, based on the multiple keyword vectors and the initial weights corresponding to each predetermined retrieval method, a hybrid retrieval is performed in the code vector knowledge base to obtain a second code vector corresponding to the configuration scheme; The second code vector is parsed to obtain a second configuration code; Based on the network configuration text and the second configuration code, a retrieval adjustment factor corresponding to each predetermined retrieval method is calculated; For each predetermined retrieval method, the initial weight is adjusted using the retrieval adjustment factor, and the adjusted initial weight is used as the initial weight for the next round of processing operations; In response to determining that the cumulative time of the executed processing operations is greater than or equal to the predetermined cumulative time, exit at least one round of processing operations, and determine the adjusted initial weight obtained in the previous round of processing operations as the target weight.

[0047] In this embodiment, there is a time limit for determining the target weights corresponding to each predetermined retrieval method. In the case where it is determined that the cumulative time of the executed processing operations is less than the predetermined cumulative time, it means that the time limit has not been reached, and the weights of each predetermined retrieval method can still be dynamically determined. Based on the multiple keyword vectors and the initial weights corresponding to each predetermined retrieval method, a hybrid retrieval is performed in the code vector knowledge base to obtain a second code vector corresponding to the configuration scheme. The second code vector is parsed to obtain a second configuration code. The dynamic weight allocation algorithm adjusts the weights according to the quality score of each retrieval result. Based on the network configuration text and the second configuration code, a retrieval adjustment factor is calculated, and the initial weights corresponding to each predetermined retrieval method are adjusted using the retrieval adjustment factor, and the adjusted initial weights are used as the initial weights for the next round of processing operations. Multiplying the retrieval adjustment factor corresponding to each predetermined retrieval method by the corresponding initial weight can achieve the adjustment of the initial weights corresponding to each predetermined retrieval method.

[0048] Exemplarily, in the case where multiple predetermined retrieval methods are sparse retrieval and dense retrieval, the initial weight of the sparse retrieval is adjusted by the following formula:

[0049] w1′ = w1 × adjustment_factor1,

[0050] where w1′ is the adjusted initial weight of the sparse retrieval, w1 is the initial weight of the sparse retrieval, and adjustment_factor1 is the retrieval adjustment factor of the sparse retrieval.

[0051] The initial weight of the dense retrieval is adjusted by the following formula:

[0052] w2′ = w2 × adjustment_factor2,

[0053] where w2' is the adjusted initial weight of the dense retrieval, w2 is the initial weight of the dense retrieval, and adjustment_factor2 is the retrieval adjustment factor of the dense retrieval.

[0054] The retrieval agent dynamically adjusts the weight ratio of the sparse retrieval BM25 and the dense retrieval bge - m3 according to the relevance and quality of the retrieval results. For example, if the quality of the retrieval results of BM25 is high, the retrieval agent increases the weight of BM25; conversely, if the quality of the retrieval results of bge - m3 is high, it increases the weight of bge - m3.

[0055] In the case where it is determined that the cumulative time of the executed processing operations is greater than or equal to the predetermined cumulative time, it indicates that the time limit is reached, and the weights of each predetermined retrieval method cannot be dynamically determined continuously. Exit at least one round of processing operations, and determine the adjusted initial weight obtained from the previous round of processing operations as the target weight. In this embodiment, the weights of multiple predetermined retrieval methods are dynamically adjusted to obtain the target weights of multiple predetermined retrieval methods, ensuring the accuracy of the retrieval participation ratio of multiple predetermined retrieval methods.

[0056] It should be noted that in order to avoid excessive scale differences between the target weights, the target weights can be normalized to make the target weights reasonable. In the case where multiple predetermined retrieval methods are sparse retrieval and dense retrieval, the target weight of the sparse retrieval is normalized by the following formula:

[0057]

[0058] where, w1 " is the target weight of the sparse retrieval;

[0059] The target weight of the dense retrieval is normalized by the following formula:

[0060]

[0061] Among them, w2 " is the target weight for dense retrieval.

[0062] In some embodiments, calculating a retrieval adjustment factor corresponding to each predetermined retrieval method based on the network configuration text and the second configuration code includes: calculating a correlation score between the network configuration text and the second configuration code, and calculating a semantic similarity score between the network configuration text and the second configuration code; calculating a retrieval adjustment factor corresponding to each predetermined retrieval method based on the correlation score and the semantic similarity score.

[0063] In this embodiment, the network configuration text can directly reflect the user's intention for network configuration. The network configuration text corresponds to multiple configuration codes. By calculating the correlation between the network configuration text and the second configuration code, the degree of relevance between the second configuration code and the network configuration text can be obtained. Therefore, it is necessary to calculate the correlation score between the network configuration text and the second configuration code. It is also necessary to calculate the semantic similarity score between the network configuration text and the second configuration code, which can obtain the degree of similarity between the second configuration code and the network configuration text. Based on the correlation score and the semantic similarity score, calculate the retrieval adjustment factor corresponding to each predetermined retrieval method. By determining the degree of relevance and the degree of similarity between the second configuration code and the network configuration text, calculate the retrieval adjustment factor corresponding to each predetermined retrieval method. Numeralizing the above-mentioned degree of relevance and degree of similarity accurately reflects the above-mentioned degree of relevance and degree of similarity, and then using the numeralized degree of relevance and degree of similarity to calculate the retrieval adjustment factor also ensures the accuracy of the retrieval adjustment factor.

[0064] Exemplarily, in the case where the multiple predetermined retrieval methods are sparse retrieval and dense retrieval, use a sparse model (such as BM25) to score each retrieval result, and obtain the correlation score score_relevance through the following formula:

[0065] score_relevance = BM25(query, document),

[0066] where BM25 is the scoring function of BM25, query is the network configuration text, and document is the second configuration code.

[0067] Use a semantic similarity model (such as bge-m3) to score each retrieval result, and obtain the semantic similarity score score_semantic through the following formula:

[0068] score_semantic

[0069] = cosine_similarity(embedding_query, embedding_document)

[0070] where cosine_similarity is the cosine similarity function, embedding_query is the embedded representation of the network configuration text, and embedding_document is the embedded representation of the second configuration code.

[0071] Calculate the retrieval adjustment factor djustmen_factor1 for sparse retrieval through the following formula:

[0072]

[0073] Calculate the retrieval adjustment factor djustmen_factor2 for dense retrieval through the following formula:

[0074]

[0075] In some embodiments, the keyword extraction of the network configuration text by the recognition agent includes: parsing the network configuration text by the recognition agent to obtain a plurality of initial keywords; and performing a correction operation on each initial keyword by the recognition agent to obtain the plurality of keywords.

[0076] In this embodiment, the recognition agent passes the received network configuration text input by the user to the large language model, and uses the semantic understanding, text analysis and other functions of the large language model to parse the network configuration text to identify a plurality of initial keywords. Correct the plurality of initial keywords, where the above corrections include optimization operations such as cleaning and standardization. For example, remove some redundant expressions, correct possible typos or non-standard terms, etc., to make the content clearer and more accurate for subsequent agent processing. The user interacts with the configuration system through natural language to propose network configuration requirements. The main task of the user intention recognition agent is to perform semantic analysis and intention recognition on the network configuration text input by the user, and refine the specific configuration requirements of the user. The recognition agent first parses the input natural language to identify keywords, parameters, and network architectures related to network configuration (such as network topology, routing protocol, interface settings, etc.). In addition, the recognition agent is also responsible for further optimizing and rewriting the content input by the user to ensure that the user input can fully and accurately express the requirements, and provide clear guidance for subsequent retrieval and code generation steps. The recognition agent accurately identifies and analyzes the user's network configuration requirements through natural language processing technology, and converts the user's requirement information into structured data to provide accurate requirement input for subsequent agents.

[0077] In some embodiments, the various configuration schemes for composing the network configuration text based on a plurality of first keywords and a plurality of second keywords include: respectively replacing each first keyword in the plurality of first keywords with its corresponding second keyword to generate a plurality of configuration schemes.

[0078] In this embodiment, based on user intent recognition, the planning agent constructs a plurality of plans for the user input of the network configuration task. Specifically, according to the information provided by the user intent recognition agent, the planning agent analyzes and disassembles the network configuration task to determine the key information to be retrieved and the possible configuration scheme frameworks. Respectively replace each first keyword in the plurality of first keywords with its corresponding second keyword to generate a plurality of configuration schemes. Exemplarily, when the plurality of first keywords include "build a network environment", "file sharing within the department", "access security", and "support remote work", and the "build a network environment" in the plurality of first keywords is replaced with the second keyword "efficiently build a network environment", then the keywords in one of the configuration schemes are "efficiently build a network environment", "file sharing within the department", "access security", and "support remote work". In this process, a plurality of possible configuration schemes are given by means of expanding the query, improving the accuracy and pertinence of the plan.

[0079] In some embodiments, the utilization of the encoding agent to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text includes: summarizing and screening all the first configuration codes according to the predetermined requirements corresponding to the network configuration text; performing syntax correction and logic improvement on the first configuration codes obtained after the summarizing and screening according to the predetermined programming specifications to obtain the target configuration code.

[0080] In this embodiment, the coding agent uses all the first configuration codes provided by the retrieval agent as the basic material and is responsible for summarizing and screening the first configuration codes. According to the predetermined requirements corresponding to the network configuration text, all the first configuration codes are summarized and screened, wherein the predetermined requirements are the configuration requirements input by the user. For example, if a network environment is to be built, codes involving network device initialization, IP address allocation, security settings, etc. may be generated. Among all the first configuration codes, the codes that best meet the user's needs are screened to ensure the accuracy of the first configuration codes obtained through summary and screening. And after the first configuration codes are obtained through summary and screening, according to the predetermined programming specifications, the coding agent performs grammatical correction and logical improvement on the generated configuration codes. Using the grammatical checking tool or special code checking software that comes with the programming language, a comprehensive grammatical check is performed on the first configuration codes obtained through summary and screening to find and correct possible grammatical errors, such as undefined variables, incorrect statement formats, etc. After the grammatical check is correct, the logical structure of the first configuration code obtained through summary and screening is deeply analyzed and improved. Ensure that the first configuration code obtained through summary and screening can operate in the expected logical order during execution, ensure that the configuration order of the network equipment is correct, the effective conditions of the security settings are reasonable, etc., so that the logic of the first configuration code obtained through summary and screening is more rigorous and clear. Based on all the first configuration codes (for example, xml files), combined with the predetermined requirements and predetermined programming specifications of the network configuration, combined with the corresponding programming language (such as Python), a complete target configuration code is obtained, ensuring that the quality of the target configuration code finally generated reaches a high level and can meet the actual network configuration application requirements.

[0081] For example, if the user's needs involve the configuration of multiple routers, the coding agent will check whether the generated code complies with the specifications of the routing protocol and whether it satisfies the topological relationship between devices. In addition, the coding agent will further optimize the code according to the specific scenarios of the user's needs (such as high availability, fault tolerance, etc.). Use the code output tool to build the target configuration code into a local configuration file, and use an efficient file writing tool to output the target configuration code to the corresponding configuration file. The coding agent supports multiple file formats, such as XML, Python, etc., to meet the needs of different network devices. At the same time, the automatic distribution and deployment of the configuration code is realized, which improves the efficiency of network configuration.

[0082] In some embodiments, the configuration system further includes a large language model; the method for constructing the code vector knowledge base includes: obtaining code documents of multiple network configuration texts, and segmenting each code document to obtain multiple segments of initial configuration codes and keywords corresponding to each segment of the initial configuration codes; using the large language model to perform semantic enhancement on the initial configuration codes to obtain configuration codes; encoding the configuration codes to obtain code vectors, and encoding the keywords corresponding to the configuration codes to obtain keyword vectors; associatively storing the code vectors corresponding to the configuration codes and the corresponding keyword vectors to obtain the code vector knowledge base.

[0083] In this embodiment, the code vector knowledge base is mainly responsible for comprehensively and deeply analyzing and understanding the code documents of multiple network configuration texts (such as xml files). The core lies in leveraging the powerful semantic processing ability of the large language model to accurately extract the hidden semantic information in the code documents and optimize the original data to make it more compliant with the requirements of subsequent retrieval and configuration generation processes.

[0084] To construct the vector knowledge base, first, data source preparation is required, collecting code documents of network configuration texts such as NETCONF YANG API documents. Then, a context-based segmentation method is used to perform structured segmentation on the code documents to obtain multiple segments of initial configuration codes and keywords corresponding to each segment of the initial configuration codes. When segmenting, full consideration is given to tags, attribute structures, and context semantics to maintain the structural semantic integrity of the segmented text blocks and reasonably divide relevant configuration elements. At the same time, the xml files of NETCONF are optimized through the context-based segmentation method. During the optimization process, rich semantic information is retained, improving the accuracy and efficiency of retrieval. In this way, multiple code segments can be merged into a complete code segment without losing semantic information. The precision of retrieval is improved, and the hallucinations of the large model are eliminated.

[0085] Subsequently, the segmented multiple initial configuration codes are transmitted to the large language model and parsed by leveraging the semantic understanding and text analysis capabilities of the large language model. The large language model will identify key information and perform semantic enhancement, such as strengthening the context semantics of text blocks to more accurately match user needs during retrieval. By analyzing the multiple initial configuration codes, the large language model identifies key information and enhances its semantics. For example, enhancing the context semantics of the initial configuration codes enables them to more precisely match user needs during retrieval. In addition, based on the large language model and related technologies, the configuration system can adapt to the rapidly updated code vector knowledge base and maintain the efficiency of retrieval. Finally, the configuration codes and their corresponding keywords are converted into vector representations. The configuration codes are encoded to obtain code vectors, and the keywords corresponding to the configuration codes are encoded to obtain keyword vectors. The code vectors corresponding to the configuration codes and the corresponding keyword vectors are associated and stored to obtain a code vector knowledge base. In this way, the configuration system not only retains the structural information of the code documents but also enhances their semantic information, making the matching with user needs during retrieval more accurate and efficient. At the same time, this code vector knowledge base is specially optimized. It is made by optimizing data files using a context understanding segmentation method, aiming to further improve the accuracy of retrieval.

[0086] In another embodiment provided by the present application, as Figure 2 shown, the configuration system includes an identification agent, a planning agent, a retrieval agent, an encoding agent, and a large language model. The identification agent is used to receive the network configuration text input by the user and extract keywords from the network configuration text to obtain multiple first keywords. For each first keyword, the planning agent is used to expand the first keyword to obtain a second keyword corresponding to the first keyword. Based on the multiple first keywords and the multiple second keywords, multiple configuration schemes of the network configuration text are formed. Through the pre-constructed code vector knowledge base, the retrieval agent determines the first configuration code corresponding to each configuration scheme through a retrieval method. The encoding agent is used to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text. The method for constructing the code vector knowledge base includes: obtaining the code documents of multiple network configuration texts, performing context text segmentation on each code document to obtain multiple initial configuration codes and the keywords corresponding to each initial configuration code; using the large language model to perform semantic enhancement on the initial configuration codes to obtain configuration codes; encoding the configuration codes to obtain code vectors, and encoding the keywords corresponding to the configuration codes to obtain keyword vectors; associating and storing the code vectors corresponding to the configuration codes and the corresponding keyword vectors to obtain a code vector knowledge base.

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

[0088] It should be noted that some embodiments of the present application have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order than in the above embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0089] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application also provides a configuration system for network configuration text.

[0090] Reference Figure 3 , the configuration system for network configuration text is applied to a configuration system, the configuration system includes an identification agent, a planning agent, a retrieval agent, and an encoding agent, and the system includes:

[0091] The identification agent 10 is configured to receive the network configuration text input by the user and extract keywords from the network configuration text to obtain a plurality of first keywords.

[0092] The planning agent 20 is configured to expand each first keyword to obtain a second keyword corresponding to the first keyword; based on the plurality of first keywords and the plurality of second keywords, form multiple configuration schemes of the network configuration text.

[0093] The retrieval agent 30 is configured to determine a first configuration code corresponding to each configuration scheme through a pre-constructed code vector knowledge base.

[0094] The encoding agent 40 is configured to integrate all the first configuration codes to obtain a target configuration code corresponding to the network configuration text.

[0095] Through the above system, the recognition agent is used to receive the network configuration text input by the user, extract keywords from the network configuration text, and obtain a plurality of first keywords, achieving the purpose of accurately extracting the specific intentions that the user wants to achieve. For each first keyword, the planning agent is used to expand the first keyword to obtain a second keyword corresponding to the first keyword, ensuring that the first keyword is more abundant on the basis of understanding the user's intention. Based on the plurality of first keywords and the plurality of second keywords, various configuration schemes of the network configuration text are formed, making the configuration methods of the network configuration text diversified. Through the pre-constructed code vector knowledge base, the retrieval agent is used to determine the first configuration code corresponding to each configuration scheme, making the determined first configuration code corresponding to each configuration scheme rich. The encoding agent is used to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text, and the configuration code that best matches the network configuration text can be selected from all the first configuration codes, improving the configuration accuracy of the network configuration text.

[0096] In some embodiments, the retrieval agent 30 is further configured to, for each configuration scheme, encode the first keyword and the second keyword that make up the configuration scheme respectively to obtain a plurality of keyword vectors; based on the plurality of keyword vectors and the initial weight corresponding to each predetermined retrieval method, perform at least one round of processing operations in the code vector knowledge base to obtain the target weight corresponding to each predetermined retrieval method; based on the plurality of keyword vectors and the target weight corresponding to each predetermined retrieval method, perform a hybrid retrieval in the code vector knowledge base to obtain a first code vector; and parse the first code vector to obtain the first configuration code.

[0097] In some embodiments, each round of processing operation performed by the retrieval agent 30 is as follows: in response to determining that the cumulative time of the executed processing operation is less than a predetermined cumulative time, perform a hybrid retrieval in the code vector knowledge base based on the plurality of keyword vectors and the initial weight corresponding to each predetermined retrieval method to obtain a second code vector corresponding to the configuration scheme; parse the second code vector to obtain a second configuration code; calculate a retrieval adjustment factor corresponding to each predetermined retrieval method based on the network configuration text and the second configuration code; for each predetermined retrieval method, use the retrieval adjustment factor to adjust the initial weight, and use the adjusted initial weight as the initial weight for the next round of processing operation; in response to determining that the cumulative time of the executed processing operation is greater than or equal to the predetermined cumulative time, exit at least one round of processing operation, and determine the adjusted initial weight obtained in the previous round of processing operation as the target weight.

[0098] In some embodiments, the retrieval agent 30 is further configured to calculate a correlation score between the network configuration text and the second configuration code, and calculate a semantic similarity score between the network configuration text and the second configuration code; based on the correlation score and the semantic similarity score, calculate a retrieval adjustment factor corresponding to each predetermined retrieval method.

[0099] In some embodiments, the recognition agent 10 is further configured to parse the network configuration text to obtain a plurality of initial keywords; remove redundant information from each initial keyword to obtain the plurality of keywords.

[0100] In some embodiments, the planning agent 20 is further configured to replace each of the plurality of first keywords with a corresponding second keyword to generate a plurality of configuration schemes.

[0101] In some embodiments, the encoding agent 40 is further configured to summarize and screen all the first configuration codes according to the predetermined requirements corresponding to the network configuration text; according to the predetermined programming specifications, perform syntax correction and logic improvement on the first configuration codes obtained through the summarization and screening to obtain the target configuration code.

[0102] In some embodiments, the configuration system further includes a large language model; the configuration system is further configured to obtain code documents of a plurality of network configuration texts, and segment each code document to obtain multiple segments of initial configuration codes and keywords corresponding to each segment of the initial configuration codes; the large language model is configured to semantically enhance the initial configuration codes to obtain configuration codes; the configuration system is further configured to encode the configuration codes to obtain code vectors, and encode the keywords corresponding to the configuration codes to obtain keyword vectors; associate and store the code vectors corresponding to the configuration codes and the corresponding keyword vectors to obtain the code vector knowledge base.

[0103] For the convenience of description, when describing the above system, various modules are described separately according to their functions. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0104] The system of the above embodiments is used to implement the configuration method of the corresponding network configuration text in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated herein.

[0105] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the configuration method of the network configuration text as described in any of the above embodiments.

[0106] Figure 4 FIG. shows a more specific schematic diagram of the hardware structure of the electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. Among them, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other inside the device through the bus 1050.

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

[0108] The memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0109] The input / output interface 1030 is used to connect to an input / output module to implement information input and output. The input / output module may be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0110] The communication interface 1040 is used to connect to a communication module (not shown in the figure) to implement communication interaction between this device and other devices. Among them, the communication module may implement communication in a wired manner (such as USB, network cable, etc.) or in a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).

[0111] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0112] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solution of the embodiments of this specification, and does not necessarily include all the components shown in the figure.

[0113] The electronic device of the above embodiment is used to implement the configuration method of the corresponding network configuration text in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.

[0114] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the configuration method of the network configuration text as described in any of the foregoing embodiments.

[0115] 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. The 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, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette tapes, magnetic disk storage, or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0116] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the configuration method of the network configuration text as described in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.

[0117] Based on the same concept, corresponding to the method of any of the above embodiments, the present application also provides a computer program product including computer program instructions, which when running on a computer, cause the computer to execute the configuration method of the network configuration text as described in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.

[0118] It should be noted that the embodiments of the present application can also be further described in the following ways:

[0119] It is understood that before using the technical solutions of the various embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.

[0120] For example, when responding to receiving an active request from the user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application program, server, or storage medium that executes the operation of the technical solution of the present disclosure according to the prompt message.

[0121] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving an active request from the user can be, for example, in the form of a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0122] It is understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not limit the implementation manner of the present disclosure, and other manners that meet relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0123] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present application is limited to these examples; under the idea of the present application, the technical features between the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present application as described above, and they are not provided in detail for the sake of brevity.

[0124] In addition, for the sake of simplicity of description and discussion, and in order not to make the embodiments of the present application difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. In addition, the system can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation manner of these block diagram systems are highly dependent on the platform on which the embodiments of the present application will be implemented (that is, these details should be completely within the understanding of those skilled in the art). In the case where specific details (such as circuits) are set forth to describe the exemplary embodiments of the present application, it will be apparent to those skilled in the art that the embodiments of the present application can be implemented without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0125] Although the present application has been described in connection with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0126] Embodiments of the present application are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the present application. Accordingly, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included within the protection scope of the present application.

Claims

1. A method for configuring a network configuration text, characterized in that: Applied to a configuration system, the configuration system includes an identification agent, a planning agent, a retrieval agent and an encoding agent, the method includes: Using the recognition agent to receive the network configuration text input by the user, and extracting keywords from the network configuration text to obtain a plurality of first keywords; For each first keyword, using the planning agent to expand the first keyword to obtain a second keyword corresponding to the first keyword; Based on the plurality of first keywords and the plurality of second keywords, a plurality of configuration schemes of the network configuration text are composed; Determine the first configuration code corresponding to each configuration scheme by using the retrieval agent through a pre-built code vector knowledge base; The coding agent is used to integrate all first configuration codes to obtain a target configuration code corresponding to the network configuration text.

2. The method according to claim 1, characterized in that The method of determining the first configuration code corresponding to each configuration scheme by using the pre-built code vector knowledge base and the retrieval agent includes: For each configuration scheme, respectively encode the first keyword and the second keyword constituting the configuration scheme to obtain a plurality of keyword vectors; Based on the multiple keyword vectors and the initial weights corresponding to each predetermined search method, performing at least one round of processing operations in the code vector knowledge base to obtain a target weight corresponding to each predetermined search method; Based on the multiple keyword vectors and the target weight corresponding to each predetermined search method, a hybrid search is performed in the code vector knowledge base to obtain a first code vector; The first code vector is parsed to obtain the first configuration code.

3. The method according to claim 2, characterized in that The performing at least one round of processing operation in the code vector knowledge base based on the multiple keyword vectors and the initial weights corresponding to each predetermined search method to obtain a target weight corresponding to each predetermined search method includes: Each round of processing is performed as follows: In response to determining that the cumulative time of the executed processing operation is less than the predetermined cumulative time, performing a hybrid search in the code vector knowledge base based on the multiple keyword vectors and the initial weights corresponding to each predetermined search method to obtain a second code vector corresponding to the configuration scheme; Parsing the second code vector to obtain a second configuration code; Calculating a search adjustment factor corresponding to each predetermined search method based on the network configuration text and the second configuration code; For each predetermined search method, the initial weight is adjusted using the search adjustment factor, and the adjusted initial weight is used as the initial weight for the next round of processing operations; In response to determining that the accumulated time of the executed processing operations is greater than or equal to the predetermined accumulated time, at least one round of processing operations is exited, and the adjusted initial weight obtained in the previous round of processing operations is determined as the target weight.

4. The method according to claim 3, characterized in that The calculating, based on the network configuration text and the second configuration code, a retrieval adjustment factor corresponding to each predetermined retrieval method comprises: Calculating a relevance score between the network configuration text and the second configuration code, and calculating a semantic similarity score between the network configuration text and the second configuration code; Based on the relevance score and the semantic similarity score, a retrieval adjustment factor corresponding to each predetermined retrieval method is calculated.

5. The method according to claim 1, characterized in that The method of using the recognition agent to extract keywords from the network configuration text obtains a plurality of keywords, including: Utilizing the recognition agent to parse the network configuration text to obtain a plurality of initial keywords; The recognition agent is used to perform a correction operation on each initial keyword to obtain the multiple keywords.

6. The method according to claim 1, characterized in that The multiple configuration schemes constituting the network configuration text based on the multiple first keywords and the multiple second keywords include: Each of the plurality of first keywords is replaced with a second keyword corresponding thereto to generate a plurality of configuration schemes.

7. The method according to claim 1, characterized in that The step of integrating all first configuration codes using the coding agent to obtain a target configuration code corresponding to the network configuration text includes: Summarize and filter all first configuration codes according to predetermined requirements corresponding to the network configuration text; According to a predetermined programming specification, the first configuration code obtained through the summary and screening is subjected to syntax correction and logic improvement to obtain the target configuration code.

8. The method according to claim 1, characterized in that The configuration system also includes a large language model; The method for constructing the code vector knowledge base includes: Obtain code documents of multiple network configuration texts, and segment each code document to obtain multiple sections of initial configuration code and keywords corresponding to each section of the initial configuration code; Using the large language model to semantically enhance the initial configuration code to obtain a configuration code; Encoding the configuration code to obtain a code vector, and encoding a keyword corresponding to the configuration code to obtain a keyword vector; The code vector corresponding to the configuration code and the corresponding keyword vector are associated and stored to obtain the code vector knowledge base.

9. A configuration system for a network configuration text, characterized in that: Applied to a configuration system, the configuration system includes an identification agent, a planning agent, a retrieval agent and an encoding agent, the system includes: The recognition agent is used to receive a network configuration text input by a user, and extract keywords from the network configuration text to obtain a plurality of first keywords; The planning agent is used to expand each first keyword to obtain a second keyword corresponding to the first keyword; and to form multiple configuration schemes of the network configuration text based on multiple first keywords and multiple second keywords; The retrieval agent is used to determine the first configuration code corresponding to each configuration scheme through a pre-built code vector knowledge base; The coding agent is used to integrate all the first configuration codes to obtain the target configuration code corresponding to the network configuration text.

10. 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, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Content generation method and device based on keyword semantics and electronic equipment

    CN120910231A