Configuration auditing method and device, program product and electronic equipment

By using a pre-trained audit model for instruction compression and anomaly analysis, the accuracy and timeliness issues of professional network equipment configuration audits are resolved, enabling efficient and accurate audit report generation and reducing labor costs.

CN121125491APending Publication Date: 2025-12-12CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511317359.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

In existing technologies, professional network equipment configuration auditing solutions cannot meet the needs of cloud-network convergence in terms of accuracy and processing time. Manual auditing is time-consuming and prone to errors, and rule engines are unable to cover hidden risks and have limited scalability.

Method used

Using pre-trained audit models, including small and large models, audit reports are generated through instruction compression, template matching, and anomaly analysis, enabling rapid response and highly accurate auditing.

Benefits of technology

It improved the accuracy and timeliness of auditing the configuration of professional network equipment, reduced labor costs, and achieved highly efficient auditing without any manual operation throughout the process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125491A_ABST
    Figure CN121125491A_ABST
Patent Text Reader

Abstract

The invention provides a configuration auditing method and device, a program product and electronic equipment, and relates to the technical field of computers. The method comprises the steps of receiving a configuration instruction input by a user; inputting the configuration instruction into a first model to obtain an auditing problem; the first model is a sub-model of a pre-trained auditing model, and the auditing model further comprises a second model; wherein the second model performs proofreading, code semantic understanding, error code analysis and potential anomaly analysis on the configuration instruction according to the auditing problem so as to output auditing reports of all error instruction segments; and inputting the auditing question into the second model, and generating an auditing report corresponding to the configuration instruction. According to the method and the device, the configuration instruction can be quickly audited through the auditing model, manual operation is not needed, and the accuracy and timeliness of configuration auditing of multiple professional network devices are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a configuration auditing method and device, a program product and an electronic device. BACKGROUND

[0002] At present, configuration auditing of professional network equipment (such as routers, switches, firewalls, load balancers, etc.) is a core means to ensure network compliance, security, stability and performance. The core goal is to find deviations from the preset standard in the configuration through systematic checking, and to avoid potential risks (such as security vulnerabilities, business interruptions, and resource waste).

[0003] For configuration auditing of professional network equipment, the related art mainly relies on manual auditing and rule engines based on regular expressions. Specifically, network engineers need to compare the configuration files of the live network with the operation manual line by line, which is time-consuming and prone to errors due to individual experience differences. Although the rule engine can automatically detect some explicit errors, it is difficult to cover implicit risks such as protocol combinations, mask overlaps, VRRP multicast address conflicts, etc. Moreover, the rule library needs to be continuously maintained with the version, and the scalability is limited.

[0004] However, as the scale of cloud network integration expands, the frequency of configuration changes of professional network equipment increases exponentially, and the auditing scheme provided in the related art cannot meet the production requirements in terms of accuracy and processing timeliness. SUMMARY

[0005] The present disclosure provides a configuration auditing method, a configuration auditing device, a computer program product and an electronic device to improve the accuracy and timeliness of configuration auditing of multiple professional network equipment.

[0006] According to a first aspect of the present disclosure, a configuration auditing method is provided, the method comprising: receiving a configuration instruction input by a user; inputting the configuration instruction into a first model to obtain an auditing question; the first model is a sub-model of a pre-trained auditing model, and the auditing model further comprises a second model; wherein the second model performs proofreading, code semantic understanding, error code analysis and potential anomaly analysis on the configuration instruction according to the auditing question to output an auditing report of all error instruction segments; inputting the auditing question into the second model to generate an auditing report corresponding to the configuration instruction.

[0007] In a possible implementation, inputting the configuration instruction into the first model to obtain the auditing question comprises: perform instruction compression processing on the configuration instruction to obtain compressed instruction information; perform matching processing on the compressed instruction information and a standard template; When a matching template is obtained, perform integration processing on the matching template and a prompt word template to obtain the audit question.

[0008] In a possible implementation, the instruction compression processing on the configuration instruction to obtain compressed instruction information includes: perform elimination of annotation character processing on the configuration instruction to obtain first compressed instruction; perform removal of repeated line processing on the first compressed instruction to obtain second compressed instruction; perform matching and division processing on the second compressed instruction based on a template library to obtain a configuration instruction block, and perform character length compression processing on the configuration instruction block to obtain a compressed instruction block; perform combined compression on the compressed instruction block by using professional knowledge and triadic compression technology and parameter normalization compression technology to obtain compressed instruction information.

[0009] In a possible implementation, the matching processing on the compressed instruction information and a standard template includes: perform dynamic edit distance calculation processing on the compressed instruction information and standard templates in a template library to obtain a plurality of distances, and determine a candidate template set according to the plurality of distances; perform context state machine matching processing on the compressed instruction information and standard templates in the candidate template set to obtain matching result information.

[0010] In a possible implementation, the second model is trained based on the following manner: determine a training sample set based on a preset first model; the training sample set includes a plurality of groups of sample pairs of labeled corpus, and each group of sample pairs includes a positive sample and a negative sample corresponding to the positive sample; input the training sample set into a preset second model for training to obtain training effect data; input the training effect data and question and answer pair data for testing the second model into a supervised large model, and obtain the first model and the second model when the supervised large model determines that a training target is reached.

[0011] In a possible implementation, the training sample set is determined, including: perform preprocessing on configuration files and configuration manuals of a plurality of professional network devices based on the preset first model to obtain a configuration template library, a configuration sentence interpretation library, and a configuration parameter description library; The configuration template library, the configuration sentence interpretation library, the configuration parameter description library, and the plurality of basic instructions are subjected to sample generation processing based on the preset first model to obtain the training sample set.

[0012] In a possible implementation, the configuration template library, the configuration sentence interpretation library, the configuration parameter description library, and the basic instructions are subjected to sample generation processing based on the preset first model to obtain the training sample set, including: The configuration template library, the configuration sentence interpretation library, the configuration parameter description library, and the basic instructions are subjected to matching processing based on the preset first model to obtain a plurality of matching templates. The plurality of matching templates and the prompt word templates are subjected to integration processing to obtain a plurality of positive samples, and a plurality of imitation positive samples are constructed to obtain the positive samples in the training sample set. The positive samples in the training sample set are processed by a negative sample generation rule to obtain the negative samples corresponding to the positive samples in the training sample set. The negative sample generation rule includes at least one of random parameter deletion, keyword replacement, parameter out-of-bound, spelling error, parameter format error, context loss, adversarial sample, noise injection generation, and multi-language mixed generation.

[0013] According to a second aspect of the present disclosure, a configuration auditing device is provided, including: A receiving unit configured to receive a configuration instruction input by a user. A first auditing unit configured to input the configuration instruction into a first model to obtain an auditing question; the first model is a sub-model of a pre-trained auditing model, and the auditing model further includes a second model; wherein the second model performs proofreading, code semantic understanding, error code analysis, and potential exception analysis on the configuration instruction according to the auditing question to output an auditing report of all error instruction segments. A second auditing unit configured to input the auditing question into the second model to generate an auditing report corresponding to the configuration instruction.

[0014] In a possible implementation, the first auditing unit is configured to: Perform instruction compression processing on the configuration instruction to obtain compressed instruction information. Perform matching processing on the compressed instruction information and a standard template. When a matching template is obtained, perform integration processing on the matching template and a prompt word template to obtain the auditing question.

[0015] In a possible implementation, the first auditing unit is configured to: Perform rejection annotation character processing on the configuration instruction to obtain first compressed instruction. performing duplicate line removal processing on the first compression instruction to obtain a second compression instruction; performing matching and splitting processing on the second compression instruction based on a template library to obtain a configuration instruction block, and performing character length compression processing on the configuration instruction block to obtain a compressed instruction block; performing combined compression on the compressed instruction block by using professional knowledge and triadic compression technology and parameter normalization compression technology to obtain compressed instruction information.

[0016] In a possible implementation, the first auditing unit is configured to: performing dynamic edit distance calculation processing on the compressed instruction information and standard templates in a template library to obtain a plurality of distances, and determining a candidate template set according to the plurality of distances; performing context state machine matching processing on the compressed instruction information and standard templates in the candidate template set to obtain matching result information.

[0017] In a possible implementation, the second model is trained based on the following manner: determining a training sample set based on a preset first model; the training sample set includes a plurality of groups of sample pairs of labeled corpus, and each group of sample pairs includes a positive sample and a negative sample corresponding to the positive sample; inputting the training sample set into a preset second model for training to obtain training effect data; inputting the training effect data and question and answer pair data for testing the second model into a supervised large model, and obtaining the first model and the second model when the supervised large model determines that a training target is reached.

[0018] In a possible implementation, the training sample set is determined, including: preprocessing configuration files and configuration manuals of a plurality of professional network devices based on the preset first model to obtain a configuration template library, a configuration sentence interpretation library, and a configuration parameter description library; generating samples based on the preset first model, the configuration template library, the configuration sentence interpretation library, the configuration parameter description library, and a plurality of basic instructions to obtain the training sample set.

[0019] In a possible implementation, the training sample set is generated based on the preset first model, the configuration template library, the configuration sentence interpretation library, the configuration parameter description library, and the basic instructions, including: performing matching processing on the configuration template library, the configuration sentence interpretation library, the configuration parameter description library, and the basic instructions based on the preset first model to obtain a plurality of matching templates; Integrate the plurality of matching templates and the prompt word templates, obtain a plurality of positive samples, and construct a plurality of simulated positive samples to obtain the positive samples in the training sample set; The negative sample generation rule is used to process the positive samples in the training sample set to obtain negative samples corresponding to the positive samples in the training sample set. The negative sample generation rule includes at least one of random deletion parameters, replacement of keywords, parameter out-of-bound, spelling errors, parameter format errors, context missing, adversarial samples, noise injection generation, and multi-language mixed generation.

[0020] According to a third aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method of the first aspect and possible implementation manners thereof.

[0021] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the method of the first aspect and possible implementation manners thereof by executing the executable instructions.

[0022] The technical solution of the present disclosure has the following beneficial effects: In the embodiment of the present disclosure, when a configuration instruction input by a user is received, the configuration instruction can be input into a first model to obtain an audit question; the first model is a sub-model of a pre-trained audit model, and the audit model further includes a second model; the audit question is input into the second model to generate an audit report corresponding to the configuration instruction. It can be seen that in the embodiment of the present disclosure, the first model in the audit model can be used to quickly respond to the configuration instruction input by the user, and the second model can be used to proofread the configuration instruction according to the audit question output by the first model, code semantic understanding, error code analysis, and potential exception analysis to output an audit report of all error instruction segments. In this way, the entire process does not require manual operation, which greatly improves the accuracy and timeliness of the audit of multiple professional network device configuration instructions.

[0023] Other features and advantages of the present disclosure will be described in the following description, and some will become apparent from the description, or will be understood through implementation of the present disclosure. The purpose and other advantages of the present disclosure can be achieved and obtained through the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the drawings needed to be used in the embodiments of the present disclosure. Obviously, the drawings to be introduced below are only some of the embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained from these drawings without any creative effort.

[0025] Figure 1 An application scenario in the present exemplary embodiment is shown in a schematic diagram; Figure 2 An architecture of an auditing system in the present exemplary embodiment is shown in a schematic diagram; Figure 3 A thinking chain reasoning visual diagram in the present exemplary embodiment is shown; Figure 4 A flowchart of a configuration auditing method in the present exemplary embodiment is shown; Figure 5 A process diagram of a configuration auditing method in the present exemplary embodiment is shown; Figure 6 An interface diagram of an auditing system in the present exemplary embodiment is shown; Figure 7 A structure diagram of a configuration auditing device in the present exemplary embodiment is shown; Figure 8 A structure diagram of an electronic device in the present exemplary embodiment is shown. DETAILED DESCRIPTION

[0026] In order to make the objectives, technical solutions and advantages of the present disclosure clearer, the following will combine the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only some of the embodiments of the present disclosure, but not all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without any creative effort are within the protection scope of the present disclosure. The embodiments in the present disclosure and the features in the embodiments can be combined with each other arbitrarily without conflict. And, although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in different order from here.

[0027] In the specification and claims of the present disclosure, the term “comprising” and any variations thereof are intended to cover the non-exclusive protection. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0028] In one or more embodiments of the present disclosure, “multiple” refers to two or more. “And / or” describes the association relationship of associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, wherein A and B can be singular or plural. The character “ / ” generally represents an “or” relationship between the associated objects before and after it. “At least one of the following (one)” or similar expressions refers to any combination of these items, including any combination of single (one) or multiple items. For example, at least one of a, b or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, and c can be single or multiple.

[0029] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which are schematic illustrations of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the drawings can be functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in the form of software, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The embodiments can be implemented in various forms and should not be understood as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure can be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to give a sufficient understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that one or more specific details can be omitted, or other methods, components, devices, steps, etc. can be used instead of one or more specific details, in implementing the technical solutions of the present disclosure.

[0030] It should be noted that in the embodiments of the present disclosure, some software, components, models, etc. of the prior art may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present disclosure, but it does not mean that the applicant has or will necessarily use the scheme. In the technical solutions of the present disclosure, the collection, transmission, use, etc. of data comply with relevant national laws and regulations.

[0031] As described above, the configuration change frequency of multiple professional network devices in the related art increases exponentially, and the auditing scheme provided in the related art cannot meet the production requirements in terms of accuracy and processing timeliness.

[0032] In view of this, an exemplary embodiment of this disclosure provides a configuration audit method. This method, when receiving a configuration command input by a user, inputs the configuration command into a first model to obtain audit questions. The first model is a sub-model of a pre-trained audit model, which also includes a second model. The audit questions are input into the second model to generate an audit report corresponding to the configuration command. It is evident that this embodiment of the disclosure can quickly respond to user-input configuration commands based on the first model in the audit model, and perform verification, code semantic understanding, error code analysis, and potential anomaly analysis on the configuration commands based on the audit questions output by the first model using the second model, to output an audit report for all erroneous command segments. Thus, the entire process requires no manual operation, greatly improving the accuracy and timeliness of auditing configuration commands for multiple professional network devices.

[0033] To better understand the technical solutions provided in the embodiments of this disclosure, the following is a brief introduction to the application scenarios applicable to the technical solutions provided in the embodiments of this disclosure. It should be noted that the application scenarios described below are only for illustrating the embodiments of this disclosure and are not intended to limit the scope. In specific implementation, the technical solutions provided in the embodiments of this disclosure can be flexibly applied according to actual needs.

[0034] To better illustrate the solutions provided in this disclosure, some key terms used in the embodiments of this disclosure will be introduced below: The large model (Foundation Model) refers to a pre-trained language model with a parameter scale of over 10 billion, which has powerful semantic understanding and reasoning capabilities. It is the second model in this embodiment of the disclosure. The second model is used to check the configuration instructions, understand the code semantics, analyze the error code and analyze the potential anomalies according to the audit questions output by the first model, so as to output an audit report of all error instruction segments. That is, it is responsible for complex configuration semantic parsing and anomaly pattern recognition.

[0035] Lightweight Model: A lightweight model optimized for a specific task (typically with less than 100 million parameters), namely the first model in this embodiment. The first model is used to quickly respond to configuration commands input by the user and perform real-time rule verification on the configuration commands. When it is determined that a matching template exists, an audit problem is identified and transmitted to the second model.

[0036] 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.

[0037] In the embodiments of the present disclosure, the configuration auditing technology can be applied to business scenarios of multi-level device collaborative auditing in enterprise campus networks, data center "Internet Protocol (IP) + Ethernet Virtual Private Network (EVPN) + Security" integration auditing scenarios, industrial Internet "Internet Protocol (IP) + Wireless + OT Security (Operational Technology Security)" special auditing scenarios, cloud-edge collaboration "IP Security Protocol Virtual Private Network (IPsec VPN) + Edge Computing" configuration auditing scenarios, or configuration auditing of multiple professional network devices, etc. The embodiments of the present disclosure do not limit this.

[0038] Please refer to Figure 1 as shown Figure 1 which is an application scenario applicable to the technical solution of the embodiments of the present disclosure. In this scenario schematic diagram, it includes a terminal device 110 and an electronic device 120. Among them, the terminal device 110 and the electronic device 120 can be directly or indirectly communicatively connected through one or more networks 130. Optionally, the application scenario may further include other electronic devices. Other electronic devices, for example, can perform linkage processing based on the output result of the electronic device 120. The embodiments of the present disclosure do not limit this. Among them, the terminal device 110 deploys a client of the auditing system, and the user can log in to the auditing system to trigger an operation of auditing the configuration instruction. The electronic device 120 is a device that provides services to the auditing system.

[0039] In the embodiments of the present disclosure, the user can log in to the client of the auditing system based on the terminal device 110 and input a configuration instruction. Then, the electronic device 120 can receive the configuration instruction input by the user and input the configuration instruction into the first model to obtain an auditing problem. The first model is a sub-model of a pre-trained auditing model, and the auditing model further includes a second model. The auditing problem is input into the second model to generate an auditing report corresponding to the configuration instruction.

[0040] In the embodiments of the present disclosure, the auditing system can be understood as an IP digital employee system covering the entire process of "data - training - inference - operation and maintenance". The auditing system can be constructed based on domestic computing power (such as the Ascend 910B chip) and an auditing model (such as the DeepSeek-COT (Chain-of-Thought) large model).

[0041] In the specific implementation process, the inventor of the present disclosure put the auditing system into online use. After the system was launched for 3 months, the auditing accuracy rate was stable at ≥95%. The average processing time per single configuration decreased from 15 minutes to 20 seconds, and the labor cost decreased by 78%. Obviously, the auditing system provided by the embodiments of the present disclosure can not only improve the accuracy of auditing the configurations of multiple professional network devices, but also greatly improve the processing efficiency and reduce the labor cost.

[0042] For example, see Figure 2 The diagram shown is an exemplary architecture diagram of an audit system provided in an embodiment of this disclosure.

[0043] exist Figure 2 In China, the audit system comprises a five-layer architecture: data layer, computing power layer, model layer, capability layer, and application layer.

[0044] The data layer features the Drain log parsing engine, which automatically extracts configuration fragments from 12 types of devices on the live network (such as routers, switches, firewalls, etc.), with a daily increment of 300,000 records. It also includes the DeepSeek corpus factory, which uses a general-purpose model with 7 billion parameters to generate 5 million synthetic configuration question-answer pairs. After secondary annotation by experts, this forms a 1.2 million-piece golden dataset (i.e., the training sample set mentioned later).

[0045] The computing layer utilizes domestically produced Huawei Ascend 910B graphics cards to achieve full domestic compatibility and end-to-end national cryptographic encryption.

[0046] The model layer uses DeepSeek-14B as the audit model, employing Low-Rank Adaptation (LoRA) fine-tuning with a thought chain length of 8-12 steps, and each of the two single-card graphics cards occupies 18GB of memory. Furthermore, it utilizes, for example, Huawei Security Sandbox + Ascend 910B inference container + Chinese national cryptographic standard TLS 1.3 to achieve "data not leaving the domain".

[0047] In this way, the final audit system (also known as the IP digital employee) supports calls from three platforms: the World Wide Web, the command-line interface (CLI), and the application programming interface (API), possessing a closed-loop capability of "error location - root cause analysis - correct configuration generation - effect evaluation." Furthermore, the audit system can support real-time rendering of Chain of Thought (COT) reasoning visualization, allowing tracing back to the original template and parameter descriptions for easy review. For example, see... Figure 3 The diagram shown illustrates the thought process chain.

[0048] In this embodiment of the disclosure, Figure 1 The terminal device 110 can be a mobile phone, tablet computer (PAD), personal computer (PC), smart TV, smart watch, smart speaker, smart in-vehicle device, and wearable device, but is not limited to these.

[0049] In this embodiment of the disclosure, the electronic device 120 can be a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server or cloud server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms, but it is not limited to these.

[0050] Of course, the methods provided in this disclosure are not limited to... Figure 1 The application scenarios shown can also be used in other possible application scenarios, such as application scenarios where only the electronic device 120 implements the configuration audit method. This disclosure does not limit the application scenarios.

[0051] To further illustrate the technical solutions provided by the embodiments of this disclosure, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this disclosure provide method operation steps as shown in the following embodiments or drawings, the method may include more or fewer operation steps based on conventional or non-inventive methods. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided by the embodiments of this disclosure. In actual processing or when the device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.

[0052] Please see Figure 4 , Figure 4 This invention provides a configuration audit method, which is implemented using an electronic device, such as... Figure 1 The electronic device 120 is not limited in this embodiment of the invention.

[0053] Step 401: Receive configuration instructions input by the user; In this embodiment of the disclosure, the electronic device can receive configuration instructions input by the user. These configuration instructions can be multiple or a single instruction; this embodiment of the disclosure does not limit this.

[0054] Step 402: Input the configuration command into the first model to obtain the audit problem; the first model is a sub-model of the pre-trained audit model, and the audit model also includes the second model.

[0055] In this embodiment of the disclosure, the audit model includes a first model and a second model. The first model is used for real-time rule verification and rapid response tasks, while the second model is used for complex configuration semantic parsing and abnormal pattern recognition.

[0056] To better understand how the audit model handles configuration commands, the process of obtaining the audit model will be introduced below.

[0057] In this disclosed embodiment, the audit model can be obtained by adopting, but is not limited to, the following steps: Step A: Determine the training sample set based on the preset first model; the training sample set includes multiple pairs of labeled corpora, each pair of samples includes a positive sample and a negative sample corresponding to the positive sample.

[0058] In this embodiment of the disclosure, the computing power resources of the electronic device can be determined first. Specifically, considering the existing localization requirements of auditing, domestically produced chips can be used to provide computing power resources. For example, the Ascend 910B chip can be used to provide computing power resources. That is, the training and inference of the whole process audit model can be completed on the Ascend 910B chip to realize the closed-loop processing of automatic discovery of configuration errors, root cause analysis, correct configuration generation and effect quantitative evaluation.

[0059] In this embodiment of the disclosure, after determining the computing power resources, a large language model adapted to the computing power resources can be selected as the preset audit model (i.e., the audit model to be trained). This allows for the preprocessing of configuration files and configuration manuals of multiple professional network devices based on the preset first model in the preset audit model, thereby obtaining a configuration template library, a configuration statement interpretation library, and a configuration parameter description library. Furthermore, based on the preset first model, sample generation processing is performed on the configuration template library, configuration statement interpretation library, configuration parameter description library, and multiple basic instructions to obtain a training sample set.

[0060] In this embodiment, the Drain log parsing engine can automatically extract configuration files and configuration manuals for 12 types of devices currently in the network, including routers, switches, firewalls, load balancers, servers, storage devices, IoT gateways, security devices, and cloud devices. This provides a configuration template library, a configuration statement interpretation library, and a configuration parameter description library.

[0061] In this embodiment, the configuration template library contains multiple standard configuration templates from various professions, covering network functions such as routing policies and rules, and uses syntax tree comparison technology to ensure the accuracy of the templates; the configuration statement interpretation library is used to collect standardized explanations of various professional terms and configuration instructions, and establish a multi-dimensional semantic association network; the configuration parameter description library is used to integrate the parameter specifications of equipment manufacturers and the existing network operation and maintenance experience to form a structured knowledge graph containing elements such as value range, associated parameters, and risk warnings.

[0062] As can be seen, in this embodiment of the disclosure, by deeply analyzing the massive configuration files (such as those from mainstream manufacturers like Huawei) running on the existing network, and combining authoritative materials such as device technical manuals and standard documents stored on the existing network, the natural language processing and machine learning technologies in the preset first model are used to systematically extract and structure network configuration knowledge elements, thereby constructing a professional knowledge base system for configuration auditing of IP and other specialties. Moreover, the aforementioned three knowledge bases are interconnected through a unified knowledge representation framework, supporting intelligent retrieval based on vector similarity, and providing comprehensive knowledge support for configuration auditing.

[0063] In this embodiment of the disclosure, after obtaining the aforementioned three knowledge bases, a high-quality training sample set can be formed based on the aforementioned three knowledge bases.

[0064] In this embodiment, a configuration template library, a configuration statement definition library, a configuration parameter description library, and basic instructions are matched based on a preset first model to obtain multiple matching templates. These multiple matching templates and prompt word templates are then integrated to obtain multiple positive samples, and multiple simulated positive samples are constructed to obtain positive samples in the training sample set. Negative sample generation rules are used to process the positive samples in the training sample set to obtain negative samples corresponding to the positive samples. The negative sample generation rules include at least one of the following: random parameter deletion, keyword replacement, parameter out-of-bounds errors, spelling errors, parameter format errors, missing context, adversarial examples, noise injection generation, and multilingual hybrid generation.

[0065] In this embodiment, the first model can first perform structured processing on the basic instructions and configuration template library, configuration statement interpretation library, and configuration parameter description library (e.g., corpus distillation, i.e., instruction compression). This not only eliminates format differences but also reduces the amount of data processing, improving the training efficiency of the model. Then, a template matching algorithm is used to find the configuration template most similar to the basic instructions and the configuration template library, configuration statement interpretation library, and configuration parameter description library. The most similar configuration template is then substituted into the prompt template to generate a single corpus, i.e., the aforementioned positive sample. In this way, multiple corpora can be obtained based on multiple basic instructions, thereby obtaining positive samples in the training sample set.

[0066] As can be seen, the samples in the training sample set are basic instructions provided by professionals, and then the instruction compression algorithm and the matching template small model algorithm are used to match the instruction template (i.e. the most similar configuration template mentioned above). The corpus is automatically generated based on the instruction template and the prompt word template. The corpus is divided into two types: positive samples and erroneous negative samples. Negative samples help the large language model understand where the instructions may be wrong.

[0067] For example, the prompt template is as follows: "You are a network operations and maintenance expert who is very familiar with the configuration specifications of equipment manufacturer: {vendor} and device type: {device_type}. Now, please use your professional knowledge to answer the user's questions."

[0068] Given a configuration block consisting of multiple lines and its corresponding configuration template, you can compare the configuration block and the template to determine if the configuration block contains any anomalies. If an anomaly is found, you can explain the reason for the anomaly and provide the correct configuration.

[0069] The configuration to be verified is shown below: {raw_user_input}.

[0070] The templates to be compared are shown below: {best_match_str}.

[0071] The template's structural information and comparison requirements are as follows: 1. The format of this template is fixed and includes < > can have multiple lines.

[0072] 2. If the template contains multiple duplicate lines, but the configuration block to be verified only has one corresponding line, this is not considered an abnormal configuration. Both the configuration block code and the template code consist entirely of English letters and symbols; these codes should not be translated into Chinese in the analysis results.

[0073] 3. Multiple repeated lines in the template can be compressed into one line, and the code to be verified only has one corresponding line, so there is no need to fill in the missing repeated lines.

[0074] The template parameters are as follows: 1. If the template contains <1> ,That <1> This is a variable parameter, which can be replaced in the configuration block with any integer not less than 1 and not greater than 512, or a time point format such as 08:00:01. Please note that the template contains variable parameters. <1> It still includes wildcards < > Please don't misidentify it.

[0075] 2. All < in the template > are all variable parameters, which can be replaced with any number, string, or IP address (without spaces) in a configuration block. Wildcard < The number of '>' and the number of 'digits', 'strings', or 'IP addresses' being replaced must strictly match, following a set of rules. The rule corresponds to a number, string, or IP address (or other parameters) without spaces. An IP address is in the format xxx.xxx.xxx.xxx, such as 192.168.3.1 or 10.25.36.214, etc. When answering, the thought process must strictly match the actual answer. The code in the thought process should be entirely in English; do not translate English code into Chinese. You must strictly compare each line of the template with the configuration code to be verified line by line, especially for spelling errors such as ">" or missing letters. Template lines can be repeated multiple times within the configuration code block to be verified. The code to be verified and the template code are not case-sensitive; do not consider configuration block errors due to case sensitivity. Do not assume an error is correct if you are unsure. The correct configuration should be based on the template. Remove any non-template lines or extra lines in the configuration code block that do not have a corresponding template line. Remove any lines missing from the configuration block but present in the template and without wildcards <. The line of code containing ">" or variable arguments should be automatically added to the final correct configuration. The final output must be the correct configuration; a correct configuration output is entirely in English code, executable code, and must not contain wildcards <. >or variable parameters <1> or <1> The lines of code that cannot be executed directly should be removed from the correct configuration. Do not output these lines, and do not output code containing Chinese characters. Finally, be sure to output the correct configuration code. Here, `{raw_user_input}` is replaced with the validation code block, `{best_match_str}` is replaced with the instruction template matched by the small model, `{vendor}` is the manufacturer (e.g., Huawei, ZTE), and `{device_type}` is the device type (e.g., router).

[0076] In this embodiment, during the positive sample generation stage, firstly, the corpus automatically generated by concatenating instruction modules and prompt word templates with high matching degrees from the device configuration log (i.e., basic instructions) and the configuration template library can be stored as part of the positive samples in the training sample set. Secondly, a dynamic topology environment can be constructed using a network simulation platform such as Graphical Network Simulator 3 (GNS3) / Ethernet Virtual Private Network (EVPN), and configuration instructions such as Open Shortest Path First (OSPF), Border Gateway Protocol (BGP), and Virtual Local Area Network (VLAN) conforming to the Request for Comments (RFC) standard set by the Internet Engineering Task Force (IETF) can be automatically generated using Python scripts to call libraries such as Netmiko, as another part of the positive samples in the training sample set, thereby ensuring the diversity of the configuration corpus.

[0077] In this embodiment of the disclosure, after obtaining positive samples, negative sample generation rules can be applied to process the positive samples in the training sample set to generate negative samples corresponding to the positive samples. The negative sample generation rules include at least one of the following: (1) Randomly delete parameters.

[0078] For example, if the positive sample is IP address 192.168.1.1 / 24, then the corresponding negative sample is IP address 192.168.1.1.

[0079] (2) Replace keywords.

[0080] For example, a positive sample is "shutdown", and the corresponding negative sample is "shutdown".

[0081] (3) Parameter out of bounds.

[0082] For example, a negative sample is IP address 300.300.300.300 / 24.

[0083] (4) Spelling error.

[0084] For example, the positive sample is shutdown, and the corresponding negative sample is shutdown.

[0085] (5) Incorrect parameter format.

[0086] For example, the positive sample is 192.168.1.1 / 24, and the corresponding negative sample is 192.168.1.1.255.

[0087] (6) Missing context

[0088] Negative examples include: configuring an IP address without configuring an interface.

[0089] (7) Adversarial examples.

[0090] For example, GANs can be used to generate highly deceptive errors, such as negative samples like: IP address 192.168.1.1 / 255.255.255.0.

[0091] (8) Noise injection generation: For example, if irrelevant characters are randomly inserted, a negative sample would be interface GigabitEthernet0 / 0 / 1 #comment.

[0092] (9) Multilingual hybrid generation: For example, in a mixed Chinese and English configuration, the negative sample is interface GigabitEthernet0 / 0 / 1 # Interface 1.

[0093] It is evident that using simulation technology to automatically generate positive samples and adversarial mutation to generate negative samples significantly increases the amount of data, which helps to accelerate the convergence speed of subsequent training.

[0094] In this embodiment, the training sample set construction stage can rely on a large model corpus factory (i.e., the training sample set) built using a general-purpose model with 7 billion parameters. An attention-based template matching algorithm is employed to intelligently map the original configuration (i.e., the aforementioned basic instructions) to standard templates, with a similarity threshold set to 0.9 to ensure data quality. Furthermore, by using a pre-defined prompt word engineering framework designed by the first model, positive and negative sample question-answer pairs containing correct and incorrect configuration instructions are automatically generated, thus obtaining the training sample set. All generated data does not require secondary annotation by a network configuration expert team, ultimately forming a golden dataset (i.e., the training sample set), providing a reliable data foundation for subsequent model training.

[0095] In this embodiment, the first model innovatively generates prompts using a professionally adapted machine learning model. Targeting multiple professional network device domains such as IP, wireless, and security, it dynamically generates optimized prompt templates (e.g., wildcard processing, parameter rules) through machine learning algorithms, replacing traditional manually designed prompts and significantly improving the model's accuracy and generalization ability in understanding configuration semantics. Specifically, the input to the first model is professional configuration instructions, and the output is the prompts posed by the second model (i.e., audit questions). The first model incorporates a machine learning model algorithm specifically trained for prompt generation from multiple professional network devices, including IP networks, wireless networks, and security devices.

[0096] Step B: Input the training sample set into the preset second model for training to obtain training effect data.

[0097] Step C: Input the training effect data and the question-answer pair data of the preset test second model into the supervised large model. When the supervised large model determines that the training objective has been achieved, the first model and the second model are obtained.

[0098] In this embodiment of the disclosure, when a training sample set including multiple positive and negative sample pairs is input into a preset second model for training, training effect data can be obtained. Then, the training effect data and the question-answer pair data of the preset test second model are input into a supervised large model. When the supervised large model determines that the training objective has been achieved, a first model and a second model are obtained.

[0099] In the actual implementation process, the hyperparameters of the second model can be iteratively modified and fine-tuned according to the actual training effect. The decline curve of the loss function of the second model can be observed. When the loss value is stable, the training of the second model is terminated to prevent overfitting.

[0100] As can be seen, the training effect of the audit model in this embodiment is determined by the supervisory big model, that is, the supervisory big model determines whether the training effect data of the second model that analyzes and processes the configuration instructions meets the requirements of the corresponding profession. The supervisory big model is input with the training result data of the second model and a certain number of question-and-answer pairs used to test the second model. This allows the supervisory big model to determine the final training effect of the second model and whether it meets the requirements of the corresponding profession, thereby saving manual supervision and time costs. The question-and-answer pairs can be understood as the question-and-answer pairs between audit questions and audit reports. Furthermore, this embodiment employs a dual-model collaborative intelligent training decision-making mechanism, creatively using the supervisory big model to replace manual decision-making for training termination. The training effect data of the second model (i.e., audit indicators + test question-and-answer pairs (i.e., the aforementioned question-and-answer pair data)) is input into the supervisory big model, which judges whether the professional requirements are met and decides to terminate training, achieving fully automated iterative optimization without manual intervention.

[0101] In this embodiment, a supervised large model can be selected as the low-rank adaptive fine-tuning technique for terminating training decisions. For example, supervised fine-tuning (SFT) is used, with a learning rate ranging from 0.0001 to 0.0005. A cosine annealing learning rate scheduling strategy is adopted, with a warm-up ratio coefficient of 0.1 to 0.2. The second model is evaluated every 500-600 training steps. The ratio of training set to validation set is 9:1. Training is performed using the BF16 (Brain Float Point 16) data type, where BF16 is a half-precision floating-point format that can reduce memory usage and computation time.

[0102] As can be seen, the second model in the audit model of this embodiment, after fine-tuning and training, has the ability to generate configuration instructions for the corresponding profession and the ability to judge the correctness of syntax. In addition, the first model, based on the matched template, can quickly judge the configuration instruction change records in the live network, saving the time cost of manual inspection.

[0103] Furthermore, the audit model in this embodiment can be iteratively modified. Based on the effect of fine-tuning the audit model, configuration commands are input in batches. Then, based on the audit accuracy index, the second model's understanding output is corrected through multiple rounds of iterative training by manually modifying prompt words (such as wildcard handling prompt words, variable parameter prompt words, prompt words to avoid letter errors, prompt words for duplicate codes, and prompt words for mixed Chinese and English output). This ensures the training of the second model meets the requirements of the corresponding profession. It is evident that the real-time matching capability of the first model contributes to the layered collaborative training of the second model's deep reasoning capability, thereby improving the iterative training effect of the second model.

[0104] In this embodiment of the disclosure, after obtaining the trained audit model and the configuration instructions input by the user, the configuration instructions can be input into the first model to obtain audit questions. Specifically, the configuration instructions can be compressed to obtain compressed instruction information; the compressed instruction information can be matched with a standard template; after obtaining the matching template, the matching template and the prompt word template can be integrated to obtain the audit questions.

[0105] In this embodiment of the disclosure, the configuration instruction can be processed by removing comment characters to obtain a first compression instruction; the first compression instruction can be processed by removing duplicate lines to obtain a second compression instruction; the second compression instruction can be processed by matching and segmenting based on a template library to obtain a configuration instruction block, and the configuration instruction block can be processed by character length compression to obtain a compressed instruction block; the compressed instruction block can be combined and compressed using professional knowledge, triplet compression technology and parameter normalization compression technology to obtain compressed instruction information.

[0106] In practical implementation, the following process can be used to compress configuration commands to obtain compressed command information: (1) The configuration instructions are segmented and divided into blocks, and the code lines are converted into code blocks.

[0107] First, comment characters and explanatory text are removed from the code, leaving only the pure code. Duplicate code line combinations are merged in dictionary form. Then, an existing template library is used to match and segment the tens of thousands of input configuration instructions. Matched lines of code are grouped into a single code block, while unmatched lines are grouped into separate code blocks, generating configuration instruction blocks. These code blocks are then compressed in length. For example, several lines of code are converted into a single line of character encoding much shorter than the code block string using an encoding and decoding algorithm, facilitating compressed storage and transmission.

[0108] (2) Use professional knowledge compression to structurally decompose complex network device configuration instruction blocks (such as command configuration lines from manufacturers like Huawei).

[0109] First, tuple extraction is performed, mainly by breaking down configuration instructions into triples of object, action, and parameter.

[0110] For example:

[0111] interface GigabitEthernet0 / 0 / 1

[0112] IP address 192.168.1.1 255.255.255.0

[0113] Shutdown

[0114] Decomposed into: (interface, GigabitEthernet0 / 0 / 1, IP address 192.168.1.1255.255.255.0) (interface, GigabitEthernet0 / 0 / 1, shutdown) (3) Normalize the parameters: Standardize IP addresses, subnet masks, VLAN IDs, etc., into a unified format.

[0115] For example, 192.168.1.1 / 24 replaces 192.168.1.1 255.255.255.0.

[0116] As can be seen, in terms of instruction compression, compared with the related technologies that use methods such as removing duplicate lines and simplifying comment characters to compress instructions, the embodiments of this disclosure add a combination of compression methods such as template-based compression of duplicate code blocks, compression using professional knowledge and triplet, parameter normalization compression, and encoding / decoding compression. On the basis of simple compression technology, semantic compression is added, resulting in a higher compression rate and improving the processing efficiency of the audit system.

[0117] In this embodiment of the disclosure, dynamic editing distance calculation can be performed on the compression instruction information and the standard templates in the template library to obtain multiple distances. Based on the multiple distances, a candidate template set can be determined. Context state machine matching processing can be performed on the compression instruction information and the standard templates in the candidate template set to obtain matching result information.

[0118] In the specific implementation process, in order to efficiently match the configuration instructions input by the user with the standard template, the embodiments of this disclosure add a template matching algorithm based on dynamic edit distance and context state machine on the basis of similarity matching.

[0119] The Adaptive Levenshtein Distance (DLD) primarily calculates the minimum editing operation (insert, delete, replace) distance between the input command and the standard template. It assigns higher weights to key fields (such as IP address), ignores irrelevant spaces / line breaks, and achieves adaptive weighting. For long commands (such as ACL rules), it uses substring matching to avoid the problem of low efficiency in global matching.

[0120] The context-aware state machine (FSM) is implemented as follows: State definition: INIT (initial state); INTERFACE (Interface configuration mode entered); IP_ADDRESS (IP configured); SHUTDOWN (Interface shut down). Error detection logic: If IP address appears when the status is INIT, the error "Interface not configured, unable to set IP" will be reported. If shutdown appears when the status is IP_ADDRESS, the error "IP not configured, interface cannot be shut down" will be reported.

[0121] Furthermore, for multi-vendor syntax adaptation, the regular expression library selected in this embodiment of the disclosure writes rules separately for the CLI syntax of different vendors (such as Cisco's IP route vs Huawei's route-static), and automatically selects matching rules according to the device type (such as show version output).

[0122] As can be seen, in terms of instruction matching, compared to related technologies that rely on regular expressions to match entire lines and are prone to missing partial code, the structured tuple matching and dynamic edit distance used in this disclosure support local error correction and reduce the false positive rate. Furthermore, while related technologies require writing independent rule bases for each vendor, the low-rank adaptive fine-tuning provided in this disclosure uniformly learns multi-vendor syntax, requiring only a few examples to adapt to new devices, significantly reducing rule maintenance costs. Moreover, compared to the single-line validation used in related technologies that ignore configuration logic dependencies, this disclosure employs a context state machine method, resulting in higher accuracy in matching user-input configuration instructions with standard templates.

[0123] Step 403: Input the audit questions into the second model and generate the audit report corresponding to the configuration instructions.

[0124] In this embodiment of the disclosure, after obtaining an audit issue, the audit issue can be input into the second model to generate an audit report corresponding to the configuration command. The second model can verify the actual configuration command input by the user, perform code semantic understanding and error code analysis, and potential anomaly (bug) analysis, such as fault / defect analysis, and finally output an audit report of all erroneous command segments for technical personnel to calibrate and review. This achieves the auditing of IP and other configuration commands using both the first and second models.

[0125] In this disclosure, for a better understanding of the configuration audit scheme provided in this disclosure, please refer to... Figure 5 As shown below, a specific example will be used to introduce the complete process of executing a configuration audit scheme on an electronic device.

[0126] exist Figure 5 This paper takes the Deepseek model as the default audit model as an example. The process begins with selecting a suitable large language model as the default audit model. Once the default audit model is determined, the existing network configuration files and configuration manuals can be preprocessed based on the default first model within the default audit model to obtain a configuration template library, a configuration statement interpretation library, and a configuration parameter description library. Furthermore, prompt words can be concatenated from the configuration template library, configuration statement interpretation library, and configuration parameter description library to obtain a configuration corpus dataset.

[0127] exist Figure 5 In this process, the preset second model in the pre-defined audit model can be fine-tuned using a configured corpus dataset. When the supervised large model is determined to meet the fine-tuning effect, the second model (i.e., Figure 5 (The Deepseek audit model in the text).

[0128] exist Figure 5In the audit model, configuration instructions can be received from the user. The first model within the audit model processes these instructions into a format consistent with the template. It then matches the instruction with the most similar template, statement definition, and parameter description. This most similar template, statement definition, and parameter description are then concatenated with prompt words to obtain a question consistent with the format of the fine-tuning corpus. This question is then input into the system. Figure 5 The DeepSeek audit model is used to obtain audit reports.

[0129] For example, see Figure 6 As shown below, a specific example illustrates the user's experience using the audit system. In this embodiment, the user inputs a configuration command, and the program matches the command with the template library, statement definition library, and configuration parameter description library with the highest similarity, concatenates them with prompt words, and uses this as a question to ask a fine-tuned second model. Finally, the second model outputs an audit report.

[0130] As can be seen, the configuration auditing scheme provided in this embodiment significantly improves the auditing accuracy. This scheme not only automatically identifies configuration errors and potential risks but also automatically generates correct configurations, effectively reducing the workload of manual review. Specifically, the auditing system implements intelligent IP configuration auditing (accuracy rate exceeding 95%) 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.

[0131] Exemplary embodiments of this disclosure also provide a configuration audit apparatus. (See reference...) Figure 7 As shown, the audit device 700 includes the following program units: The receiving unit 701 is used to receive configuration instructions input by the user; The first audit unit 702 is used to input the configuration instructions into the first model to obtain audit questions; the first model is a sub-model of a pre-trained audit model, and the audit model further includes a second model; wherein, the second model performs verification, code semantic understanding, error code analysis and potential anomaly analysis on the configuration instructions according to the audit questions, so as to output an audit report of all error instruction segments; The second audit unit 703 is used to input the audit question into the second model and generate an audit report corresponding to the configuration instruction.

[0132] In one possible implementation, the first audit unit 702 is configured to: The configuration instructions are compressed to obtain compressed instruction information; The compression instruction information is matched with the standard template; Once the matching template is obtained, it is integrated with the prompt word template to obtain the audit question.

[0133] In one possible implementation, the first audit unit 702 is configured to: The configuration instructions are processed by removing comment characters to obtain the first compression instruction; The first compression instruction is processed to remove duplicate lines, resulting in the second compression instruction; The second compression instruction is matched and segmented based on the template library to obtain a configuration instruction block, and the character length of the configuration instruction block is compressed to obtain a compression instruction block. The compression instruction block is combined and compressed using professional knowledge, triplet compression technology, and parameter normalization compression technology to obtain compression instruction information.

[0134] In one possible implementation, the first audit unit 702 is configured to: The compression instruction information and the standard templates in the template library are dynamically edited to calculate the distance, and multiple distances are obtained. Based on the multiple distances, a candidate template set is determined. The compression instruction information is matched with the standard templates in the candidate template set using a context state machine to obtain the matching result information.

[0135] In one possible implementation, the second model is trained in the following manner: The training sample set is determined based on a preset first model; the training sample set includes multiple pairs of labeled corpora, and each pair of samples includes a positive sample and a negative sample corresponding to the positive sample; The training sample set is input into a preset second model for training to obtain training effect data; The training effect data and the question-answer pair data of the second model are input into the supervised large model. When the supervised large model determines that the training objective has been achieved, the first model and the second model are obtained.

[0136] In one possible implementation, determining the training sample set includes: Based on the preset first model, the configuration files and configuration manuals of multiple professional network devices are preprocessed to obtain a configuration template library, a configuration statement interpretation library, and a configuration parameter description library. Based on the preset first model, the configuration template library, configuration statement interpretation library, configuration parameter description library, and multiple basic instructions are processed to generate samples and obtain the training sample set.

[0137] In one possible implementation, the training sample set is obtained by performing sample generation processing on the configuration template library, configuration statement interpretation library, configuration parameter description library, and basic instructions based on the preset first model, including: Based on the preset first model, the configuration template library, configuration statement interpretation library, configuration parameter description library and basic instructions are matched to obtain multiple matching templates; The multiple matching templates and prompt word templates are integrated to obtain multiple positive samples, and multiple simulated positive samples are constructed to obtain positive samples in the training sample set; The negative sample generation rule is used to process the positive samples in the training sample set to obtain the negative samples corresponding to the positive samples in the training sample set. The negative sample generation rules include at least one of the following: random parameter deletion, keyword replacement, parameter out-of-bounds, spelling errors, parameter format errors, missing context, adversarial examples, noise injection generation, and multilingual hybrid generation.

[0138] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.

[0139] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0140] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the configuration audit method described above.

[0141] In one implementation, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing a computer program, such as read-only memory, NAND flash memory, etc.

[0142] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.

[0143] Computer program code can be written in one or more programming languages. Examples of programming languages ​​include C, Java, and C++. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).

[0144] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic radiation, and infrared rays. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to cause the electronic device to execute (more specifically, the processor of the electronic device to execute) the method steps of various exemplary embodiments of this disclosure, such as the configuration audit method described above, which includes the following steps: Step 401: Receive configuration instructions input by the user; Step 402: Input the configuration instructions into a first model to obtain audit questions; The first model is a sub-model of a pre-trained audit model, and the audit model also includes a second model; wherein, the second model performs verification, code semantic understanding, error code analysis, and potential anomaly analysis on the configuration instructions according to the audit questions, so as to output an audit report of all erroneous instruction segments; Step 403: Input the audit questions into the second model to generate an audit report corresponding to the configuration instructions.

[0145] The above method steps are implemented by a computer program. When a configuration command is received from a user, the configuration command can be input into a first model to obtain an audit question. The first model is a sub-model of a pre-trained audit model, which also includes a second model. The audit question is input into the second model to generate an audit report corresponding to the configuration command. Therefore, in this embodiment, the configuration command input by the user can be responded to quickly based on the first model in the audit model, and the configuration command can be checked, its code semantics understood, error code analyzed, and potential anomaly analyzed based on the audit question output by the first model according to the second model, so as to output an audit report for all erroneous command segments. This eliminates the need for manual operation throughout the process, greatly improving the accuracy and timeliness of auditing configuration commands for multiple professional network devices.

[0146] Exemplary embodiments of this disclosure also provide an electronic device, which may include a processor and a memory. The memory stores executable instructions for the processor, such as computer programs. The processor executes the executable instructions to perform the method steps of various exemplary embodiments of this disclosure.

[0147] The following is for reference. Figure 8 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 8 The electronic device 800 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein. Figure 8 The electronic device 800 shown can be understood as being similar to the aforementioned Figure 1 The electronic device 120 in the text is the same device.

[0148] like Figure 8 As shown, the electronic device 800 may include: a processor 810, a memory 820, a bus 830, an I / O (input / output) interface 840, and a network adapter 850.

[0149] The memory 820 may include volatile memory, such as RAM 821 and cache unit 822, and may also include non-volatile memory, such as ROM 823. The memory 820 may also include one or more program modules 824, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 824 may include the modules described above.

[0150] The processor 810 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).

[0151] The processor 810 can be used to execute executable instructions stored in the memory 820, such as the configuration audit method described above, which includes the following steps: Step 401: Receive configuration instructions input by the user; Step 402: Input the configuration instructions into the first model to obtain audit questions; The first model is a sub-model of a pre-trained audit model, and the audit model also includes a second model; wherein, the second model performs verification, code semantic understanding, error code analysis, and potential anomaly analysis on the configuration instructions according to the audit questions, so as to output an audit report of all erroneous instruction segments; Step 403: Input the audit questions into the second model to generate an audit report corresponding to the configuration instructions.

[0152] The processor 810 executes the above method steps. When a configuration command input by the user is received, the configuration command can be input into the first model to obtain audit questions. The first model is a sub-model of a pre-trained audit model, which also includes a second model. The audit questions are input into the second model to generate an audit report corresponding to the configuration command. Therefore, in this embodiment, the configuration command input by the user can be quickly responded to based on the first model in the audit model, and the configuration command can be checked, its code semantics understood, error code analyzed, and potential anomaly analyzed based on the audit questions output by the first model according to the second model, so as to output an audit report for all erroneous command segments. This eliminates the need for manual operation throughout the process, greatly improving the accuracy and timeliness of auditing configuration commands for multiple professional network devices.

[0153] Bus 830 is used to connect different components of electronic device 800 and may include data bus, address bus and control bus.

[0154] Electronic device 800 can communicate with one or more external devices 900 (such as keyboard, mouse, external controller, etc.) through I / O interface 840.

[0155] Electronic device 800 can communicate with one or more networks via network adapter 850. For example, network adapter 850 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 850 can communicate with other modules of electronic device 800 via bus 830.

[0156] although Figure 8 As not shown in the diagram, other hardware and / or software modules may also be configured in the electronic device 800, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0157] As can be seen from the above, the technical solutions disclosed herein can be implemented as methods, apparatus, systems, computer program products, storage media, electronic devices, etc. Those skilled in the art will understand that various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be referred to as "circuit," "module," or "system," respectively.

[0158] It should be understood that this disclosure is not limited to the specific methods, steps, or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. Those skilled in the art will readily conceive of other embodiments based on the specific implementations provided in this disclosure. Therefore, the specific implementations provided in this disclosure are merely exemplary, and the scope and spirit of this disclosure are indicated by the claims, and should cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary technical means in the art not disclosed in this disclosure.

Claims

1. A configuration auditing method, characterized in that, The method includes: Receive configuration commands input by the user; The configuration instructions are input into the first model to obtain audit questions; the first model is a sub-model of a pre-trained audit model, and the audit model also includes a second model; wherein, the second model performs verification, code semantic understanding, error code analysis and potential anomaly analysis on the configuration instructions according to the audit questions, so as to output an audit report of all error instruction segments; Input the audit question into the second model to generate an audit report corresponding to the configuration command.

2. The method according to claim 1, characterized in that, Input the configuration command into the first model to obtain audit questions, including: The configuration instructions are compressed to obtain compressed instruction information; The compression instruction information is matched with the standard template; Once the matching template is obtained, it is integrated with the prompt word template to obtain the audit question.

3. The method according to claim 2, characterized in that, The configuration instructions are compressed to obtain compressed instruction information, including: The configuration instructions are processed by removing comment characters to obtain the first compression instruction; The first compression instruction is processed to remove duplicate lines, resulting in the second compression instruction; The second compression instruction is matched and segmented based on the template library to obtain a configuration instruction block, and the character length of the configuration instruction block is compressed to obtain a compression instruction block. The compression instruction block is combined and compressed using professional knowledge, triplet compression technology, and parameter normalization compression technology to obtain compression instruction information.

4. The method according to claim 2, characterized in that, The process of matching the compression instruction information with the standard template includes: The compression instruction information and the standard templates in the template library are dynamically edited to calculate the distance, and multiple distances are obtained. Based on the multiple distances, a candidate template set is determined. The compression instruction information is matched with the standard templates in the candidate template set using a context state machine to obtain the matching result information.

5. The method according to any one of claims 1-4, characterized in that, The second model was trained in the following way: The training sample set is determined based on a preset first model; the training sample set includes multiple pairs of labeled corpora, and each pair of samples includes a positive sample and a negative sample corresponding to the positive sample; The training sample set is input into a preset second model for training to obtain training effect data; The training effect data and the question-answer pair data of the second model are input into the supervised large model. When the supervised large model determines that the training objective has been achieved, the first model and the second model are obtained.

6. The method according to claim 5, characterized in that, Determine the training sample set, including: Based on the preset first model, the configuration files and configuration manuals of multiple professional network devices are preprocessed to obtain a configuration template library, a configuration statement interpretation library, and a configuration parameter description library. Based on the preset first model, the configuration template library, configuration statement interpretation library, configuration parameter description library, and multiple basic instructions are processed to generate samples and obtain the training sample set.

7. The method according to claim 6, characterized in that, Based on the preset first model, sample generation processing is performed on the configuration template library, configuration statement interpretation library, configuration parameter description library, and basic instructions to obtain the training sample set, including: Based on the preset first model, the configuration template library, configuration statement interpretation library, configuration parameter description library and basic instructions are matched to obtain multiple matching templates; The multiple matching templates and prompt word templates are integrated to obtain multiple positive samples, and multiple simulated positive samples are constructed to obtain positive samples in the training sample set; The negative sample generation rule is used to process the positive samples in the training sample set to obtain the negative samples corresponding to the positive samples in the training sample set. The negative sample generation rules include at least one of the following: random parameter deletion, keyword replacement, parameter out-of-bounds, spelling errors, parameter format errors, missing context, adversarial examples, noise injection generation, and multilingual hybrid generation.

8. A configuration auditing device, characterized in that, The device includes: The receiving unit is used to receive configuration instructions input by the user. The first audit unit is used to input the configuration command into the first model to obtain the audit question; the first model is a sub-model of the pre-trained audit model, and the audit model also includes a second model; The second audit unit is used to input the audit questions into the second model and generate an audit report corresponding to the configuration instructions.

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

10. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 7 by executing the executable instructions.