Configuration instruction generation method and device, computer device, storage medium and program product

CN123020358APending Publication Date: 2026-10-30CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611312709.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

但是,静态规则是预先设置好的,在匹配过程中容易出现误判、漏判,且难以真正理解配置需求,导致生成的IP配置指令的准确性较低,最终导致IP配置指令生成准确率较低

Benefits of technology

[0056]上述配置指令生成方法、装置、计算机设备、计算机可读存储介质和计算机程序产品,先获取IP配置指令生成需求信息,接着基于IP配置指令生成需求信息的指令生成意图,生成对应的提示词,并对提示词进行转换处理,得到IP配置指令生成需求信息对应的提问内容;提问内容用于表征与预先训练的IP配置指令生成模型适配的目标提示词,最后将提问内容输入预先训练的IP配置指令生成模型,得到IP配置指令生成需求信息对应的IP配置指令;预先训练的IP配置指令生成模型通过IP配置指令生成领域的样本数据,对预训练大模型进行微调得到;这样,在生成IP配置指令时,先识别出IP配置指令生成需求信息对应的指令生成意图,再基于指令生成意图生成对应的IP配置指令,有利于真正理解IP配置指令生成需求信息,使得基于意图理解所生成的IP配置指令更贴合IP配置指令生成需求信息,从而提高了IP配置指令生成准确率;而且,在基于指令生成意图生成对应的提示词之后,对提示词进行转换处理,以得到与预先训练的IP配置指令生成模型适配的目标提示词,再借助IP配置指令生成模型输出对应的IP配置指令,由于IP配置指令生成模型是基于IP配置指令生成领域的样本数据,对预训练大模型进行微调得到的,具备较强的IP配置指令生成能力,且目标提示词是与IP配置指令生成模型适配的,能够使得最终生成的IP配置指令更加准确,进一步提高了IP配置指令生成准确率,同时避免了利用静态规则匹配方式所生成的IP配置指令的准确率较低的缺陷。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020358A_ABST
    Figure CN123020358A_ABST
Patent Text Reader

Abstract

The application relates to an IP configuration instruction generation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring IP configuration instruction generation requirement information; generating corresponding prompt words based on the instruction generation intention of the IP configuration instruction generation requirement information; performing conversion processing on the prompt words to obtain question content corresponding to the IP configuration instruction generation requirement information; the question content is used to represent target prompt words adapted to a pre-trained IP configuration instruction generation model; inputting the question content into the pre-trained IP configuration instruction generation model to obtain IP configuration instructions corresponding to the IP configuration instruction generation requirement information; and the pre-trained IP configuration instruction generation model is obtained by fine-tuning a pre-training large model through sample data in an IP configuration instruction generation field. The method can improve the IP configuration instruction generation accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a configuration instruction generation method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] In the field of network communication technology, in order to ensure the normal operation of network devices, it is necessary to configure the network devices first through IP (Internet Protocol) configuration commands.

[0003] In traditional technologies, IP configuration commands are typically generated using static rule matching. For example, based on configuration requirements, preset static rules are matched one by one, and the corresponding IP configuration commands are assembled and output according to the matched rules. However, static rules are pre-set, which can easily lead to misjudgments and omissions during the matching process, and it is difficult to truly understand the configuration requirements, resulting in low accuracy of the generated IP configuration commands and ultimately a low accuracy rate for IP configuration command generation. Summary of the Invention

[0004] Therefore, it is necessary to provide a configuration instruction generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of IP configuration instruction generation in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a method for generating configuration instructions, including:

[0006] Obtain IP configuration instructions to generate required information;

[0007] Based on the IP configuration instructions, generate the instruction generation intent to generate the required information, and generate corresponding prompt words;

[0008] The prompt words are transformed to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to characterize the target prompt words that are adapted to the pre-trained IP configuration instruction generation model.

[0009] The question content is input into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation domain.

[0010] In one embodiment, the step of converting the prompt word to obtain the question content corresponding to the IP configuration instruction generation requirement information includes:

[0011] Obtain the prompt word template of the pre-trained IP configuration instruction generation model;

[0012] According to the prompt word template, the prompt words are converted to obtain the converted target prompt words, which are used as the question content corresponding to the IP configuration instruction generation requirement information.

[0013] In one embodiment, before generating the corresponding prompt word based on the instruction generation intent for generating requirement information based on the IP configuration instruction, the method further includes:

[0014] The IP configuration instruction generation requirement information is preprocessed to obtain preprocessed IP configuration instruction generation requirement information.

[0015] The preprocessed IP configuration instruction generation requirement information is subjected to intent recognition processing to obtain the instruction generation intent.

[0016] In one embodiment, the pre-trained IP configuration instruction generation model is trained in the following manner:

[0017] Obtain sample data from the IP configuration instruction generation domain;

[0018] Based on the sample data, the pre-trained large model is fine-tuned to obtain the fine-tuned large model;

[0019] By supervising the large model based on the multidimensional training index data of the fine-tuned large model, it is determined whether the fine-tuned large model meets the preset capability standard.

[0020] If the fine-tuned large model does not meet the preset capability standard, the fine-tuned large model is used as a new pre-trained large model, and the process jumps to the step of fine-tuning the pre-trained large model according to the sample data to obtain the fine-tuned large model, until the obtained fine-tuned large model meets the preset capability standard.

[0021] The finely tuned large model that meets the preset capability standards will be used as the pre-trained IP configuration instruction generation model.

[0022] In one embodiment, obtaining sample data in the IP configuration instruction generation field includes:

[0023] Obtain the live network configuration file;

[0024] Extract the existing network configuration fragments from the existing network configuration files as raw corpus data, and perform configuration template extraction processing on the existing network configuration files to obtain a configuration template library;

[0025] Based on the original corpus data, corresponding distillation knowledge is generated, and the configuration template corresponding to the target IP configuration instruction in the distillation knowledge is obtained from the configuration template library;

[0026] The distillation knowledge and the configuration template corresponding to the target IP configuration instruction in the distillation knowledge are combined to obtain sample data in the IP configuration instruction generation domain.

[0027] In one embodiment, generating corresponding distillation knowledge based on the original corpus data includes:

[0028] Based on the original corpus data, generate corresponding configuration question-answer pairs;

[0029] The configured question-answer pairs are labeled to obtain labeled configured question-answer pairs, which are used as labeled corpus data;

[0030] Knowledge distillation is performed on the original corpus data and the labeled corpus data to obtain the distilled knowledge.

[0031] In one embodiment, after inputting the question content into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information, the method further includes:

[0032] Construct a virtual environment semantically equivalent to the target live network topology of the IP configuration instructions to be deployed;

[0033] Obtain the simulation environment logs and execution results generated after running the IP configuration command in the virtual environment;

[0034] Based on the IP configuration instructions, the intention behind the instructions, the simulation environment logs, and the execution results, a structured score and improvement suggestions are generated for the IP configuration instructions.

[0035] If the structured score is less than the preset score, the IP configuration command is optimized based on the improvement suggestions to obtain the optimized IP configuration command.

[0036] Secondly, this application also provides a configuration instruction generation apparatus, comprising:

[0037] The information acquisition module is used to acquire IP configuration instructions to generate required information;

[0038] The prompt generation module is used to generate the instruction generation intent based on the IP configuration instruction to generate the required information and generate the corresponding prompt words;

[0039] The prompt conversion module is used to convert the prompt words to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to represent the target prompt words that are adapted to the pre-trained IP configuration instruction generation model.

[0040] The instruction generation module is used to input the question content into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation field.

[0041] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0042] Obtain IP configuration instructions to generate required information;

[0043] Based on the IP configuration instructions, generate the instruction generation intent to generate the required information, and generate corresponding prompt words;

[0044] The prompt words are transformed to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to characterize the target prompt words that are adapted to the pre-trained IP configuration instruction generation model.

[0045] The question content is input into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation domain.

[0046] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0047] Obtain IP configuration instructions to generate required information;

[0048] Based on the IP configuration instructions, generate the instruction generation intent to generate the required information, and generate corresponding prompt words;

[0049] The prompt words are transformed to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to characterize the target prompt words that are adapted to the pre-trained IP configuration instruction generation model.

[0050] The question content is input into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation domain.

[0051] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0052] Obtain IP configuration instructions to generate required information;

[0053] Based on the IP configuration instructions, the instruction generation intent generates the requirement information and generates corresponding prompt words;

[0054] The prompt words are transformed to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to characterize the target prompt words that are adapted to the pre-trained IP configuration instruction generation model.

[0055] The question content is input into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation domain.

[0056] The aforementioned configuration instruction generation method, apparatus, computer device, computer-readable storage medium, and computer program product first acquire IP configuration instruction generation requirement information. Then, based on the instruction generation intent of the IP configuration instruction generation requirement information, corresponding prompt words are generated, and the prompt words are converted to obtain the question content corresponding to the IP configuration instruction generation requirement information. The question content is used to characterize the target prompt words that adapt to a pre-trained IP configuration instruction generation model. Finally, the question content is input into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information. The pre-trained IP configuration instruction generation model is obtained by fine-tuning a pre-trained large model using sample data from the IP configuration instruction generation domain. Thus, when generating IP configuration instructions, the instruction generation intent corresponding to the IP configuration instruction generation requirement information is identified first, and then the corresponding IP configuration instruction is generated based on the instruction generation intent, which is advantageous. By truly understanding the IP configuration command generation requirements, the IP configuration commands generated based on intent understanding are more closely aligned with these requirements, thus improving the accuracy of IP configuration command generation. Furthermore, after generating corresponding prompt words based on the command generation intent, these prompt words are transformed to obtain target prompt words that fit the pre-trained IP configuration command generation model. The corresponding IP configuration command is then output using the IP configuration command generation model. Since the IP configuration command generation model is based on sample data from the IP configuration command generation domain and fine-tuned from a pre-trained large model, it possesses strong IP configuration command generation capabilities. Moreover, the target prompt words are adapted to the IP configuration command generation model, resulting in more accurate final IP configuration commands, further improving the accuracy of IP configuration command generation. This also avoids the lower accuracy of IP configuration commands generated using static rule matching methods. Attached Figure Description

[0057] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0058] Figure 1 This is a flowchart illustrating a configuration instruction generation method in one embodiment;

[0059] Figure 2 A question-and-answer interface diagram of the IP configuration audit assistant in one embodiment;

[0060] Figure 3This is a flowchart illustrating an automatic IP configuration instruction generation method based on intent understanding and fine-tuning of a large model in one embodiment.

[0061] Figure 4 This is a flowchart illustrating the training steps of a pre-trained IP configuration instruction generation model in one embodiment.

[0062] Figure 5 A flowchart illustrating the configuration instruction generation method in another embodiment;

[0063] Figure 6 A structural block diagram of the IP configuration instruction generation architecture in one embodiment;

[0064] Figure 7 This is a structural block diagram of a configuration instruction generation device in one embodiment;

[0065] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0067] In the field of modern network communication technology, with the rapid expansion of network scale and the continuous increase in network architecture complexity, the IP address configuration of network devices has gradually evolved from the early manual static allocation to automated configuration mechanisms. Technologies such as DHCP (Dynamic Host Configuration Protocol) and Zeroconf (Zero-configuration Networking) have alleviated the burden of manual configuration to some extent. However, traditional technologies generally rely on preset rules or template-driven configuration logic, lacking the ability to perceive dynamic changes in the network operating environment, and even more so, failing to understand the true business intent behind configuration requests. For example, when facing scenarios such as multi-tenant virtualization environments, dynamic deployment of edge computing nodes, or heterogeneous access of IoT devices, traditional configuration systems often can only allocate IP addresses based on a fixed pool, making it difficult to comprehensively consider multi-dimensional contextual information such as device type, security policies, traffic patterns, topology location, and service level. This leads to inefficient IP resource configuration and may even cause problems such as address conflicts, policy violations, or service quality degradation. Furthermore, traditional solutions often treat the configuration process as an isolated address distribution task, failing to establish a semantic connection with upper-layer business requirements. This necessitates significant manual intervention and policy tuning by network administrators, severely hindering the development of network automation and intelligence. Therefore, there is an urgent need for an automatic IP configuration command generation method that deeply integrates multi-dimensional context awareness and advanced intent understanding capabilities to achieve truly intelligent, adaptive, and semantically driven network resource configuration.

[0068] Based on this, in order to solve at least one of the above-mentioned technical problems, this application proposes a configuration instruction generation method, specifically an automatic IP configuration instruction generation method based on intent understanding and fine-tuning of a large model, which can be applied to the fields of computer application technology and wireless communication, and can improve the accuracy and efficiency of IP configuration instruction generation.

[0069] To more clearly illustrate the configuration instruction generation method provided in the embodiments of this application, the following are explanations of some terms:

[0070] Large model (Foundation Model): refers to a pre-trained language model with more than 10 billion parameters, which has powerful semantic understanding and reasoning capabilities. In this method, it is responsible for complex configuration semantic parsing and abnormal pattern recognition.

[0071] Lightweight Model: A lightweight model (typically with less than 100 million parameters) optimized for a specific task. In this solution, it is responsible for real-time rule validation and fast response.

[0072] Collaborative reasoning mechanism: Task allocation between large and small models is achieved through a dynamic routing algorithm. Large models handle fuzzy / complex scenarios, while small models perform high-frequency / deterministic tasks.

[0073] In one exemplary embodiment, such as Figure 1 As shown, a configuration instruction generation method is provided. This embodiment illustrates the application of this method to a server; it is understood that this method can also be applied to a terminal, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. This embodiment includes the following steps S101 to S104. Wherein:

[0074] Step S101: Obtain IP configuration instructions to generate required information.

[0075] Among them, IP configuration commands refer to IP protocol parameter configuration commands, which are a type of network device CLI (Command Line Interface) commands used to configure IP layer parameters such as interface IP address, subnet mask, default gateway, and static IP routes.

[0076] The IP configuration command generation request information refers to the information used to request the generation of IP configuration commands. Its format is natural language, such as "Please generate an IP network configuration command for 192.168.3.8887". In practical scenarios, the IP configuration command generation request information can be in question format; see [link to relevant documentation] for details. Figure 2 .

[0077] For example, a user enters IP configuration command generation requirement information in the IP configuration command generation interface of the terminal; the terminal responds to the user's input operation, obtains the IP configuration command generation requirement information entered by the user, and sends the IP configuration command generation requirement information to the corresponding server so that the server can process the IP configuration command generation requirement information.

[0078] For example, see reference. Figure 2 In the Q&A interface of the IP Configuration Audit Assistant, users can enter configuration commands in the input boxes, such as "Please generate an IP network configuration command for 192.168.3.8887" or "Please help me change the IP of the GE0 interface to 192.168.5.10 / 24". The system will match the requirements with prompt words, concatenate them, and use them as questions to ask the fine-tuned audit model. Finally, the corresponding IP configuration command will be generated through the fine-tuned audit model.

[0079] Step S102: Generate the instruction generation intent based on the IP configuration instruction to generate the requirement information, and generate the corresponding prompt words.

[0080] Among them, the instruction generation intent refers to the true intent corresponding to the IP configuration instruction generation requirement information, which is used to characterize the business objective of what kind of IP configuration instructions the user wants to generate.

[0081] The prompt word refers to the organized IP configuration command generation requirement information that carries the intent of the command generation. Specifically, it refers to the initial prompt word, such as "Configure the IP address 192.168.5.10 and subnet mask 255.255.255.0 for the GE0 interface". The organized IP configuration command generation requirement information refers to more formal (i.e., fluent and complete) IP configuration command generation requirement information with a relatively clear intent.

[0082] It should be noted that the IP configuration command generation requirements entered by users are usually in a rather colloquial manner. By combining the command generation intent, the IP configuration command generation requirements can be organized into more formal requirements.

[0083] For example, the server performs text preprocessing on the IP configuration command generation requirement information, such as removing colloquial particles, extra spaces, invalid symbols, garbled characters, and correcting basic typos, to obtain preprocessed IP configuration command generation requirement information. Next, the server uses an intent recognition model (such as the Transformer model) to perform intent recognition processing on the preprocessed IP configuration command generation requirement information to obtain the corresponding command generation intent. Finally, according to the command generation intent, the server organizes the preprocessed IP configuration command generation requirement information, such as standardizing parameter writing formats and streamlining configuration description statements, to obtain organized IP configuration command generation requirement information, which is then used as prompt words.

[0084] Step S103: The prompt words are converted to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to characterize the target prompt words that are adapted to the pre-trained IP configuration instruction generation model.

[0085] The process of converting prompt words refers to transforming them into target prompt words that are compatible with the pre-trained IP configuration instruction generation model. Specifically, it means converting prompt words into question content that the IP configuration instruction generation model can understand, such as format completion, task description, output constraints, and thought chain guidance based on the prompt words.

[0086] The question content refers to the target prompt words adapted to the IP configuration command generation model; the target prompt words refer to the converted prompt words, that is, the prompt words obtained after conversion processing. Their format is structured and includes at least the following: role identity setting information (e.g., you are a network operations expert who is very familiar with the configuration specifications of the device manufacturer: {vendor} and the device type: {device_type}), task objective information (e.g., now please use your professional knowledge to generate accurate and executable IP configuration commands according to user needs), output format constraint information (e.g., please output pure commands according to the following example format, note that there should be no explanation or unnecessary words, only executable configuration commands), a small sample demonstration example (e.g., question: Configure IP address 192.168.1.100 / 24 ​​for network card eth0; answer: ip addr add 192.168.1.100 / 24 ​​dev eth0), and prompt words (i.e., the organized IP configuration command generation requirement information). Alternatively, in another option, the target prompt may include role instructions (e.g., you are a network configuration expert), the matched configuration template, prompts, supplementary rules (e.g., default values ​​for missing parameters, device model), thought chains (e.g., 8-12 steps), and output constraints.

[0087] Among them, the pre-trained IP configuration instruction generation model refers to a large model that can generate corresponding IP configuration instructions based on the question content. Specifically, it refers to a large model that has been fine-tuned based on sample data in the field of IP configuration instruction generation, such as a large IP inference model or a fine-tuned large model.

[0088] For example, the server generates a prompt word template adapted to the model according to the pre-trained IP configuration instructions. Based on the prompt words, role identity setting information, task target information, output format constraint information, and few-sample demonstration examples are added to obtain the converted target prompt words. The converted target prompt words are then used as the question content corresponding to the requirement information generated by the IP configuration instructions.

[0089] Step S104: Input the question content into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation domain.

[0090] The IP configuration instruction generation field is used to characterize the specific field in which IP configuration instructions are generated.

[0091] Among them, the sample data in the field of IP configuration command generation refers to the fine-tuning corpus in the field of IP configuration command generation, such as IP professional corpus. It is specifically used to fine-tune the pre-trained large model to obtain a fine-tuned large model with IP configuration command generation capability, which serves as the IP configuration command generation model.

[0092] Fine-tuning refers to the process of using IP configuration instructions to generate domain sample data to further train a pre-trained large model, such as LoRA (Low Rank Adaptation) fine-tuning.

[0093] The pre-trained large model can refer to any type of large model, such as a large language model. Besides generating IP configuration commands, the IP configuration command generation model also possesses other capabilities, such as configuration error detection, configuration vulnerability detection, correct configuration generation, IP knowledge Q&A, automatic command execution, and automatic performance evaluation. See details for further information. Figure 6 .

[0094] For example, the server inputs the query content into a pre-trained IP configuration instruction generation model, which then performs IP configuration instruction generation processing based on the query content to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information. For instance, the IP configuration instruction generation model outputs multiple candidate IP configuration instructions and the predicted probability of each candidate IP configuration instruction, and selects the candidate IP configuration instruction with the highest predicted probability from the multiple candidate IP configuration instructions as the IP configuration instruction corresponding to the IP configuration instruction generation requirement information.

[0095] For example, see reference. Figure 3 First, the user inputs their request to generate instructions. Next, the user preprocesses the instructions to obtain corresponding prompts. Then, the prompts are converted to obtain a question that the fine-tuning model can understand. Finally, the question is input into the fine-tuning model (i.e., the IP configuration instruction generation model), which generates the corresponding instruction code, i.e., the IP configuration instruction, based on the question.

[0096] In the above configuration command generation method, IP configuration command generation requirement information is first obtained. Then, based on the command generation intent of the IP configuration command generation requirement information, corresponding prompt words are generated, and the prompt words are transformed to obtain the question content corresponding to the IP configuration command generation requirement information. The question content is used to characterize the target prompt words that are adapted to the pre-trained IP configuration command generation model. Finally, the question content is input into the pre-trained IP configuration command generation model to obtain the IP configuration command corresponding to the IP configuration command generation requirement information. The pre-trained IP configuration command generation model is obtained by fine-tuning a pre-trained large model using sample data from the IP configuration command generation domain. In this way, when generating IP configuration commands, the command generation intent corresponding to the IP configuration command generation requirement information is identified first, and then the corresponding IP configuration command is generated based on the command generation intent, which is conducive to truly understanding IP configuration command generation. The requirement information makes the IP configuration instructions generated based on intent understanding more closely match the IP configuration instruction generation requirements, thereby improving the accuracy of IP configuration instruction generation. Moreover, after generating corresponding prompt words based on the instruction generation intent, the prompt words are transformed to obtain target prompt words that are adapted to the pre-trained IP configuration instruction generation model. Then, the corresponding IP configuration instruction is output with the help of the IP configuration instruction generation model. Since the IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model based on sample data in the IP configuration instruction generation field, it has a strong IP configuration instruction generation capability. Furthermore, the target prompt words are adapted to the IP configuration instruction generation model, which makes the final generated IP configuration instructions more accurate, further improving the accuracy of IP configuration instruction generation. At the same time, it avoids the low accuracy of IP configuration instructions generated by using static rule matching methods.

[0097] In an exemplary embodiment, step S103 above, which involves converting the prompt words to obtain the question content corresponding to the IP configuration instruction generation requirement information, specifically includes the following: obtaining the prompt word template of the pre-trained IP configuration instruction generation model; converting the prompt words according to the prompt word template to obtain the converted target prompt words, which serve as the question content corresponding to the IP configuration instruction generation requirement information.

[0098] The prompt word template refers to the optimal prompt word template used to generate IP configuration instructions, which includes at least role identity setting information, task objective information, output format constraint information, few sample demonstration examples, and IP configuration instruction generation requirement information.

[0099] For example, the server inputs IP configuration command generation domain information into the prompt word generation dedicated machine learning model to obtain the optimal prompt word template corresponding to the IP configuration command generation domain, which serves as the prompt word template for the pre-trained IP configuration command generation model. For instance, the dedicated machine learning model for prompt word generation outputs multiple candidate prompt word templates and the predicted probability corresponding to each candidate prompt word template. The candidate prompt word template with the highest predicted probability is selected from the multiple candidate prompt word templates as the optimal prompt word template. Then, according to the prompt word template, the prompt word is transformed, for example, by adding role identity setting information, task goal information, output format constraint information, few-sample demonstration examples, etc., to obtain the transformed prompt word, which serves as the target prompt word. Finally, the target prompt word is used as the question content corresponding to the IP configuration command generation requirement information.

[0100] For example, the machine learning-driven dynamic prompting word engineering framework: This application innovatively proposes a technical path for automatically generating prompting words using a professionally adapted machine learning model, completely overturning the inefficient traditional model that relies on experts manually writing prompt templates. Specifically, the system constructs a dedicated machine learning model for prompting word generation for multiple disciplines such as IP networks, wireless communications, and network security. This model takes the target professional domain as input and learns the mapping rules between instruction semantics and context parameters in a large number of high-quality configuration cases. It automatically outputs the optimal prompting word template for that domain, including key elements such as dynamic wildcard layout, parameter constraint rules, grammatical structure preferences, and security policy anchors. This enables the large model to accurately capture domain-specific semantics when generating IP configuration instructions, significantly improving the depth of understanding and generalization ability of complex network intentions.

[0101] The prompt text template for the project is as follows:

[0102] "You are a network operations and maintenance expert who is very familiar with the configuration specifications of equipment manufacturer: {vendor} and equipment type: {device_type}. Now, please use your expertise to generate accurate and executable IP configuration commands based on user needs."

[0103] Please output pure commands according to the following example format. Note that you should not provide explanations or unnecessary information; only output executable configuration instructions.

[0104] Example 1:

[0105] Question: Configure the IP address 192.168.1.100 / 24 ​​for the network interface card eth0;

[0106] Answer: ip addr add 192.168.1.100 / 24 ​​dev eth0;

[0107] Example 2:

[0108] Problem: Remove the IP address 192.168.1.100 from the network interface eth0;

[0109] Answer: ip addr del 192.168.1.100 / 24 ​​dev eth0;

[0110] Example 3:

[0111] Issue: Add a default route to 192.168.1.1;

[0112] Answer: ip route add default via 192.168.1.1;

[0113] Now please answer:

[0114] Problem: {raw_user_input};

[0115] Answer:".

[0116] Here, {raw_user_input} is replaced with natural language for generating code, that is, the configuration instructions entered by the user generate the requirement information; {vendor} is the manufacturer, such as manufacturer A, manufacturer B, etc.; {device_type} is the device type, such as router, etc.

[0117] In this embodiment, the generated prompts are converted according to the prompt word template of the pre-trained IP configuration instruction generation model to obtain the question content corresponding to the IP configuration instruction generation requirement information. This achieves the goal of obtaining question content that is compatible with the IP configuration instruction generation model, so that the subsequent IP configuration instruction generation model can accurately understand the question content and automatically generate the corresponding IP configuration instruction with the help of the question content, thereby improving the accuracy of IP configuration instruction generation.

[0118] In an exemplary embodiment, before generating the corresponding prompt word based on the instruction generation intent of the IP configuration instruction generation requirement information in step S102, the step of obtaining the instruction generation intent is further included. Specifically, this includes the following: performing text preprocessing on the IP configuration instruction generation requirement information to obtain preprocessed IP configuration instruction generation requirement information; and performing intent recognition processing on the preprocessed IP configuration instruction generation requirement information to obtain the instruction generation intent.

[0119] Text preprocessing refers to deleting invalid information or correcting errors, such as removing colloquial particles, extra spaces, invalid symbols, garbled characters, and correcting basic typos.

[0120] Among them, the preprocessed IP configuration instruction generation requirement information refers to the IP configuration instruction generation requirement information after deleting invalid information or correcting erroneous information.

[0121] For example, the server performs text preprocessing on the IP configuration instruction generation requirement information according to the text preprocessing instructions to obtain the preprocessed IP configuration instruction generation requirement information; then, the preprocessed IP configuration instruction generation requirement information is input into multiple intent recognition models to obtain the initial instruction generation intent output by each intent recognition model; the initial instruction generation intents are fused to obtain the fused instruction generation intent, which serves as the instruction generation intent corresponding to the IP configuration instruction generation requirement information.

[0122] In this embodiment, the IP configuration command generation requirement information is first preprocessed into text, and then the preprocessed IP configuration command generation requirement information is subjected to intent recognition processing to obtain the command generation intent. This avoids interference from invalid information on intent recognition processing, ensures the accuracy of the obtained command generation intent, and thus improves the recognition accuracy of the command generation intent.

[0123] In one exemplary embodiment, such as Figure 4 As shown, the configuration instruction generation method provided in this application also includes a training step for a pre-trained IP configuration instruction generation model, specifically including the following steps:

[0124] Step S401: Obtain sample data from the IP configuration instruction generation field.

[0125] Step S402: Based on the sample data, fine-tune the pre-trained large model to obtain the fine-tuned large model.

[0126] Step S403: By supervising the large model based on the multi-dimensional training index data of the fine-tuned large model, determine whether the fine-tuned large model meets the preset capability standard.

[0127] In step S404, if the fine-tuned large model does not meet the preset capability standard, the fine-tuned large model is used as a new pre-trained large model, and the process jumps to the step of fine-tuning the pre-trained large model based on the sample data to obtain the fine-tuned large model, until the obtained fine-tuned large model meets the preset capability standard.

[0128] Step S405: The finely tuned large model that meets the preset capability standards is used as the pre-trained IP configuration instruction generation model.

[0129] Each sample data set includes corresponding distillation knowledge and a configuration template corresponding to the target IP configuration instruction within that distillation knowledge. The distillation knowledge includes at least the question (i.e., the requirement information for generating the sample configuration instruction), the answer (i.e., the target IP configuration instruction corresponding to the requirement information for generating the sample configuration instruction), and the thought process (i.e., the 8-12 step thought process from the question to the answer).

[0130] Among them, the fine-tuned large model refers to the large model obtained by fine-tuning the pre-trained large model based on sample data.

[0131] Among them, the supervised large model refers to an independent large model used to autonomously judge whether the fine-tuned large model meets the preset capability standards. It can be used to dynamically decide whether to terminate model training or start a new round of training.

[0132] Among them, multidimensional training metric data refers to the multidimensional effect data generated by the pre-trained large model during the iteration process, including but not limited to instruction generation accuracy, semantic consistency score, simulation pass rate, number of policy conflicts, and response quality for professional test question-answer pairs.

[0133] The preset capability standard refers to the preset professional capability standard, specifically the preset IP configuration instruction generation capability standard. For example, if the large model does not meet the preset capability standard after fine-tuning, a new round of training will be started; if the large model meets the preset capability standard after fine-tuning, model training will be terminated.

[0134] Among them, the pre-trained IP configuration instruction generation model refers to the finely tuned large model that meets the preset capability standards.

[0135] For example, the server retrieves sample data in the IP configuration instruction generation domain from the local database, and then fine-tunes the pre-trained large model based on the sample data to obtain the fine-tuned large model. For instance, the configuration template and thought chain corresponding to the question (i.e., sample configuration instruction generation requirement information) and answer (i.e. target IP configuration instruction) in the sample data are input into the pre-trained large model to obtain the predicted IP configuration instruction corresponding to the question. Based on the difference between the predicted IP configuration instruction and the target IP configuration instruction, the loss value is obtained. Based on the loss value, the model parameters of the pre-trained large model are adjusted to obtain the adjusted large model, which serves as the fine-tuned large model. Next, the server acquires the multi-dimensional training metric data of the fine-tuned large model and inputs this data into the supervised large model for inference, obtaining the IP configuration command generation capability score of the fine-tuned large model. If the IP configuration command generation capability score is greater than a preset score, the fine-tuned large model is confirmed to meet the preset capability standard, and this fine-tuned large model is used as a pre-trained IP configuration command generation model. If the IP configuration command generation capability score is less than or equal to the preset score, the fine-tuned large model is confirmed to not meet the preset capability standard, and this fine-tuned large model is used as a new pre-trained large model. The process then jumps to the step of fine-tuning the pre-trained large model based on sample data to obtain the fine-tuned large model. This training process is repeated until the obtained fine-tuned large model meets the preset capability standard. At this point, model training stops, and the fine-tuned large model that meets the preset capability standard is used as the pre-trained IP configuration command generation model. For an example, refer to [link / reference]. Figure 6 By using IP-specific corpus, the large model D2 (a certain large language model) is fine-tuned to obtain the large IP reasoning model.

[0136] For example, the intelligent training decision-making mechanism of dual-model collaboration: This application abandons the traditional training termination judgment method based on fixed thresholds or manual sampling evaluation, and innovatively introduces an independent supervised large model as an "intelligent training mentor". This supervised large model is specially trained with professional configuration knowledge and historical training trajectory data. It can receive multi-dimensional effect data generated by the configuration generation large model during the iteration process. By performing cross-dimensional semantic fusion and context-aware reasoning on these heterogeneous indicators (i.e., multi-dimensional effect data), the supervised large model can autonomously judge whether the current generation large model has met the preset professional capability standards, and dynamically decide whether to terminate the training process or trigger a new round of optimization. This realizes a paradigm leap from "manually supervised training" to "AI autonomous decision-making evolution", that is, it breaks through the limitations of traditional reliance on manual intervention or fixed threshold judgment, realizes AI-driven autonomous training process, and belongs to the innovative application of AI for AI training mechanism.

[0137] Large models were selected as the low-rank adaptive fine-tuning technique for terminating training. SFT (Supervised Fine-Tuning) was used, with a learning rate ranging from 0.0001 to 0.0005. Cosine annealing was used as the learning rate scheduling strategy, with a warm-up ratio of 0.1 to 0.2. The model was evaluated every 500-600 training steps. The ratio of training set to validation set was 9:1. BF16 (Brain Float Point 16) data type was used for training. This is a half-precision floating-point format that can reduce memory usage and computation time.

[0138] Furthermore, this application also provides a vertical domain optimization mechanism that integrates large and small models. This mechanism leverages the real-time matching capabilities of the small model to enhance the deep reasoning capabilities of the large model through layered collaborative training, thereby improving the iterative training performance of the large audit model. For example, the training corpus for the IP-generated large model consists of basic instructions provided by professionals. The small model's algorithm then matches these instructions to templates and automatically generates the corpus. This corpus is divided into two types: positive samples and erroneous negative samples, facilitating the large language model's understanding of potential errors in the instructions. Additionally, the training corpus is automatically labeled by computer rather than manually, and the large model leverages this knowledge to automatically generate more corpus data.

[0139] In this embodiment, during the training process of the pre-trained large model, the large model is supervised to automatically determine whether the fine-tuned large model meets the preset capability standards based on the multi-dimensional training index data of the fine-tuned large model. This breaks through the limitations of traditional methods that rely on manual intervention or fixed threshold judgments, and achieves the goal of AI-driven model training, which is conducive to improving model training efficiency and model accuracy.

[0140] In an exemplary embodiment, step S401, obtaining sample data in the IP configuration instruction generation domain, specifically includes the following: obtaining a live network configuration file; extracting live network configuration fragments from the live network configuration file as raw corpus data, and performing configuration template extraction processing on the live network configuration file to obtain a configuration template library; generating corresponding distillation knowledge based on the raw corpus data, obtaining the configuration template corresponding to the target IP configuration instruction from the configuration template library; and combining the distillation knowledge and the configuration template corresponding to the target IP configuration instruction in the distillation knowledge to obtain sample data in the IP configuration instruction generation domain.

[0141] Among them, the live network configuration file refers to the complete and operational configuration file of network devices (such as routers and switches) that has been put into effect.

[0142] The original corpus data refers to the existing network configuration fragments; the existing network configuration fragments refer to the fragments related to IP configuration selected from the existing network configuration files.

[0143] The configuration template library includes multiple configuration templates; configuration templates refer to IP configuration instruction templates, which are specifically extracted from the existing network configuration files.

[0144] Among them, the configuration template corresponding to the target IP configuration instruction refers to the configuration template in the configuration template library that has the highest similarity to the target IP configuration instruction.

[0145] Among them, distillation knowledge refers to the knowledge information obtained from the target IP configuration instructions, specifically including questions, answers, and thought processes.

[0146] For example, the server retrieves the current network configuration file from the local database and preprocesses it to obtain a preprocessed current network configuration file. Next, following the current network configuration fragment extraction instruction, it extracts current network configuration fragments from the current network configuration file and uses these fragments as raw corpus data. Then, following the configuration template extraction instruction, it performs configuration template extraction processing on the current network configuration file to obtain corresponding configuration templates. These configuration templates are then aggregated to obtain a configuration template library. Next, distillation processing is performed based on the raw corpus data to obtain corresponding distillation knowledge. The configuration template with the highest similarity to the target IP configuration instruction in the distillation knowledge is obtained from the configuration template library and used as the configuration template corresponding to the target IP configuration instruction in the distillation knowledge. Finally, each piece of distillation knowledge and the configuration template corresponding to the target IP configuration instruction in each piece of distillation knowledge are combined to obtain sample data corresponding to each piece of distillation knowledge. Multiple sample data sets are then aggregated to obtain sample data in the IP configuration instruction generation domain.

[0147] For example, see reference. Figure 3 The server first obtains the existing network configuration files, then cleans and extracts templates from them to obtain configuration templates. These templates are then aggregated to form a configuration template library. Simultaneously, based on distillation instructions, a large model D1 (a type of large language model) is used to generate corresponding distillation knowledge (such as high-quality COT corpus). Figure 6 In the process, based on the original and labeled corpora, distillation is performed to obtain corresponding high-quality COT corpora. Next, for each distilled knowledge, the server retrieves the configuration template corresponding to the target IP configuration instruction in that distilled knowledge from the configuration template library, and combines each distilled knowledge with the configuration template corresponding to the target IP configuration instruction in that distilled knowledge to obtain fine-tuned corpora. Finally, using the fine-tuned corpora, the pre-trained large model (such as the large model D2) is fine-tuned to obtain the fine-tuned large model.

[0148] In this embodiment, during the process of determining the sample data in the IP configuration command generation domain, the distillation knowledge corresponding to the original corpus data and the configuration template corresponding to the target IP configuration command in the distillation knowledge are comprehensively considered. This enables the large model trained based on the sample data to have professional IP configuration command generation capabilities and accurately output IP configuration commands, thereby further improving the accuracy of IP configuration command generation.

[0149] In an exemplary embodiment, generating corresponding distilled knowledge based on the original corpus data specifically includes the following: generating corresponding configuration question-answer pairs based on the original corpus data; annotating the configuration question-answer pairs to obtain annotated configuration question-answer pairs as annotated corpus data; and performing knowledge distillation processing based on the original corpus data and the annotated corpus data to obtain distilled knowledge.

[0150] The configuration question-and-answer pair includes an initial question and an initial answer; the initial question is used to represent the initial sample configuration instruction generation requirement information, and the initial answer is used to represent the initial IP configuration instruction.

[0151] The labeled corpus data refers to the labeled question-and-answer pairs; the labeled question-and-answer pairs include questions and answers; the questions are used to represent the initial sample configuration instruction generation requirement information after labeling, that is, the sample configuration instruction generation requirement information; the answers are used to represent the initial IP configuration instruction after labeling, that is, the target IP configuration instruction corresponding to the sample configuration instruction generation requirement information.

[0152] Among them, knowledge distillation is used to identify the thought chain that leads to the answer to the question (such as an 8-12 step thought chain).

[0153] For example, the server first preprocesses the raw corpus data (e.g., configuring the eth0 network interface IP: ip addr add 192.168.1.100 / 24 ​​dev eth0), such as cleaning, formatting, and anomaly removal, to obtain preprocessed corpus data (e.g., ip addr add 192.168.1.100 / 24 ​​dev eth0), which serves as the initial answer. Then, based on the initial answer, a large model performs natural language question inference processing to obtain the initial question corresponding to the raw corpus data. The initial question and initial answer are combined to obtain the corresponding configuration question-answer pair. Next, the initial question and initial answer in the configuration question-answer pair are labeled, such as by expert verification or correction, to obtain labeled configuration question-answer pairs, which are used as labeled corpus data. Finally, the raw corpus data and labeled corpus data are input into another large model (e.g., large model D1) for knowledge distillation to obtain the corresponding inference chain. The labeled configuration question-answer pairs and inference chains are then combined to obtain distilled knowledge.

[0154] For example, see reference. Figure 6 The original and labeled corpora are input into the large model D1 for distillation to obtain the corresponding high-quality COT corpora.

[0155] In this embodiment, based on the original corpus data, corresponding distillation knowledge is generated. This facilitates the subsequent combination of distillation knowledge and the configuration template corresponding to the target IP configuration instruction in the distillation knowledge to obtain sample data in the IP configuration instruction generation domain. This allows for fine-tuning of the pre-trained large model using sample data from a specific domain, resulting in a large model suitable for the IP configuration instruction generation domain. This is beneficial for outputting accurate IP configuration instructions through the large model suitable for the IP configuration instruction generation domain, further improving the accuracy of IP configuration instruction generation.

[0156] In an exemplary embodiment, step S104 above, after inputting the query content into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information, further includes a step of obtaining an optimized IP configuration instruction. Specifically, this includes: constructing a virtual environment semantically equivalent to the target live network topology of the IP configuration instruction to be deployed; obtaining simulation environment logs and running results generated after running the IP configuration instruction in the virtual environment; generating a structured score and improvement suggestions for the IP configuration instruction based on the IP configuration instruction, instruction generation intent, simulation environment logs, and running results; and optimizing the IP configuration instruction based on the improvement suggestions if the structured score is less than a preset score, thereby obtaining the optimized IP configuration instruction.

[0157] The virtual environment refers to a simulated runtime environment that is semantically equivalent to the target existing network topology to which the IP configuration instructions to be deployed are located and that can run the IP configuration instructions.

[0158] The results of the operation can refer to IP allocation results, connectivity status, policy effectiveness, potential conflicts, etc.

[0159] Among them, the structured scoring is used to measure whether IP configuration instructions are available, such as ("Intent matching": 92, "Syntax validity": 100, "Security risk score": 85, "Global policy compliance score": 78, "Overall score": 87).

[0160] Among them, the improvement suggestions refer to suggestions for optimizing IP configuration instructions, such as "Problem: The configured IP address 10.2.1.5 is already occupied by an existing interface, resulting in an IP conflict; Improvement suggestion: Change the interface IP to an available address within the network segment, 10.2.1.12, while keeping the subnet mask unchanged."

[0161] It should be noted that if the structured score is greater than or equal to the preset score, the improvement suggestions can be empty.

[0162] For example, the server first determines the target network topology of the IP configuration command to be deployed and constructs a virtual environment semantically equivalent to the target network topology. Next, it runs the IP configuration command in this virtual environment and obtains the simulation environment logs and execution results generated after running the IP configuration command. Then, it inputs the IP configuration command, command generation intent, simulation environment logs, and execution results into a decision-making large-scale model. The model performs feature extraction processing on the IP configuration command, command generation intent, simulation environment logs, and execution results to obtain feature vectors corresponding to the IP configuration command, command generation intent, simulation environment logs, and execution results. These feature vectors are then concatenated to obtain a concatenated feature vector. Based on this concatenated feature vector, a structured scoring process is performed to obtain a structured score for the IP configuration command, and improvement suggestions are generated. Finally, if the structured score is lower than a preset score, the IP configuration command is optimized based on the improvement suggestions, such as optimizing conflicting interface IPs in the IP configuration command. Automatic correction is performed to obtain optimized IP configuration instructions.

[0163] For example, this application innovatively introduces a code generation and virtual simulation linkage mechanism: the user's natural language configuration intent is submitted to a fine-tuned large model, triggering the generation of executable configuration script code. Subsequently, a network simulator (including but not limited to Mininet, GNS3, or a customized digital twin engine) is automatically invoked to construct a virtual environment semantically equivalent to the existing network topology. The generated code is then run within this environment to observe its actual behavior, including IP allocation results, connectivity status, policy effectiveness, and potential conflicts. Next, an independent decision-making large model is used as a code quality evaluator. This evaluator, also specially trained, can receive multimodal inputs such as the original intent, generated code, simulation environment logs, and execution results. Through causal reasoning and counterfactual analysis, it judges whether the code accurately meets the intent, whether there are security risks, whether it violates global policies, or whether it causes resource contention, and outputs a structured score and improvement suggestions. This evaluation result not only determines whether the current generation process terminates and outputs the final instruction, but also serves as a reinforcing signal fed back to the generation model, forming a closed-loop self-learning path of "generation-verification-evaluation-optimization".

[0164] In this embodiment, after obtaining the IP configuration command, the simulation environment log and running results generated after running the IP configuration command in the virtual environment are also obtained. Based on the IP configuration command, the command generation intent, the simulation environment log and running results, a structured score and improvement suggestions for the IP configuration command are generated. When the structured score is less than the preset score, the IP configuration command is optimized based on the improvement suggestions. This makes the final IP configuration command more accurate and effective, further improving the accuracy and effectiveness of the IP configuration command.

[0165] In one exemplary embodiment, such as Figure 5 As shown, another method for generating configuration instructions is provided. Taking the application of this method to a server as an example, the method includes the following steps S501 to S510. Wherein:

[0166] Step S501: Obtain the existing network configuration file; extract the existing network configuration fragment from the existing network configuration file as the raw corpus data, and perform configuration template extraction processing on the existing network configuration file to obtain the configuration template library.

[0167] Step S502: Based on the original corpus data, generate corresponding configuration question-answer pairs; perform annotation processing on the configuration question-answer pairs to obtain annotated configuration question-answer pairs, which serve as annotated corpus data; perform knowledge distillation processing on the original corpus data and the annotated corpus data to obtain distilled knowledge.

[0168] Step S503: Obtain the configuration template corresponding to the target IP configuration instruction from the configuration template library; combine the distillation knowledge and the configuration template corresponding to the target IP configuration instruction in the distillation knowledge to obtain sample data in the IP configuration instruction generation domain.

[0169] Step S504: Based on the sample data, fine-tune the pre-trained large model to obtain the fine-tuned large model; use the multi-dimensional training index data of the supervised large model based on the fine-tuned large model to determine whether the fine-tuned large model meets the preset capability standard.

[0170] Step S505: If the fine-tuned large model does not meet the preset capability standard, the fine-tuned large model is used as a new pre-trained large model, and the process jumps to the step of fine-tuning the pre-trained large model according to the sample data to obtain the fine-tuned large model, until the obtained fine-tuned large model meets the preset capability standard; the fine-tuned large model that meets the preset capability standard is used as the pre-trained IP configuration instruction generation model.

[0171] Step S506: Obtain IP configuration instruction generation requirement information; perform text preprocessing on the IP configuration instruction generation requirement information to obtain preprocessed IP configuration instruction generation requirement information; perform intent recognition processing on the preprocessed IP configuration instruction generation requirement information to obtain the instruction generation intent of the IP configuration instruction generation requirement information.

[0172] Step S507: Based on the instruction generation intent, generate corresponding prompt words; obtain the prompt word template of the pre-trained IP configuration instruction generation model; according to the prompt word template, convert the prompt words to obtain the converted target prompt words, which serve as the question content corresponding to the IP configuration instruction generation requirement information.

[0173] Step S508: Input the question content into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information.

[0174] Step S509: Construct a virtual environment that is semantically equivalent to the target live network topology of the IP configuration command to be deployed; obtain the simulation environment logs and running results generated after running the IP configuration command in the virtual environment.

[0175] Step S510: Based on the IP configuration command, command generation intent, simulation environment log, and running results, generate a structured score and improvement suggestions for the IP configuration command; if the structured score is less than the preset score, optimize the IP configuration command based on the improvement suggestions to obtain the optimized IP configuration command.

[0176] In the above-mentioned configuration command generation method, when generating IP configuration commands, the command generation intent corresponding to the IP configuration command generation requirement information is first identified, and then the corresponding IP configuration command is generated based on the command generation intent. This helps to truly understand the IP configuration command generation requirement information, making the IP configuration command generated based on intent understanding more closely match the IP configuration command generation requirement information, thereby improving the accuracy of IP configuration command generation. Moreover, after generating the corresponding prompt words based on the command generation intent, the prompt words are transformed to obtain target prompt words that are adapted to the pre-trained IP configuration command generation model. Then, the corresponding IP configuration command is output with the help of the IP configuration command generation model. Since the IP configuration command generation model is obtained by fine-tuning the pre-trained large model based on sample data in the IP configuration command generation field, it has a strong IP configuration command generation capability. Furthermore, since the target prompt words are adapted to the IP configuration command generation model, the final generated IP configuration command is more accurate, further improving the accuracy of IP configuration command generation. At the same time, it avoids the defect of low accuracy of IP configuration commands generated by static rule matching methods.

[0177] To more clearly illustrate the configuration instruction generation method provided in the embodiments of this application, the following describes the configuration instruction generation method in detail with a specific embodiment. In an exemplary embodiment, as follows... Figure 3 As shown, to overcome the problems of weak context awareness, lack of intent understanding, and rigid configuration process in traditional IP configuration technologies, this application proposes an automatic IP configuration command generation method based on intent understanding and fine-tuning of a large model (or an automatic IP configuration command generation method based on multi-dimensional context awareness and intent understanding). The aim is to build an intelligent system capable of dynamically sensing network environment status, deeply understanding user or system configuration intent, and automatically generating optimal IP configuration commands accordingly. This method, by introducing a cross-domain context fusion mechanism and an intent semantic parsing model, transforms the IP configuration process from a passive response to rules to a proactive, semantic decision-making process. This not only improves the utilization efficiency and configuration accuracy of IP address resources but also effectively ensures the consistency and security of network policies, ultimately achieving autonomous, intelligent, and business-driven network resource configuration, providing core technical support for building next-generation intelligent networks.

[0178] Specifically, this application proposes an intelligent IP configuration instruction generation method that integrates domestic hardware adaptation, domain-specific large-scale model fine-tuning, code generation-simulation verification closed loop, and decision-oriented large-scale model quality judgment. Its innovative breakthrough lies in constructing a self-evolving system architecture based on a four-fold iterative mechanism of "corpus-driven, model generation, simulation feedback, and intelligent evaluation." This solution, for the first time, deeply couples the large-scale model fine-tuning process under domestic chip environments with the code generation task in the IP configuration domain. It constructs a dedicated corpus by collecting massive amounts of network configuration logs, standard protocol documents, and operation and maintenance records. Then, it efficiently fine-tunes the parameters of the large language model on heterogeneous computing platforms based on domestic GPUs (Graphics Processing Units) or NPUs (Neural Processing Units). This allows the model to retain general language capabilities while deeply internalizing professional grammatical and semantic constraints such as IP address planning, subnetting, routing strategies, and ACL (Access Control List) rules, forming an IP instruction generation model with domain-specific prior knowledge.

[0179] For example, refer to Figure 3Large-scale model fine-tuning refers to the process of further training a pre-trained large model using a domain-specific dataset. The aim is to optimize the model's performance on a specific task, enabling it to better adapt to and complete tasks within that domain. The process involves selecting a resource-appropriate large model, preprocessing the existing network configuration file and configuration manual, generating a configuration template library, a statement definition library, and a parameter specification library, using a template matching algorithm to find the configuration template most similar to the existing network configuration, concatenating prompt words to generate a corpus dataset, iteratively modifying hyperparameters and fine-tuning the large model based on actual training results, observing the loss curve, and terminating training when the loss value stabilizes to prevent overfitting. Subsequently, the user-input generation instructions undergo text preprocessing and conversion to obtain question content that the large model can understand, and the large model is then fine-tuned to generate corresponding instruction codes based on this question content.

[0180] In addition, refer to Figure 6 This application also provides an IP configuration instruction generation architecture, which includes a five-layer architecture: data layer, computing power layer, model layer, capability layer, and application layer. The data layer utilizes the Drain log parsing engine to automatically extract configuration fragments from 12 types of devices on the existing network (such as routers, switches, and firewalls), with a daily increment of 300,000 entries. It also features a corpus factory based on a large model, using a general-purpose model with 7 billion parameters to generate 5 million synthetic configuration question-and-answer pairs. After secondary annotation by experts, this forms a 1.2 million-entry high-quality dataset. Through distillation using the large model D1, high-quality COT (Chain of Thought) corpus is obtained. The computing power layer utilizes domestically produced graphics cards, achieving full domestic adaptation and end-to-end national cryptographic encryption. The model layer is based on the large model D2, using LoRA fine-tuning, with a thought chain length of 8-12 steps, and each of the two single-card graphics cards occupies 18 GB of memory. A security sandbox, inference container, and national cryptographic TLS (Transport Layer Security) 1.3 are used to ensure "data does not leave the domain." Ultimately, we aim to create IP digital employees, which is an IP digital employee system built on domestic computing power and large models, covering the entire process of "data-training-inference-operation and maintenance". It can support calls from three terminals: Web (World Wide Web), CLI, and API (Application Programming Interface), and has a closed-loop capability of "error location-root cause analysis-correct configuration generation-effect evaluation". At the same time, it supports real-time visualization and rendering of COT thinking chain inference, and supports tracing back to the original template and parameter description, which is convenient for verification.

[0181] The above embodiments can achieve the following technical effects:

[0182] (1) It abandons the traditional code evaluation method of static rule matching or simple syntax verification, and instead uses the cognitive ability of the large model to achieve comprehensive intelligent judgment of the functional correctness, policy compliance and operational robustness of the generated code. The whole process is completed on the domestic computing power base, ensuring the independent control of the core technology chain.

[0183] (2) Significantly improves the accuracy and security of IP configuration command generation, effectively avoiding erroneous configurations caused by model illusions; greatly reduces the risk of trial and error in production networks through simulation pre-verification; the introduction of decision models enables the system to have continuous evolution capabilities, and can autonomously optimize the generation strategy through simulation feedback without relying on manual annotation; at the same time, the full-process localization support provides a safe and reliable technical path for the intelligent operation and maintenance of critical information infrastructure, which has outstanding industrial application value and strategic significance.

[0184] (3) The application of large-scale COT technology to implement full-process optimization can automatically generate IP configuration instructions, effectively reducing the workload of manual writing; the system is built based on domestic chips and large-scale COT technology, realizing intelligent generation of IP configuration and closed-loop operation and maintenance management. Through automated error detection, configuration generation and effect evaluation, it significantly reduces labor costs while improving operation and maintenance efficiency.

[0185] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0186] Based on the same inventive concept, this application also provides a configuration instruction generation apparatus for implementing the configuration instruction generation method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more configuration instruction generation apparatus embodiments provided below can be found in the limitations of the configuration instruction generation method described above, and will not be repeated here.

[0187] In one exemplary embodiment, such as Figure 7 As shown, a configuration instruction generation device 700 is provided, including: an information acquisition module 710, a prompt generation module 720, a prompt conversion module 730, and an instruction generation module 740, wherein:

[0188] The information acquisition module 710 is used to acquire the IP configuration command generation requirement information.

[0189] The prompt generation module 720 is used to generate the instruction generation intent based on the IP configuration instruction to generate the required information and generate the corresponding prompt words.

[0190] The prompt conversion module 730 is used to convert the prompt words to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to represent the target prompt words that are adapted to the pre-trained IP configuration instruction generation model.

[0191] The instruction generation module 740 is used to input the question content into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation field.

[0192] In an exemplary embodiment, the prompt conversion module 730 is further configured to obtain a prompt word template of a pre-trained IP configuration instruction generation model; and to convert the prompt words according to the prompt word template to obtain the converted target prompt words, which serve as the question content corresponding to the IP configuration instruction generation requirement information.

[0193] In an exemplary embodiment, the configuration instruction generation device 700 further includes an intent recognition module, which is used to perform text preprocessing on the IP configuration instruction generation requirement information to obtain preprocessed IP configuration instruction generation requirement information; and to perform intent recognition processing on the preprocessed IP configuration instruction generation requirement information to obtain the instruction generation intent.

[0194] In an exemplary embodiment, the configuration instruction generation device 700 further includes a model training module for acquiring sample data in the field of IP configuration instruction generation; fine-tuning a pre-trained large model based on the sample data to obtain a fine-tuned large model; determining whether the fine-tuned large model meets a preset capability standard by supervising the large model based on the multi-dimensional training index data of the fine-tuned large model; if the fine-tuned large model does not meet the preset capability standard, using the fine-tuned large model as a new pre-trained large model, and jumping to the step of fine-tuning the pre-trained large model based on the sample data to obtain a fine-tuned large model, until the obtained fine-tuned large model meets the preset capability standard; and using the fine-tuned large model that meets the preset capability standard as a pre-trained IP configuration instruction generation model.

[0195] In an exemplary embodiment, the model training module is further configured to: acquire existing network configuration files; extract existing network configuration fragments from the existing network configuration files as raw corpus data; perform configuration template extraction processing on the existing network configuration files to obtain a configuration template library; generate corresponding distillation knowledge based on the raw corpus data; acquire the configuration template corresponding to the target IP configuration instruction from the configuration template library; and combine the distillation knowledge and the configuration template corresponding to the target IP configuration instruction from the distillation knowledge to obtain sample data in the IP configuration instruction generation domain.

[0196] In an exemplary embodiment, the model training module is further configured to generate corresponding configuration question-answer pairs based on the original corpus data; to perform annotation processing on the configuration question-answer pairs to obtain annotated configuration question-answer pairs as annotated corpus data; and to perform knowledge distillation processing based on the original corpus data and the annotated corpus data to obtain distilled knowledge.

[0197] In an exemplary embodiment, the configuration instruction generation device 700 further includes an instruction optimization module, which is used to construct a virtual environment that is semantically equivalent to the target existing network topology of the IP configuration instruction to be deployed; obtain simulation environment logs and running results generated after running the IP configuration instruction in the virtual environment; generate a structured score and improvement suggestions for the IP configuration instruction based on the IP configuration instruction, instruction generation intent, simulation environment logs and running results; and optimize the IP configuration instruction based on the improvement suggestions if the structured score is less than the preset score, thereby obtaining an optimized IP configuration instruction.

[0198] Each module in the aforementioned configuration instruction generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0199] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores generated IP configuration instructions and other data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a configuration instruction generation method.

[0200] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0201] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0202] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0203] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0204] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0205] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0206] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0207] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for generating configuration instructions, characterized in that, The method includes: Obtain IP configuration instructions to generate required information; Based on the IP configuration instructions, the instruction generation intent generates the requirement information and generates corresponding prompt words; The prompt words are transformed to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to characterize the target prompt words that are adapted to the pre-trained IP configuration instruction generation model. The question content is input into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation domain.

2. The method according to claim 1, characterized in that, The process of converting the prompt words to obtain the question content corresponding to the IP configuration instruction generation requirement information includes: Obtain the prompt word template of the pre-trained IP configuration instruction generation model; According to the prompt word template, the prompt words are converted to obtain the converted target prompt words, which are used as the question content corresponding to the IP configuration instruction generation requirement information.

3. The method according to claim 1, characterized in that, Before generating the corresponding prompt word based on the instruction generation intent for generating requirement information based on the IP configuration instruction, the process also includes: The IP configuration instruction generation requirement information is preprocessed to obtain preprocessed IP configuration instruction generation requirement information. The preprocessed IP configuration instruction generation requirement information is subjected to intent recognition processing to obtain the instruction generation intent.

4. The method according to claim 1, characterized in that, The pre-trained IP configuration instruction generation model is trained in the following manner: Obtain sample data from the IP configuration instruction generation domain; Based on the sample data, the pre-trained large model is fine-tuned to obtain the fine-tuned large model; By supervising the large model based on the multidimensional training index data of the fine-tuned large model, it is determined whether the fine-tuned large model meets the preset capability standard. If the fine-tuned large model does not meet the preset capability standard, the fine-tuned large model is used as a new pre-trained large model, and the process jumps to the step of fine-tuning the pre-trained large model according to the sample data to obtain the fine-tuned large model, until the obtained fine-tuned large model meets the preset capability standard. The finely tuned large model that meets the preset capability standards will be used as the pre-trained IP configuration instruction generation model.

5. The method according to claim 4, characterized in that, The step of obtaining sample data in the IP configuration instruction generation field includes: Obtain the live network configuration file; Extract the existing network configuration fragments from the existing network configuration files as raw corpus data, and perform configuration template extraction processing on the existing network configuration files to obtain a configuration template library; Based on the original corpus data, corresponding distillation knowledge is generated, and the configuration template corresponding to the target IP configuration instruction in the distillation knowledge is obtained from the configuration template library; The distillation knowledge and the configuration template corresponding to the target IP configuration instruction in the distillation knowledge are combined to obtain sample data in the IP configuration instruction generation domain.

6. The method according to claim 5, characterized in that, The generation of corresponding distillation knowledge based on the original corpus data includes: Based on the original corpus data, generate corresponding configuration question-answer pairs; The configured question-answer pairs are labeled to obtain labeled configured question-answer pairs, which are used as labeled corpus data; Knowledge distillation is performed on the original corpus data and the labeled corpus data to obtain the distilled knowledge.

7. The method according to any one of claims 1 to 6, characterized in that, After inputting the question content into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information, the method further includes: Construct a virtual environment semantically equivalent to the target live network topology of the IP configuration instructions to be deployed; Obtain the simulation environment logs and execution results generated after running the IP configuration command in the virtual environment; Based on the IP configuration instructions, the intention behind the instructions, the simulation environment logs, and the execution results, a structured score and improvement suggestions are generated for the IP configuration instructions. If the structured score is less than the preset score, the IP configuration command is optimized based on the improvement suggestions to obtain the optimized IP configuration command.

8. A configuration instruction generation apparatus, characterized in that, The device includes: The information acquisition module is used to acquire IP configuration instructions to generate required information; The prompt generation module is used to generate the instruction generation intent based on the IP configuration instruction to generate the required information and generate the corresponding prompt words; The prompt conversion module is used to convert the prompt words to obtain the question content corresponding to the IP configuration instruction generation requirement information; the question content is used to represent the target prompt words that are adapted to the pre-trained IP configuration instruction generation model. The instruction generation module is used to input the question content into the pre-trained IP configuration instruction generation model to obtain the IP configuration instruction corresponding to the IP configuration instruction generation requirement information; the pre-trained IP configuration instruction generation model is obtained by fine-tuning the pre-trained large model through sample data in the IP configuration instruction generation field.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.