Network configuration method and device, electronic equipment and computer program product
By filtering configuration keywords from natural language text, generating accurate network configuration templates, and using hash indexes to retrieve cases, the problem of low network configuration efficiency is solved, achieving an efficient and intelligent network configuration process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA TOWER CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies have low network configuration efficiency, especially in complex and dynamic network environments where they struggle to meet the needs for rapid response and professional configuration.
By extracting the natural language text input by the user, filtering the target configuration keywords that match the network configuration keyword library, generating accurate network configuration templates by combining them with the template library, and retrieving target network configuration cases from the configuration case library based on hash index, the configuration commands are highly consistent with the user's intent.
It improves the efficiency and reliability of network configuration, reduces the risk of network failures caused by misconfiguration, and realizes an efficient and intelligent network configuration process.
Smart Images

Figure CN121907683A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network and information security, and more specifically, to a network configuration method, apparatus, electronic device, and computer program product. Background Technology
[0002] In network management and configuration practices related to these technologies, network operations and maintenance (O&M) personnel face numerous challenges. As the types and numbers of network devices increase, the complexity of network services also rises. O&M personnel need to configure various functions, such as address translation, virtual LAN partitioning, and access control, manually entering configuration commands through the device's command-line interface. However, this requires O&M personnel to possess a high level of professional knowledge, enabling them to understand and accurately execute the specific configuration syntax of devices from different vendors.
[0003] However, configuration commands in related technologies typically rely on keyword matching, using static rules or vectors combined with semantic templates for transformation. These methods are ineffective at parsing complex, ambiguous, or logged-out user expressions. Keyword- or semantic vector-based matching methods struggle to correctly identify their corresponding network functions. With the increasing number of network devices and the growing complexity of network services, network configuration methods based on static rules or shallow semantic models are insufficient to meet the demands for rapid response and professional configuration in dynamic scenarios.
[0004] There is currently no effective solution to the problem of low network configuration efficiency in related technologies. Summary of the Invention
[0005] The main objective of this application is to provide a network configuration method, apparatus, electronic device, and computer program product to solve the problem of low network configuration efficiency in related technologies.
[0006] To achieve the above objectives, according to one aspect of this application, a network configuration method is provided. The method includes: extracting natural language text from a user-input network configuration request; filtering target configuration keywords matching the natural language text from a network configuration keyword library, wherein the network configuration keyword library stores multiple configuration keywords for operation commands set by network device manufacturers for network devices; determining a target network configuration template matching the target configuration keywords from a network configuration template library, wherein the network configuration template library contains multiple types of network configuration templates; determining the network device type and configuration operation sequence in the target network configuration template; generating a hash index based on the network device type and configuration operation sequence, wherein the configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order; retrieving a target network configuration case from a network configuration case library based on the hash index; and configuring the network device based on the target network configuration case and configuration parameters in the natural language text.
[0007] Optionally, selecting target configuration keywords that match natural language text from the network configuration keyword library includes: performing word segmentation on the natural language text using a natural language processing model to obtain multiple words; for each word, calculating the similarity between the word and each configuration keyword in the network configuration keyword library using a dynamic similarity model; and determining the configuration keyword as the target configuration keyword of the word if the similarity is greater than or equal to the similarity threshold.
[0008] Optionally, calculating the similarity between a word and each configured keyword in the network configuration keyword library using a dynamic similarity model includes: for each configured keyword, converting the word into a first word vector and the configured keyword into a second word vector; calculating the cosine similarity between the first and second word vectors to obtain the initial similarity; calculating the dynamic weight of the configured keyword based on its initial weight and frequency change, where the frequency change is the ratio of the difference between the first and second occurrence frequencies to the first occurrence frequency, the first occurrence frequency being the frequency of the configured keyword in the network configuration keyword library during the previous update cycle, and the second occurrence frequency being the frequency of the configured keyword in the updated network configuration keyword library; and calculating the product of the dynamic weight and the initial similarity to obtain the similarity between the word and the configured keyword.
[0009] Optionally, determining the target network configuration template that matches the target configuration keyword from the network configuration template library includes: extracting a first feature vector from the target configuration keyword and extracting a second feature vector from each network configuration template in the network configuration template library; calculating the Euclidean distance between the first feature vector and the second feature vector of each network configuration template to obtain the similarity between the target configuration keyword and each network configuration template; and determining the network configuration template with the maximum similarity as the target network configuration template.
[0010] Optionally, generating a hash index based on the network device type and configuration operation sequence includes: determining a first preset code corresponding to the network device type and a second preset code corresponding to the configuration operation sequence; inputting the first preset code and the second preset code into a preset hash function to obtain a target hash value, and determining the target hash value as the hash index.
[0011] Optionally, retrieving the target network configuration case from the network configuration case library based on the hash index includes: determining the hash bucket corresponding to the network configuration case library, wherein the hash bucket contains multiple mapping values corresponding to hash values, and each mapping value represents a network configuration case in the network configuration case library; determining the target mapping value corresponding to the target hash value in the hash index, and determining the network configuration case corresponding to the target mapping value as the target network configuration case.
[0012] Optionally, after determining the target network configuration template matching the target configuration keyword from the network configuration template library, the method includes: determining the parameter slots contained in the network configuration template; determining whether the configuration parameters in the natural language text cover all parameter slots in the network configuration template; if the configuration parameters in the natural language text cover all parameter slots in the network configuration template, performing the step of determining the network device type and configuration operation sequence in the target network configuration template; if the configuration parameters in the natural language text do not cover all parameter slots in the network configuration template, issuing a prompt message, wherein the prompt message is used to prompt the user that parameters are missing.
[0013] To achieve the above objectives, according to another aspect of this application, a network configuration apparatus is provided. The apparatus includes: an extraction unit, configured to extract natural language text from a user-input network configuration request, and filter target configuration keywords matching the natural language text from a network configuration keyword library, wherein the network configuration keyword library stores multiple configuration keywords for operation commands set by network device manufacturers for network devices; a first determining unit, configured to determine a target network configuration template matching the target configuration keywords from a network configuration template library, wherein the network configuration template library contains multiple types of network configuration templates; a second determining unit, configured to determine the network device type and configuration operation sequence in the target network configuration template, and generate a hash index based on the network device type and configuration operation sequence, wherein the configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order; and a configuration unit, configured to retrieve a target network configuration case from a network configuration case library based on the hash index, and configure the network device based on the target network configuration case and configuration parameters in the natural language text.
[0014] To achieve the above objectives, according to another aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the network configuration method described in various embodiments of this application.
[0015] This application employs the following steps: extracting natural language text from the user-input network configuration request; filtering target configuration keywords matching the natural language text from a network configuration keyword library, which stores multiple configuration keywords for operation commands set by network device manufacturers for network devices; determining target network configuration templates matching the target configuration keywords from a network configuration template library, which contains various types of network configuration templates; determining the network device type and configuration operation sequence in the target network configuration template; generating a hash index based on the network device type and configuration operation sequence, where the configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order; retrieving target network configuration cases from a network configuration case library based on the hash index; and configuring the network device based on the target network configuration cases and configuration parameters in the natural language text. This solves the problem of low network configuration efficiency in related technologies. By starting from natural language text, filtering relevant configuration keywords through a keyword library, and then combining this with a template library to generate accurately matching network configuration templates, it ensures that the generated configuration commands are highly consistent with the user's intent. Generating a hash index and using it for rapid retrieval provides an efficient means of finding network configuration cases. The recommendation mechanism, based on real-world network configuration examples, provides verified configuration instances, ensuring high reliability of generated configuration commands. This reduces the risk of network failures due to misconfigurations, thereby improving network configuration efficiency. Attached Figure Description
[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 This is a flowchart of a network configuration method provided according to an embodiment of this application;
[0018] Figure 2 This is a schematic diagram of a network configuration system provided according to an embodiment of this application;
[0019] Figure 3 This is a schematic diagram of a network configuration device provided according to an embodiment of this application;
[0020] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] 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 display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0025] It should be noted that the information collected is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation portals are provided for users to choose to authorize or refuse.
[0026] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a network configuration method provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0027] Step S101: Extract the natural language text from the network configuration request input by the user, and filter the target configuration keywords that match the natural language text from the network configuration keyword library. The network configuration keyword library stores multiple configuration keywords of the operation commands of the network device manufacturer for setting the network device.
[0028] In step S101, the natural language text input by the user first needs to undergo word segmentation. A suitable word segmenter for the network domain is used to split the text into sub-words, filtering out redundant symbols and stop words, and retaining the key tokens. A vectorized representation is generated for the retained tokens. Then, the cosine similarity between the key tokens input by the user and the keywords in the network configuration keyword library is calculated. Based on the calculated similarity, several target network configuration keywords with the highest matching degree with the user input are selected.
[0029] Step S102: Determine the target network configuration template that matches the target configuration keyword from the network configuration template library. The network configuration template library contains various types of network configuration templates.
[0030] In step S102, the network configuration template library is composed of collected operation manuals from different network device manufacturers. The configuration commands within are parsed and abstracted into templates. Each template contains configuration keywords, parameter slots, device compatibility information, etc., to ensure that it can be correctly understood and applied by the system. After the target configuration keywords are filtered out, target network configuration templates that match these keywords are searched.
[0031] Step S103: Determine the network device type and configuration operation sequence in the target network configuration template, and generate a hash index based on the network device type and configuration operation sequence. The configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order.
[0032] In this context, network device types are common device categories in a network environment, such as switches, routers, firewalls, and load balancers. Each device type has its unique configuration requirements and command syntax. A configuration operation sequence refers to the sequential set of operations performed when executing configuration commands on a specific network device. These operations are arranged in chronological and logical order, such as "creating a VLAN (Virtual Local Area Network)," "setting the VLAN interface IP address," and "applying ACL (Access Control List) rules." Each operation has specific parameters and context requirements. To effectively retrieve and match network configuration cases, a multi-dimensional feature hash index system based on network device type and configuration operation sequence was designed. The index generation process is roughly as follows: each network device type is assigned a unique code; for example, a switch is coded as 1, a router as 2, a firewall as 3, a load balancer as 4, and so on.
[0033] Configuration operations also require encoding. Considering the timing of these operations, each configuration operation not only has a fixed code (e.g., 10 for device initialization, 11 for VLAN configuration) but also records its first appearance in the case database, incrementing according to the order in which cases are added to the database. Thus, the encoding of a configuration operation contains both "device code" and "operation code." Combining the device type code D and the configuration operation code O, a feature string in the format "DO" is generated. Then, a low-collision-rate, high-efficiency hash function is used to map the feature string to an integer hash value H, which is the final generated hash index.
[0034] Step S104: Retrieve the target network configuration case from the network configuration case library based on the hash index, and configure the network device based on the target network configuration case and the configuration parameters in the natural language text.
[0035] In step S104, a hash index is used to query the network configuration case library to quickly locate the set of cases in the case library that match the user's intent. For each located case, its matching degree with the user's intent is calculated. The matching degree can be calculated based on natural language processing techniques such as keyword frequency, inverse document frequency, and term frequency to ensure semantic consistency between the case and the user's intent. Through comprehensive evaluation of multi-dimensional features, such as device type, temporal attributes of configuration operations, and the occurrence of specific parameters, the matching degree of the case is quantified, and the most matching case is selected as a recommendation or reference.
[0036] Based on the configuration parameters provided by the user in natural language text, check the completeness and accuracy of the configuration commands in the case study. If parameters are missing or ambiguous, ask the user interactively to complete the parameter information. After the user confirms or modifies the parameters, generate a specific configuration command. This command is based on the configuration command template in the case study library but incorporates the user's specific parameter settings to ensure the applicability and effectiveness of the command. Based on the most matching target network configuration case and the user's configuration parameters, generate the final network configuration commands. These commands can be CLI (Command Line Interface) commands for specific network devices or instructions that can be executed via API (Application Programming Interface). After generating the commands, configure the network device according to user requirements or the system's automated process.
[0037] The network configuration method provided in this application extracts natural language text from the user-input network configuration request, filters target configuration keywords matching the natural language text from a network configuration keyword library (which stores multiple configuration keywords for operation commands set by network device manufacturers for network devices), determines a target network configuration template matching the target configuration keywords from a network configuration template library (which contains various types of network configuration templates), determines the network device type and configuration operation sequence in the target network configuration template, and generates a hash index based on the network device type and configuration operation sequence (where the configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order), retrieves a target network configuration case from a network configuration case library based on the hash index, and configures the network device based on the target network configuration case and the configuration parameters in the natural language text. This solves the problem of low network configuration efficiency in related technologies. By starting from natural language text, filtering relevant configuration keywords through a keyword library, and then combining this with a template library to generate a precisely matching network configuration template, it ensures that the generated configuration commands are highly consistent with the user's intent. The generation of a hash index and its use for fast retrieval provides an efficient means of finding network configuration cases. The recommendation mechanism, based on real-world network configuration examples, provides verified configuration instances, ensuring high reliability of generated configuration commands. This reduces the risk of network failures due to misconfigurations, thereby improving network configuration efficiency.
[0038] Selecting target configuration keywords based on similarity: Optionally, in the network configuration method provided in this application embodiment, selecting target configuration keywords that match natural language text from the network configuration keyword library includes: performing word segmentation on the natural language text using a natural language processing model to obtain multiple words; for each word, calculating the similarity between the word and each configuration keyword in the network configuration keyword library using a dynamic similarity model; and determining the configuration keyword as the target configuration keyword of the word if the similarity is greater than or equal to the similarity threshold.
[0039] In some embodiments, a token segmentation mechanism based on a natural language processing model is used to segment words into sub-words. Redundant symbols and stop words are filtered out, and key tokens, i.e., words, are retained. For each word in the natural language text, a dynamic similarity model is used to calculate its similarity to each configuration keyword in the network configuration keyword library. Similarity is calculated based on word vectors and combined with domain weight factors to ensure priority matching of network domain terminology. The calculated similarity can be cosine similarity. A similarity threshold is set; when the similarity between a word and a configuration keyword is greater than or equal to this threshold, the configuration keyword is determined to be the target configuration keyword for that word, i.e., the configuration term most relevant to the user's intent. For example, the similarity between "port" and configuration keywords such as "port" and "interface" is higher than the threshold, and therefore they are selected as the target configuration keywords for matching.
[0040] It should be noted that multiple target configuration keywords can exist when selecting matching natural language text from the network configuration keyword library.
[0041] This embodiment uses a dynamic similarity model to filter target configuration keywords, ensuring accurate capture of user intent and avoiding configuration errors caused by inaccurate keyword understanding. The dynamic similarity model adjusts weights based on network domain expertise, enabling more intelligent identification and matching of technical terms and improving the intelligence level of configuration generation. Users do not need in-depth knowledge of network configuration terminology; they only need to express their intent in natural language for automatic recognition and configuration command generation, lowering the barrier to configuring network devices and enhancing the overall user experience.
[0042] The dynamic similarity model can calculate similarity based on word vectors and dynamic weights. Optionally, in the network configuration method provided in this application embodiment, calculating the similarity between a word and each configuration keyword in the network configuration keyword library using the dynamic similarity model includes: for each configuration keyword, converting the word into a first word vector and the configuration keyword into a second word vector; calculating the cosine similarity between the first word vector and the second word vector to obtain an initial similarity; calculating the dynamic weight of the configuration keyword based on the initial weight and frequency change, wherein the frequency change is the ratio of the difference between the first occurrence frequency and the second occurrence frequency to the first occurrence frequency, the first occurrence frequency is the occurrence frequency of the configuration keyword in the network configuration keyword library in the previous update cycle, and the second occurrence frequency is the occurrence frequency of the configuration keyword in the updated network configuration keyword library; and calculating the product of the dynamic weight and the initial similarity to obtain the similarity between the word and the configuration keyword.
[0043] In some embodiments, word vectorization can be achieved through a word embedding model, generating 200-dimensional word vectors based on a network domain corpus. Words are converted into first word vectors, and configuration keywords are converted into second word vectors. The cosine similarity between the words and the set of operation command keywords (i.e., configuration keywords) of a given manufacturer's network equipment is calculated. The cosine similarity is used to calculate the cosine value of the angle between the two vectors: when the angle is 0°, the cosine value is 1 (completely similar); when the angle is 90°, the cosine value is 0 (no association); and when the angle is 180°, the cosine value is -1 (semantic opposite). To improve the accuracy of network keyword mapping, a dynamic domain weight factor is introduced to construct a network domain-specific dynamic similarity model.
[0044] ;
[0045] in, The initial similarity score measures the cosine of the angle between the token and keyword vectors, reflecting their degree of similarity in the general semantic space. The dynamic weighting factor for the network keyword k:
[0046] = ;
[0047] in, The initial weight of keywords is based on the presupposition of importance in the network domain; To adjust the coefficients and control the magnitude of weight changes; The frequency change of keywords in the new and old cycles is also known as the frequency change.
[0048] Taking the matching of "internal network penetration" and "NAT (Network Address Translation)" as an example: the original cosine similarity is 0.85, and the initial weight of "NAT" is 1.4. If the new cycle frequency increases from 150 to 220, the dynamic weight becomes 1.503, and the final similarity is 1.278. This significantly improves the matching priority of core network terms (such as "BGP (Border Gateway Protocol)" and "subnet mask"), and the weight is dynamically adjusted with the domain frequency. This ensures the semantic priority of professional terms while responding promptly to the changing importance of emerging technology terms (such as "CDN (Content Delivery Network)"), achieving a complete mapping of semantic elements from natural language to network keywords.
[0049] This embodiment calculates the similarity between words and configuration keywords using a dynamic similarity model. It not only considers semantic matching but also incorporates the usage variations of keywords in specific contexts, greatly improving the intelligence and accuracy of network configuration generation.
[0050] The target network configuration template can be determined based on similarity. Optionally, in the network configuration method provided in this application embodiment, determining the target network configuration template that matches the target configuration keyword from the network configuration template library includes: extracting a first feature vector from the target configuration keyword and extracting a second feature vector from each network configuration template in the network configuration template library; calculating the Euclidean distance between the first feature vector and the second feature vector of each network configuration template to obtain the similarity between the target configuration keyword and each network configuration template; and determining the network configuration template corresponding to the maximum similarity as the target network configuration template.
[0051] In some embodiments, in network configuration scenarios, user-input natural language commands suffer from semantic ambiguity or missing parameters. Parameter completion and intent clarification are achieved by quantifying the semantic distance between user intent and standard configuration templates. First, network configuration commands are abstracted as combinations of fixed command structures and parameter slots, constructing a network configuration template library containing various configuration types. For user input and templates, word vectors are generated, mapping the text semantics to a continuous n-dimensional vector space. Based on the Euclidean distance calculation model, the matching degree between user intent and templates is quantified. For user-input natural language commands, n target configuration keywords matching the natural language command are selected from the network configuration keyword library. Each of the n target configuration keywords corresponds to a target network configuration template. The n target configuration keywords are mapped to a continuous n-dimensional vector space to obtain feature vectors. That is, the first feature vector and the template feature vector. That is, the second eigenvector, whose Euclidean distance is:
[0052] ;
[0053] Among them, I j Let T represent the coordinates of the first eigenvector in the j-th dimension of an n-dimensional vector space. ij Let represent the coordinates of the second feature vector of the i-th network configuration template in the j-th dimension within an n-dimensional vector space. Semantic similarity is intuitively reflected by calculating the straight-line distance between two points in the vector space. The template with the smallest Euclidean distance is selected. As a candidate, set a distance threshold. ,like If the similarity is less than the distance threshold, then no matching template is found. If the similarity is less than the distance threshold, then the network configuration template corresponding to the maximum similarity is determined as the target network configuration template.
[0054] This embodiment uses vectorized representations of keywords and templates, measures semantic similarity through Euclidean distance, and then selects the network configuration template that best matches the user's intent, thereby achieving more intelligent and automated network configuration generation.
[0055] Optionally, in the network configuration method provided in this application embodiment, generating a hash index based on the network device type and configuration operation sequence includes: determining a first preset code corresponding to the network device type and determining a second preset code corresponding to the configuration operation sequence; inputting the first preset code and the second preset code into a preset hash function to obtain a target hash value, and determining the target hash value as the hash index.
[0056] In some embodiments, to meet the efficient retrieval needs of a real network configuration case library, a hash index system based on multi-dimensional features is constructed. Through structured encoding and hash mapping of network device types and configuration operations, rapid case location and recommendation are achieved. For example, the first-dimensional feature is the device category, covering common core devices in the network environment, such as switches, routers, firewalls, and load balancers. Each device type is assigned a unique integer code, denoted as D, where switches are coded as 1, routers as 2, firewalls as 3, load balancers as 4, and so on, ensuring unique identification of device types. The second and subsequent feature dimensions are core configuration operations containing time-series attributes, divided according to the functional attributes of network configuration, including device initialization, VLAN configuration, routing protocol deployment, security policy settings, interface parameter adjustments, etc., also using integer encoding, denoted as D. For example, device initialization might be set to 10, VLAN configuration to 11, routing protocol deployment to 12, and security policy to 13. To reduce hash collisions, the configuration operation code is recorded based on the operation command sequence. Where i represents the sequence number of the first occurrence of the operation in the case library, incrementing in the order the cases were added to the library. The generated hash key is as follows:
[0057] ;
[0058] Here, concat means combining the device category code D, the separator "-", and the configuration operation code. The strings are concatenated to form a feature string of "device code - operation code"; MurmurHash3 is a hash function with low collision rate and high computational efficiency, which can map the feature string into a 32-bit or 64-bit integer hash value H, that is, the final generated hash index.
[0059] This embodiment designs a hash index based on multi-dimensional features using a database of real-world network configuration examples. During a query, a hash key is generated according to the configuration type to quickly locate similar examples and recommend them to the user.
[0060] After obtaining the hash index, the target network configuration case is retrieved from the network configuration case library based on the hash index. Optionally, in the network configuration method provided in this application embodiment, retrieving the target network configuration case from the network configuration case library based on the hash index includes: determining the hash bucket corresponding to the network configuration case library, wherein the hash bucket contains multiple mapping values corresponding to hash values, and each mapping value represents a network configuration case in the network configuration case library; determining the target mapping value corresponding to the target hash value in the hash index, and determining the network configuration case corresponding to the target mapping value as the target network configuration case.
[0061] In some embodiments, the hash index H can be used to directly locate the corresponding hash bucket in the hash table, thereby quickly obtaining similar cases and sorting and recommending them according to their matching degree with the user's intent. For example, in the network configuration case library, there is a case whose device type is a router (encoded as 2), and the configuration operation is to add a static route (encoded as 12), so the hash index is 2-12. The MurmurHash3 function is used to generate the corresponding hash value H. When the user expresses the intent "need to configure a static route to connect two networks", the system parses the device type and configuration operation, constructs a hash key and calculates the hash value. The hash index is used to locate the mapping value in the hash bucket, thereby obtaining the corresponding case information.
[0062] In some optional embodiments, when existing network configuration cases are added to the database, for each case, a feature string is generated based on its corresponding device category code D and configuration operation code O containing timing attributes. The corresponding hash value H is then calculated using the MurmurHash3 hash function. When a user queries, the same hash generation rules as during the database entry stage are used to determine the required device category and timing configuration operation, obtaining the corresponding D and O, and then calculating the hash key H. During the query process, the hash key obtained from the user's intent can directly locate the corresponding hash bucket in the case database hash table, thereby quickly retrieving similar cases. When the hash value H generated after parsing the user intent corresponds to multiple cases, the target network configuration case is further determined based on the priority ranking rules of configuration information content. Specifically, firstly, the configuration file sizes of multiple matching cases corresponding to hash value H are compared; cases with larger file sizes have higher priority. When file sizes are the same, the number of network configuration elements contained in the cases is further compared, including the number of IP addresses, VLANs (Virtual Local Area Networks), etc. Cases with richer configuration information have higher priority. Finally, the case with the highest priority is selected as the recommended target network configuration case and returned to the user. Even after applying the above rules, there may still be situations where multiple cases with the same hash value need to be ordered. In such cases, they should be sorted according to the system entry time of the case database, and cases with later entry times should be recommended to users first.
[0063] This embodiment implements an efficient indexing of the real network configuration case library based on a hash index of multi-dimensional features, which greatly reduces the traversal time during queries and ensures that users can quickly obtain the reference cases they need.
[0064] For the target network configuration template, parameter slot verification is also required. Optionally, in the network configuration method provided in this application embodiment, after determining the target network configuration template that matches the target configuration keyword from the network configuration template library, the method includes: determining the parameter slots contained in the network configuration template, and determining whether the configuration parameters in the natural language text cover all parameter slots in the network configuration template; if the configuration parameters in the natural language text cover all parameter slots in the network configuration template, performing the step of determining the network device type and configuration operation sequence in the target network configuration template; if the configuration parameters in the natural language text do not cover all parameter slots in the network configuration template, issuing a prompt message, wherein the prompt message is used to prompt the user that parameters are missing.
[0065] In some embodiments, after determining the candidate template, it is necessary to verify whether the parameters provided in the user input meet the necessary configuration requirements of the template. Each network configuration template has a preset list of parameters required to complete the configuration operation (adding a static route template requires the target network address, subnet mask, and next-hop address). The user parameter set is compared with the template's necessary parameter list. If there are template parameter slots that are not covered by user parameters (e.g., the user's intent does not mention the target network address and subnet mask), it is determined that the parameters are missing. If there is no matching template or the parameters are missing, a targeted query statement, i.e., a prompt message, is given to guide the user to supplement the necessary information: "Please clarify whether you need to add a static route, or explain whether you need to delete a static route or modify the route priority" or "You need to provide the target network address and subnet mask for adding a static route."
[0066] This embodiment can intelligently process user input by verifying the target network configuration template, ensuring that the generated configuration commands not only conform to the user's intent but also follow the configuration rules of the network device, thereby improving the accuracy and efficiency of network configuration.
[0067] According to another embodiment of this application, a network configuration system is also provided. Figure 2 This is a schematic diagram of a network configuration system provided according to an embodiment of this application. For example... Figure 2 As shown, the system includes: a dynamic semantic mapping module, a two-round interactive intent clarification module, and a case library recommendation module.
[0068] Specifically, the user inputs natural language text, and the dynamic semantic mapping module identifies the user's intent. Based on the semantic similarity between the natural language text and network configuration keywords, target configuration keywords are selected. These target configuration keywords are used as the input to the large language model. The large language model outputs configuration commands, which are then processed by a two-round interactive intent clarification module. This module uses a template matching algorithm based on Euclidean distance to quantify the semantic distance between the user's intent and the standard configuration template, thereby achieving parameter completion and intent clarification. Finally, the case library recommendation module recommends similar configuration cases from a real case library. All modules work together to achieve accurate conversion from user intent to network configuration.
[0069] This embodiment uses a dynamic semantic mapping module, an intent clarification and parameter completion module, and a hash index case library recommendation module based on multi-dimensional features to automatically convert the user's natural language intent into professional network configuration commands. This helps the user confirm or correct the current intent and recommends similar configuration instances to the user, achieving efficient conversion from fuzzy expression to precise configuration. It improves the intelligence and automation level of configuration generation and is suitable for rapid deployment and operation and maintenance assistance in various network scenarios.
[0070] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0071] This application also provides a network configuration device. It should be noted that the network configuration device of this application can be used to execute the network configuration method provided in this application. The network configuration device provided in this application is described below.
[0072] Figure 3 This is a schematic diagram of a network configuration device provided according to an embodiment of this application. For example... Figure 3 As shown, the device includes:
[0073] Extraction unit 301 is used to extract natural language text from the network configuration request input by the user, and to filter target configuration keywords that match the natural language text from the network configuration keyword library. The network configuration keyword library stores multiple configuration keywords of the operation commands set by the network device manufacturer for the network device.
[0074] The first determining unit 302 is used to determine the target network configuration template that matches the target configuration keyword from the network configuration template library, wherein the network configuration template library contains multiple types of network configuration templates;
[0075] The second determining unit 303 is used to determine the network device type and configuration operation sequence in the target network configuration template, and generate a hash index based on the network device type and configuration operation sequence, wherein the configuration operation sequence is a set of configuration operations corresponding to the network configuration command executed in chronological order;
[0076] The second determining unit 303 is used to retrieve the target network configuration case from the network configuration case library based on the hash index, and configure the network device based on the target network configuration case and the configuration parameters in the natural language text.
[0077] The network configuration device provided in this application embodiment extracts natural language text from a user-input network configuration request using an extraction unit 301, and filters target configuration keywords matching the natural language text from a network configuration keyword library. The network configuration keyword library stores multiple configuration keywords for operation commands set by network device manufacturers for network devices. A first determining unit 302 determines a target network configuration template matching the target configuration keywords from a network configuration template library, which contains various types of network configuration templates. A second determining unit 303 determines the network device type and configuration operation sequence in the target network configuration template, and generates a configuration file based on the network device type and configuration operation sequence. A hash index is generated, where the configuration operation sequence is a set of configuration operations corresponding to the executed network configuration commands, arranged in chronological order. Configuration unit 304 retrieves the target network configuration case from the network configuration case library based on the hash index. It then configures the network device based on the target network configuration case and configuration parameters from natural language text. This solves the problem of low network configuration efficiency in related technologies. By starting from natural language text, filtering relevant configuration keywords through a keyword library, and combining this with a template library to generate accurately matching network configuration templates, it ensures that the generated configuration commands are highly consistent with user intent. Generating a hash index and using it for fast retrieval provides an efficient means of finding network configuration cases. A recommendation mechanism based on real network configuration cases provides verified configuration examples, ensuring the high reliability of the generated configuration commands. This reduces the risk of network failures due to misconfiguration, thereby improving network configuration efficiency.
[0078] Optionally, in the network configuration device provided in this application embodiment, the extraction unit 301 includes: a word segmentation module, used to perform word segmentation processing on natural language text through a natural language processing model to obtain multiple words; a first calculation module, used to calculate the similarity between each word and each configuration keyword in the network configuration keyword library through a dynamic similarity model; and a first determination module, used to determine the configuration keyword as the target configuration keyword of the word when the similarity is greater than or equal to the similarity threshold.
[0079] Optionally, in the network configuration device provided in this application embodiment, the calculation module includes: a conversion submodule, used to convert each configuration keyword into a first word vector and the configuration keyword into a second word vector; a first calculation submodule, used to calculate the cosine similarity between the first word vector and the second word vector to obtain an initial similarity; a second calculation submodule, used to calculate the dynamic weight of the configuration keyword based on the initial weight and frequency change of the configuration keyword, wherein the frequency change is the ratio of the difference between the first occurrence frequency and the second occurrence frequency to the first occurrence frequency, the first occurrence frequency is the occurrence frequency of the configuration keyword in the network configuration keyword library in the previous update cycle, and the second occurrence frequency is the occurrence frequency of the configuration keyword in the updated network configuration keyword library; and a third calculation submodule, used to calculate the product of the dynamic weight and the initial similarity to obtain the similarity between the word and the configuration keyword.
[0080] Optionally, in the network configuration apparatus provided in this application embodiment, the first determining unit 302 includes: an extraction module, used to extract a first feature vector from the target configuration keyword and extract a second feature vector from each network configuration template in the network configuration template library; a second calculation module, used to calculate the Euclidean distance between the first feature vector and the second feature vector of each network configuration template to obtain the similarity between the target configuration keyword and each network configuration template; and a second determining module, used to determine the network configuration template corresponding to the maximum similarity as the target network configuration template.
[0081] Optionally, in the network configuration device provided in this application embodiment, the second determining unit 303 includes: a third determining module, used to determine a first preset code corresponding to the network device type and a second preset code corresponding to the configuration operation sequence; and an input module, used to input the first preset code and the second preset code into a preset hash function to obtain a target hash value and determine the target hash value as a hash index.
[0082] Optionally, in the network configuration device provided in this application embodiment, the configuration unit 304 includes: a fourth determining module, used to determine the hash bucket corresponding to the network configuration case library, wherein the hash bucket contains multiple mapping values corresponding to hash values, and each mapping value represents a network configuration case in the network configuration case library; and a fifth determining module, used to determine the target mapping value corresponding to the target hash value in the hash index, and determine the network configuration case corresponding to the target mapping value as the target network configuration case.
[0083] Optionally, in the network configuration apparatus provided in this application embodiment, the apparatus includes: a third determining unit, configured to determine the parameter slots included in the network configuration template, and determine whether the configuration parameters in the natural language text cover all parameter slots in the network configuration template; an execution unit, configured to execute the step of determining the network device type and configuration operation sequence in the target network configuration template when the configuration parameters in the natural language text cover all parameter slots in the network configuration template; and a prompting unit, configured to issue a prompting message when the configuration parameters in the natural language text do not cover all parameter slots in the network configuration template, wherein the prompting message is used to prompt the user that parameters are missing.
[0084] The network configuration device includes a processor and a memory. The aforementioned extraction unit 301, first determination unit 302, second determination unit 303, and second determination unit 303 are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0085] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and network configuration efficiency can be improved by adjusting kernel parameters.
[0086] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0087] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a network configuration method.
[0088] This invention provides a processor for running a program, wherein the program executes a network configuration method during runtime.
[0089] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. For example... Figure 4As shown, electronic device 401 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: extracting natural language text from a user-input network configuration request; filtering target configuration keywords matching the natural language text from a network configuration keyword library, wherein the network configuration keyword library stores multiple configuration keywords for operation commands set by network device manufacturers for network devices; determining a target network configuration template matching the target configuration keywords from a network configuration template library, wherein the network configuration template library contains various types of network configuration templates; determining the network device type and configuration operation sequence in the target network configuration template; generating a hash index based on the network device type and configuration operation sequence, wherein the configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order; retrieving a target network configuration case from a network configuration case library based on the hash index; and configuring the network device based on the target network configuration case and the configuration parameters in the natural language text. The device in this document can be a server, PC, PAD, mobile phone, etc.
[0090] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: extracting natural language text from a user-input network configuration request; filtering target configuration keywords matching the natural language text from a network configuration keyword library, wherein the network configuration keyword library stores multiple configuration keywords for operation commands set by network device manufacturers for network devices; determining a target network configuration template matching the target configuration keywords from a network configuration template library, wherein the network configuration template library contains multiple types of network configuration templates; determining the network device type and configuration operation sequence in the target network configuration template; generating a hash index based on the network device type and configuration operation sequence, wherein the configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order; retrieving a target network configuration case from a network configuration case library based on the hash index; and configuring the network device based on the target network configuration case and configuration parameters in the natural language text.
[0091] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0092] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0093] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0094] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0095] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0096] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0097] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0098] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0099] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0100] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A network configuration method, characterized in that, include: Extract the natural language text from the network configuration request input by the user, and filter the target configuration keywords that match the natural language text from the network configuration keyword library, wherein the network configuration keyword library stores multiple configuration keywords of the operation commands set by the network device manufacturer for the network device. A target network configuration template matching the target configuration keyword is determined from the network configuration template library, wherein the network configuration template library contains multiple types of network configuration templates; Determine the network device type and configuration operation sequence in the target network configuration template, and generate a hash index based on the network device type and the configuration operation sequence, wherein the configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order; The target network configuration case is retrieved from the network configuration case library based on the hash index, and the network device is configured based on the target network configuration case and the configuration parameters in the natural language text.
2. The network configuration method according to claim 1, characterized in that, The selection of target configuration keywords that match the natural language text from the network configuration keyword library includes: The natural language text is segmented using a natural language processing model to obtain multiple words; For each word, the similarity between the word and each configured keyword in the network configured keyword library is calculated using a dynamic similarity model; If the similarity is greater than or equal to the similarity threshold, the configured keyword is determined as the target configured keyword for the word.
3. The network configuration method according to claim 2, characterized in that, The similarity between the word and each configured keyword in the network configured keyword library is calculated using a dynamic similarity model, including: For each configured keyword, the word is converted into a first word vector, and the configured keyword is converted into a second word vector; Calculate the cosine similarity between the first word vector and the second word vector to obtain the initial similarity; The dynamic weight of the configuration keyword is calculated based on the initial weight and frequency change of the configuration keyword, wherein the frequency change is the ratio of the difference between the first occurrence frequency and the second occurrence frequency to the first occurrence frequency, the first occurrence frequency is the occurrence frequency of the configuration keyword in the network configuration keyword library in the previous update cycle, and the second occurrence frequency is the occurrence frequency of the configuration keyword in the updated network configuration keyword library. The product of the dynamic weight and the initial similarity is calculated to obtain the similarity between the word and the configured keyword.
4. The network configuration method according to claim 1, characterized in that, Determining the target network configuration template that matches the target configuration keyword from the network configuration template library includes: Extract the first feature vector from the target configuration keywords, and extract the second feature vector from each network configuration template in the network configuration template library; Calculate the Euclidean distance between the first feature vector and the second feature vector of each network configuration template to obtain the similarity between the target configuration keyword and each network configuration template; The network configuration template corresponding to the highest similarity is determined as the target network configuration template.
5. The network configuration method according to claim 1, characterized in that, Generating a hash index based on the network device type and the configuration operation sequence includes: Determine a first preset code corresponding to the network device type, and determine a second preset code corresponding to the configuration operation sequence; The first preset code and the second preset code are input into a preset hash function to obtain a target hash value, and the target hash value is determined as the hash index.
6. The network configuration method according to claim 1, characterized in that, The target network configuration cases retrieved from the network configuration case library based on the hash index include: Determine the hash bucket corresponding to the network configuration case library, wherein the hash bucket contains multiple mapping values corresponding to hash values, and each mapping value represents a network configuration case in the network configuration case library; Determine the target mapping value corresponding to the target hash value in the hash index, and determine the network configuration case corresponding to the target mapping value as the target network configuration case.
7. The network configuration method according to claim 1, characterized in that, After determining a target network configuration template that matches the target configuration keyword from the network configuration template library, the method includes: Determine the parameter slots included in the network configuration template, and determine whether the configuration parameters in the natural language text cover all parameter slots in the network configuration template; If the configuration parameters in the natural language text cover all parameter slots in the network configuration template, perform the step of determining the network device type and configuration operation sequence in the target network configuration template; If the configuration parameters in the natural language text do not cover all parameter slots in the network configuration template, a prompt message is issued, wherein the prompt message is used to indicate to the user that the parameters are missing.
8. A network configuration device, characterized in that, include: The extraction unit is used to extract natural language text from the network configuration request input by the user, and filter target configuration keywords that match the natural language text from the network configuration keyword library, wherein the network configuration keyword library stores multiple configuration keywords of the operation commands set by the network device manufacturer for the network device. The first determining unit is configured to determine a target network configuration template that matches the target configuration keyword from a network configuration template library, wherein the network configuration template library contains multiple types of network configuration templates; The second determining unit is used to determine the network device type and configuration operation sequence in the target network configuration template, and generate a hash index based on the network device type and the configuration operation sequence, wherein the configuration operation sequence is a set of configuration operations corresponding to the execution of network configuration commands arranged in chronological order; The configuration unit is used to retrieve a target network configuration case from the network configuration case library based on the hash index, and configure the network device based on the target network configuration case and the configuration parameters in the natural language text.
9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the network configuration method according to any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the network configuration method according to any one of claims 1 to 7.