Method and system for testing task decisions

By deeply understanding the test environment topology and intelligent resource matching, an optimized decision-making model is built, which solves the problems of low resource utilization and insufficient intelligent decision-making in traditional automated testing platforms, and achieves efficient scheduling of test tasks and maximum utilization of resources.

CN122111616APending Publication Date: 2026-05-29FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
Filing Date
2026-03-06
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Traditional automated testing platforms suffer from low resource utilization and insufficient intelligence in test task decision-making when executing test tasks. They are unable to make globally optimal decisions in complex scenarios with multiple tasks and multiple strategies running concurrently, resulting in resource conflicts and low efficiency.

Method used

By deeply understanding the test environment topology, an intelligent resource matching mechanism and dynamic programming algorithm are used to build an optimization decision model. Test tasks are decomposed into multiple test lists. Based on the resource matching priority and test strategy weight of topology nodes, the optimal set of test lists is calculated to maximize resource utilization and achieve optimal strategy scheduling.

Benefits of technology

It improved resource utilization, shortened the execution cycle of test tasks, and enabled efficient test task scheduling and decision-making in dynamically changing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111616A_ABST
    Figure CN122111616A_ABST
Patent Text Reader

Abstract

The application discloses a kind of methods and systems for testing task decision-making, belong to test field, method includes: according to the test logic topology described in environment configuration file, the test task is decomposed into multiple test lists;For each test list to be issued, the corresponding environment configuration file is parsed to obtain a set of resource requirements, and the maximum resource matching number supporting all resource requirements of the test list is calculated;An optimization decision model is constructed, which constrains the sum of the test strategy weights of the test list to be less than the preset upper limit, maximizes the sum of the product of the maximum matching resource number and the test strategy weight of the test list as the target, and solves the optimal test list set currently to be executed;According to the resource configuration information of each test list in the optimal test list set, the test case is executed, and the final test result is obtained.The method can maximize the use of test resources, and automatically make optimal task decision according to multi-strategy target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of testing, and in particular relates to a method and system for test task decision-making. Background Technology

[0002] Automated testing, as a crucial link in ensuring the quality and reliability of modern communication, network, and software products, directly impacts product development cycles and testing costs through its execution efficiency and resource utilization. With the continuous expansion of testing scale and the increasing complexity of testing scenarios, traditional automated testing platforms face the following two core technical challenges when executing testing tasks: First, test resource utilization is low. Existing automated testing platforms often use simple First-Come, First-Served (FCFS) or static priority queues for scheduling when executing test cases, lacking a global awareness of the topology and relationships of underlying test resources (such as instruments, devices under test ports, and boards). This often leads to some test cases being blocked for extended periods while waiting for specific exclusive resources, resulting in resource conflicts. Furthermore, other available and compliant resources may remain idle and not be effectively considered in the scheduling process. This uneven resource allocation prevents the maximization of resource pool utilization and severely restricts the improvement of test throughput.

[0003] Second, the intelligent decision-making of test tasks is insufficient. When faced with complex test scenarios with multiple tasks and multiple strategies running concurrently, test engineers often need to rely on experience to manually specify the execution order or perform simple strategy configuration. This approach is not only inefficient, but also makes it difficult to make globally optimal decisions in a dynamically changing resource environment.

[0004] To address these challenges, the industry has explored various approaches, such as introducing resource pool management and adopting basic scheduling algorithms. However, these solutions either focus solely on monitoring and statically allocating resource status, failing to deeply integrate with the test topology for intelligent matching; or they use only a single scheduling strategy, which cannot handle complex decision-making scenarios with multiple objectives and constraints. Therefore, there is an urgent need for a method that can deeply understand the test environment topology, intelligently match and maximize resource utilization, driving automated testing towards a higher level of intelligence and efficiency. Summary of the Invention

[0005] To address the aforementioned issues, this application provides a method and system for test task decision-making, which can deeply understand the test environment topology, intelligently match and maximize resource utilization, and automatically make optimal task decisions based on multiple strategy objectives.

[0006] The technical solution is as follows: A method for making test task decisions includes: Obtain a test task, which includes a test strategy configuration file and at least one environment configuration file. Based on the test logic topology described in the environment configuration file, decompose the test task into multiple test lists. For each test list to be issued, the resource requirement set is obtained by parsing the corresponding environment configuration file, and available resources are allocated to each resource requirement in the resource requirement set based on the resource matching priority of each topology node, and the maximum number of resource matches that can support all resource requirements of the test list is calculated. Test strategies are extracted from the test strategy configuration file, and an optimization decision model is constructed. The optimization decision model is constrained by the total weight of the test strategies of each candidate test list not exceeding a preset upper limit, and aims to maximize the sum of the products of the maximum number of resource matching items and the corresponding test strategy weights of each candidate test list. The optimal set of test lists to be executed is solved based on the dynamic programming algorithm. Based on the resource configuration information of each test list in the optimal test list set, execute the test cases and obtain the final test results.

[0007] A system for making test task decisions, comprising: The task decomposition module is configured to acquire test tasks, which include test strategy configuration files and at least one environment configuration file, and decompose the test tasks into multiple test lists according to the test logic topology described in the environment configuration file. The resource matching module is configured to obtain a set of resource requirements by parsing the corresponding environment configuration file for each test list to be issued, and allocate available resources for each resource requirement in the set of resource requirements based on the resource matching priority of each topology node, and calculate the maximum number of resource matches that support all resource requirements of the test list. The decision module is configured to extract test strategies from the test strategy configuration file and construct an optimization decision model. The optimization decision model is constrained by the total weight of the test strategies of each candidate test list not exceeding a preset upper limit, and aims to maximize the sum of the products of the maximum number of resource matching items of each candidate test list and the corresponding test strategy weight. It solves the optimal set of test lists to be executed based on a dynamic programming algorithm. The test execution module is configured to execute test cases and obtain the final test results based on the resource configuration information of each test list in the optimal test list set.

[0008] Compared with the prior art, this application has the following advantages: (1) Introduce an intelligent resource matching mechanism that combines test logic topology, deeply analyze environment configuration, accurately identify resource requirements and dependencies, and ensure that critical path resources are given priority by setting differentiated matching priorities based on core nodes of the topology; (2) A three-layer discrimination mode is adopted to select the qualified set of resources from the available resource pool, and the maximum number of instances that can be executed in parallel for each test list is calculated as the maximum number of resource matching. This solves the problem of resource idleness and fragmentation, enabling limited hardware resources to carry more concurrent test tasks, improve resource utilization, and shorten the overall execution cycle of test tasks.

[0009] (3) By assigning weights to different test strategies and constructing an optimization model with the goal of maximizing the total weighted efficiency and the constraint of the total strategy weights, the multi-strategy task scheduling problem is transformed into a quantifiable combinatorial optimization problem. Then, the dynamic programming algorithm is used to solve it accurately. Based on the real-time changing resource matching results and the preset strategy priority, the optimal set of test lists currently being executed can be obtained, thus realizing the self-scheduling of test tasks.

[0010] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description

[0011] 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 The flowchart of the test task decision-making method is shown; Figure 2 A schematic diagram of the test task analysis is shown; Figure 3 A schematic diagram of environment configuration file parsing is shown; Figure 4 A schematic diagram of a three-layer discrimination model for filtering the qualified resource set is shown; Figure 5 This diagram illustrates the calculation of the number of resource matching sets for the test list. Figure 6 A schematic diagram of the list information set and the strategy information set is shown; Figure 7 A schematic diagram of a three-layer discrimination pattern for selecting a candidate test list set is shown. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] like Figure 1 As shown in the embodiment of this application, a method for test task decision-making is provided, the method comprising: S1. Obtain test tasks, the test tasks include test strategy configuration files and at least one environment configuration file, and decompose the test tasks into multiple test lists according to the test logic topology described in the environment configuration file. S2. For each test list to be issued, obtain the resource requirement set by parsing the corresponding environment configuration file, and allocate available resources for each resource requirement in the resource requirement set based on the resource matching priority of each topology node, and calculate the maximum number of resource matches that support all resource requirements of the test list. S3. Extract test strategies from the test strategy configuration file and construct an optimization decision model. The optimization decision model is constrained by the total weight of test strategies in each candidate test list not exceeding a preset upper limit, and aims to maximize the sum of the products of the maximum resource matching quantity and the corresponding test strategy weight of each candidate test list. It solves the optimal set of test lists to be executed based on dynamic programming algorithm. S4. Execute test cases based on the resource configuration information of each test list in the optimal test list set, and obtain the final test results.

[0015] The specific implementation process and terminology of this method are as follows: (a) Test Task 1. Definition of Test Task: A test task contains all the materials required to execute the test and is used to define the composition relationship between the test strategy configuration file and the test list in the subsequent decision-making process.

[0016] 2. Components of the test task: like Figure 2 As shown, one test task = multiple test projects + one test strategy configuration file. Each test project consists of an environment configuration file, a parameter configuration file, and a script set (a collection of test case code). 3. Explanation of the key components of the test task (1) Test strategy configuration file: used to describe the test focus of the test task, including but not limited to various test strategies such as maximum resources, resource limits, time limits, etc., such as prioritizing the use of the most resources, prioritizing the fastest completion, prioritizing balanced use of resources, and restricting a certain type of resources.

[0017] (2) Environment configuration file: The logical topology of the test project is described using structured data (such as JSON).

[0018] The core contents of the environment configuration file include: ① Device Information: Describes the attributes of the device under test (DUT), including device type (DUT_type), management IP (DUT_IP), software version (DUT_version, used to associate the LIB library version of the test script), main control cross card (DUT_main_cross_card, the core component of the device), main control card (DUT_main_card), and cross card (DUT_cross_card). ② Interface information: Describes the physical or logical port information of the device / instrument, including the card type (card_type), card slot (card_slot), port number (interface_num), interface type (interface_type, such as ETH / Flexe), speed (interface_speed), and transmission medium (interface_media). ③ Connection relationships: Describe the physical connection topology between devices, boards, and ports in the form of parent-child nesting or related lists, as well as the physical connection topology between instruments and ports.

[0019] (3) Test case set: Based on the topology defined in the environment configuration file, the test scripts are associated and classified with the corresponding running parameters to form a test case set that can be executed uniformly.

[0020] Parameter configuration file: Defines runtime variables (such as transmission rate and test duration) for the test script.

[0021] Script set: The actual test code is categorized according to the same topology environment for easy and unified execution.

[0022] By breaking down test tasks into multiple test projects and a global test strategy configuration file, environment isolation (different test projects use test resources that do not interfere with each other) and cyclic execution (the same set of test projects can be run repeatedly by modifying parameters) are achieved.

[0023] (II) Test Task Decomposition and Test List Management (1) Obtain the test task and decompose the test task into multiple test lists according to the test logic topology described in the environment configuration file.

[0024] Specifically, it includes: The test tasks are split according to the topology of the environment configuration file, and test projects with the same topology are decomposed into the same list, resulting in multiple test lists.

[0025] A test task is broken down into N test lists, each of which is the smallest unit of execution that can be executed independently (e.g., list 1 only tests 10 test cases of topology A), thus avoiding a large test task from consuming all resources and supporting the parallel execution of multiple test lists.

[0026] (2) In order to alleviate the pressure of high-concurrency decision-making and effectively handle the situation of resource matching failure, test queues and cache queues are set up, and the test list is managed according to the preset queue interaction rules.

[0027] The test queue manages the test list of resources to be matched and records the failure information of the test list. The cache queue is used to cache the test list of resources that failed to match.

[0028] Set up a test task container to record the test tasks to which the test list belongs, as well as the test strategies for those tasks.

[0029] (3) The interaction rules between the test queue and the cache queue are as follows: The multiple test lists obtained from the initial decomposition of the test task are placed into the test queue, and a decision failure count is maintained for each test list in the test queue; When a test list issued by the test queue fails in resource matching or decision-making, its decision failure count is increased. If the decision failure count of the test list exceeds a preset threshold, it is moved from the test queue to the cache queue. The failure count of a test list in the cache queue is periodically decremented. When the failure count of a test list in the cache queue reaches zero, it is moved back to the test queue.

[0030] The specific rules are as follows: Rule 1: If the number of decision failures in the test list in the test queue is greater than 1, move it to the cache queue to avoid continuously occupying decision resources; Rule 2: The cache queue will automatically trigger a poll every 30 minutes, decrementing the number of decision failures for each test list by 1. For example, if the number of decision failures changes from 2 to 1 in one poll, it will become 0 in the next poll. Rule 3: If the number of decision failures in the test list in the cache queue is 0, then re-enter the test queue and try matching resources again; Rule 4: If a test list in the test queue fails to occupy a topology or fail to match a resource, increment the failure count of that test list by 1.

[0031] The queue interaction rules solve the conflict problem when resources are scarce. For example, if a certain list cannot grab a resource temporarily, it can be cached to avoid continuous retries that could cause system lag.

[0032] (III) Resource Matching For each test list to be issued, the resource requirement set is obtained by parsing the corresponding environment configuration file. Based on the resource matching priority of each topology node, available resources are allocated to each resource requirement in the resource requirement set, and the maximum number of resource matches that can support all resource requirements of the test list is calculated.

[0033] Resource matching is one of the core components of this solution. Its purpose is to find all available resources and calculate how many sets of resources can be used for each test list, thereby maximizing resource utilization through matching.

[0034] The specific process is as follows: 1. For each test list to be issued in the test queue, obtain the resource requirement set by parsing its environment configuration file.

[0035] The steps to parse the environment configuration file are as follows: ① Entity recognition and hierarchical decomposition The system identifies two types of entities: instruments and equipment. For each entity, based on its description, it creates an independent sub-resource object in memory and flattens and decomposes it from the original nested structure, such as... Figure 3 As shown, parsing the environment configuration file yields five sub-resource categories: Instruments: Main body of instrument equipment Instrument interface: The physical or logical port on the instrument. Equipment: The main body of the device under test Boards: Service boards or control boards inserted into the equipment. Board interface: The physical or logical port on the board. ② Resource classification and containerized storage: Sub-resource objects of the same type obtained from decomposition are stored in independent container lists for management, thereby forming five parallel resource pools, namely instrument container, instrument interface container, device container, board container, and board interface container.

[0036] Objects within each container share the same attribute structure, facilitating rapid filtering and matching based on unified rules.

[0037] ③ Topology analysis and topology core node marking During the parsing of the environment configuration file, the topology core nodes are determined based on the test logic topology of the environment configuration file. The topology core node is a topology node with a number of connected nodes greater than a preset number. That is, by analyzing the connectivity degree of each node in the topology network, preferably, nodes with more than 2 connected nodes (which can be devices, instruments, boards, or interfaces) are marked as topology core nodes, such as core switches or key transmission equipment that connect multiple links.

[0038] The topology core node is stored independently in the topology core node container, which is used to prioritize the allocation of critical path resources in the subsequent resource matching phase.

[0039] Based on the above steps, the environment configuration file is parsed into a set of resource requirements, and Table 1 is a table of resource requirement categories.

[0040] Table 1

[0041] 2. A three-layer discrimination model is used to select a qualified set of resources from the available resource pool.

[0042] like Figure 4 As shown, the process of selecting a qualified set of resources from the available resource pool using a three-layer discrimination model is as follows: First layer (expanded layer): Expand the discrimination sub-item for each resource category in the resource demand set.

[0043] The discriminant sub-item refers to all the attribute conditions that need to be checked when matching each resource category.

[0044] Example: For instrument resources, the identification sub-items usually include instrument type, instrument version, instrument address, instrument interface, etc.

[0045] The second layer (discriminator layer) judges each discrimination sub-item in turn according to preset conditions. If the judgment is successful, the corresponding resource object is used as the judgment result.

[0046] For each discriminant sub-item expanded in the first layer, it is matched and compared with each candidate resource of the corresponding category in the resource pool.

[0047] The judgment conditions are as follows: if the attribute value of the candidate resource is consistent with the requirements of the discrimination sub-item, the judgment of the discrimination sub-item is successful; if the attribute value of the candidate resource is inconsistent with the requirements of the discrimination sub-item, the judgment fails.

[0048] For example, if the discrimination condition is "instrument type = OTN", and the type of "instrument A" in the resource pool is OTN, then the judgment for "instrument A" is successful; if the type of "instrument B" is PTN, then the judgment for "instrument B" is unsuccessful.

[0049] Resource object storage rules: Judgments are made only for specific resource objects (such as a particular meter or interface). For a given sub-item, all resource objects that meet that condition are temporarily stored. For example, in the judgment of "meter type = OTN", if both meter A and meter B in the resource pool meet the condition, they are both stored as candidate objects that pass this judgment. A resource object must pass the judgments of all sub-items at the current level to enter the next level or the final qualified set. If any sub-item judgment fails, the resource object is removed from the current matching path.

[0050] The third layer (merger layer): merges the decision results of all discrimination sub-items to obtain the resource qualification set, including the instrument qualification set, instrument interface qualification set, equipment qualification set, board qualification set, and board interface qualification set.

[0051] The third layer is used to merge the decision results of all the decision items in the second layer. That is, it checks whether a resource object has been successfully saved on all the necessary decision items. Only when it meets all the conditions will the resource object be output to the final qualified resource set.

[0052] After three layers of discrimination, five independent qualified sets are formed: instrument qualified set, instrument interface qualified set, equipment qualified set, board qualified set, and board interface qualified set.

[0053] For example, if there are 5 meters in the original resource pool, after the two-level sub-item judgment of "type=OTN" and "version ≥V2.0", only 3 meters may meet both conditions at the same time. Then the "meter qualified set" will include these 3 meters.

[0054] 3. Based on the resource matching priority of each topology node, allocate available resources to each resource requirement in the resource requirement set to obtain a matching resource set.

[0055] First, determine the resource matching priority for each topology node, including: When the topology node is a core topology node, it is assigned the first resource matching priority; When the topology node is a general node in the test logic topology other than the core topology node, it is assigned a second resource matching priority. The first matching priority is higher than the second matching priority.

[0056] Furthermore, based on the resource matching priority of each topology node, available resources are allocated to each resource requirement in the resource requirement set, that is, the resources in the qualified resource set are allocated according to the requirements of the test list to ensure the highest resource utilization rate.

[0057] The operation is as follows: ① Define the resource demand set R and the matching resource set U. The resource requirement set R = {R1, R2, ..., Rn} is the set of resources necessary to execute the test list, which is parsed from the environment configuration file corresponding to the test list. Any element Ri in the resource requirement set R represents a resource requirement.

[0058] Example: Based on the dut1 in the environment configuration file example, a device resource requirement (1 meter + 2 meter interfaces + 1 device) is parsed and denoted as R1.

[0059] The matching resource set U = {U1, U2, ..., Um} is the set of available resources obtained by the three-layer discrimination and filtering process (i.e., the summary of the five qualified sets). Any element Uj in the matching resource set U represents an available resource entity in the qualified resource set.

[0060] Example: A specific instrument or device port that meets the conditions after three-level decision-making is denoted as U1.

[0061] ② Construct the matching cost matrix C By determining which resource demand corresponds to which available resource at the lowest cost, priority is given to ensuring the resources of the core nodes in the topology, thus avoiding the idleness of critical resources.

[0062] Among them, when the topology core node matches resources, the matching cost C m,n =a, when a general node matches resources, the matching cost C m,n =b, when node resources do not match, the matching cost C m,n =c, where a c.

[0063] For example, when the core node of the topology matches resources, the matching cost C m,n =1 (highest priority); when a node matches resources, the matching cost C is... m,n =2; when node resources do not match, the matching cost C m,n =100 (can be directly excluded). If R1 (the instrument required in List 1) is a topology core node requirement, and U2 (available instrument 2) is a topology core node resource, then in the matching cost matrix C, matrix element C 1,2 =1, if U3 (available meter 3) is a general node resource, C 1,3 =2.

[0064] ③ For each resource requirement Ri, find the available resource Uj with the minimum resource matching cost from the matching cost matrix C.

[0065] ​If Uj has not been assigned to other resource requirements, then Ri is bound to Uj and added to the matching result set M; if Uj has already been assigned to other resource requirements, and if the matching cost of Ri and Uj is smaller than the matching cost of the currently assigned resource requirement and Uj, then the currently assigned resource requirement is replaced with Ri.

[0066] Repeat the matching process described above until all resource requirements in the resource requirement set R have been matched.

[0067] 4. After obtaining the matching result set M of each type of resource requirement in the test list, calculate the maximum number of resource matches that support all resource requirements of the test list (hereinafter referred to as the number of resource matching sets).

[0068] Each test list requires a complete set of resources to be executed. The number of instances that can be parallelized is determined by the scarcest type of resource (bottleneck resource). The number of matching sets of a certain type of resource in the test list = the total number of qualified sets of that type of resource / the number of single sets required by the test list for that type of resource. If the ratio is not an integer, it is rounded down and the resource matching result is output.

[0069] For example: The single-set resource requirements for Test List 1 are: 1 instrument + 2 instrument interfaces + 1 device + 2 boards + 2 board interfaces; Total qualified centralized resources: 3 instruments, 6 instrument interfaces, 2 pieces of equipment, 5 circuit boards, and 7 circuit board interfaces; Calculate the maximum number of sets that each type of resource can support: meter:

[0070] Instrument interface:

[0071] equipment:

[0072] Circuit board:

[0073] Board interface:

[0074] Bottleneck resources: equipment and boards, supporting a maximum of 2 sets. The final output resource matching result: The number of resource matching sets for Test List 1 is 2 sets, which means that Test List 1 can start a maximum of 2 test instances at the same time.

[0075] (iv) Testing Decision Test strategies are extracted from the test strategy configuration file, and an optimization decision model is constructed. The optimization decision model is constrained by the total weight of the test strategies in the test list not exceeding a preset upper limit, and aims to maximize the sum of the products of the maximum number of matching resources in the test list and the weight of the test strategies. The optimal set of test lists to be executed is solved based on the dynamic programming algorithm.

[0076] The specific steps are as follows: (1) Construct information sets, including list information sets and strategy information sets.

[0077] like Figure 5 and Figure 6 As shown, the list information is used to collect detailed information for each test list, including the test list number, the number of resource matching sets for the test list, the cumulative execution time of the script, and the test strategy to which it belongs.

[0078] The cumulative execution time of the scripts is obtained by querying the interface provided by the test execution platform to get the historical cumulative execution time of all scripts in the test list.

[0079] The strategy information set is used to gather all test strategies that need to be considered in a coordinated manner and to remove duplicates.

[0080] (2) Based on the test strategy configuration file, extract the test strategies of all test lists in the test list queue, perform deduplication on the extracted test strategies to obtain a list of test strategies without duplicates, and assign priority (weight) to each test strategy to generate a strategy weight table (Table 2).

[0081] Table 2

[0082] (3) Select a set of candidate test lists that meet the guidance of each test strategy. That is, filter the list information set according to each test strategy in the strategy information set to generate a set of candidate test lists that meet the guidance of the strategy.

[0083] For N test strategies in the strategy information set, execute N rounds of decisions, such as... Figure 7 As shown, each round of decision-making employs a three-layer discrimination model to filter the candidate test list set that conforms to the testing strategy. The specific process is as follows: First layer (expanded layer): Expands all the inventory information sets for any test strategy; The second layer (decision layer): makes a decision on each test list based on the judgment logic corresponding to the current round strategy; Preferably, the decision logic of the maximum resource strategy is to filter the list with a relatively high number of resource matching sets, and the decision logic of the shortest time strategy is to filter the list with a short cumulative script execution time. List objects that are successfully judged are retained. For example, the decision condition of the maximum resource strategy is that the number of resource matching sets is ≥2 sets. Test lists that meet the condition are retained, and those that do not meet the condition are removed.

[0084] The third layer (merging layer): summarizes all the test lists that were successful in this round, forming a single-round qualified set under this test strategy. For example, the qualified set of the resource maximization strategy is test list 1 and list 3.

[0085] After N rounds of judgment, N single-round qualified sets are obtained. Each single-round qualified set represents a list of candidate tests that conform to a specific strategy orientation.

[0086] (4) Construct an optimization decision model to obtain the optimal test list set.

[0087] Based on N single-round qualified sets, combined with preset strategy weights and the number of matching sets of list resources, a dynamic programming algorithm is used to select the optimal list combination that balances strategy priority and resource utilization, providing a clear scheduling basis for test execution.

[0088] The specific process is as follows: ① Problem Modeling and Variable Definition Suppose there are n candidate test lists in N single-round qualified sets, denoted as {H1, H2, ... H...} n}, any candidate test list H i There are two key parameters: number of resource matching sets (maximum number of resource matching sets) N i And test strategy weight P i Number of resource matching sets N i Used for characterization test list H i Resource utilization efficiency; a higher value indicates more test instances can be executed in parallel. The strategy weight P... i Derived from the policy weight table, used to characterize the test list H i The priority of the testing strategy followed.

[0089] Model it as a 0-1 knapsack problem: For each candidate test list H... i Treat it as an "item", and the "item weight" is the strategy weight P. i "Value of goods" is the weighted comprehensive utility value Vi=N i ×P i Let the "knapsack capacity" be the maximum sum of strategy weights J that the system can handle. The optimization objective is to select some items from n items to put into the knapsack, such that the knapsack capacity constraint is satisfied, i.e., the sum of strategy weights ∑P. iUnder the condition that J ≤ J, the total value of the items in the knapsack ∑Vi is maximized.

[0090] ② Solving using dynamic programming algorithm Define the dynamic programming state dp[i][j]: representing the state from the first i candidate test cases (H1~H2). i The objective function finds the maximum value when the sum of the policy weights of the subset S is no more than j.

[0091] objective function F ( S ) is the sum of the products of the number of resource matching sets and the strategy weights of all candidate test lists in subset S;

[0092] Where j≥P i dp[0][j]=0 State initialization: dp[0][j]=0, indicating that when no candidate test cases are involved in the decision (i=0), regardless of the value of the sum of policy weights j, the objective function is... The values ​​are all 0.

[0093] For each candidate test case and each possible policy weight sum j, calculate the value of dp[i][j] according to the state transition equation, which is as follows:

[0094] If j≥P i If the i-th candidate test list is not selected, the value of dp[i][j] is the maximum value obtained by the objective function of the first i-1 candidate test lists under the sum of policy weights j, that is, dp[i][j]=dp[i-1][j].

[0095] If j≥P i If the total weights are sufficient to cover the policy weights of the current list, then the i-th candidate test list is selected. At this time, the value of dp[i][j] is the sum of the policy weights of the first i-1 candidate test lists (jP). i The maximum value obtained by the objective function is the product of the number of resource matching sets of the i-th candidate test list and the strategy weight, i.e., dp[i][j] = dp[i-1][jP i ]+N i ×P i .

[0096] Take the larger value of dp[i][j] in the two cases mentioned above as the final value of dp[i][j], that is, dp[i][j] = max(dp[i-1][j], dp[i-1][j-Pi] + N). i ×Pi ).

[0097] Create a two-dimensional state table dp, and iterate through all the values ​​of i and j according to the above rules to fill the entire two-dimensional state table dp, so as to obtain the optimal result under the constraints of all possible list combinations and the sum of policy weights.

[0098] ③ Backtracking to determine the optimal list combination: By backtracking the final state dp[n][j max The decision path is determined to identify the optimal test list set, where n is the total number of candidate test lists and j is the number of candidate test lists. max Let j be the maximum value.

[0099] Based on the two-dimensional state table DP, the specific optimal list combination is derived in reverse through backtracking. The steps are as follows: Locating the optimal state: Iterate through all values ​​of dp[n][j], find the maximum value, and denote the j value corresponding to the maximum value as j. max The corresponding state is dp[n][j max That is, in the n lists, the sum of the strategy weights does not exceed j. max The optimal result at that time; Backtracking list selection: Starting from the nth list, backtrack sequentially to the 1st list, and determine whether each list is included in the optimal combination: If i≥1 and dp[i][j] max ]≠dp[i-1][j max This indicates that the i-th item in the list is included in the optimal combination. Add it to the optimal list set and update j. max = j max -P i ; If dp[i][j max ]=dp[i-1][j max This indicates that the i-th item in the list was not included in the optimal combination, and the j-th item is kept constant. max No change, continue back to the previous list; Output the optimal result: After backtracking all lists, the optimal list set is the final optimal list decision result.

[0100] The optimal list set is integrated with the corresponding resource matching details (such as the supporting resource configuration and topology connection information of each list) to form a complete test decision result, which is then transmitted to the test execution module.

[0101] Through the above-mentioned judgment process, while ensuring the priority execution of high-priority strategies, testing resources can be maximized, and the scientific scheduling and efficient execution of testing tasks can be achieved.

[0102] Example 1 There are 3 test lists with the following basic parameters: List 1: Number of resource matching sets N1=1, optimal resource strategy weight P1=1, value V1=N1×P1=1 List 2: Number of resource matching sets N2=0, optimal resource strategy weight P2=1, value V2=N2×P2=0 List 3: Number of resource matching sets N3=1, optimal resource strategy weight P3=1, value V3=N3×P3=1 Under the resource-optimal strategy, the state function dp[i][j] represents the state when the sum of the first i lists and the total strategy weights is ≤ j, N i ×P i Find the maximum value and fill in Table 3.

[0103] Table 3

[0104] Table 3 is explained as follows: 1) i=0 means no list is selected, regardless of the value of j, dp[0][j]=0; j=0 means the total sum of policy weights is 0, and no list can be selected, dp[i][0]=0.

[0105] 2) When i=1 (considering only list 1), j≥1 (j=1~20) means that list 1 can be selected, dp[1][j]=max(dp[0][j], dp[0][j-1]+1)=1. Corresponding to the "i=1" row in the table, when j=0, dp[i][j]=0, and when j≥1, dp[i][j]=1.

[0106] 3) When i=2 (considering List 1 + List 2), since the value of List 2 V2=0, regardless of the value of j (j>0), dp[2][j]=max(dp[1][j], dp[1][j-1]+0)=dp[1][j]. Corresponding to the "i=2" row in the table, when j≥1, dp[i][j]=1.

[0107] 4) When i=3 (considering List 1 + List 2 + List 3), j=1 indicates that the total strategy weights cannot simultaneously cover the weight requirements of List 1 + List 3 (j=1 is only enough to choose one of List 1 or List 3), dp[3][1]=dp[2][1]=1; j≥2 (j=2~20) indicates that the total strategy weights can simultaneously cover the weight requirements of List 1 + List 3 (List 1 + List 3 can be selected simultaneously), dp[3][j]=max(dp[2][j], dp[2][j-1]+1)=2. Corresponding to the "i=3" row in the table, when j=1, dp[i][j]=1, and when j≥2, dp[i][j]=2.

[0108] Determine the optimal inventory set by backtracking under the scenario of optimal resource utilization. As shown in Table 3, the maximum value in the optimal resource scenario is 2, corresponding to state dp[3][2]. The backtracking process is as follows: Step 1: Determine whether to select list 3: Since dp[3][2]=2 and dp[2][2]=1, they are not equal, indicating that list 3 has been selected. Add list 3 to the optimal list set and update the total policy weight j=2-P3=1.

[0109] Step 2: Determine whether to select list 2: Since dp[2][1]=dp[1][1]=1, it means that list 2 is not selected. The total strategy weight remains unchanged, and j=1.

[0110] Step 3: Determine whether to select list 1: Since dp[1][1]=1 and dp[0][1]=0, they are not equal, indicating that list 1 has been selected. Add list 1 to the optimal list set and update j=1-P1=0.

[0111] The final optimal list combination is: List 1 + List 3, which is consistent with the goal of resource optimization (maximizing the number of resource matching sets).

[0112] Example 2 There are 3 test lists with the following basic parameters: List 1: Number of resource matching sets N1=1, priority optimal strategy weight P1=10, value V1=N1×P1=10 List 2: Number of resource matching sets N2=0, priority optimal strategy weight P2=10, value V2=N2×P2=0 List 3: Number of resource matching sets N3=1, priority optimal strategy weight P3=10, value V3=N3×P3=10 Under the priority-optimal policy, the state function dp[i][j] represents the state when the sum of the policy weights of the first i lists is less than or equal to j, and N is... i ×P i Find the maximum value and fill in Table 4.

[0113] Table 4

[0114] Table 4 is explained as follows: 1) dp[0][j]=0; dp[i][0]=0.

[0115] 2) When i=1 (considering only list 1), j≥10 indicates that list 1 can be selected. Corresponding to the "i=1" row in the table, dp[1][j]=10.

[0116] 3) When i=2 (considering List 1 + List 2), since the value of List 2 V2=0, regardless of the value of j (j=10, 20, 30), dp[2][j]=dp[1][j]. Corresponding to the row "i=2" in the table, when j takes the values ​​10, 20, or 30, dp[i][j]=10.

[0117] 4) When i=3 (considering list 1 + list 2 + list 3), j=10 indicates that the total strategy weights cannot simultaneously cover the weight requirements of list 1 + list 3 (j=10 is only enough to select one of list 1 or list 3), dp[3]

[10] =max(dp[2]

[10] ,dp[2]

[10] ). 10]+10)=max(10,0+10)=10; j=20 indicates that the total strategy weights can simultaneously cover the weight requirements of List 1+List 3 (P1+P3=20), therefore, dp[3]

[20] =max(dp[2]

[20] , dp[2][20-10]+10)=max(10, 10+10)=20). Corresponding to the "i=3" row in the table, when j=10, dp[i][j]=10, and when j=20, dp[i][j]=20.

[0118] Determine the optimal list set by backtracking in the scenario of highest priority. As shown in Table 4, the maximum value in the optimal priority scenario is 20, corresponding to state dp[3]

[20] . The backtracking process is as follows: Step 1: Determine whether to select list 3: Since dp[3]

[20] =20 and dp[2]

[20] =10, the two are not equal, indicating that list 3 has been selected. Add list 3 to the optimal list set and update the total policy weight j =20-P3=10.

[0119] Step 2: Determine whether to select list 2: Since dp[2]

[10] =dp[1]

[10] =10, it means that list 2 is not selected, and the total strategy weight remains unchanged.

[0120] Step 3: Determine whether to select list 1: Since dp[1]

[10] =10 and dp[0]

[10] =0, the two are not equal, indicating that list 1 has been selected. Add list 1 to the optimal list set and update the total policy weight j=10-P1=0.

[0121] The final optimal list set is: List 1 + List 3, which is consistent with the goal of optimal priority (prioritizing high-weight strategies).

[0122] (v) Test execution: Based on the resource configuration information of each test list in the optimal test list set, execute the test cases and obtain the final test results.

[0123] The operation steps are as follows: 1. Distribute the optimal test list set and corresponding resource configuration information to each test executor; 2. Each test executor starts the script set in the test manifest and executes the tests according to the parameter configuration file; 3. Test the other lists in the test queue according to the process of resource matching, test decision, and test execution until the data in the test list queue is 0 and all lists have been executed.

[0124] Based on the above embodiments, the beneficial effects of the present application are as follows: (1) Introduce an intelligent resource matching mechanism that combines test logic topology, deeply analyze environment configuration, accurately identify resource requirements and dependencies, and ensure that critical path resources are given priority by setting differentiated matching priorities based on core nodes of the topology; (2) The three-layer discrimination mode and resource matching set calculation can filter out all available resource combinations that meet the conditions from the resource pool and calculate the maximum number of instances that can be executed in parallel for each test list. This solves the problem of resource idleness and fragmentation, enabling limited hardware resources (instruments, equipment, ports, etc.) to carry more concurrent test tasks, improve resource utilization, and shorten the overall execution cycle of test tasks.

[0125] (3) By assigning weights to different test strategies and constructing an optimization model with the goal of maximizing the total weighted efficiency and the constraint of the total strategy weights, the multi-strategy task scheduling problem is transformed into a quantifiable combinatorial optimization problem. Then, the dynamic programming algorithm is used to solve it accurately. Based on the real-time changes in resource matching results and the preset strategy priorities, the optimal test list execution set can be dynamically and globally determined. This replaces the traditional scheduling method that relies on human experience, making the execution of test tasks highly adaptive, policy-compliant and overall optimal, and realizing test task self-scheduling.

[0126] (4) Design a dual-queue management mechanism including a test queue and a cache queue. The test queue maintains a decision failure count for each test list. When a test list fails to match due to temporary resource occupation, the test process will not get stuck in deadlock or infinite retry. Instead, it will be cached and retried after a delay. This mechanism effectively alleviates the pressure of instantaneous high concurrency and ensures that the test process can be carried out continuously and stably in a complex and dynamic test environment. It avoids the risk of interrupting the entire test plan due to the failure of individual tasks, enhances the robustness and fault tolerance of the test system, and ensures the continuity and stability of the test process.

[0127] (5) By parsing the environment configuration file and test strategy configuration to drive the entire decision-making process, this solution is highly decoupled from the specific test equipment type, topology, and business strategy. Whether it is testing different products such as OTN, PTN, switches, or data communication, you only need to write the configuration file according to the specifications to apply this solution for intelligent scheduling. At the same time, new test strategies or resource types can be easily added through extended configuration without modifying the core decision algorithm, demonstrating good versatility, configurability, and scalability.

[0128] This application also provides a system for test task decision-making, the system including: a task decomposition module, a resource matching module, a decision-making module and a test execution module.

[0129] The task decomposition module is configured to acquire test tasks, which include test strategy configuration files and at least one environment configuration file, and decompose the test tasks into multiple test lists according to the test logic topology described in the environment configuration file.

[0130] The resource matching module is configured to obtain a set of resource requirements by parsing the corresponding environment configuration file for each test list to be issued, and allocate available resources for each resource requirement in the set of resource requirements based on the resource matching priority of each topology node, and calculate the maximum number of resource matches that support all resource requirements of the test list.

[0131] The decision module is configured to extract test strategies from the test strategy configuration file and construct an optimization decision model. The optimization decision model is constrained by the total weight of the test strategies of each candidate test list not exceeding a preset upper limit, and aims to maximize the sum of the products of the maximum number of resource matching items for each candidate test list and the corresponding test strategy weight. It solves for the optimal set of test lists to be executed based on a dynamic programming algorithm.

[0132] The test execution module is configured to execute test cases and obtain the final test results based on the resource configuration information of each test list in the optimal test list set.

[0133] Preferably, the system further includes a queue management module, which uses a test queue and a cache queue to manage the distribution of the test list according to preset queue interaction rules.

[0134] The preset queue interaction rules include: The multiple test lists obtained from the initial decomposition of the test task are placed into the test queue, and a decision failure count is maintained for each test list in the test queue; When a test list issued by the test queue fails in resource matching or decision-making, its decision failure count is increased. If the decision failure count of the test list exceeds a preset threshold, it is moved from the test queue to the cache queue. The failure count of a test list in the cache queue is periodically decremented. When the failure count of a test list in the cache queue reaches zero, it is moved back to the test queue.

[0135] Preferably, the decision-making module uses the optimized decision-making model to obtain the optimal test list set, including: Select a list of candidate tests that meet the requirements of each testing strategy. Define the dynamic programming state dp[i][j], which represents the maximum value of the objective function when selecting a subset S from the first i candidate test lists such that the sum of the policy weights of the subset S does not exceed j. objective function F ( S ) is the sum of the products of the number of resource matching sets and the strategy weights of all candidate test lists in subset S;

[0136] Where, N i P represents the maximum number of resource matches for the i-th candidate test list. i Let J be the test strategy weight for the i-th candidate test list, and j ≥ P. i dp[0][j]=0; Calculate the value of dp[i][j] according to the state transition equation; The state transition equation is as follows:

[0137] By backtracking the final state dp[n][j max The decision path is determined to identify the optimal test list set, where n is the total number of candidate test lists and j is the number of candidate test lists. max Let j be the maximum value.

[0138] Regarding the system in the above embodiments, the specific manner in which each unit module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0139] Based on the same inventive concept, embodiments of this application also provide an electronic device, including: a memory and a processor, wherein the processor is used to read and execute a computer program stored in the memory to implement the aforementioned method for test task decision-making.

[0140] Based on the same inventive concept, embodiments of this application also provide a computer storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed, implement the aforementioned method for test task decision-making.

[0141] Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for making decisions on test tasks, characterized in that, The method includes: Obtain a test task, which includes a test strategy configuration file and at least one environment configuration file. Based on the test logic topology described in the environment configuration file, decompose the test task into multiple test lists. For each test list to be issued, the resource requirement set is obtained by parsing the corresponding environment configuration file, and available resources are allocated to each resource requirement in the resource requirement set based on the resource matching priority of each topology node, and the maximum number of resource matches that can support all resource requirements of the test list is calculated. Test strategies are extracted from the test strategy configuration file, and an optimization decision model is constructed. The optimization decision model is constrained by the total weight of the test strategies of each candidate test list not exceeding a preset upper limit, and aims to maximize the sum of the products of the maximum number of resource matching items and the corresponding test strategy weights of each candidate test list. The optimal set of test lists to be executed is solved based on the dynamic programming algorithm. Based on the resource configuration information of each test list in the optimal test list set, execute the test cases and obtain the final test results.

2. The method according to claim 1, characterized in that, The resource requirements set for each test list includes the following resource categories: instruments, instrument interfaces, equipment, boards, and board interfaces.

3. The method according to claim 2, characterized in that, After obtaining the resource requirement set, the process also includes: A three-layer discrimination model is used to filter out the qualified set of resources from the available resource pool; The method of using a three-layer discrimination model to filter out the qualified set of resources from the available resource pool includes: The first layer involves identifying sub-items for each resource category in the resource demand set. The second layer makes judgments on each sub-item according to preset conditions. If the judgment is successful, the corresponding resource object is used as the judgment result. The third layer merges the judgment results of all discrimination sub-items to obtain the resource qualification set, including the instrument qualification set, instrument interface qualification set, equipment qualification set, board qualification set, and board interface qualification set.

4. The method according to claim 1, characterized in that, During the parsing of the environment configuration file, the topology core node is determined according to the test logic topology of the environment configuration file, wherein the topology core node is a topology node whose number of connected nodes is greater than a preset number. Determine the resource matching priority for each topology node, including: When the topology node is a core topology node, it is assigned the first resource matching priority; When the topology node is a general node in the test logic topology other than the core topology node, it is assigned a second resource matching priority. The first matching priority is higher than the second matching priority.

5. The method according to claim 1, characterized in that, The allocation of available resources for each resource requirement in the resource requirement set based on the resource matching priority of each topology node includes: Define a resource demand set R = {R1, R2, ..., Rn} and a matching resource set U = {U1, U2, ..., Um}, where any element Ri in the resource demand set R represents a resource demand, and any element Uj in the matching resource set U represents an available resource entity in the resource qualification set. Construct a matching cost matrix C, where the matching cost C is the cost when a core node of the topology matches a resource. m,n =a, when a general node matches resources, the matching cost C m,n =b, when node resources do not match, the matching cost C m,n =c, where a c);​ For each resource requirement Ri, find the available resource entity Uj with the minimum matching cost from the matching cost matrix C and match it. If Uj is not assigned to other resource requirements, then Ri is bound to Uj and added to the matching result set M; If Uj has already been allocated to other resource requirements, and if the matching cost of Ri and Uj is less than the matching cost of the currently allocated resource requirement and Uj, then replace the currently allocated resource requirement with Ri. Repeat the matching process described above until all resource requirements in the resource requirement set R have been matched.

6. The method according to claim 1, characterized in that, The method further includes: setting up a test queue and a cache queue, and managing the test list according to preset queue interaction rules; The queue interaction rules include: The multiple test lists obtained from the initial decomposition of the test task are placed into the test queue, and a decision failure count is maintained for each test list in the test queue; When a test list issued by the test queue fails in resource matching or decision-making, its decision failure count is increased. If the decision failure count of the test list exceeds a preset threshold, it is moved from the test queue to the cache queue. The failure count of a test list in the cache queue is periodically decremented. When the failure count of a test list in the cache queue reaches zero, it is moved back to the test queue.

7. The method according to claim 1, characterized in that, The optimization decision model obtains the optimal test list set, including: Select a list of candidate tests that meet the requirements of each testing strategy. Define the dynamic programming state dp[i][j], which represents the maximum value of the objective function when selecting a subset S from the first i candidate test lists such that the sum of the policy weights of the subset S does not exceed j. objective function F ( S ) is the sum of the products of the number of resource matching sets and the strategy weights of all candidate test lists in subset S; Where, N i P represents the maximum number of resource matches for the i-th candidate test list. i Let J be the test strategy weight for the i-th candidate test list, and j ≥ P. i dp[0][j]=0; Calculate the value of dp[i][j] according to the state transition equation; The state transition equation is as follows: By backtracking the final state dp[n][j max The decision path is determined to identify the optimal test list set, where n is the total number of candidate test lists and j is the number of candidate test lists. max Let j be the maximum value.

8. A system for making decisions on test tasks, characterized in that, The system includes: The task decomposition module is configured to acquire test tasks, which include test strategy configuration files and at least one environment configuration file, and decompose the test tasks into multiple test lists according to the test logic topology described in the environment configuration file. The resource matching module is configured to obtain a set of resource requirements by parsing the corresponding environment configuration file for each test list to be issued, and allocate available resources for each resource requirement in the set of resource requirements based on the resource matching priority of each topology node, and calculate the maximum number of resource matches that support all resource requirements of the test list. The decision module is configured to extract test strategies from the test strategy configuration file and construct an optimization decision model. The optimization decision model is constrained by the total weight of the test strategies of each candidate test list not exceeding a preset upper limit, and aims to maximize the sum of the products of the maximum number of resource matching items of each candidate test list and the corresponding test strategy weight. It solves the optimal set of test lists to be executed based on a dynamic programming algorithm. The test execution module is configured to execute test cases and obtain the final test results based on the resource configuration information of each test list in the optimal test list set.

9. The system according to claim 8, characterized in that, The system also includes a queue management module, which uses a test queue and a cache queue to manage the distribution of the test list according to preset queue interaction rules; The preset queue interaction rules include: The multiple test lists obtained from the initial decomposition of the test task are placed into the test queue, and a decision failure count is maintained for each test list in the test queue; When a test list issued by the test queue fails in resource matching or decision-making, its decision failure count is increased. If the decision failure count of the test list exceeds a preset threshold, it is moved from the test queue to the cache queue. The failure count of a test list in the cache queue is periodically decremented. When the failure count of a test list in the cache queue reaches zero, it is moved back to the test queue.

10. The system according to claim 8, characterized in that, The decision-making module uses the optimized decision-making model to obtain the optimal test list set, including: Select a list of candidate tests that meet the requirements of each testing strategy. Define the dynamic programming state dp[i][j], which represents the maximum value of the objective function when selecting a subset S from the first i candidate test lists such that the sum of the policy weights of the subset S does not exceed j. objective function F ( S ) is the sum of the products of the number of resource matching sets and the strategy weights of all candidate test lists in subset S; Where, N i P represents the maximum number of resource matches for the i-th candidate test list. i Let J be the test strategy weight for the i-th candidate test list, and j ≥ P. i dp[0][j]=0; Calculate the value of dp[i][j] according to the state transition equation; The state transition equation is as follows: By backtracking the final state dp[n][j max The decision path is determined to identify the optimal test list set, where n is the total number of candidate test lists and j is the number of candidate test lists. max Let j be the maximum value.