Service configuration processing method and related device

By obtaining the device configuration text and attribute information of the target network device, selecting candidate configuration templates, matching the device configuration text and template configuration text, and determining the target audit results, the problem that traditional solutions cannot be flexibly applied to devices of different manufacturers and models is solved, and efficient device configuration auditing is achieved.

CN120639616APending Publication Date: 2025-09-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410285612.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Traditional device configuration auditing solutions cannot be flexibly applied to network devices of different manufacturers and models, resulting in the inability to timely and effectively detect whether there are any anomalies in the device configuration text, affecting the stable operation of the network.

Method used

By obtaining the device configuration text and attribute information of the target network device, selecting candidate configuration templates, matching the device configuration text with the template configuration text, determining the target audit result, and realizing flexible audit of the device configuration.

Benefits of technology

The accuracy and adaptability of device configuration auditing have been improved, and anomalies in device configuration texts can be discovered in a timely manner to ensure the continuous and stable operation of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120639616A_ABST
    Figure CN120639616A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a service configuration processing method and a related device, which can flexibly adapt to different configuration auditing scenes and improve the accuracy and suitability of auditing processing. The method comprises the steps that an audit request for target network equipment is acquired, the audit request comprises equipment configuration text and equipment attribute information of the target network equipment, and the equipment configuration text is used for representing the configuration condition of service parameters of the target network equipment; at least one candidate configuration template is selected based on the equipment attribute information, each candidate configuration template comprises one or more configuration sub-templates of different configuration versions, and each configuration sub-template correspondingly comprises a template configuration text; for each candidate configuration template, determining a target sub-template corresponding to the candidate configuration template based on the equipment configuration text and a template configuration text in the one or more configuration sub-templates; and determining a target audit result based on the equipment configuration text and the template configuration texts of all the target sub-templates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method for service configuration processing and related devices. Background Art

[0002] As networks continue to expand, more and more network devices are involved in network operations. Network devices from different manufacturers, and even different models, often have different configuration files. The accuracy and effectiveness of network device configuration files are crucial to ensuring stable network operation. Therefore, auditing network device configuration files is essential to ensure accurate and valid configuration files are used to implement relevant network operations.

[0003] In traditional device configuration auditing solutions, the tree structure described by the Yang model (i.e., tree model) is usually used to describe the device configuration text to generate the corresponding device configuration tree model. In addition, the device configuration tree model and the memory configuration tree model are compared by the controller to complete the audit processing of the device configuration text based on the comparison results. However, different equipment manufacturers have different implementation standards for the Yang model, and the network equipment produced by some equipment manufacturers has relatively poor support for the Yang model. This can easily lead to the traditional configuration auditing solution being unable to flexibly apply to the configuration audit processing scenarios of network equipment of various manufacturers and different models, and thus being unable to timely and effectively detect whether there are any abnormalities in the device configuration text, and unable to ensure the continuous and stable operation of the network. Summary of the Invention

[0004] The embodiments of the present application provide a method and related devices for business configuration processing, which can flexibly adapt to the configuration audit scenarios of equipment from different manufacturers, improve the accuracy and adaptability of audit processing, facilitate timely discovery of anomalies in device configuration texts, and ensure continuous and stable operation of the network.

[0005] In the first aspect, an embodiment of the present application provides a service configuration processing method. The method includes: obtaining an audit request for a target network device, the audit request including a device configuration text and device attribute information of the target network device, the device attribute information being used to characterize the attribute status of the target network device, and the device configuration text being used to characterize the configuration status of the service parameters of the target network device; selecting at least one candidate configuration template based on the device attribute information, each candidate configuration template including one or more configuration sub-templates with different configuration versions, each configuration sub-template correspondingly including a template configuration text, the template configuration text being used to characterize the configuration status of the template parameters in the corresponding configuration sub-template; for each candidate configuration template, determining a target sub-template in the corresponding candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates; determining a target audit result based on the device configuration text and the template configuration texts of all target sub-templates, the target audit result being used to characterize the service configuration audit status of the target network device.

[0006] In a second aspect, an embodiment of the present application provides a business processing device. The business processing device includes an acquisition unit and a processing unit. The acquisition unit is used to acquire an audit request for a target network device, the audit request including a device configuration text and device attribute information of the target network device, the device attribute information being used to characterize the attribute status of the target network device, and the device configuration text being used to characterize the configuration status of the business parameters of the target network device. The processing unit is used to select at least one candidate configuration template based on the device attribute information, each candidate configuration template including one or more configuration sub-templates of different configuration versions, each configuration sub-template correspondingly including a template configuration text, and the template configuration text being used to characterize the configuration status of the template parameters in the corresponding configuration sub-template. The processing unit is used to determine, for each candidate configuration template, a target sub-template in each candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates. The processing unit is used to determine a target audit result based on the device configuration text and the template configuration texts of all target sub-templates, and the target audit result is used to characterize the business configuration audit status of the target network device.

[0007] In some optional embodiments, the processing unit is used to: calculate the similarity distance between the device configuration text and the template configuration text of each target sub-template to obtain each first similarity, each first similarity is used to characterize the degree of similarity between the device configuration text and the template configuration text of the corresponding target sub-template; based on each first similarity, the first threshold and the second threshold, respectively determine the first information, each first information is used to indicate the text matching situation between the device configuration text and the template configuration text of the corresponding target sub-template, the first threshold is less than the second threshold; determine the target audit result based on all the first information.

[0008] In other optional embodiments, the processing unit is used to: divide the device configuration text and the first configuration text into rows, respectively, to obtain N rows of first strings and M rows of second strings, where the first configuration text is the template configuration text of the target sub-template in the first candidate configuration template, and the first candidate configuration template is any one of at least one candidate configuration template, and N and M are integers greater than or equal to 1 respectively; based on the N rows of first strings and the M rows of second strings, count the first value and the second value, the first value is used to represent the intersection between the N rows of first strings and the M rows of second strings, and the second value is used to represent the difference between the N rows of first strings and the M rows of second strings; based on the first value and the second value, calculate the similarity distance between the device configuration text and the first configuration text to obtain the corresponding first similarity.

[0009] In other optional embodiments, the processing unit is used to: Step 1, when the first substring is the same as the second string in any line of the M lines of second strings, record the first number of similar lines, and the first substring is any line in the N lines of first strings; Step 2, when the first substring is different from the second string in any line of the M lines of second strings, record the first number of difference lines; repeat the above steps 1 to 2 to traverse the N lines of first strings in sequence, and determine the first value based on the number of first similar lines, and determine the second value based on the number of first difference lines, or the sum of the number of first difference lines and the number of second difference lines, the number of second difference lines includes the number of string lines remaining in the N lines of first strings except the first similar lines and the first difference lines, or the number of string lines remaining in the M lines of second strings except the first similar lines and the first difference lines; calculate the sum of the first value and the second value to obtain a third value; solve the quotient between the first value and the third value to obtain the similarity distance between the device configuration text and the first configuration text, and obtain the corresponding first similarity.

[0010] In other optional embodiments, the processing unit is used to: when the first similarity is less than the second threshold and greater than the first threshold, determine that the first information is difference information, and the difference information is used to indicate the text difference between the device configuration text and the template configuration text of the corresponding target sub-template.

[0011] In other optional implementations, the processing unit is used to: when the first similarity is equal to the second threshold, determine that the first information is indifference information, and the indifference information is used to indicate that the device configuration text is the same as the template configuration text of the corresponding target sub-template.

[0012] In other optional implementations, the processing unit is configured to: when the first similarity is equal to a first threshold, determine that the first information is abnormal information, where the abnormal information is used to indicate that the device configuration text does not match the template configuration text of all target sub-templates.

[0013] In other optional embodiments, the processing unit is also used to: after determining the target audit result based on all the first information, splice the device configuration text, and the first information and template information corresponding to each target sub-template to obtain configuration item entry information corresponding to each target sub-template, each configuration item entry information is used to reflect the audit details between the template configuration text and the device configuration text of the corresponding target sub-template, and the template information includes the template configuration text; record all configuration item entry information in the target audit result, and display the target audit result.

[0014] In other optional embodiments, the processing unit is used to: calculate the similarity distance between the device configuration text and the template configuration text of each first configuration sub-template to obtain each second similarity, each first similarity is used to characterize the degree of similarity between the device configuration text and the template configuration text of the corresponding first configuration sub-template, each first configuration sub-template is a configuration sub-template in the second candidate configuration template, and the second candidate configuration template is any one of at least one candidate configuration template; the first configuration sub-template corresponding to the minimum similarity among all the second similarities is determined as the target sub-template in the second candidate configuration template.

[0015] In other optional embodiments, the processing unit is used to: divide the device configuration text and the second configuration text into rows, respectively, to obtain P rows of third character strings and Q rows of fourth character strings, where the second configuration text is the template configuration text of any first configuration sub-template, and P and Q are both integers greater than or equal to 1; calculate the first participle intersection and the first participle union between the P rows of third character strings and the Q rows of fourth character strings; and determine the similarity distance between the device configuration text and the second configuration text based on the first participle intersection and the first participle union.

[0016] In other optional embodiments, the processing unit is used to: divide the third character string in each line and the fourth character string in each line according to spaces to obtain a first word segmentation set and a second word segmentation set, respectively; calculate the intersection and union between the first word segmentation set and the second word segmentation set to obtain a first word segmentation intersection and a first word segmentation union between the third character string in P lines and the fourth character string in Q lines.

[0017] In other optional implementations, the processing unit is used to: count the number of first participles in the intersection of the first participles and the number of second participles in the union of the first participles; solve the quotient between the number of first participles and the number of second participles to obtain the similarity distance between the device configuration text and the second configuration text.

[0018] In other optional embodiments, the processing unit is also used to: extract the policy name and policy definition line in each configuration sub-template for each candidate configuration template before determining the target sub-template in each candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates; and extract the template configuration text of each configuration sub-template based on the policy name and policy definition line.

[0019] In other optional embodiments, the acquisition unit is further configured to: before selecting at least one candidate configuration template based on the device attribute information, acquire multiple initial configuration templates, each initial configuration template including a configuration field. The processing unit is configured to: when the device attribute information matches the configuration fields of one or more initial configuration templates, select the one or more matching initial configuration templates as at least one candidate configuration template.

[0020] In other optional embodiments, the acquisition unit is configured to: acquire device attribute parameters and template configuration parameters. The processing unit is configured to: extract the parameter value of each template configuration parameter from the parameter center; and render the device attribute parameters and the parameter value of each template configuration parameter based on the template engine to obtain multiple initial configuration templates.

[0021] A third aspect of the present application provides a service processing device, comprising: a memory, an input / output (I / O) interface, and a memory. The memory is configured to store program instructions. A processor is configured to execute the program instructions in the memory to perform the service configuration processing method corresponding to the implementation method of the first aspect described above.

[0022] A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the method corresponding to the implementation method of the first aspect above.

[0023] The fifth aspect of the embodiments of the present application provides a computer program product containing instructions, which, when run on a computer or processor, enables the computer or processor to execute the above-mentioned method corresponding to the implementation method of the first aspect.

[0024] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0025] In an embodiment of the present application, an audit request for a target network device is first obtained, and the audit request includes a device configuration text and device attribute information of the target network device. Among them, the device attribute information can be used to represent the attribute status of the target network device, and the device configuration text can represent the configuration status of the service parameters of the target network device. After obtaining the audit request, at least one candidate configuration template is selected based on the device attribute information. In each candidate configuration template, one or more configuration sub-templates of different versions are included, and each configuration sub-template contains a corresponding template configuration text. Each template configuration text mentioned can also be used to represent the configuration status of the template parameters in the corresponding configuration sub-template. For each candidate configuration template, based on the device configuration text and the template configuration text in one or more configuration sub-templates, the target sub-template in each candidate configuration template can be determined. In this way, the target audit result is determined based on the device configuration text and the template configuration texts of all target sub-templates, so as to indicate the service configuration audit status of the target network device through the target audit result. Through the above method, this application does not need to convert the device configuration text into a device configuration tree model, nor does it need to use the tree model comparison method to complete the audit processing of the device configuration. Instead, it pre-records the standard configuration (i.e., configuration sub-template) containing different configuration versions of the template configuration text. In this way, this application then selects the pre-customized candidate configuration template through the device attribute information of the target network device, and then directly completes the matching process between the device configuration text and the template configuration text of the configuration sub-template of different configuration versions in the candidate configuration template through text matching, flexibly adapting to the configuration audit processing of network devices of different manufacturers and models, improving the accuracy and adaptability of the audit processing, and facilitating the timely discovery of whether there are abnormalities in the device configuration text, thereby ensuring the continuous and stable operation of the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0027] Figure 1 A schematic diagram of the system framework provided by an embodiment of the present application is shown;

[0028] Figure 2 A flowchart of a method for service configuration processing provided by an embodiment of the present application is shown;

[0029] Figure 3 An optional schematic diagram showing the device configuration text provided by this application;

[0030] Figure 4 A schematic diagram showing optional parameter values ​​of query template parameters provided by this application;

[0031] Figure 5 An optional schematic diagram of using a Git repository to manage an initial configuration template provided by this application is shown;

[0032] Figure 6 Another optional schematic diagram of the management configuration template provided by this application is shown;

[0033] Figure 7 An optional schematic diagram of calculating the similarity of text matching in this application is shown;

[0034] Figure 8 An optional schematic diagram showing the target audit results provided by this application;

[0035] Figure 9 Another optional schematic diagram showing the audit results provided by this application;

[0036] Figure 10 Another processing flow diagram of the service configuration processing method provided in an embodiment of the present application is shown;

[0037] Figure 11 An optional schematic diagram showing the functional modules of the service processing device provided in an embodiment of the present application is shown;

[0038] Figure 12 An optional schematic diagram showing the hardware structure of the business processing device provided in the embodiments of the present application. DETAILED DESCRIPTION

[0039] The embodiments of the present application provide a method and related devices for business configuration processing, which can flexibly adapt to the configuration audit scenarios of equipment from different manufacturers, improve the accuracy and adaptability of audit processing, facilitate timely discovery of anomalies in device configuration texts, and ensure continuous and stable operation of the network.

[0040] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0042] The terms "first," "second," "third," "fourth," and the like (if any) in the specification and claims of the present application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the implementation of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to such processes, methods, products, or apparatus.

[0043] In many cases, operations personnel correctly adjust the configurations of network devices such as switches, routers, firewalls, and servers to align with current communication methods between users and devices. However, while making these configuration changes, deleting old and obsolete commands can take a long time. Although these configurations may be dormant, and some configurations in network devices are benign from a performance or security perspective, they can cause confusion and often lead to incorrect actions in the next step. Based on this, it is necessary to audit the configuration text of network devices to ensure that the configuration text of network devices is consistent with the standard configuration. This can solve the problem of network inoperability often caused by outdated or invalid configurations, and ensure that the network can be easily understood and trusted by all network operations and management personnel.

[0044] However, in traditional device configuration audit processing solutions, the tree structure described by the Yang model (i.e., tree model) is usually used to describe the device configuration text to generate the corresponding device configuration tree model. In addition, the device configuration tree model and the memory configuration tree model are compared by the controller to complete the audit processing of the device configuration text through the comparison results. However, different equipment manufacturers have different implementation standards for the Yang model, and the network equipment produced by some equipment manufacturers has relatively poor support for the Yang model, which easily leads to the traditional configuration audit solution being unable to flexibly apply to the configuration audit processing scenarios of network equipment of various manufacturers and different models, and thus being unable to timely and effectively discover whether there are any abnormalities in the device configuration text, etc., which in turn leads to the network being unable to operate continuously and stably, seriously affecting business execution.

[0045] Therefore, in order to solve the above-mentioned technical problems, the embodiment of the present application provides a method for service configuration processing. For example, the service configuration processing method can be applied to Figure 1 In the system framework shown in Figure 1 As shown, the system framework includes an open service layer, an application layer, an engine layer, and a storage layer. Optionally, it may also include an operation service layer.

[0046] In the application layer, different configuration interfaces can be provided to implement the processing of configuration audit requests for different configuration policies, such as but not limited to requests related to routing policy (Routepolicy) configuration, requests related to access control list (ACL) configuration, requests related to community configuration, requests related to border gateway protocol (BGP) configuration, etc., which are not specifically limited in this application.

[0047] In the engine layer, configuration templates that are suitable for devices of different manufacturers and models can be customized in advance through configuration pulling and configuration structuring, and then parameter acquisition can be performed to extract the parameter values ​​of the template parameters from the parameter center in the storage layer. Then, with the help of modules such as Jinja2 template rendering, the parameter values ​​of the template parameters can be inserted to generate the corresponding initial configuration template. In addition, in the engine layer, different interfaces can be used to obtain audit requests with different requirements from the application layer, and candidate configuration templates can be selected from the initial configuration template based on the device attribute information in the audit request. Then, text matching between the device configuration text and the template configuration text of different versions of the configuration sub-modules in the candidate configuration templates, as well as matching between the device configuration text and the template configuration text of the target sub-template in different candidate configuration templates, can be completed to determine the target audit results. Through the target audit results, the business configuration audit status of the target network device can be understood.

[0048] The storage layer mentioned can be used to store initial configuration templates, candidate configuration templates, etc., and can also be used to store target audit results, parameter values ​​of template parameters, etc. It can also be used to store statistical data such as the number of string lines generated during the audit processing, which is not limited in this application.

[0049] The open service layer can be used to generate different tasks, such as configuration change inspection tasks, daily configuration inspection tasks, etc.

[0050] In the operation service layer, it can be used to record the reasons for text differences during the audit process, set up whitelists, perform repair work order management tasks, associate configuration change tasks, and other processing.

[0051] It should be noted that the business configuration processing method provided in this application is not only applied to Figure 1 In addition to the system architecture shown, it can also be applied to other system architectures in actual applications, which is not limited in this application.

[0052] For example, the service configuration processing method provided in this application can be applied to service processing devices, such as network devices, terminal devices, servers, etc., which are not limited in this application.

[0053] The network devices mentioned herein may include, but are not limited to, network communication devices, network security devices, network storage devices, network management devices, and the like. For example, network communication devices may include, but are not limited to, routers, switches, fiber optic modems, and the like. Network security devices mentioned herein may include, but are not limited to, firewalls, intrusion detection systems, and the like. Network storage devices mentioned herein may include, but are not limited to, file storage servers, network attachment storage devices, and the like. The network management devices described herein may include, but are not limited to, network detectors, and the like, and are not limited in the present embodiments.

[0054] The server mentioned can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0055] The terminal device may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. The terminal and the server may be connected directly or indirectly via wired or wireless communication, and this application does not impose any restrictions thereon.

[0056] For example, the business configuration processing method provided by this application can also be applied in the field of cloud technology. The cloud technology mentioned here refers to the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool and be used on demand, flexibly and conveniently. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, every item may have its own identification mark in the future, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately, and all types of industry data require strong system backing support, which can only be achieved through cloud computing.

[0057] Cloud computing is a computing model that distributes computing tasks across a resource pool consisting of a large number of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network that provides these resources is called the "cloud." To users, the resources in the "cloud" appear infinitely scalable, readily accessible, on-demand, and scalable, with a pay-per-use policy. Cloud computing infrastructure providers establish a cloud computing resource pool (referred to as a cloud platform, often referred to as Infrastructure as a Service (IaaS)) within which they deploy various virtual resources for external clients to choose from. This resource pool primarily includes computing devices (virtualized machines, including operating systems), storage devices, and network equipment. Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of diverse storage devices (also known as storage nodes) across a network, working collaboratively through application software or application interfaces to provide external data storage and service access.

[0058] In the embodiments of the present application, cloud technology can be used to implement storage processing of template parameters, configuration templates, etc. based on cloud storage, and matching calculations of configuration texts, etc. can also be implemented based on cloud computing, without specific limitations.

[0059] For example, the service configuration processing method provided in this application can also be applied to scenarios such as artificial intelligence, smart transportation, and assisted driving, which are not limited in this application.

[0060] The following describes a method for service configuration processing provided by an embodiment of the present application in conjunction with the accompanying drawings. Figure 2A flow chart of the method for service configuration processing provided by an embodiment of the present application is shown. Figure 2 As shown, the service configuration processing method may include the following steps:

[0061] 201. Obtain an audit request for a target network device. The audit request includes a device configuration text and device attribute information of the target network device. The device attribute information is used to represent the attribute status of the target network device. The device configuration text is used to represent the configuration status of the service parameters of the target network device.

[0062] In this example, the target network device can be understood as a network device that needs to be audited, such as but not limited to routers, switches, fiber optic modems, network detectors, etc., which is not limited in the embodiments of this application.

[0063] When the device configuration of a target network device needs to be audited, the user can use the terminal device to map information related to the target network device, such as the device configuration text and device attribute information, into an audit request. In other words, the audit request includes the device configuration text and device attribute information of the target network device.

[0064] The device configuration text described, sometimes also referred to as device configuration content, can be used to represent the configuration of service parameters of the target network device. For example, using a transmission channel of 20600 for transmission, etc., is not limited in this application.

[0065] The device attribute information mentioned can be used to reflect the attributes of the target network device, such as but not limited to the device manufacturer, device role, device region, etc., which are not specifically limited. The device manufacturer described can be understood as the manufacturer that provides the target network device. The device role mentioned can be understood as the function that the target network device can achieve. The device region described can be understood as the region where the target network device is deployed, such as domestically, internationally, etc., which is not limited in this application.

[0066] After mapping the audit request, for example, the terminal device can send the audit request to the service processing device. The service processing device can then obtain the audit request for the target network device. As an example, the service processing device can demap the audit request to obtain the device configuration text and device attribute information contained in the audit request.

[0067] For example, Figure 3 Schematic diagram of the optional device configuration text provided by this application is shown. Figure 3As shown, taking the device configuration text related to auditing and routing policy configuration as an example, it includes one or more configuration information for the routing policy name "rp_tRR_V6", such as "if-match ipv6 address prefix-list pl_special_deny_V6_in", "if-match as_path 1", "if-match community name cl_special_deny_V6_in", etc., which are not repeated in this application.

[0068] It should be noted that the above Figure 3 The device configuration text shown is only an example. In actual applications, other device configuration texts are also included, and this application does not limit them.

[0069] 202. Select at least one candidate configuration template based on device attribute information, each candidate configuration template including one or more configuration sub-templates of different configuration versions, each configuration sub-template correspondingly including template configuration text, and the template configuration text is used to represent the configuration status of template parameters in the corresponding configuration sub-template.

[0070] In this example, different initial configuration templates can be generated in advance according to the configurations of different manufacturers and different models of equipment, such as routing policy configuration templates, ACL configuration templates, interface configuration templates, BGP configuration templates, etc., which are not limited in this application.

[0071] As a schematic description, the configurations will be different due to different device attributes. For example, taking the device region attribute as an example, the community configurations on devices responsible for different regional networks will be different. Therefore, in the process of generating different initial configuration templates, the present application can first obtain device attribute parameters and template configuration parameters. The device attribute parameters described may include but are not limited to parameters such as the device's regional attributes, manufacturer attributes, and functional role attributes. After obtaining the device attribute parameters and template configuration parameters, the parameter value of each template configuration parameter is extracted from the parameter center based on the device configuration parameters and template configuration parameters. In this way, the device attribute parameters and the parameter values ​​of each template configuration parameter are rendered based on the template engine to obtain multiple initial configuration templates, thereby enabling the maintenance of template configuration parameters from the perspective of device configuration parameters.

[0072] For example, Figure 4 Schematic diagram showing optional parameter values ​​of query template parameters provided by this application. Figure 4As shown, the parameter center may include parameter values ​​of template configuration parameters under different device regions. For example, the device region may include domestic regions such as City A, City B, and Province C, and may also include foreign regions such as District D, State E, and City F. Taking City A as an example, the parameter values ​​of the template configuration parameters corresponding to it in the parameter center may include but are not limited to, for example, the parameter value of the parameter name "TIX_SpecialCampus_Community" is "21:8", the parameter value of the parameter name "TIX_BackupRegion_Peer_Community" is "20:1", etc., which are not limited in this application. In this way, in the process of querying the parameter values ​​of the template parameters, the corresponding parameter values ​​can be found by using the regional attributes (such as City A) and the template configuration parameters in the device attribute parameters, such as "21:8", "20:1", etc., which are not limited in this application.

[0073] In addition, the parameter center in this application stores the parameter values ​​of each template configuration parameter, which makes it easier to maintain the variable template parameters in different configuration templates. In addition, for the entry of the above-mentioned template parameters, it is possible to support the entry of fixed values ​​through custom methods or to support real-time calculation using cloud functions, which is not limited in this application.

[0074] It should be noted that the template engine described may include but is not limited to the Jinja2 template engine, etc., and is not limited in this application.

[0075] Optionally, in the process of rendering parameter values, taking the Jinja2 template engine as an example, by utilizing the variables, conditional judgments, loop rendering and other features in the Jinja2 template engine, the rendering processing of the parameter values ​​is completed, so that the same template can be used to flexibly generate corresponding initial configuration templates according to different demand scenarios, which has good readability and extensibility. Specifically, the process of rendering using the Jinja2 template engine can be understood in the following way, namely: first, call the find_undeclared_variables method in the PythonJinja2 SDK to parse the template text of each configuration template and extract the variables in each initial configuration template. After extracting the variables in each initial configuration template, the corresponding parameter values ​​can be queried from the parameter center according to the variable name. In the process of querying the corresponding parameter values, the parameter center will be based on the level of data storage (for example Figure 4 The hierarchical content shown in the table starts from the lowest level and searches the higher level, and then returns the matching parameter values. Figure 4Taking the device region shown in as an example, you can query upward step by step according to the query rules of device level-network module level-campus level-region level-public parameters. This application does not specifically limit the query rules. In this way, after obtaining the parameter values ​​of all parameters in each initial configuration template, call the render method of Python Jinja2SDK to map the template configuration text and parameter values ​​to the initial configuration template, and then complete the rendering process of each initial configuration template. The rendered initial configuration template includes the template configuration text and parameter values, etc.

[0076] In some optional examples, after generating different initial configuration templates, the initial configuration templates can also be stored. For example, the initial configuration templates can be stored in a Git repository or other database. Exemplarily, the initial configuration templates can also be managed through a Git repository, such as but not limited to modifying, deleting, adding, etc., which are not limited in this application. For example, Figure 5 Schematic diagram of an optional initial configuration template using Git repository management provided by this application is shown. Figure 5 As shown, taking the Git repository as an example, architects, developers, operation and maintenance personnel, etc. can update the template configuration text in the initial configuration template by submitting code. By utilizing the code management capabilities of the GiT repository, it is easy to implement multi-person development and management of different versions of configuration templates. As a schematic description, the initial configuration template can be identified by the template path and file name. For example, the corresponding initial configuration template is identified by device manufacturer / device role / device region / configuration module_template name_configuration version.Jinja2, etc. For example Figure 5 In the example shown in Manufacturer A / Role B / Domestic / Routepolicy_Con2Bgpipv4_2.5.j2, the configuration module is represented as Routepolicy, which means the routing policy function that can be implemented by the initial configuration template. The template name is Con2Bgpipv4, the configuration version is 2.5, and j2 represents the Jinja2 template engine.

[0077] In addition, for Figure 5 The initial configuration templates managed by the Git repository are available in the following sections: Figure 6 Another optional schematic diagram of the management configuration template is shown for understanding. Figure 6 As shown above Figure 5The template configuration text corresponding to "Routepolicy_Con2Bgpipv4_2.5.j2" in the example may be: "Routepolicy_rp_CON2BGP_v6 pernit node 10; If-match ipv6 address prefix-listpl-localinterface-v6; apply cost 0; apply local-preference 400", etc. This application does not make any specific restrictions.

[0078] In other optional examples, a callback function can also be configured in the Git repository, through which the changed data in the initial configuration template can be written to a database such as MySQL, so that the data in the database (DB) is kept consistent with the data in the template in the Git repository.

[0079] In other optional examples, the initial configuration template can also be stored in a MySQL database process. For each initial configuration template, it can include corresponding configuration fields, such as template name, device role, device region, device manufacturer, etc. For details, please refer to the fields shown in Table 1 below, namely:

[0080] Table 1

[0081] Field Name Data Type Remark template_name VARCHAR Template Name role VARCHAR Device Role location VARCHAR Device Region manufacture VARCHAR Equipment manufacturers config_module VARCHAR Configuration Module content MEDIUM TEXT Template configuration text template_version VARCHAR Configuration version number description TEXT Template Description template_key VARCHAR Template key

[0082] It should be noted that, in actual applications, the initial configuration template may include other configuration fields in addition to the fields mentioned in Table 1 above, which is not specifically limited in this application.

[0083] After obtaining multiple initial configuration templates, at least one candidate configuration template can be selected from these multiple initial configuration templates based on the device attribute information in the audit request. As an illustrative example, since each initial configuration template includes configuration fields, such as device name, device region, device role, and device manufacturer, after obtaining the device attribute information from the audit request, the device attribute information can be matched with the configuration fields of each of the one or more initial configuration templates, and the one or more matching initial configuration templates can be selected as at least one candidate configuration template.

[0084] For example, assuming the configuration field is device manufacturer, assume that multiple initial configuration templates are Template 1 through Template 8, and the device manufacturers of Templates 1 through Template 8 are A, B, C, A, D, E, A, and B, respectively. In this case, the device manufacturer in the device attribute information can be matched against the device manufacturers of Templates 1 through Template 8. If the device manufacturer in the device attribute information is A, Template 1, Template 4, and Template 7 can be matched. Therefore, the candidate configuration templates selected are Template 1, Template 4, and Template 7.

[0085] It should be noted that the above description uses the device manufacturer as an example. In actual applications, you can also use one or more fields from the device manufacturer, device role, and device region as selection criteria to select at least one candidate configuration template corresponding to the device attribute information from multiple initial configuration templates. This approach can match a candidate configuration template that is more accurate and closely matches the device attribute information, improving matching accuracy.

[0086] In addition, the same initial configuration template may correspond to one or more templates with different configuration versions. In other words, each selected candidate configuration template may include one or more configuration sub-templates with different configuration versions. Moreover, each configuration sub-template includes template configuration text.

[0087] For example, assume that three candidate configuration templates related to routing policies are selected, with template names such as TRRIpv4, DdosIpv4, and DdosIpv6. Furthermore, the candidate configuration template for TRRIpv4 includes two configuration sub-templates, such as RoutePolicy_TRRIpv4_2.5.j2 and RoutePolicy_TRRIpv4_2.6.j2. The candidate configuration template for DdosIpv4 includes one configuration sub-template, such as RoutePolicy_DdosIpv4_2.0.j2. Similarly, the candidate configuration template for DdosIpv6 includes three configuration sub-templates, such as RoutePolicy_DdosIpv6_2.0.j2, RoutePolicy_DdosIpv6_2.5.j2, and RoutePolicy_DdosIpv6_2.6.j2.

[0088] Optionally, after obtaining each candidate configuration template, the respective configuration sub-templates can be classified to form a corresponding template data structure, such as {"template_name":["template_version":{"jinja_content":"","template_key":""}]}. Through this template data structure, the configuration sub-templates in each candidate configuration template can be clearly understood.

[0089] For example, taking the candidate configuration templates of the routing policy selected above as an example, they can be classified as follows:

[0090]

[0091] It should be noted that the template key mentioned above can be used to uniquely identify the corresponding configuration sub-template. Its composition format is device manufacturer_device role_device region_configuration module_template name_configuration version number.

[0092] 203. For each candidate configuration template, determine a target sub-template in the corresponding candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates.

[0093] In this example, each candidate configuration template contains one or more configuration sub-templates with different configuration versions. Different versions of these configuration sub-templates can be configured with different parameters to generate different template configuration texts. Different template configuration texts can reflect different configurations of the template parameters. However, within the same candidate configuration template, using the configuration sub-template with a better match can determine whether the device configuration text of the current target network device meets the standard configuration, that is, whether it meets the configuration in the configuration template previously rendered by the template engine.

[0094] Therefore, after selecting at least one candidate configuration template, for each candidate configuration template, it is necessary to determine a target sub-template in the corresponding candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates.

[0095] For example, assume that three candidate configuration templates are selected, and their template names are TRRIpv4, DdosIpv4, and DdosIpv6. Furthermore, the candidate configuration template for TRRIpv4 includes two configuration sub-templates, such as RoutePolicy_TRRIpv4_2.5.j2 and RoutePolicy_TRRIpv4_2.6.j2. The candidate configuration template for DdosIpv4 includes one configuration sub-template, such as RoutePolicy_DdosIpv4_2.0.j2. Similarly, the candidate configuration template for DdosIpv6 includes three configuration sub-templates, such as RoutePolicy_DdosIpv6_2.0.j2, RoutePolicy_DdosIpv6_2.5.j2, and RoutePolicy_DdosIpv6_2.6.j2. Furthermore, target sub-templates in each of the candidate configuration template with the template name TRRIpv4, the candidate configuration template with the template name DdosIpv4, and the candidate configuration template with the template name DdosIpv6 are determined respectively.

[0096] In some examples, for each candidate configuration template, before determining the target sub-template, the policy name and policy definition line in each configuration sub-template can be extracted, and based on the policy name and policy definition line, the template configuration text of each configuration sub-template can be extracted. For example, taking the configuration related to routing policy as an example, the regular expression ^route-policy\s+(\S+) can be defined to traverse the configuration columns in the configuration sub-template and the device configuration text, and all routing policy names (such as rp_WC_CAP_V6_in) and routing policy definition lines (such as route-policy rp_WC_CAP_V6_in deny node 10) in the configuration sub-template can be extracted. After determining the routing policy definition line, the indented configuration line located after the routing policy definition line is searched, and the indented configuration line is extracted as the template configuration text of the configuration sub-template, that is, the configuration content.

[0097] It should be noted that in scenarios where template configuration text is not demarcated by indentation, users can also develop regular expressions based on device configuration characteristics to extract and compare configuration text. By customizing configuration text extraction rules and comparison logic, the system can flexibly adapt to various scenarios and expand the scope of auditing.

[0098] In some optional examples, the similarity between the device configuration text and the template configuration text in one or more configuration sub-templates can be calculated to determine which version of the configuration sub-template in the candidate configuration template is used as the target sub-template. As an illustrative description, taking any one of the at least one candidate configuration templates (hereinafter referred to as the second candidate configuration template) as an example, and each configuration sub-template in the second candidate configuration template as the first configuration sub-template, the similarity calculation process can be understood with reference to the content described in the following steps S11 to S12, namely:

[0099] Step S11: Calculate the similarity distance between the device configuration text and the template configuration text of each first configuration sub-template to obtain respective second similarities.

[0100] In this example, each second similarity reflects the degree of similarity between the device configuration text and the template configuration text of the corresponding first configuration sub-template. A smaller similarity distance indicates a greater second similarity, indicating that the device configuration text is closer to the template configuration text of the corresponding first configuration sub-template. Conversely, a larger similarity distance indicates a smaller corresponding second similarity, indicating that the device configuration text deviates further from the template configuration text of the corresponding first configuration sub-template.

[0101] For example, taking the candidate configuration template with the template name TRRIpv4 as the second candidate configuration template, and its corresponding RoutePolicy_TRRIpv4_2.5.j2 and RoutePolicy_TRRIpv4_2.6.j2 as the first configuration sub-templates, it is necessary to calculate the similarity distance between the device configuration text and the template configuration text corresponding to RoutePolicy_TRRIpv4_2.5.j2, as well as the similarity distance between the device configuration text and the template configuration text corresponding to RoutePolicy_TRRIpv4_2.6.j2.

[0102] As a schematic description, the calculation of each second similarity can be obtained by string segmentation or string line segmentation. Due to the similarity distance between the computing device configuration text and the template configuration text of each first configuration sub-template, the calculation process is basically similar. Therefore, the following only takes the template configuration text of any one of the first configuration sub-templates (hereinafter referred to as the second configuration text) as an example for detailed introduction. For specific understanding, please refer to the contents described in the following method ① and method ②, that is:

[0103] Method ①: Calculate the second similarity by using string segmentation

[0104] For example, when calculating the second similarity using string segmentation, the Python string splitlines() method can be first called to split the device configuration text and the second configuration text into lines, respectively, to obtain P lines of the third string and Q lines of the fourth string. P and Q are both integers greater than or equal to 1.

[0105] After the third string of P rows and the fourth string of Q rows are obtained by partitioning, the first segmentation intersection and the first segmentation union between the third string of P rows and the fourth string of Q rows are calculated. As an illustrative description, the third string of each row and the fourth string of each row can be partitioned according to the space partitioning method to obtain the first segmentation set and the second segmentation set. Furthermore, the intersection and the union between the first segmentation set and the second segmentation set are calculated to obtain the first segmentation intersection and the first segmentation union between the third string of P rows and the fourth string of Q rows.

[0106] It should be noted that the first segmentation intersection can reflect repeated or identical character strings between the device configuration text and the second configuration text, while the first segmentation union can reflect all character strings between the device configuration text and the second configuration text.

[0107] In this way, after determining the first participle intersection and the first participle union, the similarity distance between the device configuration text and the second configuration text can be determined based on the first participle intersection and the first participle union. As an illustrative description, this can be done by counting the number of first participles in the first participle intersection and the number of second participles in the first participle union. In other words, the number of first participles can represent the number of character strings in the first participle intersection, and the number of second participles can represent the number of character strings in the first participle union. In this way, by solving the quotient between the number of first participles and the number of second participles, the similarity distance between the device configuration text and the second configuration text can be calculated.

[0108] For example, Figure 7 An optional schematic diagram of calculating the similarity of text matching in this application is shown. Figure 7 As shown in part (a) of the figure, dividing the device configuration text, we can get four lines of third character strings, namely: "interfacetunnel0 / 0 / 20600", "mtu 9166", "description SGPBR2-T0-B0MBR1-test-lsp-1", and "mplste tunnel-id 20600". Similarly, Figure 7As shown in part (b), the template configuration file corresponding to RoutePolicy_TRRIpv4_2.5.j2 is used as the second configuration file. By dividing the second configuration file, we can obtain five lines of fourth character strings: "interface tunnel0 / 0 / 10010", "mtu 9166", "description SBJBR2-T0-BRABR1-test-lsp-1", "mpls te affinity primary include-any TEST", and "mpls te tunnel-id10010".

[0109] Then, using these four lines of the third character string and the five lines of the fourth character string, we can determine that the number of first participles in the first participle intersection is 15, and the number of second participles in the first participle union is 27. Based on this, we can calculate the corresponding second similarity as 15 / 27≈0.56.

[0110] Method ②: Calculate the second similarity by string branching

[0111] For example, in the process of calculating the second similarity using string segmentation, the device configuration text and the second configuration text can be first divided into lines to obtain P lines of third character strings and Q lines of fourth character strings. P and Q are both integers greater than or equal to 1. After the third character strings of P lines and the fourth character strings of Q lines are obtained by segmentation, the first character value and the second character value are counted based on the third character strings of P lines and the fourth character strings of Q lines. The first character value can be used to reflect the intersection between the third character strings of P lines and the fourth character strings of Q lines, and the second character value is used to represent the difference between the third character strings of P lines and the fourth character strings of Q lines.

[0112] As an illustrative description, in the process of counting the first character value and the second character value, it can be achieved by repeating step 1 and step 2. That is:

[0113] Step 1: When the second substring is identical to the fourth string of any row in the fourth strings of Q rows, record the second number of similar rows. The second substring is any row in the third strings of P rows.

[0114] Step 2: When the second substring is different from the fourth character string in any row of the Q rows of fourth character strings, record the third number of different rows.

[0115] Repeat steps 1 and 2 above to complete the P-line third character string. Then, the first character value is determined based on the second number of similar lines, and the second character value is determined based on the third number of different lines, or the sum of the third number of different lines and the fourth number of different lines. The fourth number of different lines includes the remaining number of lines in the P-line third character string excluding the second number of similar lines and the third number of different lines, or the remaining number of lines in the Q-line fourth character string excluding the second number of similar lines and the third number of different lines.

[0116] Thus, after calculating the first and second character values, the similarity distance between the device configuration text and the second configuration text is calculated based on the first and second character values ​​to obtain the corresponding second similarity. For example, the sum of the first and second character values ​​can be first calculated to obtain the third character value. After calculating the third character value, the quotient between the first and third character values ​​is calculated to obtain the similarity distance between the device configuration text and the second configuration text, thereby obtaining the corresponding second similarity.

[0117] For example, the aforementioned Figure 7 Taking the device configuration text shown, and the template configuration text corresponding to RoutePolicy_TRRIpv4_2.5.j2, as an example of the second configuration text, it can be divided into 4 lines of third strings and 5 lines of fourth strings. Then, the first of these 4 lines of third strings is traversed and matched against each of the 5 lines of fourth strings. If no string in these 5 lines of fourth strings matches, the third number of difference lines can be recorded as 1. Furthermore, the second line of third strings is matched against each of the 5 lines of fourth strings. If a match is found, the second line of fourth strings in these 5 lines of fourth strings matches. In this case, the second number of similarity lines can be recorded as 1. Similarly, the third line of third strings is matched against each of the 5 lines of fourth strings. If no string in these 5 lines of fourth strings matches, the third number of difference lines can be recorded as 1. Furthermore, the fourth line of third strings is matched against each of the 5 lines of fourth strings. If no string in these 5 lines of fourth strings matches, the third number of difference lines can be recorded as 1.

[0118] Furthermore, since all third character strings in the device configuration text have been traversed, and there are still four lines in the template configuration text that are different from the device configuration text, we can determine that the fourth number of different lines is 4. At this point, we can calculate that the first character value is 1, and the second character value is the sum of the number of third and fourth different lines (i.e., 3) and 4, which is 7. Thus, the second similarity can be calculated as 1 / 7 = 0.14.

[0119] It should be noted that in the process of calculating the second similarity, in addition to using the above-mentioned method ① and method ②, other similarity calculation methods can also be used in actual applications, such as cosine similarity algorithm, Euclidean distance algorithm, etc., which are not limited in the embodiments of this application.

[0120] Based on one or more of the above methods ① and ②, the similarity distance between the device configuration text and the template configuration text of all the first configuration sub-templates can be calculated, that is, each second similarity can be calculated. For example, for the similarity distance between the device configuration text and the template configuration text corresponding to RoutePolicy_TRRIpv4_2.6.j2, you can also refer to the above Figure 7 The calculation process of the similarity distance between the device configuration text and the template configuration text corresponding to RoutePolicy_TRRIpv4_2.5.j2 can be understood, and is not repeated here.

[0121] In this way, after calculating the similarity between the device configuration text and the template configuration text of each first configuration sub-template, the minimum similarity can be selected from all the second similarities, and the first configuration sub-template corresponding to the minimum similarity can be determined as the target sub-template in the second candidate configuration template. For example, assume that the second similarities between the device configuration text and the template configuration text corresponding to RoutePolicy_TRRIpv4_2.5.j2 and the template configuration text corresponding to RoutePolicy_TRRIpv4_2.6.j2 are 0.56 and 0.48, respectively. Therefore, the template configuration text corresponding to RoutePolicy_TRRIpv4_2.5.j2 can be used as the target sub-template in the candidate configuration template corresponding to TRRIpv4.

[0122] It should be noted that if the calculated second similarities are the same, any configuration sub-template in the candidate configuration template can be selected as the target sub-template.

[0123] It should be noted that the above is only explained by taking the selection of the corresponding target sub-template from any candidate configuration template (i.e., the second candidate configuration template) as an example. For the target sub-templates in other candidate configuration templates, you can also refer to the calculation process of the target sub-template of the second candidate configuration template for understanding, which will not be described in detail here. For example, for other candidate configuration templates, such as DdosIpv4, DdosIpv6, etc., the respective target sub-templates can also be understood by referring to the calculation process of the target sub-template of the candidate configuration template whose template name is TRRIpv4, which will not be described in detail in this application.

[0124] For example, taking the target sub-template of the candidate configuration templates of TRRIpv4, DdosIpv4, and DdosIpv6 as an example, it can be recorded through the following data structure, namely: {"template name":{"exc_flag":0,"exc_info":"","match_version":"","rendered_content":"","template_keys":""}}.

[0125] For example, the details are as follows:

[0126]

[0127]

[0128] It should be noted that the data structure of the above-mentioned target sub-template is merely a schematic description. In actual applications, other data structures may be used for recording, which is not limited in this application.

[0129] 204. Determine a target audit result based on the device configuration text and the template configuration texts of all target sub-templates. The target audit result is used to represent a service configuration audit status of the target network device.

[0130] In this example, after selecting a target sub-template from the different versions of the configuration sub-templates in each candidate configuration template, a target audit result can be determined based on the device configuration text and the template configuration text of all target sub-templates. This target audit result can reflect the service configuration audit status of the target network device.

[0131] For example, in the process of determining the target audit result, each first similarity can be obtained by calculating the similarity distance between the device configuration text and the template configuration text of each target sub-template. Each first similarity can reflect the degree of similarity between the device configuration text and the template configuration text of the corresponding target sub-template.

[0132] As an illustrative description, consistency is usually required in the audit process, so in the process of calculating the first similarity, the string line segmentation method mentioned in the aforementioned method ② can be used to implement it. Specifically, taking any one of the at least one candidate configuration templates (i.e., the first candidate configuration template mentioned later) as an example, the device configuration text and the first configuration text can be divided into lines to obtain N lines of first character strings and M lines of second character strings. It should be noted that the first configuration text is the template configuration text of the target sub-template in the first candidate configuration template, and N and M are integers greater than or equal to 1. After dividing to obtain N lines of first character strings and M lines of second character strings, the first value and the second value are counted based on the N lines of first character strings and the M lines of second character strings. The described first value can reflect the intersection between the N lines of first character strings and the M lines of second character strings. The described second value can represent the difference between the N lines of first character strings and the M lines of second character strings.

[0133] As an illustrative description, in the process of counting the first value and the second value, it can be achieved by repeatedly executing step 1 and step 2. That is:

[0134] Step 1: When the first substring is identical to the second string in any one of the M lines of second strings, record the first number of similar lines, where the first substring is any one of the N lines of first strings.

[0135] Step 2: When the first substring is different from the second string in any of the M lines of second strings, record the first number of different lines.

[0136] Repeat steps 1 and 2 above to traverse the N lines of the first character string in sequence. Then, a first value is determined based on the number of the first similar lines, and a second value is determined based on the number of the first different lines, or the sum of the first different lines and the second different lines, where the second different lines include the number of character string lines remaining in the N lines of the first character string excluding the first similar lines and the first different lines, or the number of character string lines remaining in the M lines of the second character string excluding the first similar lines and the first different lines.

[0137] Thus, after calculating the first and second values, the similarity distance between the device configuration text and the first configuration text is calculated based on the first and second values ​​to obtain the corresponding first similarity. For example, the sum of the first and second values ​​can be first calculated to obtain a third value. After calculating the third value, the quotient between the first and third values ​​is calculated to obtain the similarity distance between the device configuration text and the first configuration text, thereby obtaining the corresponding first similarity.

[0138] It should be noted that the calculation of the first similarity here can be understood by referring to the process of calculating the second similarity using the string branching method in the aforementioned method ②, and will not be described in detail here. In addition, in the process of calculating the first similarity, in addition to using the above-mentioned method of whether the string branches match, other similarity calculation methods can also be used in actual applications, such as the cosine similarity algorithm, the Euclidean distance algorithm, etc., which are not limited in the embodiments of this application.

[0139] In addition, the above description is only based on the template configuration text (i.e., the first configuration text) of the target sub-template in any candidate configuration template (i.e., the first candidate configuration template) as an example. The similarity between the template configuration text of the target sub-template of other candidate configuration templates and the device configuration text can also be understood by referring to the calculation process of the similarity between the device configuration text and the first configuration text, and will not be repeated here.

[0140] Since the device configuration text can be judged as to whether there are anomalies, differences, or no differences in the device configuration text during the process of matching with the template configuration text of different target sub-templates by determining the text matching situation, the target audit result can be constructed. In other words, after obtaining each first similarity, the first information can also be determined based on each first similarity, the first threshold, and the second threshold. The first threshold described is less than the second threshold. In addition, each first information can indicate the text matching situation between the device configuration text and the template configuration text of the corresponding target sub-template.

[0141] As an illustrative description, the first information may include abnormal information, difference information, or no difference information. After calculating each first similarity, each first similarity is compared with the first threshold and the second threshold, and then the corresponding first information is determined based on the comparison result. The following will be explained separately, namely:

[0142] If the first similarity is less than the second threshold and greater than the first threshold, it indicates that there is a difference between the template configuration text of the corresponding target sub-template and the device configuration text, and the first information can be determined as difference information. In other words, the text difference between the template configuration text of the target sub-template and the device configuration text can be obtained through the difference information.

[0143] Furthermore, if the first similarity is equal to the second threshold, it indicates that the template configuration text of the corresponding target sub-template is identical to the device configuration text, which also indicates that the device configuration text complies with the standard configuration. In this case, the first information can be determined to be indifferent information. Alternatively, indifferent information can be used to indicate that the device configuration text is identical to the template configuration text of the corresponding target sub-template.

[0144] Additionally, if the first similarity is equal to the first threshold, it indicates that the template configuration text of the corresponding target sub-template is completely different from the device configuration text, which can also indicate that no configuration sub-template was matched from the candidate configuration templates. Based on this, if the first similarity is equal to the first threshold, the corresponding first information is determined to be abnormal information. This abnormal information can indicate that the device configuration text does not match the template configuration text of all target sub-templates.

[0145] It should be noted that the first threshold mentioned above can be, for example, 0, the second threshold can be, for example, 1, and so on. In practical applications, it can also be other values, which are not specifically limited in this application.

[0146] For example, if the device configuration text matches the target sub-templates RoutePolicy_TRRIpv4_2.5.j2, RoutePolicy_DdosIpv4_2.0.j2, and RoutePolicy_DdosIpv6_2.6.j2, and the first similarities between the device configuration text and the template configuration texts of these three target sub-templates are calculated using the above method, they are 0.56, 1, and 0, respectively. Assuming the first threshold is 0 and the second threshold is 1, the comparison shows that the first information between the device configuration text and the template configuration text of RoutePolicy_TRRIpv4_2.5.j2 is discrepancy; the first information between the device configuration text and the template configuration text of RoutePolicy_DdosIpv4_2.0.j2 is indistinguishable; and the first information between the device configuration text and the template configuration text of RoutePolicy_DdosIpv6_2.0.j2 is anomaly.

[0147] In this way, after determining the text matching between the device configuration text and the template configuration text of each target sub-template, the target audit result is determined based on all the first information.

[0148] For example, the above device configuration text is compared with the first information between RoutePolicy_TRRIpv4_2.5.j2, RoutePolicy_DdosIpv4_2.0.j2, and RoutePolicy_DdosIpv6_2.6.j2, namely, difference information, no difference information, and abnormal information, to determine the corresponding target audit result.

[0149] As an illustrative example, the diff_config_items method can be called via an interface call: def diff_config_items(self, standard_template:str, device_config:str), where standard_template represents the template configuration text of the target sub-template, and device_config represents the device configuration text. Thus, through the interface call, the corresponding audit results returned can be represented by the following data structure: [{"name":"Configuration Item Name","template_content":"Template Configuration Text","dev_content":"Device Configuration Text","has_diff":true}], where has_diff indicates whether there are differences in the configuration item (i.e., the first information mentioned above). By recording differences in the audit process through configuration items, users can flexibly control the granularity of the audit, better meeting audit requirements.

[0150] Optionally, in some examples, after determining the target audit result based on all the first information, the device configuration text, and the first information and template information corresponding to each target sub-template can also be spliced ​​together to obtain the configuration item entry information corresponding to each target sub-template. The template information described may include but is not limited to the template configuration text, template name, and other content. In addition, through the configuration item entry information, the audit details between the template configuration text and the device configuration text of the corresponding target sub-template can be clearly known, such as which version of the template is used for matching, whether there are differences in the matching results, etc. In this way, all configuration item entry information is recorded in the target audit result, and then the target audit result is displayed.

[0151] For example, Figure 8 : shows an optional schematic diagram of the target audit results provided by this application. Figure 8 As shown in the figure, for the target network device named CQ-TH-M101-C12-H12516AF-TIX-01, it includes three configuration item entries. For example, configuration item entry 1 shows the differences between the device configuration text and RoutePolicy_TRRIpv4_2.5.j2; configuration item entry 2 shows the differences between the device configuration text and RoutePolicy_DdosIpv4_2.0.j2; and configuration item entry 3 shows the differences between the device configuration text and RoutePolicy_DdosIpv6_2.6.j2.

[0152] Correspondingly, for Figure 8The difference between the device configuration text and RoutePolicy_TRRIpv4_2.5.j2 can be found in Figure 9 The audit results shown are understood. Figure 9 As shown, the differences between the device configuration text and the template configuration text of RoutePolicy_TRRIpv4_2.5.j2 can be clearly located. For example, the transmission channel tunnel identifier in the device configuration text is 20600, while the channel identifier in the template configuration text is 10010.

[0153] By displaying the target audit results, operations and maintenance personnel can review them. As an example, based on the abnormal information in the target audit results, the cause of the abnormality in the device configuration text can be located, and the device configuration text can be modified based on the abnormality. Alternatively, based on the difference information in the target audit results, the content of the device configuration text can be modified to ensure that the modified device configuration text conforms to the standard configuration and facilitates subsequent continuous network operation.

[0154] For example, the service configuration processing method provided in the embodiment of the present application can also be applied to Figure 10 Another processing flow architecture is shown. Figure 10 As shown, the processing flow architecture includes at least a preprocessing module, an audit module and a configuration generation module.

[0155] The pre-processing module can receive the audit request, and is used to obtain candidate configuration templates according to device attribute information, and extract device configuration text.

[0156] The audit module can be used to extract configuration fields and other content from candidate configuration templates.

[0157] In the configuration generation module, it can be used to extract template parameters of different configuration sub-templates in the candidate configuration template and obtain the corresponding parameter values ​​from the parameter center. In addition, the configuration generation module can also use the template engine to render the configuration sub-template and complete the matching process of the target sub-template in each candidate configuration template.

[0158] The audit module can also complete the matching processing between the device configuration text and the template configuration text of each target sub-template to generate the corresponding target audit results and inform the user through the preprocessing module.

[0159] Similarly, the configuration generation module can also identify abnormal situations, such as template rendering abnormalities or parameter acquisition abnormalities, etc. In addition, the pre-processing module can also complete the encapsulation processing of abnormal situations to inform users of audit abnormal situations.

[0160] In the embodiment of the present application, it is not necessary to convert the device configuration text into a device configuration tree model, nor is it necessary to use a tree model comparison method to complete the audit processing of the device configuration. Instead, the standard configuration (i.e., configuration sub-template) containing different configuration versions of the template configuration text is pre-recorded. In this way, the present application selects a pre-defined candidate configuration template through the device attribute information of the target network device, and then directly completes the matching process between the device configuration text and the template configuration text of the configuration sub-template of different configuration versions in the candidate configuration template through text matching, flexibly adapting to the configuration audit processing of network devices of different manufacturers and models, improving the accuracy and adaptability of the audit processing, and facilitating the timely discovery of whether there are abnormalities in the device configuration text, thereby ensuring the continuous and stable operation of the network.

[0161] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of method. It can be understood that in order to realize the above functions, the hardware structure and / or software modules corresponding to the execution of each function are included. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiment disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0162] The embodiment of the present application can divide the functional modules of the device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods.

[0163] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0164] The following describes in detail the service processing device in the embodiment of the present application. Figure 11Schematic diagram of the optional functional modules of the service processing device provided in the embodiment of the present application. Figure 11 As shown, the service processing device may include an acquisition unit 1101 and a processing unit 1102 .

[0165] Acquisition unit 1101 is configured to acquire an audit request for a target network device. The audit request includes a device configuration text and device attribute information of the target network device. The device attribute information is used to represent the attributes of the target network device, and the device configuration text is used to represent the configuration of service parameters of the target network device. For details, reference may be made to the description of step 201 above and will not be repeated here.

[0166] Processing unit 1102 is configured to select at least one candidate configuration template based on the device attribute information. Each candidate configuration template includes one or more configuration sub-templates with different configuration versions. Each configuration sub-template includes template configuration text that represents the configuration of template parameters in the corresponding configuration sub-template. For details, please refer to the description of step 202 above and will not be repeated here.

[0167] Processing unit 1102 is configured to determine a target sub-template in each candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates. Detailed descriptions can be made with reference to the contents described in step 203 above and will not be repeated here.

[0168] Processing unit 1102 is used to determine the target audit result based on the device configuration text and the template configuration texts of all target sub-templates. The target audit result is used to characterize the service configuration audit status of the target network device. The details can be understood by referring to the content described in the above step 204, which will not be repeated here.

[0169] In some optional embodiments, the processing unit 1102 is used to: calculate the similarity distance between the device configuration text and the template configuration text of each target sub-template to obtain each first similarity, each first similarity is used to characterize the degree of similarity between the device configuration text and the template configuration text of the corresponding target sub-template; based on each first similarity, the first threshold and the second threshold, respectively determine the first information, each first information is used to indicate the text matching situation between the device configuration text and the template configuration text of the corresponding target sub-template, the first threshold is less than the second threshold; determine the target audit result based on all the first information.

[0170] In other optional embodiments, the processing unit 1102 is used to: divide the device configuration text and the first configuration text into rows, respectively, to obtain N rows of first strings and M rows of second strings, where the first configuration text is the template configuration text of the target sub-template in the first candidate configuration template, and the first candidate configuration template is any one of at least one candidate configuration template, and N and M are integers greater than or equal to 1 respectively; based on the N rows of first strings and the M rows of second strings, count the first value and the second value, the first value is used to represent the intersection between the N rows of first strings and the M rows of second strings, and the second value is used to represent the difference between the N rows of first strings and the M rows of second strings; based on the first value and the second value, calculate the similarity distance between the device configuration text and the first configuration text to obtain the corresponding first similarity.

[0171] In other optional embodiments, the processing unit 1102 is used to: Step 1, when the first substring is the same as the second string in any line of the M lines of the second string, record the first number of similar lines, and the first substring is any line in the N lines of the first string; Step 2, when the first substring is different from the second string in any line of the M lines of the second string, record the first number of different lines; repeat the above steps 1 to 2 to traverse the N lines of the first string in sequence, and determine the first value based on the number of the first similar lines, and determine the second value based on the number of the first different lines, or the sum of the number of the first different lines and the number of the second different lines, the number of the second different lines includes the number of string lines remaining in the N lines of the first string except the first similar lines and the first different lines, or the number of string lines remaining in the M lines of the second string except the first similar lines and the first different lines; calculate the sum of the first value and the second value to obtain a third value; solve the quotient between the first value and the third value to obtain the similarity distance between the device configuration text and the first configuration text, and obtain the corresponding first similarity.

[0172] In other optional embodiments, the processing unit 1102 is used to: when the first similarity is less than the second threshold and greater than the first threshold, determine that the first information is difference information, and the difference information is used to indicate the text difference between the device configuration text and the template configuration text of the corresponding target sub-template.

[0173] In other optional implementations, the processing unit 1102 is configured to: when the first similarity is equal to a second threshold, determine that the first information is indifference information, where the indifference information is used to indicate that the device configuration text is the same as the template configuration text of the corresponding target sub-template.

[0174] In other optional implementations, the processing unit 1102 is configured to: when the first similarity is equal to a first threshold, determine that the first information is abnormal information, where the abnormal information is used to indicate that the device configuration text does not match the template configuration text of all target sub-templates.

[0175] In other optional embodiments, the processing unit 1102 is also used to: after determining the target audit result based on all the first information, splice the device configuration text, and the first information and template information corresponding to each target sub-template to obtain configuration item entry information corresponding to each target sub-template, each configuration item entry information is used to reflect the audit details between the template configuration text and the device configuration text of the corresponding target sub-template, and the template information includes the template configuration text; record all configuration item entry information in the target audit result, and display the target audit result.

[0176] In other optional embodiments, the processing unit 1102 is used to: calculate the similarity distance between the device configuration text and the template configuration text of each first configuration sub-template to obtain each second similarity, each first similarity is used to characterize the degree of similarity between the device configuration text and the template configuration text of the corresponding first configuration sub-template, each first configuration sub-template is a configuration sub-template in the second candidate configuration template, and the second candidate configuration template is any one of at least one candidate configuration template; the first configuration sub-template corresponding to the minimum similarity among all second similarities is determined as the target sub-template in the second candidate configuration template.

[0177] In other optional implementations, the processing unit 1102 is used to: divide the device configuration text and the second configuration text into rows, respectively, to obtain P rows of third character strings and Q rows of fourth character strings, where the second configuration text is the template configuration text of any first configuration sub-template, and P and Q are both integers greater than or equal to 1; calculate the first participle intersection and the first participle union between the P rows of third character strings and the Q rows of fourth character strings; and determine the similarity distance between the device configuration text and the second configuration text based on the first participle intersection and the first participle union.

[0178] In other optional implementations, the processing unit 1102 is used to: divide the third character string in each line and the fourth character string in each line according to spaces to obtain a first word segmentation set and a second word segmentation set, respectively; calculate the intersection and union between the first word segmentation set and the second word segmentation set to obtain a first word segmentation intersection and a first word segmentation union between the third character string in P lines and the fourth character string in Q lines.

[0179] In other optional implementations, the processing unit 1102 is used to: count the number of first participles in the intersection of the first participles and the number of second participles in the union of the first participles; solve the quotient between the number of first participles and the number of second participles to obtain the similarity distance between the device configuration text and the second configuration text.

[0180] In other optional embodiments, the processing unit 1102 is also used to: extract the policy name and policy definition line in each configuration sub-template for each candidate configuration template before determining the target sub-template in each candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates; and extract the template configuration text of each configuration sub-template based on the policy name and policy definition line.

[0181] In other optional embodiments, the acquisition unit 1101 is further configured to: before selecting at least one candidate configuration template based on the device attribute information, obtain multiple initial configuration templates, each initial configuration template including a configuration field. The processing unit 1102 is configured to: when the device attribute information matches the configuration fields of one or more initial configuration templates, select the one or more matching initial configuration templates as at least one candidate configuration template.

[0182] In other optional implementations, the acquisition unit 1101 is configured to acquire device attribute parameters and template configuration parameters. The processing unit 1102 is configured to extract the parameter value of each template configuration parameter from the parameter center and render the device attribute parameters and the parameter value of each template configuration parameter based on the template engine to obtain multiple initial configuration templates.

[0183] The above describes the service processing apparatus in the embodiment of the present application from the perspective of modular functional entities. The following describes the service processing device in the embodiment of the present application from the perspective of hardware processing. Figure 12 This is an optional schematic diagram of the hardware structure of the business processing device provided in the embodiment of the present application. The business processing device may have relatively large differences due to different configurations or performances, such as but not limited to the above Figure 11 The business processing device mentioned in, etc.

[0184] like Figure 12As shown, the business processing device 300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 322 (for example, one or more processors) and memory 332, and one or more storage media 330 (for example, one or more mass storage devices) for storing applications 342 or data 344. Among them, the memory 332 and the storage medium 330 can be temporary storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), each module may include a series of instruction operations in the classification processing device. Furthermore, the central processor 322 can be configured to communicate with the storage medium 330 and execute a series of instruction operations in the storage medium 330 on the business processing device 300. Exemplarily, the central processor 322 is used to execute the application 342 stored in the storage medium 330, thereby implementing the method for business configuration processing provided in the above embodiment of the present application.

[0185] The business processing device 300 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .

[0186] For example, Figure 12 The central processor 322 in the memory 332 can call the computer execution instructions stored in the memory 332 to make the business processing device execute the following Figures 2 to 10 The method in the corresponding method embodiment.

[0187] Specifically, Figure 11 The function / implementation process of the processing unit 1102 can be achieved by Figure 12 The central processing unit 322 in the memory 332 calls the computer execution instructions stored in the memory 332 to achieve this. Figure 11 The function / implementation process of the acquisition unit 1101 can be achieved by Figure 12 It is implemented by the input and output interface 358 in.

[0188] The steps performed by the classification processing device in the above embodiment can be based on the Figure 12 The business processing equipment structure shown.

[0189] A computer-readable storage medium is also provided in an embodiment of the present application, on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the method described in the above embodiments are implemented.

[0190] A computer program product is also provided in an embodiment of the present application, including a computer program or instructions, which, when executed by a processor, implements the steps of the methods described in the above embodiments.

[0191] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0192] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0193] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0194] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.

[0195] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0196] The computer program product includes one or more computer instructions. When the computer is loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction can be transmitted from a website, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website, a computer, a server or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. Available media can be magnetic media, (such as floppy disk, hard disk, tape), optical media (such as DVD) or semiconductor media (such as SSD)) etc.

[0197] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for business configuration processing, characterized in that: include: Obtaining an audit request for a target network device, the audit request including a device configuration text and device attribute information of the target network device, the device attribute information being used to characterize the attributes of the target network device, and the device configuration text being used to characterize the configuration of service parameters of the target network device; Selecting at least one candidate configuration template based on the device attribute information, each candidate configuration template including one or more configuration sub-templates with different configuration versions, each configuration sub-template correspondingly including a template configuration text, the template configuration text being used to represent a configuration status of template parameters in the corresponding configuration sub-template; For each candidate configuration template, determining a target sub-template corresponding to the candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates; Based on the device configuration text and the template configuration texts of all the target sub-templates, a target audit result is determined, and the target audit result is used to characterize the service configuration audit status of the target network device.

2. The method according to claim 1, characterized in that Determining a target audit result based on the device configuration text and the template configuration texts of all the target sub-templates includes: Calculating a similarity distance between the device configuration text and the template configuration text of each target sub-template to obtain respective first similarities, each first similarity being used to represent a degree of similarity between the device configuration text and the template configuration text corresponding to the target sub-template; Determining first information based on each of the first similarities, a first threshold, and a second threshold, each of the first information being used to indicate a text match between the device configuration text and a template configuration text corresponding to the target sub-template, the first threshold being less than the second threshold; A target audit result is determined based on all of the first information.

3. The method according to claim 2, characterized in that Calculating a similarity distance between the device configuration text and the template configuration text of each target sub-template to obtain respective first similarities includes: Divide the device configuration text and the first configuration text into rows to obtain N rows of first character strings and M rows of second character strings, where the first configuration text is a template configuration text of a target sub-template in a first candidate configuration template, the first candidate configuration template is any one of the at least one candidate configuration template, and N and M are integers greater than or equal to 1; Based on the N rows of first character strings and the M rows of second character strings, a first value and a second value are counted, where the first value is used to represent an intersection between the N rows of first character strings and the M rows of second character strings, and the second value is used to represent a difference between the N rows of first character strings and the M rows of second character strings; Based on the first value and the second value, a similarity distance between the device configuration text and the first configuration text is calculated to obtain a corresponding first similarity.

4. The method according to claim 3, characterized in that Counting the first value and the second value based on the N rows of first character strings and the M rows of second character strings includes: Step 1: When a first substring is identical to the second string in any one of the M lines of second strings, record a first number of similar lines, where the first substring is any one of the N lines of first strings. Step 2: When the first substring is different from the second string in any line of the M lines of second strings, record the first number of different lines; Repeating steps 1 to 2 above to sequentially traverse the N lines of the first character string, and determining a first value based on the number of the first similar lines, and determining a second value based on the number of the first different lines, or the sum of the first different lines and the second different lines, where the second different lines include the number of character string lines remaining in the N lines of the first character string excluding the first similar lines and the first different lines, or the number of character string lines remaining in the M lines of the second character string excluding the first similar lines and the first different lines; Calculating a similarity distance between the device configuration text and the first configuration text based on the first value and the second value to obtain a corresponding first similarity includes: Calculating the sum of the first value and the second value to obtain a third value; A quotient between the first value and the third value is solved to obtain a similarity distance between the device configuration text and the first configuration text, and to obtain a corresponding first similarity.

5. The method according to any one of claims 2 to 4, characterized in that Determining first information based on each of the first similarities, the first threshold, and the second threshold, respectively, includes: When the first similarity is less than the second threshold and greater than the first threshold, the first information is determined to be difference information, and the difference information is used to indicate the text difference between the device configuration text and the template configuration text corresponding to the target sub-template.

6. The method according to any one of claims 2 to 4, characterized in that Determining first information based on each of the first similarities, the first threshold, and the second threshold, respectively, includes: When the first similarity is equal to the second threshold, it is determined that the first information is indifference information, where the indifference information is used to indicate that the device configuration text is identical to the template configuration text corresponding to the target sub-template.

7. The method according to any one of claims 2 to 4, characterized in that Determining first information based on each of the first similarities, the first threshold, and the second threshold, respectively, includes: When the first similarity is equal to the first threshold, the first information is determined to be abnormal information, where the abnormal information is used to indicate that the device configuration text does not match the template configuration texts of all the target sub-templates.

8. The method according to any one of claims 2 to 7, characterized in that After determining a target audit result based on all the first information, the method further includes: splicing the device configuration text, and the first information and template information corresponding to each target sub-template to obtain configuration item entry information corresponding to each target sub-template, each configuration item entry information being used to reflect audit details between the template configuration text corresponding to the target sub-template and the device configuration text, the template information including the template configuration text; All the configuration item entry information is recorded in the target audit result, and the target audit result is displayed.

9. The method according to any one of claims 1 to 8, characterized in that Determining a target sub-template in each of the candidate configuration templates based on the device configuration text and the template configuration text of one or more configuration sub-templates includes: calculating a similarity distance between the device configuration text and the template configuration text of each first configuration sub-template to obtain respective second similarities, where each first similarity is used to characterize a degree of similarity between the device configuration text and the template configuration text corresponding to the first configuration sub-template, each first configuration sub-template being a configuration sub-template in a second candidate configuration template, and the second candidate configuration template being any one of the at least one candidate configuration template; The first configuration sub-template corresponding to the minimum similarity among all the second similarities is determined as the target sub-template in the second candidate configuration template.

10. The method according to claim 9, characterized in that Calculating a similarity distance between the device configuration text and the template configuration text of each first configuration sub-template includes: Divide the device configuration text and the second configuration text into rows to obtain P rows of third character strings and Q rows of fourth character strings, where the second configuration text is a template configuration text of any one of the first configuration sub-templates, and P and Q are both integers greater than or equal to 1; Calculate the first participle intersection and the first participle union between the third character string in the P row and the fourth character string in the Q row; Based on the first segmentation intersection and the first segmentation union, a similarity distance between the device configuration text and the second configuration text is determined.

11. The method according to claim 10, characterized in that Calculating the first participle intersection and the first participle union between the third character string in the P row and the fourth character string in the Q row includes: Divide the third character string in each line and the fourth character string in each line according to spaces to obtain a first word segmentation set and a second word segmentation set respectively; The intersection and union of the first word segmentation set and the second word segmentation set are calculated to obtain a first word segmentation intersection and a first word segmentation union between the third character string in the P rows and the fourth character string in the Q rows.

12. The method according to any one of claims 10 to 11, characterized in that Determining a similarity distance between the device configuration text and the second configuration text based on the first segmentation intersection and the first segmentation union includes: Counting the number of first participles in the intersection of the first participles and the number of second participles in the union of the first participles; A quotient between the first number of segmented words and the second number of segmented words is calculated to obtain a similarity distance between the device configuration text and the second configuration text.

13. The method according to any one of claims 1 to 12, characterized in that Before determining a target sub-template in each candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates, the method further includes: For each candidate configuration template, extract the policy name and policy definition line in each configuration sub-template; Based on the policy name and the policy definition line, the template configuration text of each configuration sub-template is extracted.

14. The method according to any one of claims 1 to 13, characterized in that Before selecting at least one candidate configuration template based on the device attribute information, the method further includes: Acquire multiple initial configuration templates, each of the initial configuration templates including a configuration field; Selecting at least one candidate configuration template based on the device attribute information includes: When the device attribute information matches the configuration fields of one or more initial configuration templates, the matched one or more initial configuration templates are selected as the at least one candidate configuration template.

15. The method according to claim 14, characterized in that Get several initial configuration templates, including: Get device attribute parameters and template configuration parameters; Extracting a parameter value of each template configuration parameter from a parameter center; The device attribute parameters and the parameter value of each template configuration parameter are rendered based on the template engine to obtain multiple initial configuration templates.

16. A business processing device, characterized in that: include: an acquisition unit, configured to acquire an audit request for a target network device, the audit request including a device configuration text and device attribute information of the target network device, the device attribute information being used to characterize the attributes of the target network device, and the device configuration text being used to characterize the configuration of service parameters of the target network device; a processing unit, configured to select at least one candidate configuration template based on the device attribute information, each candidate configuration template including one or more configuration sub-templates of different configuration versions, each configuration sub-template corresponding to a template configuration text, the template configuration text being used to represent a configuration status of template parameters in the corresponding configuration sub-template; The processing unit is configured to determine, for each candidate configuration template, a target sub-template in each candidate configuration template based on the device configuration text and the template configuration text in one or more configuration sub-templates; The processing unit is used to determine a target audit result based on the device configuration text and the template configuration texts of all the target sub-templates, and the target audit result is used to characterize the service configuration audit status of the target network device.

17. A business processing device, characterized in that: include: An input / output interface, a processor, and a memory, wherein program instructions are stored in the memory; The processor is configured to execute program instructions stored in the memory to perform the method according to any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that The computer-readable storage medium comprises instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 15.

19. A computer program product, characterized in that The computer program product comprises instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 15 .