Test topology automatic generation method and electronic device

CN123020418APending Publication Date: 2026-10-30INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611520208.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本申请提供了测试拓扑自动生成方法和电子设备,以至少解决相关技术中难以支撑现代软件开发快速迭代、复杂多变的测试需求的问题

Benefits of technology

[0009]通过本申请,由于接收多模态拓扑数据并解析,生成结构化拓扑文件;获取测试环境中的至少一个资源的资源状态,从测试资源数据库中获取资源的关系数据,基于资源和对应的关系数据构建环境资源图谱以展示环境中所有资源及其关系;对结构化拓扑文件进行语义解析,确定网络架构需求,并基于网络架构需求,查询环境资源图谱,筛选并确定可用物理资源和对应的状态;基于网络架构需求和可用物理资源,确定初始测试拓扑配置,并基于初始测试拓扑配置,生成测试拓扑;将测试拓扑对应的配置资源实体、连接关系和配置属性转化为资源实体的配置命令并下发;接收测试结果,根据测试结果优化初始测试拓扑配置,因此,通过构建一个从多模态需求感知、动态环境适配、智能决策生成到闭环持续优化的完整系统,实现从手工操作到规则自动化,再到环境感知与智能优化的转变,提升测试拓扑搭建的效率与成功率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020418A_ABST
    Figure CN123020418A_ABST
Patent Text Reader

Abstract

The application discloses a test topology automatic generation method and electronic equipment, relates to the technical field of machine learning, and comprises the following steps: receiving multi-modal topology data and analyzing, generating a structured topology file; acquiring the resource state of at least one resource in a test environment, acquiring the relationship data of the resource from a test resource database, and constructing an environment resource graph based on the resource and the corresponding relationship data to show all resources and their relationships in the environment; performing semantic analysis on the structured topology file, determining network architecture requirements, querying the environment resource graph, screening and determining available physical resources, generating a test topology based on the network architecture requirements and the available physical resources; converting the test topology into a configuration command of a resource entity and issuing the configuration command; and optimizing the initial test topology configuration according to a test result, solving the problem that related technologies cannot adapt to the fast iteration and complex and changeable test requirements of software development, and achieving the technical effect of improving the efficiency and success rate of test topology construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning technology, and in particular to a method and electronic device for automatically generating test topologies. Background Technology

[0002] In existing technologies, the construction of automated test topologies for network devices faces significant bottlenecks: related technologies heavily rely on test engineers manually designing and configuring topologies based on specific requirements, a cumbersome process that is difficult to adapt to the frequent changes in agile development scenarios; while virtualization-based solutions can achieve a certain degree of automation, they still require pre-defining all topology connections statically in configuration files, lacking flexibility and making troubleshooting difficult. The fundamental problem with these technologies lies in their insufficient level of automation and intelligence: they cannot intelligently parse diverse topology intentions from users, nor can they dynamically match and resolve conflicts based on real-time resource status.

[0003] Therefore, in view of the shortcomings of existing technical solutions, the present invention provides a method for automatically generating test topologies. Summary of the Invention

[0004] This application provides a method and electronic device for automatically generating test topologies, in order to at least address the problem in related technologies that are unable to support the rapid iteration and complex and ever-changing testing needs of modern software development.

[0005] This application provides a method for automatically generating test topologies. The method includes: receiving and parsing multimodal topology data to generate a structured topology file; obtaining the resource status of at least one resource in the test environment, retrieving resource relationship data from a test resource database, and constructing an environmental resource graph based on the resources and their corresponding relationship data to display all resources and their relationships in the environment; performing semantic parsing on the structured topology file to determine network architecture requirements, and querying the environmental resource graph based on the network architecture requirements to filter and determine available physical resources and their corresponding statuses; determining an initial test topology configuration based on the network architecture requirements and available physical resources, and generating a test topology based on the initial test topology configuration; converting the configuration resource entities, connection relationships, and configuration attributes corresponding to the test topology into configuration commands for resource entities and issuing them; receiving test results and optimizing the initial test topology configuration based on the test results.

[0006] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described automatic test topology generation methods.

[0007] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described automatic test topology generation methods.

[0008] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described automatic test topology generation methods.

[0009] This application achieves the following: by receiving and parsing multimodal topology data to generate a structured topology file; obtaining the resource status of at least one resource in the test environment; retrieving resource relationship data from the test resource database; constructing an environmental resource map based on the resources and their corresponding relationship data to display all resources and their relationships in the environment; performing semantic parsing on the structured topology file to determine network architecture requirements; querying the environmental resource map based on network architecture requirements to filter and determine available physical resources and their corresponding statuses; determining the initial test topology configuration based on network architecture requirements and available physical resources; generating a test topology based on the initial test topology configuration; converting the configuration resource entities, connection relationships, and configuration attributes corresponding to the test topology into configuration commands for resource entities and issuing them; receiving test results and optimizing the initial test topology configuration based on the test results; thus, by constructing a complete system from multimodal requirement perception, dynamic environment adaptation, intelligent decision generation to closed-loop continuous optimization, the system realizes the transformation from manual operation to rule automation, and then to environmental perception and intelligent optimization, improving the efficiency and success rate of test topology construction. Attached Figure Description

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

[0011] Figure 1 A flowchart illustrating an automatic test topology generation method provided in this application embodiment; Figure 2 This application provides another flowchart illustrating an automatic test topology generation method. Figure 3 A schematic diagram of the network connection of a test environment for an automatic test topology generation method provided in this application embodiment; Figure 4 This application provides an architectural diagram of an automatic test topology generation system. Figure 5 A structural block diagram of a test topology automatic generation device provided in this application embodiment; Figure 6 This is an internal structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0012] The technical solutions of 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 application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0013] It should be noted that, in the description of this application, 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. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0014] It should be noted that the terms "S1," "S2," etc., are used only for descriptive purposes and do not specifically refer to the order or sequence, nor are they intended to limit this application. They are merely for the convenience of describing the method of this application and should not be construed as indicating the sequential order of the steps. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0015] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0016] With the rapid development of data center switches, campus switches, cloud network equipment, and network operating systems (NOS), the scale and complexity of testing continue to grow, and traditional methods relying on manual design and construction of test topologies are no longer sufficient to meet R&D needs. This application can be widely used in: switch R&D testing platforms, data center network testing platforms, network equipment manufacturer laboratories, cloud computing and carrier network verification environments, and continuous integration (CI / CD) automated testing platforms.

[0017] The embodiments of this application provide a method for automatically generating test topologies. The method is described in detail below in conjunction with the execution flow of the method for automatically generating test topologies.

[0018] S101: Receives and parses multimodal topology data to generate a structured topology file.

[0019] Here, multimodality comes from a variety of different modalities or types, such as images, text, audio, video, sensors, etc.

[0020] Here, the structured topology file can include the abstract structure of the topology, such as a typical microservice architecture pattern (frontend-backend-database), or it can include some topology constraints (such as each service must have at least two instances, and it must be deployed across availability zones). For example, it can include the logical role of the device (such as Core-Switch-01), type, expected model or configuration parameters, interconnection relationships between devices, port types, link bandwidth requirements, etc.

[0021] Multimodal topology data may include one mode or multiple modes.

[0022] The structured topology file may include one or more topology descriptions.

[0023] Specifically, through the input interface, multimodal topology data is received, deep semantic parsing is performed on the data of different modalities, and the parsing results output by semantic understanding are mapped and filled into a predefined structured schema (such as based on JSON Schema or XML Schema) to generate a standardized document.

[0024] In one embodiment, multimodal topology data can be generated by user interaction through a human-computer interface. For example, users can use a graphical user interface (GUI) to drag and drop virtual components such as switches, routers, and terminal devices, and connect cables to visually draw the desired topology; users can use structured scripts (such as JSON or YAML) to describe it precisely; or users can use natural language (such as "build a test topology to test the ebgp functionality of the switch") to input the topology requirements for testing based on the test cases.

[0025] In one embodiment, the system can use computer vision (CV) technology to identify device symbols and connecting lines by having the user hand-draw a topology sketch (even an imprecise one) on a tablet, and then combine this with domain knowledge to perform topology repair and normalization.

[0026] In one embodiment, by integrating speech recognition and speech synthesis, users can be enabled to describe the topology, query resource status, or make local adjustments via voice commands.

[0027] In one embodiment, when receiving multimodal topology data, the system may also check whether the number of device port connections exceeds the limit, whether the IP address format is correct, and whether there are any unconnected isolated devices, and provide timely feedback to the user to ensure the validity and rationality of the input information.

[0028] In one embodiment, various multimodal inputs can also be uniformly converted into a standardized, semantically rich intermediate data format (typically a structured YAML, JSON, or XML file).

[0029] In one embodiment, receiving and parsing multimodal topology data may further include: Receive the input test target and parse the test target; Based on the parsed test target, the topological structure is obtained by pattern matching and derivation of the parsed test target through the derivation model; By using the device configuration inference model, the topology is functionally mapped to generate device parameter configurations. Based on the analyzed test objectives and topology, the monitoring indicators and data collection points are determined. By analyzing the model, the test objectives are transformed into evaluation rules; A structured topology file is generated based on the topology, device parameter configuration, monitoring indicators and collection points, and evaluation rules.

[0030] In this way, users do not need to provide any specific topology diagrams or configuration scripts. They only need to describe the test objectives in natural or structured language to automatically generate a complete implementation plan, which improves the efficiency, accuracy and consistency of test environment preparation.

[0031] S102: Obtain the resource status of at least one resource in the test environment, retrieve the relationship data of the resource from the test resource database, and construct an environment resource map based on the resource and its corresponding relationship data to display all resources in the environment and their relationships.

[0032] Here, the environmental resource map uses a graph structure to visualize, query, and analyze all resources in the environment and their relationships through knowledge modeling.

[0033] In the environmental resource map, nodes represent resources, and edges represent relationships between resources.

[0034] Among them, the environmental resource map changes in real time according to the resource status.

[0035] The resources may include switches, servers, testers, and third-party auxiliary testing equipment.

[0036] The test resource database can be a relational database (such as MySQL or PostgreSQL) to provide unified, efficient, and reliable data storage, access, and management services for each functional module. All management information, connection information, and status information of the test resources are registered in the database and updated in real time.

[0037] Specifically, the system collects resource status information from the test environment (e.g., through monitoring tools, API calls, command-line tools, etc.), retrieves relevant configuration data or resource relationship data from the database, compares the two, and constructs a graph by treating resources as nodes and the relationships between resources as edges.

[0038] S103: Perform semantic parsing on the structured topology file to determine network architecture requirements, and based on these requirements, query the environmental resource map to filter and determine available physical resources and their corresponding states.

[0039] Network architecture requirements can include logical devices, logical connections, connection constraints, and configuration constraints. Connection constraints can include bandwidth, latency, protocol requirements, etc.

[0040] Specifically, based on the connection constraints in the network architecture requirements and the port status of available physical resources, logical ports and physical ports are mapped to determine the port mapping relationship.

[0041] Based on network architecture requirements and available physical resources, determine the initial test topology configuration, and generate the test topology based on the initial test topology configuration.

[0042] Here, a test topology is a temporary environment structure built for specific tests (such as performance testing, fault recovery testing, etc.), simulating the topology of the production environment and simplified or adjusted according to test requirements.

[0043] The test topology consists of a set of resource nodes and the connections between them, as well as the configuration of each resource (such as instance specifications, image version, etc.) and the global attributes of the topology (such as network configuration, security group rules, etc.).

[0044] In one embodiment, the generated test topology is written to a database.

[0045] Specifically, based on network architecture requirements and the port status of available physical resources, port mapping relationships are determined, and the initial test topology configuration is determined based on network architecture requirements, available physical resources, and port mapping relationships.

[0046] Specifically, the mapping strategy can be based on multi-dimensional features: for example, it can be a hard constraint, such as when the port rate is greater than or equal to the required rate, the port type is compatible with the required optical module, or the port status is idle; or it can be a soft optimization, such as prioritizing the port with the closest rate match to avoid resource waste, prioritizing the same board or adjacent ports to reduce configuration fragmentation, and taking into account optical module inventory and cost.

[0047] Specifically, it receives structured topology files and environmental resource maps, performs calculations, reasoning, and decision-making through built-in machine learning, and finally outputs a detailed test topology that can be recognized by machines under the current resource constraints, as well as the configuration scheme of all test resources, and writes it into the database to drive the execution unit to complete the automated construction.

[0048] S105: Convert the configuration resource entities, connection relationships and configuration attributes corresponding to the test topology into configuration commands for resource entities and issue them.

[0049] Specifically, the system reads the test resource management information and configuration required for the generated test topology, converts them into a series of specific configuration commands that can be recognized by network devices, and issues and executes them on the target device through automated tools (such as Ansible) to realistically build the test topology expected by the user in the physical environment.

[0050] S106: Receive test results and optimize the initial test topology configuration based on the test results.

[0051] Specifically, after successfully building the test topology, the system automatically triggers and executes predefined or dynamically generated test case sets to obtain test results. The test results are collected and compared with the initial results stored in the database. The actual effect of the planning scheme is evaluated through machine learning algorithms, and the engine's model parameters and strategies are automatically trained and optimized accordingly.

[0052] In one embodiment, it may also include in-depth processing, multi-dimensional analysis, and visualization of various types of data generated throughout the process (including user topology intent, network device configuration, execution logs, test results, and optimization records) to generate a comprehensive analysis report.

[0053] It should be noted that this application constructs a complete system from multimodal demand perception, dynamic environment adaptation, intelligent decision generation to closed-loop continuous optimization, realizing the transformation from manual operation to rule automation, and then to environment perception and intelligent optimization, thereby improving the efficiency and success rate of test topology construction; at the same time, it can reduce labor costs, improve equipment utilization, and shorten the test cycle.

[0054] In some specific implementations, multimodal topology data is received and parsed to generate a structured topology file, including: In response to the recognition of text topology data, the text topology data is parsed using a natural language processing model to determine the text configuration information; In response to the recognition of image topology data, the image topology data is identified through an image recognition model to determine the image configuration information; In response to the identification of script topology data, the corresponding lexical analysis and syntax analysis are determined according to the language type of the script topology data, an abstract syntax tree is constructed, the script topology data is parsed, and the script configuration information is determined; A structured topology file is generated based on the parsed configuration information.

[0055] Here, natural language processing models are used to transform text into a computer-understandable form. This can include steps such as part-of-speech tagging, named entity recognition, sentiment analysis, machine translation, text summarization, and question-answering systems.

[0056] Among them, natural language processing models can be n-gram models, Transformer models, long short-term memory networks, etc.

[0057] Here, image recognition models are used to enable computers to automatically identify, detect, and classify objects, scenes, or activities from digital images or videos. This can include steps such as image classification, object detection, image segmentation, and face recognition.

[0058] Among them, image recognition models can include ResNet, YOLO, etc.

[0059] Here, the abstract syntax tree represents the syntax structure of a programming language in a tree-like form. Each node in the tree represents a structure in the source code (such as operators, keywords, variables, literals, etc.), while ignoring some specific details in the code (such as parentheses, semicolons, whitespace characters, etc.).

[0060] Syntax analysis transforms the character stream of source code into a meaningful lexical unit stream. Using the token stream generated by lexical analysis, syntax analysis checks the program structure against the language's grammatical rules to ensure correctness and constructs a tree structure that reflects the grammatical hierarchy.

[0061] In this way, by adopting appropriate parsing techniques for different data types, the efficiency and accuracy of extracting configuration information from various forms of data can be improved.

[0062] In some specific implementations, the method further includes: In response to the fact that multimodal topology data includes multiple data types, the configuration information corresponding to each data type is parsed and obtained respectively; Verify and merge all configuration information, and detect conflicts in the merged configuration information; According to the preset conflict handling rules, conflicting configuration information is processed. Based on the processed configuration information, a structured topology file is generated.

[0063] Here, the overall confidence level is the degree of confidence that the data type identifier believes the input data belongs to a certain type.

[0064] Here, the boundary detection algorithm is an algorithm used to segment mixed data into independent fragments.

[0065] Here, conflict handling rules are a set of predefined strategies and logic used to resolve inconsistencies or contradictions between configuration information parsed from different modal data sources.

[0066] Conflicts can include entity attribute conflicts (such as identifier conflicts, network parameter conflicts, and device specification conflicts), configuration and constraint conflicts, and logical and semantic conflicts.

[0067] The conflict handling rules can include data source priority rules, timestamp rules, semantic confidence weighted rules, custom rules, and merging rules.

[0068] The conflict resolution methods may include analysis or selection of the best option.

[0069] Thus, merging information from multiple sources helps to form a more comprehensive and accurate description of topology requirements, enhancing practicality and robustness.

[0070] In some specific implementations, the data types for identifying multimodal topology data include: Multimodal topology data is input into a data type recognizer, which outputs the corresponding overall confidence score. The data type recognizer includes a text recognizer, an image recognizer, and a script recognizer. In response to the overall confidence level being greater than the preset confidence level and the internal features of the data satisfying the condition of the same data type, the data type of the multimodal topology data is determined; In response to an overall confidence level that is less than or equal to a preset confidence level, the multimodal topology data is fragmented using a boundary detection algorithm. The multiple data fragments are then input into a data type identifier, which outputs the fragment confidence level. Determine the data type of the fragments based on the fragment confidence level; Based on the data type, spatial relationship and / or location relationship of multiple data fragments, integrate multiple data fragments; Based on the integration results, the data type of the multimodal topology data is determined.

[0071] The text recognizer can use statistical features (such as entropy and character distribution) and language models (such as n-grams) to determine whether the data is natural language text and output the confidence score of the text type.

[0072] Boundary detection algorithms can include segmentation based on OCR (Optical Character Recognition) regions, image edges, and PDF (Portable Document Format) object boxes.

[0073] The image recognizer can check if the file header conforms to common image formats (such as JPEG, PNG, etc.) and attempt to decode the image. Meanwhile, for image data without a file header, it can determine the image type by analyzing byte distribution and structural features, and output the confidence level of the image type.

[0074] The script recognizer can check whether it contains script-specific syntax structures, such as shebangs, function definitions, and variable assignments. It can also combine the keywords and structural features of programming languages ​​to output the confidence level of the script type.

[0075] If one type accounts for the vast majority (e.g., more than 90%) of the fragment identification results, and other types of fragments are very small (e.g., less than 10 bytes), they can be identified as a single type, and the small fragments are noise.

[0076] Specifically, determining whether the internal characteristics of data satisfy the condition of being of the same data type can include: For text types, calculating the proportion of non-text characters (control characters, binary data); if it exceeds a threshold, it is not satisfied; or, attempting decoding; if the decoding failure rate is too high, it is not satisfied; For image types, checking whether the image file header and footer are complete; if incomplete, it is not satisfied; or, attempting to parse the image size and checking whether the data is complete; if incomplete, it is not satisfied; For script types, checking for syntax errors (simple syntax checks such as bracket matching and keywords can be used); if present, it is not satisfied; or, checking for obvious non-script content (such as large blocks of binary data); if present, it is not satisfied.

[0077] In one embodiment, integrating multiple data shards includes: if adjacent data shards have the same data type and their confidence levels are all higher than a second threshold, then they are merged into the same data region; if there is a data type conflict, then the data type is determined according to the shard confidence level or according to a preset priority rule.

[0078] Thus, through the fragmentation and integration mechanism, even for non-pure or irregularly formatted files, the different components within them can be effectively parsed, expanding the range of inputs that can be processed.

[0079] In some specific implementations, obtaining the resource status of at least one resource in the test environment includes: Based on preset periods for different resources, probe messages are sent to the corresponding resources and responses are received to determine the resource status of at least one resource; and / or, Monitor the test resource database in real time to determine the resource status of at least one resource.

[0080] Among them, proactive detection can detect changes in the database that have not been updated in a timely manner (such as unexpected device offline or sudden port blockage).

[0081] In this way, by combining active detection and passive monitoring databases, a comprehensive and real-time perception of resource status can be achieved.

[0082] In some specific implementations, a test topology is generated based on the initial test topology configuration, including: Identify potential resource configuration conflicts in the initial test topology configuration using machine learning algorithms; Based on potential resource configuration conflicts, the initial test topology configuration is modified according to preset correction rules to generate at least one candidate test topology. The test topology is determined by evaluating at least one candidate test topology using a reward function.

[0083] Here, machine learning algorithms are algorithms that can learn patterns from data and use these patterns to make predictions or decisions about unknown data. A model is built by training on data, and then that model is used to make inferences about new data.

[0084] Machine learning algorithms can include supervised learning (such as linear regression, logistic regression, neural networks, etc.), unsupervised learning (such as clustering algorithms, etc.), semi-supervised learning (such as self-training, co-training, etc.) and reinforcement learning (such as Q-learning, deep Q-networks, etc.).

[0085] Resource configuration conflicts can include port occupancy, VLAN ID conflicts, and insufficient device performance.

[0086] The reward function can include performance, cost, balance, and other metrics such as resource utilization, configuration complexity, and conflict.

[0087] In this way, by using machine learning to analyze historical and environmental data, potential resource conflicts can be proactively predicted during the topology generation phase and avoided in advance when generating solutions, thus improving the success rate of the first deployment.

[0088] In some specific implementations, the initial test topology configuration is optimized based on the test results, including: Based on the test results and the corresponding test topology, source tracing data is constructed; The source data is input into the feedback learning model to obtain the adjustment results; Optimize the initial test topology configuration based on the adjustment results.

[0089] This allows the system to adapt to the characteristics of different testing phases and projects, enabling data-driven continuous iteration.

[0090] In some specific implementations, the method further includes: The multimodal topology data is analyzed to determine the test targets; Based on the test results and test objectives, determine the subsequent test operations, which include obtaining test cases or generating test topologies.

[0091] The multimodal topology data may also include test type and depth, specific behavior or target to be verified, passability criteria and performance indicators, etc.

[0092] Subsequent testing operations may also include adjusting parameters.

[0093] For example, the types and depth of tests may include functional verification (such as verifying whether a specific protocol or function works as expected), stability testing (such as running continuously for 24 hours under full bandwidth traffic surges), and fault recovery testing (verifying the network's self-healing ability when a fault occurs).

[0094] For example, the specific behavior or target to be verified may include protocol interactions, traffic forwarding paths, state transitions, etc.

[0095] For example, passability criteria and performance metrics may include quantitative performance metrics (such as throughput, latency, packet loss rate, convergence time, etc.).

[0096] The testing objectives can include verifying throughput, testing fault recovery, covering the most fault scenarios with the fewest test rounds, and identifying system performance bottlenecks.

[0097] In this way, not only can the environment be set up, but the test objectives can also be understood, and subsequent steps can be intelligently decided accordingly, thereby improving the level of automation of the entire testing activity.

[0098] In some specific implementations, subsequent test operations are determined based on the test results and test objectives, including: If the test result is successful, determine the subsequent test operations based on the test objectives; In response to a test failure, analyze the root cause of the failure and determine the phased test objectives based on the root cause. Based on the phased testing objectives, determine the subsequent testing operations.

[0099] The root cause could be a link failure, a configuration error, or something similar.

[0100] One of the phased testing objectives is to locate the fault point.

[0101] Specifically, if there is a clear root cause of failure, priority is given to generating a topology for targeted reproduction or verification; if there is no serious failure or active exploration is required, the candidate topology with the highest information value is selected based on the global optimization goal.

[0102] In one embodiment, subsequent testing operations may further include: automatically constructing a specialized test topology for locating problems based on the phased testing objectives.

[0103] In this way, the testing strategy can be dynamically adjusted based on the test results, which improves the utilization efficiency of testing resources and the depth of testing.

[0104] In one embodiment, Figure 2 This is a schematic diagram of the method flow in the embodiments of this application, such as... Figure 2 As shown, the process in this application includes: physically constructing a full-mesh test environment network connection; inputting a network topology description, such as an image, text, or script; parsing the topology description using multimodal topology intent perception to generate a structured topology file; real-time detection and perception of available environmental resources to generate and maintain an environmental resource map; a machine learning engine matching topology requirements with the environmental resource map to generate a topology configuration; an automated configuration execution module executing the configuration to complete the automatic construction of the test topology; calling the switch automated testing module to execute the test; and feedback of test results to optimize the machine learning engine.

[0105] In one embodiment, Figure 3 This is a schematic diagram of the network connection of the test environment in the embodiments of this application, such as... Figure 3 As shown, the network connection of the test environment in this application includes: leaf switch, switch 1, server 1, tester 1, device under test 1, automation device 1, switch 2, server 2, tester 2, device under test 2, automation device 2, management network, database server and device management server.

[0106] It should be understood that, although Figures 1-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 1-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0107] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0108] Embodiments of this application also provide a test topology automatic generation system, such as... Figure 4 As shown, the system includes: a front-end topology input module, a multimodal topology intent perception module, an environmental resource dynamic cognition module, a database module, a machine learning planning module, an automated testing module, a self-learning optimization feedback module, an automated configuration execution module, and a reporting system module.

[0109] Specifically, the front-end topology input module is the user-machine interaction interface of this system. Its main responsibility is to receive and initially process the user's description of the expected test topology, and transform the user's abstract or specific test intentions into standardized input that the system can parse.

[0110] Specifically, the multimodal topology intent perception module is coupled between the front-end topology input module and the machine learning planning module. It receives raw, multimodal test network topology description data from the front-end topology input module, which may be in the form of graphics, text, or scripts based on formats such as YAML or JSON. By fusing perception, image recognition, code recognition, and natural language processing and semantic understanding, it parses and extracts the user's deep intent to build the test topology, generating a structured, machine-readable topology description file, providing precise input for subsequent planning and execution.

[0111] Specifically, the dynamic environmental resource cognition module is coupled between the physical testing environment, the machine learning planning module, and the database module. By viewing database data in real time and intermittently sending probe messages, it monitors and collects the status of various resource elements in the physical testing environment in real time, and constructs and maintains a dynamically updated, digital environmental resource map through modeling techniques.

[0112] Specifically, the database module is a relational database (such as MySQL or PostgreSQL) that provides unified, efficient, and reliable data storage, access, and management services for all functional modules in the system. All management information, connection information, and status information of test resources are registered in the database and updated in real time in conjunction with the dynamic environmental resource awareness module. This ensures the consistency, integrity, and traceability of data throughout the entire automated workflow.

[0113] Specifically, the machine learning planning module is coupled between the multimodal topology intent perception module, the environmental resource dynamic cognition module, the database module, and the automated configuration execution module. It receives a structured topology description file (user intent) output from the multimodal topology intent perception module and a test environment resource map (physical reality) provided by the environmental resource dynamic cognition module. Through built-in machine learning, it performs calculations, reasoning, and decision-making, ultimately outputting a detailed test topology that is machine-recognizable under the current resource constraints, along with a configuration scheme for all test resources. This information is then written to the database module, driving the downstream execution module to complete the automated construction.

[0114] Specifically, the automated configuration execution module is coupled between the database module and network devices such as target physical switches, servers, and test instruments. It reads the required test resource management information and configurations generated by the machine learning planning module from the database module, converts them into a series of specific configuration commands that can be recognized by network devices, and issues and executes them on the target devices through Ansible automation tools, ultimately building the test topology expected by the user in the physical environment.

[0115] Specifically, after the automated configuration and execution module successfully constructs the target test topology, the automated testing module automatically triggers and executes predefined or dynamically generated test case sets. Its output provides direct analytical basis for the self-learning optimization feedback module and serves as a data source driving continuous system optimization.

[0116] Specifically, the self-learning optimization feedback module runs through and connects the machine learning planning module, the automated testing module, and the database module. It collects test result data generated by the automated testing module, compares and analyzes it with the initial results stored in the database by the machine learning planning module, evaluates the actual effectiveness of the planning scheme through machine learning algorithms, and automatically trains and optimizes the engine's model parameters and strategies accordingly.

[0117] Specifically, the reporting system module performs in-depth processing, multi-dimensional analysis, and visualization of various types of data generated throughout the system process (including user topology intent, network device configuration, execution logs, test results, and optimization records) to generate comprehensive analysis reports.

[0118] This application integrates cutting-edge technologies in the fields of artificial intelligence and automated testing, including: multimodal perception technology (image + text + script), large language model semantic understanding technology, network resource graph modeling technology, intelligent planning and constraint solving technology, automated configuration orchestration technology, test failure root cause analysis technology, and self-learning feedback optimization technology, to achieve a technological upgrade from manually designing test environments to intelligently generating test environments.

[0119] In this way, by creating a closed loop of multimodal intent recognition, machine learning planning, automated execution, and testing, the traditional network testing model that relies on manual design and configuration is changed, greatly improving the efficiency and accuracy of topology construction and testing.

[0120] Embodiments of this application also provide an automatic test topology generation device, comprising: a first processing module 501, configured to receive and parse multimodal topology data to generate a structured topology file; a second processing module 502, configured to obtain the resource status of at least one resource in the test environment, obtain the relationship data of the resource from the test resource database, and construct an environmental resource map based on the resources and their corresponding relationship data to display all resources and their relationships in the environment; a third processing module 503, configured to perform semantic parsing on the structured topology file to determine network architecture requirements, and based on the network architecture requirements, query the environmental resource map to filter and determine available physical resources and their corresponding statuses; a fourth processing module 504, configured to determine an initial test topology configuration based on the network architecture requirements and available physical resources, and generate a test topology based on the initial test topology configuration; a fifth processing module 505, configured to convert the configuration resource entities, connection relationships, and configuration attributes corresponding to the test topology into configuration commands for resource entities and issue them; and a sixth processing module 506, configured to receive test results and optimize the initial test topology configuration based on the test results.

[0121] In a preferred embodiment of this application, the first processing module 501 is specifically configured to: in response to the identification of text topology data, parse the text topology data using a natural language processing model to determine text configuration information; in response to the identification of image topology data, identify the image topology data using an image recognition model to determine image configuration information; in response to the identification of script topology data, determine the corresponding lexical analysis and syntax analysis based on the language type of the script topology data, construct an abstract syntax tree, parse the script topology data, and determine script configuration information; and generate a structured topology file based on the parsed configuration information.

[0122] As a preferred implementation, in this embodiment of the application, the first processing module 501 is further configured to: in response to the fact that the multimodal topology data includes multiple data types, parse and obtain the configuration information corresponding to each data type respectively; verify and merge each configuration information, and detect conflicts in the merged configuration information; process the conflicting configuration information according to preset conflict handling rules; and generate a structured topology file according to the processed configuration information.

[0123] In a preferred embodiment of this application, the first processing module 501 is further configured to: input multimodal topology data into a data type recognizer and output the corresponding overall confidence score, wherein the data type recognizer includes a text recognizer, an image recognizer, and a script recognizer; determine the data type of the multimodal topology data in response to the overall confidence score being greater than a preset confidence score and the internal features of the data satisfying the same data type condition; segment the multimodal topology data using a boundary detection algorithm in response to the overall confidence score being less than or equal to the preset confidence score, input multiple data segments into the data type recognizer, and output segment confidence scores; determine the data type of the segments based on the segment confidence scores; integrate the multiple data segments based on their data types, spatial relationships, and / or positional relationships; and determine the data type of the multimodal topology data based on the integration result.

[0124] In a preferred embodiment of this application, the second processing module 502 is specifically used to: send probe messages to the corresponding resources and receive replies according to the preset period of different resources, and determine the resource status of at least one resource; and / or monitor the test resource database in real time to determine the resource status of at least one resource.

[0125] As a preferred implementation, in this embodiment of the application, the fourth processing module 504 is specifically used to: identify potential resource configuration conflicts in the initial test topology configuration through a machine learning algorithm; modify the initial test topology configuration according to the potential resource configuration conflicts through a preset correction rule to generate at least one candidate test topology; and evaluate the at least one candidate test topology through a reward function to determine the test topology.

[0126] As a preferred implementation, in this embodiment of the application, the sixth processing module 506 is specifically used to: construct source tracing data based on the test results and the corresponding test topology; input the source tracing data into the feedback learning model to obtain the adjustment results; and optimize the initial test topology configuration based on the adjustment results.

[0127] In a preferred embodiment of this application, the device further includes a prediction module, which is specifically used to: parse the multimodal topology data to determine the test target; and determine subsequent test operations based on the test results and the test target, wherein the test operations include obtaining test cases or generating test topologies.

[0128] In a preferred embodiment of this application, the prediction module is further configured to: in response to a successful test result, determine subsequent test operations based on the test objective; in response to a failed test result, analyze the root cause of the failure, determine a phased test objective based on the root cause of the failure, and determine subsequent test operations based on the phased test objective.

[0129] For a description of the features in the embodiment corresponding to the test topology automatic generation device, please refer to the relevant description of the embodiment corresponding to the test topology automatic generation method, which will not be repeated here.

[0130] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the test topology automatic generation method.

[0131] The electronic device can be the target device, and its internal structure diagram can be as follows: Figure 6 As shown, this electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores spare parts recommendation data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a method for automatically generating test topologies.

[0132] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described test topology automatic generation method embodiments at runtime.

[0133] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0134] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the automatic test topology generation method.

[0135] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above-described test topology automatic generation method embodiments.

[0136] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0137] The above provides a detailed description of the test topology automatic generation method, electronic device, storage medium, and computer program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A method for automatically generating test topologies, characterized in that, The method includes: Receive and parse multimodal topology data to generate structured topology files; Obtain the resource status of at least one resource in the test environment, retrieve the relationship data of the resources from the test resource database, and construct an environment resource map based on the resources and their corresponding relationship data to display all resources in the environment and their relationships. The structured topology file is semantically parsed to determine network architecture requirements. Based on the network architecture requirements, the environmental resource map is queried to filter and determine available physical resources and their corresponding states. Based on the network architecture requirements and the available physical resources, an initial test topology configuration is determined, and a test topology is generated based on the initial test topology configuration. The configuration resource entities, connection relationships, and configuration attributes corresponding to the test topology are converted into configuration commands for the resource entities and then issued. Receive the test results and optimize the initial test topology configuration based on the test results.

2. The test topology automatic generation method according to claim 1, characterized in that, The process of receiving and parsing multimodal topology data to generate a structured topology file includes: Identify the data type of the multimodal topology data, wherein the data type includes text topology data, image topology data, and script topology data; In response to the identification of text topology data, the text topology data is parsed using a natural language processing model to determine text configuration information; In response to the identification of image topology data, the image topology data is identified through an image recognition model to determine image configuration information; In response to the identification of script topology data, the corresponding lexical analysis and syntax analysis are determined according to the language type of the script topology data, an abstract syntax tree is constructed, the script topology data is parsed, and the script configuration information is determined; The structured topology file is generated based on the parsed configuration information.

3. The test topology automatic generation method according to claim 2, characterized in that, The method further includes: In response to the fact that the multimodal topology data includes multiple data types, the configuration information corresponding to each data type is parsed and obtained respectively; Verify and merge all configuration information, and detect conflicts in the merged configuration information; According to the preset conflict handling rules, conflicting configuration information is processed. The structured topology file is generated based on the processed configuration information.

4. The test topology automatic generation method according to claim 2, characterized in that, The data types for identifying the multimodal topology data include: The multimodal topology data is input into a data type recognizer, which outputs the corresponding overall confidence score. The data type recognizer includes a text recognizer, an image recognizer, and a script recognizer. In response to the overall confidence level being greater than a preset confidence level and the internal features of the data satisfying the condition of the same data type, the data type of the multimodal topology data is determined; In response to the overall confidence level being less than or equal to the preset confidence level, the multimodal topology data is fragmented using a boundary detection algorithm, and the multiple data fragments are input into a data type identifier to output the fragment confidence level. Based on the fragment confidence level, determine the data type of the fragment; Based on the data type, spatial relationship, and / or positional relationship of the multiple data fragments, the multiple data fragments are integrated; Based on the integration results, the data type of the multimodal topology data is determined.

5. The test topology automatic generation method according to claim 1, characterized in that, The step of obtaining the resource status of at least one resource in the test environment includes: Based on preset periods for different resources, probe messages are sent to the corresponding resources and responses are received to determine the resource status of at least one resource; and / or, The test resource database is monitored in real time to determine the resource status of at least one resource.

6. The test topology automatic generation method according to claim 1, characterized in that, The step of generating a test topology based on the initial test topology configuration includes: Potential resource configuration conflicts in the initial test topology configuration are identified using machine learning algorithms. Based on the potential resource configuration conflicts, the initial test topology configuration is modified according to preset correction rules to generate at least one candidate test topology; The at least one candidate test topology is evaluated using a reward function to determine the test topology.

7. The test topology automatic generation method according to claim 1, characterized in that, The step of optimizing the initial test topology configuration based on the test results includes: Based on the test results and the corresponding test topology, source tracing data is constructed; The source tracing data is input into the feedback learning model to obtain the adjustment result; The initial test topology configuration is optimized based on the adjustment results.

8. The test topology automatic generation method according to claim 1, characterized in that, The method further includes: The multimodal topology data is analyzed to determine the test target; Based on the test results and the test objectives, subsequent test operations are determined, including obtaining test cases or generating test topologies.

9. The test topology automatic generation method according to claim 8, characterized in that, The step of determining subsequent test operations based on the test results and the test objective includes: In response to the test result being successful, the subsequent test operations are determined according to the test objective; In response to a test result of failure, the root cause of the failure is analyzed, and the phased test objectives are determined based on the root cause of the failure. Based on the stated phased testing objectives, the subsequent testing operations are determined.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the test topology automatic generation method as described in any one of claims 1 to 9 when executing the computer program.