A method, device and medium for intelligent testing of switches

By adopting a hierarchical knowledge base architecture and an intelligent agent verification mechanism, the problem of isolated domain knowledge in switch testing is solved, enabling efficient knowledge retrieval and continuous evolution, and improving testing efficiency and knowledge accumulation.

CN123123225APending Publication Date: 2026-11-17INSPUR NETWORK TECH (SHANDONG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611128501.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, the domain knowledge and AI agent are loosely coupled during switch testing, and the knowledge in each stage is isolated from each other, resulting in low testing efficiency and difficulty in knowledge accumulation.

Method used

A layered knowledge base architecture is adopted, including an understanding layer, a translation layer, an encoding layer, a debugging layer, an inspection layer, and a metadata layer. Each layer is built with an independently numbered knowledge base using MCP standard primitives, and intelligent agents are used to process and verify data layer by layer, forming a closed loop of knowledge.

Benefits of technology

It enables efficient retrieval and continuous evolution of knowledge during switch testing, reduces noise interference, and improves testing efficiency and the ability to automatically accumulate knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123225A_ABST
    Figure CN123123225A_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, and medium for intelligent testing of switches, belonging to the field of switch testing technology. It addresses the technical problem of loose coupling between domain knowledge and AI agents, and the isolation of knowledge at each stage in existing technologies. The method includes: dividing the knowledge base into layers to obtain knowledge base hierarchies; wherein the knowledge base hierarchy includes: an understanding layer, a translation layer, an encoding layer, a debugging layer, an inspection layer, and a metadata layer; processing and outputting test data layer by layer using intelligent agents to obtain JSON format data; performing knowledge verification processing on the JSON format data based on relevant field processing strategies to obtain knowledge verification results; aggregating the verified knowledge entries to obtain knowledge aggregation results; feeding back and updating the knowledge verification results and knowledge aggregation results to the switch test knowledge base; and encapsulating the switch test knowledge base using MCP standardization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of switch testing, and in particular to a method, device and medium for implementing intelligent testing of switches. Background Technology

[0002] Network switch software systems are becoming increasingly complex, with each version iteration involving regression verification of hundreds of functional features. Traditional testing relies heavily on manual processes: developers read functional test cases, understand their intent, supplement implementation details, manually write scripts containing command-line operations, run the scripts on a physical test platform, analyze logs to locate failures, and repeatedly modify them until they are perfected. A single test case can take hours to days from writing to passing.

[0003] With the emergence of AI-Agents, AI is capable of participating in several processes, including understanding, coding, and verifying test cases. However, existing solutions still have certain limitations, including: (1) Domain knowledge is scattered in scripts, documents and personal experience, and cannot be systematically retrieved and utilized by AI; (2) The knowledge of each stage is designed independently. The products of the understanding stage cannot constrain the encoding, and the patterns of the encoding stage cannot feed back into the understanding, thus forming knowledge silos. (3) The AI ​​model and the tool are integrated point-to-point. If the model or tool is changed, it needs to be re-adapted. (4) Newly generated knowledge cannot be automatically recycled, resulting in the inability to accumulate experiential knowledge.

[0004] Moreover, the MCP protocol is positioned as a USB-C interface between AI and external tools, achieving plug-and-play functionality through a standardized Server / Client architecture. The adapter encapsulates domain knowledge in the MCP standard format as an MCP Server, fully decoupling it from AI models / Agent tools. This means that when the switch's functionality is expanded, only the knowledge base content needs to be modified; no adaptation is required on the AI ​​side. Summary of the Invention

[0005] This application provides a method, device, and medium for implementing intelligent testing of switches, which addresses the following technical problem: the lack of loose coupling between domain knowledge and AI Agent and the isolation of knowledge in each link in the prior art.

[0006] The embodiments of this application adopt the following technical solutions: On one hand, this application provides a method for implementing intelligent testing of a switch, including: dividing the knowledge base into layers according to the knowledge base form type and knowledge representation type to obtain knowledge base levels; wherein, the knowledge base levels include: understanding layer, translation layer, encoding layer, debugging layer, review layer, and metadata layer; through the knowledge base levels, performing data processing and data output on the test data layer by layer of intelligent agents to obtain JSON format data; using actual verification parameters, performing knowledge verification processing on the JSON format data based on different levels in the knowledge base levels to obtain knowledge verification results; after obtaining the knowledge verification results, aggregating the verified knowledge entries to obtain knowledge aggregation results; feeding back and updating the knowledge verification results and the knowledge aggregation results to the switch test knowledge base, and performing MCP standardized encapsulation processing on the switch test knowledge base.

[0007] This application's embodiments construct a five-layer knowledge base—understanding, translation, encoding, debugging, and review—using MCP standard primitives. Each layer is independently numbered and represented according to differences in knowledge form. Furthermore, the intelligent agent performs targeted searches by layer and keywords through the retrieval interface, hitting only relevant knowledge within its own layer and unaffected by noise from other layers. The URIs are directly mapped to the numbering system, ensuring that retrieval efficiency is not affected by the growth of knowledge scale. The output of preceding intelligent agents serves as input constraints for subsequent intelligent agents (forward propagation), while the knowledge verification agent uses the final passed code as a reference to backtrack and verify candidate knowledge at each layer (backward feedback). Deviations are marked in ext extended form without violating the original rules. Simultaneously, the metadata layer synchronously records hit counts and source identifiers, forming a closed loop in the processing flow, allowing the knowledge base to continuously evolve with use case processing without being contaminated by unverified outputs.

[0008] In one feasible implementation, the knowledge base is divided into layers based on its form and representation type to obtain knowledge base hierarchies. Specifically, this includes: performing layered processing on the knowledge base architecture of the switch test knowledge base based on its form and representation: determining the understanding layer based on semantic processing strategies and natural language declarative strategy rules; determining the translation layer based on a CLI template library and multiple discrete templates; determining the encoding layer based on an encoding rule template library and file type encoding constraints; determining the debugging layer based on a debugging experience knowledge base and mapping chains; determining the review layer based on a review specification library and the mapping from file type to review rules; and determining the metadata layer based on a knowledge meta database and key-value mapping methods.

[0009] In one feasible implementation, the test data is processed and output layer by layer by the knowledge base hierarchy to obtain JSON format data. Specifically, this includes: defining the test data based on top-level key-value pairs and filled content using the classification rules and numbering system of the understanding layer, and outputting the JSON format data of the understanding layer; wherein the top-level key-value pairs include: layer field name, hit field name, discovery field name, and result field name; the classification rules include: structure validation rules, fuzzy blocking rules, fuzzy inference rules, and ambiguity resolution rules; defining the translation data of the JSON format data of the understanding layer based on top-level key-value pairs and filled content using the classification templates and numbering system of the translation layer, and outputting the JSON format data of the translation layer; wherein the classification templates include: single command templates, configuration combination templates, and view jump templates; and defining the translation data of the JSON format data based on top-level key-value pairs and filled content using the code specifications and numbering system of the encoding layer. The code defines the encoded data of the layer key-value pairs and filler content, and outputs the JSON format data of the encoding layer. The code specifications include: config class code specifications, parse class code specifications, and test class code specifications. Using the fault strategy and numbering system of the debugging layer, the JSON format data of the encoding layer is defined based on the top-level key-value pairs and filler content, and the JSON format data of the debugging layer is output. The fault strategy includes: programming fault strategy, common fault strategy, and characteristic fault strategy. Using the review classification rules and numbering system of the review layer, the JSON format data of the debugging layer is defined based on the top-level key-value pairs and filler content, and the JSON format data of the review layer is output. The review classification rules include: general review rules and file adaptation rules. The JSON format data in the understanding layer, translation layer, encoding layer, debugging layer, and review layer are numbered, reused, and mapped as key-value pairs, and the JSON format data of the metadata layer is output.

[0010] In one feasible implementation, the metadata layer receives the knowledge verification push results from the knowledge verification agent and updates the knowledge content at the corresponding level; the metadata layer periodically scans the knowledge aggregation agent's memory and identifies highly active knowledge items, then performs a knowledge aggregation operation.

[0011] In one feasible implementation, based on different levels in the knowledge base hierarchy and actual verification parameters, knowledge verification processing of the JSON format data related to field processing strategies is performed to obtain knowledge verification results. Specifically, this includes: using a knowledge verification agent to determine the hit field processing strategy between the JSON format data of the understanding layer and the actual effective parameters of the actual verification parameters, obtaining the understanding layer knowledge verification result; determining the hit field processing strategy between the JSON format data of the translation layer and the actual CLI sequence of the actual verification parameters, obtaining the translation layer knowledge verification result; determining the hit field processing strategy between the JSON format data of the encoding layer and the actual code of the actual verification parameters, obtaining the encoding layer knowledge verification result; and determining the hit field processing strategy between the JSON format data of the debugging layer and the actual effective repair of the actual verification parameters. The parameters are processed to determine the hit field processing strategy, resulting in a debugging layer knowledge verification result. This hit field processing strategy knowledge verification result comprises the understanding layer knowledge verification result, the encoding layer knowledge verification result, the translation layer knowledge verification result, and the debugging layer knowledge verification result. A knowledge verification agent is used to determine the discovery field processing strategy between JSON format data at different levels and the actual verification parameters, resulting in a discovery field processing strategy-based knowledge verification result. These different levels are the understanding layer, the translation layer, the encoding layer, the debugging layer, and the review layer. The discovery field processing strategy knowledge verification result includes valid and invalid verification results. The hit field processing strategy knowledge verification result includes consistent and divergent verification results.

[0012] In one feasible implementation, after obtaining the knowledge verification result, the method further includes: The knowledge meta database processing strategy of the metadata layer is used to classify the knowledge verification results of the hit field processing strategy and the discovery field processing strategy into scenarios; and based on the pre-action of the knowledge verification agent in the knowledge meta database processing strategy and the update action of the metadata layer, the data update of the knowledge meta database is triggered.

[0013] In one feasible implementation, after obtaining the knowledge verification result, the verified knowledge entries are aggregated to obtain a knowledge aggregation result. Specifically, this includes: after executing multiple workflows of the switch test knowledge base, using an intelligent aggregation agent to deduplicate related derivative entries of the verified knowledge entries to obtain a knowledge deduplication result; using the intelligent aggregation agent to determine knowledge entries with a cumulative hit count higher than the hit base rule as new default base rules, and retaining historical links for tracing to obtain a knowledge upgrade result; using the intelligent aggregation agent to expand the verified knowledge entries hierarchically and generate a global knowledge graph; and based on the knowledge deduplication result, the knowledge upgrade result, and the global knowledge graph, obtaining the knowledge aggregation result after knowledge aggregation.

[0014] In one feasible implementation, the knowledge verification results and the knowledge aggregation results are fed back and updated to the switch test knowledge base, and the switch test knowledge base is encapsulated using MCP standardization. Specifically, this includes: using URI unique identifiers to locate the knowledge entry numbers in the switch test knowledge base to obtain resource standardization logic; performing targeted knowledge retrieval and verification knowledge push on the knowledge entries in the switch test knowledge base to obtain retrieval standardization logic; wherein, the targeted knowledge retrieval is a knowledge retrieval based on hierarchy and keyword matching; and encapsulating the resource standardization logic and the retrieval standardization logic into the switch test knowledge base to achieve MCP standardization configuration of the switch test knowledge base.

[0015] Secondly, embodiments of this application also provide a switch intelligent testing implementation device, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, so that the at least one processor can execute a switch intelligent testing implementation method as described in any of the above embodiments.

[0016] Thirdly, embodiments of this application also provide a non-volatile computer storage medium, which is a non-volatile computer-readable storage medium storing at least one program. Each program includes instructions, which, when executed by a terminal, cause the terminal to execute a switch intelligent testing implementation method as described in any of the above embodiments.

[0017] This application provides a method, device, and medium for intelligent testing of switches. Compared with the prior art, the embodiments of this application have the following beneficial technical effects: 1. A five-layer knowledge base—understanding, translation, encoding, debugging, and review—is constructed using MCP standard primitives. Each layer is independently numbered and represented according to the differences in knowledge forms. Furthermore, the agent can perform targeted searches by layer and keywords through the retrieval interface, only hitting relevant knowledge within its own layer and unaffected by noise from other layers. URIs are directly mapped to the numbering system, ensuring that retrieval efficiency is not affected by the growth in knowledge volume.

[0018] 2. The product of the preceding agent is used as the input constraint of the subsequent agent (forward transmission). The knowledge verification agent backtracks and verifies the candidate knowledge of each layer with the final passed code as a reference (backward feedback). The deviation is marked in the form of ext extension without breaking the original rules.

[0019] 3. The metadata layer synchronously records the hit count and source identifier, forming a closed loop in the processing flow, allowing the knowledge base to continuously evolve with the use case processing without being contaminated by unverified products. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 A flowchart illustrating a method for implementing intelligent testing of a switch, as provided in this application embodiment; Figure 2 A schematic diagram of a layered knowledge base architecture based on an MCP Server, provided for embodiments of this application; Figure 3 This is a schematic diagram of the structure of a smart test implementation device for a switch provided in an embodiment of this application. Detailed Implementation

[0021] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0022] It should be noted that the intelligent testing method for switches proposed in this application addresses the shortcomings of existing technologies, such as loose coupling between domain knowledge and AI agents and isolated knowledge at each stage. This invention focuses on constructing a hierarchical knowledge base for the entire switch testing process, and the technical problems to be solved include: (1) How to design a layered knowledge base architecture for the whole process: For the differences in knowledge requirements of the five stages of use case understanding, use case translation, use case coding, script debugging and script review, design a knowledge structure with corresponding layers so that the AI ​​Agent of each stage can retrieve accurate domain knowledge as needed.

[0023] (2) How to establish a cross-stage knowledge association mechanism: to form positive transmission constraints and reverse experience feedback between knowledge bases at each level - the structured output of the preceding stage serves as the input constraint for the subsequent stage, and the verification results of the subsequent stage feed back to update the preceding knowledge base, breaking the isolated state of independent knowledge design in the existing scheme, so that the AI ​​Agent can perform vertical reasoning and knowledge verification throughout the entire life cycle.

[0024] (3) How to achieve automatic knowledge accumulation and continuous evolution: The output of Agents at each stage is not directly accumulated, but is backtracked and corrected according to the final execution form after the entire process is completed—correcting the deviation between intermediate reasoning and actual execution, and then uniformly transmitting it back to the MCP Server as dynamic experience to supplement or correct the knowledge base execution, forming a continuously evolving knowledge closed loop.

[0025] This application provides a method for implementing intelligent testing of switches, such as... Figure 1 As shown, the intelligent testing implementation method for switches specifically includes steps S101-S105: S101. Based on the knowledge base's form and representation type, the knowledge base is divided into layers to obtain knowledge base hierarchies. These hierarchies include: understanding layer, translation layer, encoding layer, debugging layer, review layer, and metadata layer.

[0026] Specifically, the knowledge base architecture in the switch test knowledge base is layered based on knowledge base form and knowledge representation: the understanding layer is determined based on semantic processing strategies and natural language declarative strategy rules; the translation layer is determined based on CLI template library and multiple discrete templates; the encoding layer is determined based on encoding rule template library and file type encoding constraints; the debugging layer is determined based on debugging experience knowledge base and mapping chain; the review layer is determined based on review specification library and file type to review rule mapping; and the metadata layer is determined based on knowledge element database and key-value mapping method.

[0027] In one embodiment, Figure 2A schematic diagram of a layered knowledge base architecture based on an MCP Server is provided for embodiments of this application, such as... Figure 2 As shown, a layered knowledge base architecture based on the MCP Server supports various agents in the AI ​​workflow to complete subdivided tasks. The switch testing knowledge base MCP Server encapsulates and provides the domain knowledge required for the switch testing process in the form of MCP protocol standard interfaces (Tools + Resources). Furthermore, the switch testing knowledge base includes multiple knowledge bases: an understanding layer knowledge base, a translation layer knowledge base, an encoding layer knowledge base, a debugging layer knowledge base, a review layer knowledge base, and a knowledge meta-database. It can also utilize knowledge aggregation agents for periodic knowledge aggregation and knowledge verification agents for knowledge accumulation.

[0028] In one embodiment, the hierarchical organization of the knowledge base includes an understanding layer, a translation layer, an encoding layer, a debugging layer, a review layer, and a metadata layer, as shown in Table 1 below. Based on the knowledge characteristics of each layer, different forms of knowledge representation methods need to be designed and numbered. The numbering system is designed according to the actual knowledge representation requirements. Furthermore, constraints are designed for the behavior of workflow agents: the task results of each agent must include JSON-formatted outputs with predefined fields, balancing the backward transfer of reasoning knowledge and the backflow of knowledge accumulation.

[0029] Table 1

[0030] S102. Through the knowledge base hierarchy, the test data is processed and output layer by layer by the intelligent agents to obtain JSON format data.

[0031] Specifically, by understanding the classification rules and numbering system of the layer, the test data is defined based on the top-level key-value pairs and the populated content, and the JSON format data of the understanding layer is output. The top-level key-value pairs include: layer field name, hit field name, discovery field name, and result field name. The classification rules include: structure validation rules, fuzzy blocking rules, fuzzy inference rules, and ambiguity resolution rules.

[0032] In one embodiment, for the understanding layer, its knowledge representation is: natural language declarative policy rules, each containing triggering conditions and actions, numbered as: sem-{type}-rule-xxx.

[0033] As a feasible implementation method, the definition of the intelligent agent's output JSON file is shown in Table 2: Table 2

[0034] Furthermore, through the classification templates and numbering system of the translation layer, the JSON format data of the understanding layer is defined based on the top-level key-value pairs and populated content, and the JSON format data of the translation layer is output. The classification templates include: single command templates, configuration combination templates, and view navigation templates.

[0035] In one embodiment, for the translation layer, its knowledge representation includes three categories: single command templates, configuration combination templates, and view jump templates, represented in multiple discrete template forms, with the numbering system: trans-{type}-tpl-xxx. As a feasible implementation, the JSON file output by the translation agent is defined as shown in Table 3. Table 3

[0036] Furthermore, through the code style and numbering system of the encoding layer, the JSON format data of the translation layer is encoded based on the top-level key-value pairs and the filled content, and the JSON format data of the encoding layer is output. The code style includes: config class code style, parse class code style, and test class code style.

[0037] In one embodiment, for the coding layer, the knowledge representation is: coding constraints organized by file type, with each file corresponding to a specification set, numbered as: code-{filetype}-spec-xxx.

[0038] As a feasible implementation method, the definition of the JSON file output by the coded agent is shown in Table 4: Table 4

[0039] Furthermore, through the fault strategy and numbering system of the debugging layer, the JSON format data of the encoding layer is defined based on the top-level key-value pairs and the filled content, and the JSON format data of the debugging layer is output. Among them, the fault strategy includes: programming fault strategy, common fault strategy, and characteristic fault strategy.

[0040] In one embodiment, for the debugging layer, its knowledge representation is: a mapping chain of <failure mode - location path - root cause confirmation - remediation plan>. The numbering system is: debug-{category}-strategy-xxx. Examples of categories: Programming failure strategy: debug-coding-strategy-xxx (programming language layer failure); Common failure strategy: debug-common-strategy-xxx (cross-feature common failure); Feature failure strategy: debug-{feature}-strategy-xxx (specific functional failures such as IP conflicts, missing VLAN dependencies, etc., the feature field is expandable).

[0041] As a feasible implementation method, the definition of the JSON file output by the debugging agent is shown in Table 5: Table 5

[0042] Furthermore, through the review classification rules and numbering system of the review layer, the JSON format data of the debugging layer is defined based on the top-level key-value pairs and the populated content, and the JSON format data of the review layer is output. Among them, the review classification rules include: general review rules and file adaptation rules.

[0043] In one embodiment, for the review layer, the knowledge representation is as follows: a mapping from file types to review rules, with each file type having its own subset of rules, and also general rules across files. The numbering system is: review-{scope}-rule-xxx. Examples of classification: general review rules review-common-rule-xxx (cross-file rules such as line width and hard-coded detection); file adaptation rules review-{filetype}-rule-xxx (a set of review rules specific to each file type). As one feasible implementation method, the definition of the JSON file output by the review agent is shown in Table 6: Table 6

[0044] Furthermore, it is necessary to reuse the JSON format data in the understanding layer, translation layer, encoding layer, debugging layer, and review layer by numbering and mapping key-value pairs, and output the JSON format data of the metadata layer.

[0045] In one embodiment, for the metadata layer, the knowledge representation is a key-value mapping method. The numbering system reuses the five-layer knowledge numbering as the primary key, eliminating the need for custom numbering. The maintenance mechanism receives the results pushed by the knowledge verification agent and updates the knowledge content; it also provides the knowledge aggregation agent with periodic scanning capabilities to identify highly active knowledge items and execute knowledge aggregation operations.

[0046] The JSON format data of its metadata layer is shown in Table 7: Table 7

[0047] As a feasible implementation method, the metadata layer can also receive the knowledge verification push results from the knowledge verification agent and update the knowledge content at the corresponding level. The metadata layer can also periodically scan the knowledge aggregation agent's memory, identify highly active knowledge items, and perform knowledge aggregation operations.

[0048] S103. Using actual verification parameters, based on different levels in the knowledge base hierarchy, perform knowledge verification processing on the JSON format data according to the relevant field processing strategies to obtain the knowledge verification results.

[0049] It should be noted that the knowledge produced by the four levels of intelligent agents—understanding, translating, encoding, and debugging—during the reasoning stage is limited by local context and incomplete information during reasoning. It may contain AI illusions and cannot be directly used as highly confident knowledge to be deposited back into the knowledge base.

[0050] As a feasible implementation, an independent knowledge verification agent needs to be introduced to perform knowledge verification. This agent is triggered after the workflow has been fully executed and does not participate in business reasoning within the workflow process. Furthermore, the knowledge verification agent only processes the knowledge generated during the complete execution of the workflow. If the workflow fails to complete to the final stage, such as due to a blocking issue during the debugging phase causing an interruption or skipping of the current workflow, the knowledge verification agent is not triggered. Instead, the knowledge archive (JSON files for each stage) generated by the workflow agent is preserved as is, and the workflow requests manual processing.

[0051] Specifically, the knowledge verification agent first needs to determine the hit field processing strategy between the JSON format data of the understanding layer and the actual effective parameters of the actual verification parameters to obtain the knowledge verification result of the understanding layer.

[0052] Furthermore, the JSON format data of the translation layer is then compared with the actual CLI sequence of the actual verification parameters to determine the hit field processing strategy, thereby obtaining the knowledge verification result of the translation layer.

[0053] Furthermore, the JSON format data of the encoding layer is then compared with the actual verification parameters through code to determine the relevant hit field processing strategy, thereby obtaining the knowledge verification result of the encoding layer.

[0054] Furthermore, the JSON data from the debugging layer must be compared with the actual valid repair parameters of the actual verification parameters by determining the hit field processing strategy to obtain the debugging layer knowledge verification result. The knowledge verification result of the hit field processing strategy consists of the understanding layer knowledge verification result, the encoding layer knowledge verification result, the translation layer knowledge verification result, and the debugging layer knowledge verification result.

[0055] In one embodiment, the knowledge verification result of the hit field processing strategy for the knowledge verification agent includes a consistency verification result and a deviation verification result; the specific hit field processing strategy is shown in Table 8 below: Table 8

[0056] Furthermore, a knowledge verification agent is needed to process the JSON-formatted data at different levels against the actual verification parameters, determining the relevant discovery field processing strategy to obtain a knowledge verification result based on that strategy. This means that the understanding layer, translation layer, encoding layer, debugging layer, and review layer need to perform this determination process against the actual verification parameters, considering the discovery field processing strategy. The knowledge verification result for the discovery field processing strategy includes both valid and invalid verification results.

[0057] In one embodiment, the processing strategy for the discovery field in the knowledge verification agent is shown in Table 9 below: Table 9

[0058] Furthermore, it is necessary to classify the knowledge verification results of the hit field processing strategy and the discovery field processing strategy using the knowledge meta database processing strategy at the metadata layer. Then, based on the pre-actions of the knowledge verification agent in the knowledge meta database processing strategy and the update actions at the metadata layer, the data update of the knowledge meta database is triggered.

[0059] In one embodiment, after completing knowledge verification, the knowledge verification agent pushes a knowledge update message to the switch test knowledge base MCPServer, triggering knowledge changes at the corresponding level and simultaneously triggering an update of the knowledge metadata database; the knowledge metadata database processing strategy at its metadata layer is shown in Table 10 below: Table 10

[0060] S104. After obtaining the knowledge verification results, the verified knowledge items are aggregated to obtain the knowledge aggregation results.

[0061] It should be noted that knowledge aggregation is a supplementary step to knowledge accumulation. An independent knowledge aggregation agent needs to be introduced to perform knowledge aggregation. The aggregation action is not triggered by a single workflow, but rather after multiple rounds of cumulative execution, or triggered manually at an appropriate time.

[0062] Specifically, after executing multiple workflows in the switch test knowledge base, the intelligent aggregation agent performs deduplication processing on the knowledge entries after verification to obtain the knowledge deduplication result.

[0063] In one embodiment, based on the design of knowledge accumulation, the knowledge aggregation processing action is designed as follows: First, deduplication is performed, that is, if there are multiple derived ext entries for the same knowledge entry, their deviation content and triggering scenarios are checked. If they are confirmed to be of the same type after comparison, they are merged into one entry, and the number with the highest hit count is retained.

[0064] Furthermore, through intelligent aggregation agents, knowledge items with a cumulative hit count higher than the hit base rule are identified as new default base rules, and historical links for tracing are retained to obtain knowledge upgrade results.

[0065] In one embodiment, knowledge entries also need to be upgraded: when the cumulative hit count of a certain ext entry is consistently higher than its base rule, it indicates that the deviation value has become a more common default behavior in the actual scenario. The aggregation automatically upgrades the description of the ext entry to the new default value of the base rule, and the original ext entry is marked and archived to retain a traceable historical link.

[0066] Furthermore, an intelligent aggregation agent is needed to expand the verified knowledge items into layers and generate a global knowledge graph. Then, based on the knowledge deduplication results, knowledge upgrade results, and the global knowledge graph, the knowledge items can be aggregated to obtain the aggregated knowledge result.

[0067] In one embodiment, after executing multiple workflows of the switch test knowledge base, a global knowledge graph can be generated, expanded into five layers of knowledge base: each rule in each layer lists its number, content summary, hit count, source identifier, etc. Two types of entries are marked in the graph for human attention—low-frequency entries (hit counts significantly lower than the average level of the same layer) and long-term inactive entries (hit counts have not increased across multiple rounds of knowledge aggregation actions). Humans can then evaluate whether to retain, modify, or delete these entries.

[0068] S105. Feedback and update the knowledge verification results and knowledge aggregation results to the switch test knowledge base, and perform MCP-standardized encapsulation processing on the switch test knowledge base. That is, adopt the MCP-standardized design so that the switch test knowledge base is uniformly exposed to the outside using MCP standard primitives.

[0069] Specifically, the knowledge entry numbers in the switch test knowledge base are first located by using unique URI identifiers to obtain the resource standardization logic.

[0070] As a feasible implementation method, for the Resources in the resource standardization logic: it needs to support the construction of knowledge entries, with each knowledge entry uniquely identified by a URI. The agent can directly locate a single knowledge content through the URI. The URI design directly corresponds to the knowledge number, requiring no special conversion. Specifically, newly added rules automatically generate URIs and register them, and URIs are synchronously recycled after an entry is deleted. The URI path directly reflects the segmented structure of the numbering system, requiring no additional indexing.

[0071] In one embodiment, as shown in Table 11, the correspondence between knowledge entry numbers and URI identifiers is as follows: Table 11

[0072] Furthermore, the knowledge entries in the switch test knowledge base are then used for targeted knowledge retrieval and verification knowledge push to obtain standardized retrieval logic. Targeted knowledge retrieval involves matching knowledge by level and keywords.

[0073] As a feasible implementation method, the Tools in the standardized retrieval logic can provide basic knowledge interactive retrieval, realize targeted knowledge retrieval (knowledge retrieval by level and keyword matching) and knowledge verification push.

[0074] In one embodiment, as shown in Table 12, the relationship between tool usage and logic encapsulation is as follows: Table 12

[0075] Furthermore, the resource standardization logic and retrieval standardization logic are encapsulated into the switch test knowledge base to achieve MCP standardization configuration of the switch test knowledge base.

[0076] As a feasible implementation method, the key technical points of this application are as follows: Key Point 1: A five-layered knowledge base architecture for the entire switch testing process. The domain knowledge required for the entire switch test case process, from natural language input to final code review, is divided into five independent layers according to the processing stage: understanding layer, translation layer, coding layer, debugging layer, and review layer. Each layer adopts different representation methods and numbering systems based on its own knowledge form differences.

[0077] Key Point 2: Numbering and Tracing Mechanism for Inference Products and Knowledge Rules. The inference products of each layer of the intelligent agent adopt a unified JSON format; the layer identifies the level, the hit list records the rule number of the current hit, the discovery list marks new discoveries that cannot be matched by the knowledge base, and the result carries the specific output of this layer. The hit field allows each inference result to be accurately traced back to the knowledge number that triggered it, and the discovery field allows the intelligent agent to actively mark unknown scenarios. The numbering system itself does not generate new knowledge, but it makes the three stages of knowledge retrieval, verification feedback, and missing information discovery traceable.

[0078] Key Point 3: Candidate Knowledge - Truth Verification and Bias Expansion Mechanism. The knowledge generated by each agent during the inference phase is only candidate knowledge and is not written to the MCP Server. After the entire process is completed, an independent knowledge verification agent uses the final passed code and test results as the truth value to backtrack and verify the candidate knowledge of each layer.

[0079] Key Point 4: Unified Encapsulation of MCP Standard Primitives. All rule entries in the five-layer knowledge base are uniformly exposed using MCP Resources primitives, with each rule assigned a unique URI; knowledge interaction is converged through standard MCP Tools calls, providing operations such as targeted knowledge retrieval and knowledge accumulation writing.

[0080] Key Point 5: The knowledge metadata layer is isolated from the regular layer. The MCP Server implicitly contains a two-layer structure: a regular five-layer hierarchical storage of business-related knowledge content for intelligent agents to retrieve, and a metadata layer that uses the knowledge ID as the primary key to record the cumulative hit count and source identifier of each rule.

[0081] Key Point 6: Extended Knowledge (EXT) Hierarchical Deviation Management. Hits do not overwrite existing knowledge rules. Instead, extended knowledge entries are appended under the original rule number. Each EXT entry is recorded as an independent knowledge unit, including the deviation scenario, correction value, and hit count. During subsequent agent retrieval, basic rule knowledge is first retrieved. If a hit occurs, the EXT links of that knowledge are traversed, and the most suitable extended knowledge is selected based on scenario matching.

[0082] In addition, embodiments of this application also provide a device for implementing intelligent testing of switches, such as... Figure 3 As shown, the intelligent testing implementation device 300 for switches specifically includes: At least one processor 301; and a memory 302 communicatively connected to the at least one processor 301; wherein the memory 302 stores instructions executable by the at least one processor 301 to enable the at least one processor 301 to execute: Based on the knowledge base form type and knowledge representation type, the knowledge base is divided into layers to obtain knowledge base levels; the knowledge base levels include: understanding layer, translation layer, encoding layer, debugging layer, review layer and metadata layer; Through the knowledge base hierarchy, the test data is processed and output layer by layer by intelligent agents to obtain JSON format data; By using actual verification parameters, based on different levels in the knowledge base hierarchy, knowledge verification processing of JSON format data is performed on relevant field processing strategies to obtain knowledge verification results. After obtaining the knowledge verification results, the verified knowledge items are aggregated to obtain the knowledge aggregation results. The knowledge verification results and knowledge aggregation results are fed back and updated to the switch test knowledge base, and the switch test knowledge base is encapsulated using MCP standardization.

[0083] This application's embodiments construct a five-layer knowledge base—understanding, translation, encoding, debugging, and review—using MCP standard primitives. Each layer is independently numbered and represented according to differences in knowledge form. Furthermore, the intelligent agent performs targeted searches by layer and keywords through the retrieval interface, hitting only relevant knowledge within its own layer and unaffected by noise from other layers. The URIs are directly mapped to the numbering system, ensuring that retrieval efficiency is not affected by the growth of knowledge scale. The output of preceding intelligent agents serves as input constraints for subsequent intelligent agents (forward propagation), while the knowledge verification agent uses the final passed code as a reference to backtrack and verify candidate knowledge at each layer (backward feedback). Deviations are marked in ext extended form without violating the original rules. Simultaneously, the metadata layer synchronously records hit counts and source identifiers, forming a closed loop in the processing flow, allowing the knowledge base to continuously evolve with use case processing without being contaminated by unverified outputs.

[0084] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.

[0085] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0086] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0087] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0088] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0089] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0090] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0091] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0092] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0093] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0094] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of this specification.

Claims

1. A method for implementing intelligent testing of a switch, characterized in that, The method includes: Based on the knowledge base form type and knowledge representation type, the knowledge base is divided into layers to obtain knowledge base levels; wherein, the knowledge base levels include: understanding layer, translation layer, encoding layer, debugging layer, review layer and metadata layer; Through the knowledge base hierarchy, the test data is processed and output by the intelligent agents at each level to obtain JSON format data; By using actual verification parameters, the JSON format data output from different levels in the knowledge base is subjected to knowledge verification processing based on relevant field processing strategies to obtain knowledge verification results. The knowledge entries that have undergone verification processing in the knowledge verification results are aggregated to obtain the knowledge aggregation result; The knowledge verification results and the knowledge aggregation results are fed back and updated to the switch test knowledge base, and the switch test knowledge base is configured using MCP standardization.

2. The method for implementing intelligent testing of a switch according to claim 1, characterized in that, Based on the knowledge base's form and representation type, the knowledge base is divided into layers, resulting in knowledge base hierarchies, specifically including: The knowledge base architecture in the switch test knowledge base is processed by layering based on knowledge base form and knowledge representation: The understanding layer is determined based on semantic processing strategies and natural language declarative strategy rules; The translation layer is determined based on the CLI template library and multiple discrete templates; The encoding layer is determined based on the encoding rule template library and the encoding constraints of the file type; The debugging layer is determined based on the debugging experience knowledge base and mapping chain; The review layer is determined based on the review specification library and the mapping from document type to review rules; The metadata layer is determined based on the knowledge metadata database and key-value mapping method.

3. The method for implementing intelligent testing of a switch according to claim 1, characterized in that, Through the aforementioned knowledge base hierarchy, the test data is processed and output layer by layer by the intelligent agent to obtain JSON format data, specifically including: Using the classification rules and numbering system of the understanding layer, the test data is defined based on the top-level key-value pairs and the filled content, and the JSON format data of the understanding layer is output; wherein, the top-level key-value pairs include: layer field name, hit field name, discovery field name and result field name; the classification rules include: structure verification rules, fuzzy blocking rules, fuzzy inference rules and ambiguity resolution rules; Using the classification templates and numbering system of the translation layer, the JSON format data of the understanding layer is defined based on the top-level key-value pairs and the filled content, and the JSON format data of the translation layer is output; wherein, the classification templates include: single command templates, configuration combination templates, and view jump templates; The JSON format data of the translation layer is encoded based on the top-level key-value pairs and the numbering system of the encoding layer, and the JSON format data of the encoding layer is output. The code specifications include: config class code specifications, parse class code specifications and test class code specifications. The debugging layer uses a fault strategy and numbering system to define debugging data for the JSON format data of the encoding layer based on top-level key-value pairs and fill content, and outputs the JSON format data of the debugging layer; wherein, the fault strategy includes: programming fault strategy, common fault strategy and characteristic fault strategy; The JSON format data of the debugging layer is defined based on the top-level key-value pairs and the numbering system of the review layer, and the JSON format data of the review layer is output. The review classification rules include general review rules and file adaptation rules. The JSON format data in the understanding layer, translation layer, encoding layer, debugging layer, and review layer are numbered, reused, and mapped to key-value pairs to output the JSON format data of the metadata layer.

4. The method for implementing intelligent testing of a switch according to claim 3, characterized in that, The metadata layer receives the knowledge verification push results from the knowledge verification agent and updates the knowledge content at the corresponding level. The metadata layer periodically scans the knowledge aggregation agent's memory and identifies highly active knowledge items, then performs knowledge aggregation operations.

5. The method for implementing intelligent testing of a switch according to claim 1, characterized in that, By using actual verification parameters and based on different levels within the knowledge base hierarchy, the JSON format data undergoes knowledge verification processing related to field processing strategies to obtain knowledge verification results, specifically including: The knowledge verification agent determines the hit field processing strategy between the JSON format data of the understanding layer and the actual effective parameters of the actual verification parameters to obtain the knowledge verification result of the understanding layer. The translation layer's JSON format data is compared with the actual CLI sequence of the actual verification parameters by determining the hit field processing strategy to obtain the translation layer knowledge verification result. The JSON format data of the encoding layer is compared with the actual verification parameters through code to determine the relevant hit field processing strategy, and the knowledge verification result of the encoding layer is obtained. The JSON format data of the debugging layer is compared with the actual valid repair parameters of the actual verification parameters by performing a judgment process on the hit field processing strategy to obtain the knowledge verification result of the debugging layer; wherein, the knowledge verification result of the hit field processing strategy is composed of the knowledge verification result of the understanding layer, the knowledge verification result of the encoding layer, the knowledge verification result of the translation layer, and the knowledge verification result of the debugging layer. The knowledge verification agent performs a judgment process on the discovery field processing strategy between the JSON format data in different levels and the actual verification parameters to obtain the knowledge verification result based on the discovery field processing strategy; the different levels are the understanding layer, the translation layer, the encoding layer, the debugging layer and the review layer. The knowledge verification results of the discovery field processing strategy include valid verification results and invalid verification results; the knowledge verification results of the hit field processing strategy include consistent verification results and deviation verification results.

6. The intelligent testing implementation method for a switch according to claim 5, characterized in that, After obtaining the knowledge verification result, the method further includes: The knowledge meta database processing strategy of the metadata layer is used to classify the knowledge verification results of the hit field processing strategy and the discovery field processing strategy into scenarios; and based on the pre-action of the knowledge verification agent in the knowledge meta database processing strategy and the update action of the metadata layer, the data update of the knowledge meta database is triggered.

7. The intelligent testing method for a switch according to claim 1, characterized in that, After obtaining the knowledge verification results, the verified knowledge items are aggregated to obtain knowledge aggregation results, which specifically include: After executing multiple workflows in the switch test knowledge base, the intelligent aggregation agent performs deduplication processing on the knowledge entries after verification to obtain the knowledge deduplication result. By using intelligent aggregation agents, knowledge items whose cumulative hit count exceeds the hit base rule are identified as new default base rules, and historical links for tracing are retained to obtain knowledge upgrade results; By using intelligent aggregation agents, the verified knowledge items are expanded in layers and a global knowledge graph is generated. Based on the knowledge deduplication results, the knowledge upgrade results, and the global knowledge graph, the knowledge aggregation result after knowledge aggregation is obtained.

8. The method for implementing intelligent testing of a switch according to claim 1, characterized in that, The knowledge verification results and knowledge aggregation results are fed back and updated to the switch test knowledge base, and the switch test knowledge base is encapsulated using MCP standardization, specifically including: The knowledge entry numbers in the switch test knowledge base are located by using unique URI identifiers to obtain the resource standardization logic; The knowledge entries in the switch test knowledge base are retrieved and verified through targeted knowledge retrieval and knowledge push, resulting in a standardized retrieval logic; wherein, the targeted knowledge retrieval is a knowledge retrieval based on hierarchical and keyword matching; The resource standardization logic and the retrieval standardization logic are encapsulated into the switch test knowledge base to achieve MCP standardization configuration of the switch test knowledge base.

9. A device for intelligent testing of switches, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute a smart test implementation method for a switch according to any one of claims 1-8.

10. A non-volatile computer storage medium, characterized in that, The storage medium is a non-volatile computer-readable storage medium that stores at least one program, each program including instructions that, when executed by a terminal, cause the terminal to perform a switch intelligent testing implementation method according to any one of claims 1-8.