Server testing method and device

By subdividing the server test tasks into multiple task items and assigning them to multiple modules for execution according to feasibility parameters, the problem of inefficient testing in the prior art is solved, and faster acquisition of test results is achieved.

CN118885347BActive Publication Date: 2024-12-20INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411372921.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-20
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

The existing server testing methods are inefficient, resulting in long test cycles and inability to effectively process multiple test items, resulting in poor testing efficiency.

Method used

Convert the target test task into multiple test task items, and cluster it into a test task group based on feasibility parameters, and assign it to multiple test execution modules to execute, and perform it in the order of feasibility from high to low to ensure tasks that can be executed simultaneously. Items are executed simultaneously on different modules.

Benefits of technology

By subdividing tasks and reasonably allocating them, testing time is reduced, testing efficiency is improved, and the problem of long test cycles is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885347B_ABST
    Figure CN118885347B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for testing a server, the method comprising: converting a received target test task into multiple test task items; clustering the multiple test task items according to the feasibility parameters corresponding to each of the multiple test task items to obtain one or more test task groups; assigning the test task items in each test task group to multiple test execution modules running on the test server for execution, obtaining the test results of the server to be tested in the target server test, and each test execution module is used to execute the assigned test task items in the order of feasibility from high to low indicated by the feasibility parameter. Through the present application, the problem of poor test efficiency of the server to be tested is solved, thereby achieving the effect of improving the test efficiency of the server to be tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and in particular, to a server testing method and device. Background Art

[0002] With the continuous development of servers and server products, people pay more and more attention to the testing of server products. At present, the testing of server products requires the corresponding test execution module to fully execute the entire test task. With the continuous development of server products and the continuous expansion of functions, more and more test items are required, resulting in an increasing volume of test tasks, which further leads to a longer and longer test cycle for server products. It takes a long time to get the final test results, and the test efficiency of the server under test is poor. Summary of the invention

[0003] The embodiments of the present application provide a server testing method and device to at least solve the problem of poor testing efficiency of the server to be tested in the related art.

[0004] According to an embodiment of the present application, a server testing method is provided, wherein the testing server is connected to a server to be tested, and the testing server executes a testing task of the server to be tested through a test execution module. The method is applied to the testing server, and the method includes:

[0005] Converting the received target test task into a plurality of test task items, wherein the target test task is used to instruct to perform a target server test on the server to be tested, and the plurality of test task items are used to implement the target server test;

[0006] According to the feasibility parameters corresponding to each of the multiple test task items, the multiple test task items are clustered to obtain one or more test task groups, wherein each of the test task groups includes one or more test task items, and the feasibility parameters are used to indicate the feasibility of executing the corresponding test task item simultaneously with other test task items in the multiple test task items;

[0007] The test task items in each of the test task groups are assigned to the multiple test execution modules running on the test server to execute, and the test results of the server to be tested in the target server test are obtained, wherein each test execution module is used to execute the assigned test task items in the order of feasibility from high to low indicated by the feasibility parameter.

[0008] In an exemplary embodiment, clustering the multiple test task items according to the feasibility parameters corresponding to each of the multiple test task items includes:

[0009] Extracting the target task item type of each test task item as the feasibility parameter;

[0010] In the case where the target task item type belongs to a first type set, the test task item corresponding to the feasibility parameter is divided into a first test task group, wherein the first type set includes a task item type that is allowed to be executed simultaneously with other test task items;

[0011] In the case that the target task item type belongs to a second type set, the test task item corresponding to the feasibility parameter is divided into a second test task group, wherein the second type set includes a task item type that is not allowed to be executed simultaneously with other test task items.

[0012] In an exemplary embodiment, the allocating the test task items in each of the test task groups to the plurality of test execution modules running on the test server for execution includes:

[0013] Allocating the test task items in each of the test task groups to the plurality of test execution modules in the order of the feasibility parameters from large to small, wherein the higher the feasibility indicated by the feasibility parameter, the larger the feasibility parameter;

[0014] Control the plurality of test execution modules to execute the assigned test task items in the order in which the assigned test task items are received.

[0015] In an exemplary embodiment, allocating the test task items in each of the test task groups to the plurality of test execution modules includes:

[0016] Compare the task item parameters in the reference test task group with the module parameters of the test server, wherein the task item parameters are used to indicate the number of test task items allocated by the reference test task group, and the module parameters are used to indicate the number of the test execution modules running on the test server, and the test task items in the reference test task group are allowed to be executed simultaneously with other test task items;

[0017] In the case where the task item parameter is less than or equal to the module parameter, a test execution module is matched for each test task item in the reference test task group and each test task item is assigned to the matched test execution module, wherein the test execution modules matched by each test task item are different from each other;

[0018] When the task item parameter is greater than the module parameter, the multiple test task items are clustered according to the attribute information of each test task item in the reference test task group to obtain multiple test task blocks, wherein each test task block includes one or more test task items, and only one test task item of the multiple test task items belonging to the same test task block is executed; each test task block is assigned to multiple test execution modules.

[0019] In an exemplary embodiment, allocating each of the test task blocks to the plurality of test execution modules includes:

[0020] comparing a test block parameter with a module parameter of the test server, wherein the test block parameter is used to indicate the number of the test task blocks;

[0021] In the case where the test block parameter is less than or equal to the module parameter, a test execution module is matched for each of the test task blocks and each of the test task blocks is assigned to the matched test execution module, wherein the test execution modules matched by each of the test task blocks are different from each other;

[0022] In the case where the test block parameter is greater than the module parameter, the multiple test task blocks are allocated to the multiple test execution modules according to the sizes of complexity parameters corresponding to the multiple test task blocks, wherein the complexity parameter is used to indicate the time required to execute the corresponding test task item, and the larger the complexity parameter is, the longer the time required to execute the corresponding test task item.

[0023] In an exemplary embodiment, allocating the plurality of test task blocks to the plurality of test execution modules according to the sizes of the complexity parameters corresponding to the plurality of test task blocks comprises:

[0024] polling a plurality of the test execution modules;

[0025] In the case of first polling of the plurality of test execution modules, allocating a test task block to the plurality of test execution modules in descending order of complexity parameters of the plurality of test task blocks;

[0026] In the case of polling multiple test execution modules in other rounds except the first polling, the task blocks to be assigned are assigned to the multiple test execution modules according to the total complexity parameter of the multiple test execution modules and the complexity parameters of the task blocks to be assigned, wherein the total complexity parameter is the parameter sum of the complexity parameters of the test task blocks assigned in the corresponding test execution modules, and the task blocks to be assigned are other task blocks among the multiple test task blocks except the test task blocks that have been assigned in the first polling of the multiple test execution modules, and the task blocks to be assigned include one or more test task blocks.

[0027] In an exemplary embodiment, in the case of polling the plurality of test execution modules in other rounds except the first polling, allocating the task blocks to be allocated to the plurality of test execution modules according to the total complexity parameters of the plurality of test execution modules and the complexity parameters of the task blocks to be allocated, comprises:

[0028] Repeat the following steps until the multiple test execution modules are polled and the next round of polling is started to poll the multiple test execution modules again, or the polling of the multiple test execution modules is terminated when all the task blocks to be assigned have been assigned to the multiple test execution modules:

[0029] Allocate the test task block with the largest complexity parameter among the task blocks to be allocated to the first test execution module with the smallest total complexity parameter among the plurality of test execution modules;

[0030] Polling other test execution modules except the first test execution module among the multiple test execution modules, comparing the maximum total complexity parameter with the total complexity parameter of the second test execution module, wherein the maximum total complexity parameter is the largest total complexity parameter among the total complexity parameters corresponding to the multiple test execution modules, and the other test execution modules include the second test execution module;

[0031] When the total complexity parameter of the second test execution module is greater than or equal to the maximum total complexity parameter, updating the maximum total complexity parameter according to the total complexity parameter of the second test execution module;

[0032] When the total complexity parameter of the second test execution module is less than the maximum total complexity parameter, comparing the difference between the maximum total complexity parameter and the total complexity parameter of the second test execution module with the smallest complexity parameter among the multiple complexity parameters corresponding to the task block to be assigned;

[0033] When the difference is greater than or equal to the minimum complexity parameter, the test task block with the largest corresponding complexity parameter in the task blocks to be assigned is taken out from the task blocks to be assigned and assigned to the second test execution module.

[0034] In an exemplary embodiment, after controlling the plurality of test execution modules to execute the assigned test task items in the order in which the assigned test task items are received, the method further includes:

[0035] Arrange multiple test task sub-results of the multiple test task items according to the correspondence between the target test task and the test task item and the test time of the test task item, wherein the test task sub-result is an execution result obtained after the test execution module executes the corresponding test task item;

[0036] The test result of the server to be tested in the target server test is determined according to the multiple test task sub-results.

[0037] In an exemplary embodiment, the allocating the test task items in each of the test task groups to the plurality of test execution modules running on the test server for execution includes:

[0038] Multiple test task items in the target test task group are assigned to multiple test execution modules for execution, wherein the multiple test execution modules are configured to allow only one test execution module to execute the test task items in the target test task group at the same time, and the test task items in the target test task group are not allowed to be executed simultaneously with other test task items.

[0039] In an exemplary embodiment, before assigning the test task items in each of the test task groups to the plurality of test execution modules running on the test server for execution, the method further includes:

[0040] Based on the hardware performance parameters of the test server and the time parameters of the target test task, the target number of multiple test execution modules with the highest test efficiency for the test server to execute the target server test on the server to be tested is calculated, wherein the hardware performance parameters are used to indicate the ability of the test server to run the test execution module, and the time parameters include the execution time of multiple test task items in the target test task and the waiting time for multiple test task items to meet the execution conditions.

[0041] In an exemplary embodiment, the calculating, based on the hardware performance parameters of the test server and the time parameters of the target test task, the target number of the plurality of test execution modules having the highest test efficiency for the test server to perform the target server test on the server to be tested comprises:

[0042] The target number of the plurality of test execution modules with the highest test efficiency for the test server to execute the target server test on the server to be tested is calculated by the following formula:

[0043] ;

[0044] Among them, N Th is the target number, N is the number of processor cores of the test server, S is the expected utilization of the processor of the test server, W is the waiting time for waiting for multiple test task items to meet the execution conditions, and R is the execution time of multiple test task items in the target test task.

[0045] According to another embodiment of the present application, a server testing device is provided, wherein the testing server is connected to a server to be tested, and the testing server executes a testing task of the server to be tested through a test execution module. The device is applied to the testing server, and the device includes:

[0046] A conversion module, used for converting the received target test task into a plurality of test task items, wherein the target test task is used for instructing to perform a target server test on the server to be tested, and the plurality of test task items are used for implementing the target server test;

[0047] A clustering module, for clustering the multiple test task items according to feasibility parameters corresponding to each of the multiple test task items to obtain one or more test task groups, wherein each of the test task groups includes one or more test task items, and the feasibility parameters are used to indicate the feasibility of executing the corresponding test task item simultaneously with other test task items in the multiple test task items;

[0048] An allocation module is used to allocate the test task items in each of the test task groups to the multiple test execution modules running on the test server for execution, so as to obtain the test results of the server to be tested in the target server test, wherein each test execution module is used to execute the allocated test task items in the order of feasibility from high to low indicated by the feasibility parameter.

[0049] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0050] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0051] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0052] Through the present application, the target test task of the server to be tested is converted into multiple test task items, and the multiple test task items are clustered according to the feasibility parameters corresponding to each test task item in the multiple test task items to obtain one or more test task groups, and then the test task items in each test task group are assigned to multiple test execution modules running on the test server for execution, that is, after the target test task is subdivided into multiple test task items, they are divided into multiple test execution modules for execution according to the feasibility of simultaneous execution, so that the test task items in the target test task that can be executed simultaneously are executed simultaneously on different test execution modules, avoiding the problem of long test time caused by the full execution of the target test task by one test execution module, and reducing the test time of the server to be tested. Therefore, the problem of poor testing efficiency of the server to be tested can be solved, and the effect of improving the testing efficiency of the server to be tested can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a hardware structure block diagram of a server device of a server testing method according to an embodiment of the present application;

[0054] Figure 2 is a flow chart of a method for testing a server according to an embodiment of the present application;

[0055] Figure 3 is an interaction diagram of a server testing method according to an embodiment of the present application;

[0056] Figure 4 It is a schematic diagram of a process of performing action classification of a test task according to an embodiment of the present application;

[0057] Figure 5 is a flow chart of allocating test instructions according to an embodiment of the present application;

[0058] Figure 6 is a schematic diagram of a test instruction allocation process according to an embodiment of the present application;

[0059] Figure 7 It is a structural block diagram of a server testing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0060] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0061] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0062] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a server testing method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0063] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the test method of the server in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0064] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0065] In this embodiment, a server testing method is provided. A testing server is connected to a server to be tested. The testing server executes a testing task of the server to be tested through a testing execution module. Figure 2 is a flow chart of a method for testing a server according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0066] Step S202, converting the received target test task into a plurality of test task items, wherein the target test task is used to instruct to perform a target server test on the server to be tested, and the plurality of test task items are used to implement the target server test;

[0067] Step S204, clustering the multiple test task items according to the feasibility parameters corresponding to each of the multiple test task items to obtain one or more test task groups, wherein each of the test task groups includes one or more test task items, and the feasibility parameters are used to indicate the feasibility of executing the corresponding test task item simultaneously with other test task items in the multiple test task items;

[0068] Step S206, assigning the test task items in each of the test task groups to the multiple test execution modules running on the test server for execution, and obtaining the test results of the server to be tested in the target server test, wherein each test execution module is used to execute the assigned test task items in the order of feasibility from high to low indicated by the feasibility parameter.

[0069] Through the above steps, the target test task of the server to be tested is converted into multiple test task items, and the multiple test task items are clustered according to the feasibility parameters corresponding to each test task item in the multiple test task items to obtain one or more test task groups, and then the test task items in each test task group are assigned to multiple test execution modules running on the test server for execution, that is, after the target test task is subdivided into multiple test task items, they are divided into multiple test execution modules for execution according to the feasibility of simultaneous execution, so that the test task items in the target test task that can be executed simultaneously are executed simultaneously on different test execution modules, avoiding the problem of long test time caused by the full execution of the target test task by one test execution module, and reducing the test time of the server to be tested. Therefore, the problem of poor testing efficiency of the server to be tested can be solved, and the effect of improving the testing efficiency of the server to be tested can be achieved.

[0070] Optionally, in an embodiment of the present application, the test server may, but is not limited to, record the conversion relationship between each test task and the corresponding multiple test task items and the task item type of each test task item. Therefore, after receiving the target test task, the conversion relationship recorded on the test server can be used to convert the target test task into multiple test task items, and the feasibility parameters of each test task item can also be obtained.

[0071] Optionally, the test execution module may be, but is not limited to, a module or unit in an operating system that can independently execute instructions, and may be, but is not limited to, a thread.

[0072] Optionally, the test task of the server to be tested may be but is not limited to a single test task for a server function of the server to be tested or a combined test task for multiple server functions. The solution provided in the present application may be but is not limited to converting test task items for both single test tasks and combined test tasks, converting both single test tasks and multiple test tasks into the smallest executable units and assigning them to multiple test execution modules for execution, thereby improving the test execution efficiency of single test tasks or combined test tasks.

[0073] In the embodiment provided in step S202, the test task item may be, but is not limited to, a subtask of a test task with a smaller execution scale than the test task, for example, it may be a smallest executable unit including only one execution action.

[0074] Optionally, in an embodiment of the present application, converting the received target test task into multiple test task items includes but is not limited to encapsulating the target test task into the multiple test task items according to the execution action, wherein each test task item in the multiple test task items has an execution action, or encapsulating the target test task into the multiple test task items according to the execution object, wherein each test task item in the multiple test task items is for the same execution object.

[0075] In the embodiment provided in step S204, the feasibility parameter can be but is not limited to being used to indicate the feasibility of executing the corresponding test task item simultaneously with other test task items in multiple test task items. The feasibility parameter includes but is not limited to being related to the degree of influence of the execution result of the test task item on the execution of other test task items and the degree of influence of the execution conditions of the test task item from other test task items.

[0076] Optionally, in an embodiment of the present application, before clustering the multiple test task items according to the feasibility parameters corresponding to each of the multiple test task items, the method also includes: matching feasibility parameters for the multiple test task items according to the test result parameters of each of the multiple test task items, wherein the test result parameters are used to indicate the degree of influence of the execution process of the corresponding test task item on whether other test task items in the multiple test task items can be executed normally at the same time, and the higher the degree of influence indicated by the test result parameters, the higher the feasibility indicated by the corresponding feasibility parameters.

[0077] Optionally, in an embodiment of the present application, according to the feasibility parameters corresponding to each of the multiple test task items, the multiple test task items are clustered, including but not limited to traversing the feasibility parameters corresponding to each test task item, wherein the feasibility parameter is calculated based on the task attribute information of the corresponding test task item; when the feasibility parameter is greater than a parameter threshold, the test task item corresponding to the feasibility parameter is divided into a third test task group, wherein the test task items in the third test task group are allowed to be executed simultaneously with other test task items; when the feasibility parameter is less than or equal to the parameter threshold, the test task item corresponding to the feasibility parameter is divided into a fourth test task group, wherein the test task items in the fourth test task group are not allowed to be executed simultaneously with other test task items.

[0078] In the embodiment provided in step S206, the test task items in each of the test task groups are assigned to the multiple test execution modules running on the test server for execution, including but not limited to the order of feasibility of simultaneous execution of the test task items indicated by the feasibility parameters corresponding to the test task groups and other test task items from large to small. First, the test task items whose feasibility parameters are greater than or equal to the first parameter threshold in the test task group whose feasibility parameters are greater than the parameter threshold are assigned to multiple test execution modules for simultaneous execution; after the test task items whose feasibility parameters are greater than or equal to the first parameter threshold in the test task group whose feasibility parameters are greater than the parameter threshold are all executed, the test task items whose feasibility parameters are greater than the parameter threshold in the test task group whose feasibility parameters are greater than the parameter threshold are assigned to multiple test execution modules for simultaneous execution. The test task items in the test task group whose feasibility parameter is greater than the parameter threshold and whose feasibility parameter is greater than or equal to the second parameter threshold but less than the first parameter threshold are all executed, and then the test task items in the test task group whose feasibility parameter is greater than the parameter threshold and whose feasibility parameter is greater than the parameter threshold but less than the second parameter threshold are assigned to multiple test execution modules for simultaneous execution; after the test task items in the test task group whose feasibility parameter is greater than the parameter threshold and whose feasibility parameter is greater than the parameter threshold but less than the second parameter threshold are all executed, the test task items in the test task group whose feasibility parameter is less than or equal to the parameter threshold are assigned to multiple test execution modules for execution according to the rule that only one test execution module executes the test task items at the same time, wherein the first parameter threshold is greater than the second parameter threshold, and the second parameter threshold is greater than the parameter threshold. Through the above steps, in combination with assigning similar feasibility parameters to some of the test task items that can be executed simultaneously, as many test task items as possible can be executed by the test execution module at the same time while ensuring the normal execution of the test process, thereby further improving the test efficiency of the server to be tested.

[0079] Optionally, in the embodiments of the present application, Figure 3 is an interaction diagram of a server testing method according to an embodiment of the present application, such as Figure 3As shown, the machine to be tested is the server to be tested, and the test server includes a management machine and an execution machine. The main program service runs on the management machine and is used to schedule data and various models. The test device service runs on the execution machine and is responsible for calculating the pheromone set of each model. The database service runs on the management machine and is used for data storage and log storage. The stored test log can be reorganized to obtain the complete test log of the test task. After receiving the instruction to execute the test, the main program sends a CPU (Central Processing Unit) acquisition information instruction to the processor of the execution machine to obtain the running information of the execution machine, which is used to determine the maximum number of threads that can be established in the current test system. The execution machine responds to the instruction of the main program and returns information. The main program sends the test task information and the thread-related information (i.e., the execution machine information) obtained from the execution machine to the test device. The test device queries the action (i.e., the test task item) pheromone set corresponding to the test task from the database, determines how many models (i.e., the test task item) combinations there are based on the query information, and then establishes a multi-threaded (i.e., test execution module) task, models each model, and confirms the minimum execution pheromone of each model. After confirmation, the test device service forms an execution instruction set according to the minimum model and tests the server. After execution, the log is recorded and reorganized according to the model, and the final result is obtained and returned to the main program.

[0080] As an optional implementation, the multiple test task items are clustered according to the feasibility parameters corresponding to each of the multiple test task items, including: extracting the target task item type of each test task item as the feasibility parameter; when the target task item type belongs to a first type set, dividing the test task item corresponding to the feasibility parameter into a first test task group, wherein the first type set includes task item types that are allowed to be executed simultaneously with other test task items; when the target task item type belongs to a second type set, dividing the test task item corresponding to the feasibility parameter into a second test task group, wherein the second type set includes task item types that are not allowed to be executed simultaneously with other test task items.

[0081] Optionally, in an embodiment of the present application, the task item types of all test task items may be recorded in the test server, but is not limited to, as well as the correspondence between each test task item type and the type set.

[0082] Through the above steps, the test task items are divided into the first test task group and the second test task group according to the task item type, that is, the task items that can be executed simultaneously and the task items that cannot be executed simultaneously are divided into two parts, so that different test task item execution rules can be adopted for different test task groups later, which provides a basis for ensuring that the test tasks can be executed normally while improving the execution efficiency of the test, and also improves the test efficiency of the server to be tested to a certain extent.

[0083] Optionally, in the embodiment of the present application, the test script (i.e., test task) may be atomically encapsulated according to the execution action to obtain multiple test task items, and the test task items may be divided into levels I (i.e., X1), II (i.e., X2), and III (i.e., X3) according to the following rules:

[0084] I: Executing related operations on the machine will not affect other tests, such as query tests;

[0085] II: Executing related operations on the machine may not affect the specified test type, such as stress and performance tests;

[0086] III: Executing related operations on the machine will completely affect other types of operations, such as restarting and shutting down.

[0087] Optionally, in the embodiments of the present application, Figure 4 is a schematic diagram of a process of performing action classification of a test task according to an embodiment of the present application, such as Figure 4 As shown, the A test script can be but not limited to being graded into minimum execution actions, which can be divided into five instructions (i.e., test task items) of C1, C2, C3, C4, and C5. Each instruction will have a corresponding pheromone (i.e., complexity parameter), and each instruction has a corresponding instruction level (X1, X2, and X3). After sequential reorganization, three execution level modules (corresponding to the test task group) can be formed, and each module is represented by a vector similar to [C1, C2].

[0088] Optional, including but not limited to adding dynamic calibration codes to execution actions (i.e. test task items) in the script (i.e. test tasks), and scanning whether the same level of testing (i.e. the same test task group testing) is to be performed before executing the operation. If the same level of testing is to be performed, it is considered to still belong to the original module and the execution rules are not changed; if a level is skipped, the next module is entered for testing, and the execution rules corresponding to the module are adopted according to the needs.

[0089] As an optional implementation, the test task items in each of the test task groups are assigned to the multiple test execution modules running on the test server for execution, including: assigning the test task items in each of the test task groups to the multiple test execution modules in the order of the feasibility parameters from large to small, wherein the higher the feasibility indicated by the feasibility parameter, the larger the feasibility parameter; and controlling the multiple test execution modules to execute the assigned test task items in the order in which the assigned test task items are received.

[0090] As an optional implementation, the assigning of the test task items in each of the test task groups to the multiple test execution modules includes: comparing the size of the task item parameters in the reference test task group and the module parameters of the test server, wherein the task item parameters are used to indicate the number of test task items assigned to the reference test task group, and the module parameters are used to indicate the number of test execution modules running on the test server, and the test task items in the reference test task group are allowed to be executed simultaneously with other test task items; when the task item parameters are less than or equal to the module parameters, matching a test execution module for each test task item in the reference test task group and assigning each test task item to the matched test execution module, wherein the test execution modules matched by each test task item are different from each other; when the task item parameters are greater than the module parameters, clustering the multiple test task items according to the attribute information of each test task item in the reference test task group to obtain multiple test task blocks, wherein each of the test task blocks includes one or more test task items, and only one of the multiple test task items belonging to the same test task block is executed; assigning each of the test task blocks to the multiple test execution modules.

[0091] Optionally, in an embodiment of the present application, the first test task group may include, but is not limited to, a reference test task group.

[0092] Optionally, in an embodiment of the present application, the attribute information may be, but is not limited to, used to indicate the operation to be performed corresponding to the test task item. Test task items with the same operation to be performed may be grouped into the same test task block based on the attribute information.

[0093] Through the above steps, when the number of test execution modules is insufficient to execute each test task item in the reference test task group individually, multiple test task items are clustered according to attribute information and converted into multiple test task blocks. Test task items with the same attribute information are grouped into one test task block, and only one test task item among the multiple test task items in one test task block will be executed, thereby avoiding repeated execution of test task items with the same execution content and improving the testing efficiency of the server to be tested.

[0094] Optional, Figure 5 is a flow chart of distributing test instructions according to an embodiment of the present application, such as Figure 5 As shown, first determine the non-mutually exclusive combination, that is, determine the test task items that can be executed simultaneously, and obtain a set of test task items (that is, the pheromone data of X1, X2, and X3 sets), and then perform deduplication of instructions, and then follow the same-level sequential parallel algorithm (that is, assign instructions that can be executed simultaneously at the same level to different test execution modules for simultaneous execution, as opposed to the skip-level sequential algorithm that assigns level I and level II instructions to different test execution modules for simultaneous execution), form corresponding minimum execution models for multiple levels, execute each test task item, and record the execution data of the test task items.

[0095] Optionally, in an embodiment of the present application, it is possible but not limited to execute the multiple test tasks according to the method given in the present application when there are multiple test tasks. Table 1 is a test task that needs to be executed by a server to be tested. As shown in Table 1, there are 9 execution scripts (i.e., test tasks) including A, B, ..., and I. For example, for script A, it includes 3 test task groups, corresponding to instructions (i.e., test task items) of levels I, II, and III, respectively. The instruction belonging to level I in A is Y1a, and the pheromone corresponding to Y1a is 5. The instruction belonging to level II in A is Y3b, and the pheromone corresponding to Y3b is 15. The instruction level corresponding to Y3b is the X2-1 sub-level in level II. It is possible but not limited to reclassifying the instructions in level II so that the instructions that can be executed simultaneously can be executed simultaneously. For example, the instructions of sub-level X2-1 in Table 2 are executed simultaneously, and the instructions of sub-level X2-2 are executed simultaneously. Both X2-1 and X2-2 belong to level II. The execution actions of the execution scripts are graded and dynamically calibrated.

[0096] Table 1

[0097]

[0098] Optionally, when executing the above test tasks, the instructions of level I (i.e., test task items) can be assigned to multiple threads (i.e., test execution modules) first, but not limited to: first, the number of level I instructions is compared with the number of test execution modules N1 in the test server. If it is less than N1, the number of level I test execution modules is assigned, and each test execution module executes 1 level I instruction. If N1 is less than the number of level I instructions, the level I instructions are sorted according to the pheromone, and the sorting method shown in Table 2 is adopted. After sorting, duplicates are removed and repeated data is calibrated. For example, as shown in Table 2, there are three types of repeated pheromones, 2, 3, and 5. Then, in the instruction set with the same pheromone, the operation content (i.e., attribute information) of multiple instructions in each instruction set is queried respectively. If the corresponding instruction content is consistent, the instruction with the same instruction content is defined as an instruction to be executed, so as to ensure that the same instruction is executed only once during the test process.

[0099] Table 2

[0100]

[0101] As an optional implementation, the allocating each of the test task blocks to the multiple test execution modules includes: comparing a test block parameter with a module parameter of the test server, wherein the test block parameter is used to indicate the number of the test task blocks; when the test block parameter is less than or equal to the module parameter, matching a test execution module for each of the test task blocks and allocating each of the test task blocks to the matched test execution module, wherein the test execution modules matched by each of the test task blocks are different from each other; when the test block parameter is greater than the module parameter, allocating the multiple test task blocks to the multiple test execution modules according to the size of complexity parameters corresponding to the multiple test task blocks, wherein the complexity parameter is used to indicate the time required to execute the corresponding test task item, and the larger the complexity parameter, the longer the time required to execute the corresponding test task item.

[0102] Optionally, in an embodiment of the present application, the complexity parameter may be, but is not limited to, the time spent executing the corresponding test task item, or a weighted value of the time spent executing the corresponding test task item and other test resource consumption conditions.

[0103] As an optional implementation, the method of allocating the multiple test task blocks to the multiple test execution modules according to the sizes of complexity parameters corresponding to the multiple test task blocks includes: polling the multiple test execution modules; when polling the multiple test execution modules for the first time, allocating one test task block to the multiple test execution modules in descending order of the complexity parameters of the multiple test task blocks; when polling the multiple test execution modules in other rounds except the first polling, allocating the task blocks to be allocated to the multiple test execution modules according to the total complexity parameters of the multiple test execution modules and the complexity parameters of the task blocks to be allocated, wherein the total complexity parameter is the parameter sum of the complexity parameters of the test task blocks allocated in the corresponding test execution modules, and the task blocks to be allocated are other task blocks among the multiple test task blocks except the test task blocks allocated when polling the multiple test execution modules for the first time, and the task blocks to be allocated include one or more test task blocks.

[0104] As an optional implementation, in the case of polling multiple test execution modules in other rounds except the first polling, the task blocks to be assigned are assigned to the multiple test execution modules according to the total complexity parameters of the multiple test execution modules and the complexity parameters of the task blocks to be assigned, including: repeatedly performing the following steps until the multiple test execution modules are polled and the next round of polling is entered to re-pollating the multiple test execution modules, or until the task blocks to be assigned have been all assigned to the multiple test execution modules, the polling of the multiple test execution modules is terminated:

[0105] Assign the test task block with the largest complexity parameter in the task blocks to be assigned to the first test execution module with the smallest current total complexity parameter among the multiple test execution modules; poll the other test execution modules except the first test execution module among the multiple test execution modules, and compare the maximum total complexity parameter with the total complexity parameter of the second test execution module, wherein the maximum total complexity parameter is the largest total complexity parameter among the total complexity parameters corresponding to the multiple test execution modules, and the other test execution modules include the second test execution module; when the total complexity parameter of the second test execution module is greater than or equal to the maximum total complexity parameter, update the maximum total complexity parameter according to the total complexity parameter of the second test execution module; when the total complexity parameter of the second test execution module is less than the maximum total complexity parameter, compare the difference between the maximum total complexity parameter and the total complexity parameter of the second test execution module with the smallest complexity parameter among the multiple complexity parameters corresponding to the task block to be assigned; when the difference is greater than or equal to the smallest complexity parameter, take out the test task block with the largest corresponding complexity parameter in the task blocks to be assigned from the task blocks to be assigned and assign it to the second test execution module.

[0106] Through the above steps, when the test execution modules that can execute the test task items are not enough to execute each test task block obtained after deduplication, try to assign test task blocks with equivalent total complexity parameters to each test execution module, try to make the execution time and pressure of each test execution module similar, and evenly share the test pressure and test time. It can also reduce the test waiting during the test process and improve the test efficiency of the server to be tested.

[0107] Optionally, in an embodiment of the present application, after deduplicating instructions (i.e., test task items), the number of deduplicated level I instructions is compared with the number N1 of test execution modules in the test server. If it is less than N1, test execution modules with the number of level I instructions are allocated, and each test execution module only needs to execute 1 level I instruction. Figure 6 is a schematic diagram of a test instruction allocation process according to an embodiment of the present application, such as Figure 6As shown, if N1 is less than the number of level I instructions after deduplication, initialize N1 sets again, first put the instruction with the largest pheromone into the first set, and then put 1 instruction into N1 sets in turn (in order of pheromone from large to small), keep calculating the pheromone sum of the instructions in each set, and compare it with the largest pheromone sum in the pheromone sum corresponding to the N1 sets. If it is greater than the maximum pheromone sum, reassign the maximum pheromone sum and add instructions to the remaining sets. Specifically, when adding instructions to the remaining sets, each round of instruction addition calculates the pheromone sum of the instructions in the set and compares it with the maximum pheromone sum. If it is greater than the maximum pheromone sum, reassign the maximum pheromone sum. When the next round of polling is performed, the instruction is inserted from the set with the smallest pheromone and compared with the maximum pheromone sum. If it is greater than the maximum pheromone sum, the maximum pheromone sum is reassigned; if it is less than the maximum pheromone sum and the maximum pheromone sum minus the pheromone sum of the current set is greater than the minimum value of the pheromone corresponding to the instruction of the level I set to be inserted, then the data is continued to be inserted into the current set until the difference value becomes less than the minimum value of the pheromone corresponding to the instruction of the level I set to be inserted; if it is less than the maximum pheromone sum and the maximum pheromone sum minus the pheromone sum of the current set is less than the minimum value of the pheromone corresponding to the instruction of the level I set to be inserted, then the instruction is continued to be inserted into the next set. Similarly, the instructions of level II can be allocated in the same way as above, or the instructions of level I and level II can be reorganized and allocated according to the number N1 of test execution modules running on the test server, and the minimum execution pheromone value is calculated. The instructions of level I can be combined with instructions of different sequences of level II at will, and the optimal model is calculated according to the allocation scheme of level I instructions as above after the combination.

[0108] As an optional implementation manner, after controlling the plurality of test execution modules to execute the assigned test task items in the order in which the assigned test task items are received, the method further includes:

[0109] Arrange multiple test task sub-results of the multiple test task items according to the correspondence between the target test task and the test task item and the test time of the test task item, wherein the test task sub-result is an execution result obtained after the test execution module executes the corresponding test task item;

[0110] The test result of the server to be tested in the target server test is determined according to the multiple test task sub-results.

[0111] Through the above steps, the test task sub-results are arranged with the help of the correspondence between the target test task and the test task item and the test time of the test task item to obtain the test result of the test task, which realizes the integration of the execution results after the test tasks are executed separately, thereby ensuring the accuracy of the test results.

[0112] Optionally, in an embodiment of the present application, it is possible but not limited to matching the test action results (i.e., test task sub-results) with the scripts (i.e., target test tasks) one-to-one, and then checking whether there is a repeat mark. If there is a repetition, the repeated action results and repeated scripts are also matched one-to-one, and then the final test result is determined according to the timestamp.

[0113] As an optional implementation manner, allocating the test task items in each of the test task groups to the plurality of test execution modules running on the test server for execution includes:

[0114] Multiple test task items in the target test task group are assigned to multiple test execution modules for execution, wherein the multiple test execution modules are configured to allow only one test execution module to execute the test task items in the target test task group at the same time, and the test task items in the target test task group are not allowed to be executed simultaneously with other test task items.

[0115] Optionally, in an embodiment of the present application, for level III instructions (i.e., test task items), since level III instructions have a necessary mutually exclusive relationship, it is only necessary to perform deduplication operations on the level III instructions and execute them sequentially.

[0116] Through the above steps, it is ensured that the test task items that cannot be executed simultaneously with other test task items are executed separately, and the test can be carried out normally while pursuing the improvement of the test speed, and the accuracy of the test results is guaranteed.

[0117] As an optional implementation manner, before allocating the test task items in each of the test task groups to the plurality of test execution modules running on the test server for execution, the method further includes:

[0118] Based on the hardware performance parameters of the test server and the time parameters of the target test task, the target number of multiple test execution modules with the highest test efficiency for the test server to execute the target server test on the server to be tested is calculated, wherein the hardware performance parameters are used to indicate the ability of the test server to run the test execution module, and the time parameters include the execution time of multiple test task items in the target test task and the waiting time for multiple test task items to meet the execution conditions.

[0119] Optionally, in the embodiment of the present application, when there are multiple execution machines on the test server, the test device service obtains the list of execution machines and allocates the number of threads (i.e., test execution modules) according to the number of CPU cores of the execution machine and the number of execution machines: N Th (Number of threads) = N (Number of processor cores) S (expected CPU utilization) [1+W / R (ratio of waiting time to computing time)] M (number of execution machines), where waiting time (waiting—runnable) is the waiting time for the test task item to meet the execution conditions, and calculation time is the action execution time of executing the test task item.

[0120] As an optional implementation, the calculating, based on the hardware performance parameters of the test server and the time parameters of the target test task, the target number of the plurality of test execution modules with the highest test efficiency for the test server to perform the target server test on the server to be tested includes:

[0121] The target number of the plurality of test execution modules with the highest test efficiency for the test server to execute the target server test on the server to be tested is calculated by the following formula:

[0122] ;

[0123] Among them, N Th is the target number, N is the number of processor cores of the test server, S is the expected utilization of the processor of the test server, W is the waiting time for waiting for multiple test task items to meet the execution conditions, and R is the execution time of multiple test task items in the target test task.

[0124] Through the above steps, the number of appropriate test execution modules is determined in combination with the specific situation of the test task and the situation of the mapping server, thereby improving the test efficiency of the server to be tested from another perspective.

[0125] As an optional implementation, after assigning the test task items in each of the test task groups to the multiple test execution modules running on the test server for execution, the method further includes: splicing the multiple test log items corresponding to the multiple test task items according to the correspondence between the target test task and the test task item and the test time of the test task item, to obtain the test log of the server to be tested in the target server test, wherein the test log item records the execution process of the test execution module executing the corresponding test task item.

[0126] Optionally, the test server records the operation coordinates (corresponding to the test task and time) and whether it is repeated in each test task item. In the case of multiple test tasks, the test action log should first be matched with the test task one by one, and then the repeated flag should be checked. If there is a repetition, the repeated log should also be matched with the repeated test task one by one, and then combined into the final test log according to the timestamp. Finally, the test report and the corresponding test data file set are generated on the test server and provided to the test engineer for viewing the test results and analyzing the test problems.

[0127] Through the solution provided in this application, a fast execution mechanism is established to help server testing, which has higher work efficiency, lower error rate, better flexibility and scalability, lower cost and stronger adaptability. By automatically performing various tasks through algorithms and models, a large amount of work can be completed in a very short time, greatly improving work efficiency. And because the automated tools can accurately perform preset tasks, the possibility of human negligence or errors is reduced, so the error rate is also reduced. Usually with a modular design, the execution strategy and task sequence can be flexibly adjusted as needed to adapt to different application scenarios and needs. Although the initial investment may be high, in the long run, due to improved work efficiency and reduced error rate, it can save a lot of manpower, material resources and time costs for enterprises. Reducing the workload of employees on repetitive and tedious tasks can allow employees to focus more on creative and valuable work, and improve employee satisfaction and participation.

[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0129] In this embodiment, a testing device for a server is also provided, wherein the testing server is connected to a server to be tested, and the testing server executes the testing task of the server to be tested through a testing execution module. The device is applied to the testing server, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0130] Figure 7 is a structural block diagram of a server testing device according to an embodiment of the present application, such as Figure 7 As shown, the device comprises:

[0131] A conversion module 702, configured to convert the received target test task into a plurality of test task items, wherein the target test task is used to instruct to perform a target server test on the server to be tested, and the plurality of test task items are used to implement the target server test;

[0132] A clustering module 704 is used to cluster the multiple test task items according to the feasibility parameters corresponding to each of the multiple test task items to obtain one or more test task groups, wherein each of the test task groups includes one or more test task items, and the feasibility parameters are used to indicate the feasibility of executing the corresponding test task item simultaneously with other test task items in the multiple test task items;

[0133] The allocation module 706 is used to allocate the test task items in each of the test task groups to the multiple test execution modules running on the test server for execution, so as to obtain the test results of the server to be tested in the target server test, wherein each test execution module is used to execute the allocated test task items in the order of feasibility from high to low indicated by the feasibility parameter.

[0134] Through the above steps, the target test task of the server to be tested is converted into multiple test task items, and the multiple test task items are clustered according to the feasibility parameters corresponding to each test task item in the multiple test task items to obtain one or more test task groups, and then the test task items in each test task group are assigned to multiple test execution modules running on the test server for execution, that is, after the target test task is subdivided into multiple test task items, they are divided into multiple test execution modules for execution according to the feasibility of simultaneous execution, so that the test task items in the target test task that can be executed simultaneously are executed simultaneously on different test execution modules, avoiding the problem of long test time caused by the full execution of the target test task by one test execution module, and reducing the test time of the server to be tested. Therefore, the problem of poor testing efficiency of the server to be tested can be solved, and the effect of improving the testing efficiency of the server to be tested can be achieved.

[0135] As an optional implementation, the clustering module includes: an extraction unit, used to extract the target task item type of each test task item as the feasibility parameter; a first division unit, used to, when the target task item type belongs to a first type set, divide the test task items corresponding to the feasibility parameter into a first test task group, wherein the first type set includes task item types that are allowed to be executed simultaneously with other test task items; a second division unit, used to, when the target task item type belongs to a second type set, divide the test task items corresponding to the feasibility parameter into a second test task group, wherein the second type set includes task item types that are not allowed to be executed simultaneously with other test task items.

[0136] As an optional implementation, the allocation module includes: a first allocation unit, used to allocate the test task items in each of the test task groups to the multiple test execution modules in the order of the feasibility parameters from large to small, wherein the higher the feasibility indicated by the feasibility parameter, the larger the feasibility parameter; a control unit, used to control the multiple test execution modules to execute the assigned test task items in the order in which the assigned test task items are received.

[0137] Optionally, the first allocation unit is also used to: compare the size of the task item parameters in the reference test task group and the module parameters of the test server, wherein the task item parameters are used to indicate the number of test task items allocated by the reference test task group, and the module parameters are used to indicate the number of test execution modules running on the test server, and the test task items in the reference test task group are allowed to be executed simultaneously with other test task items; when the task item parameters are less than or equal to the module parameters, match a test execution module for each test task item in the reference test task group and assign each test task item to the matched test execution module, wherein the test execution modules matched by each test task item are different from each other; when the task item parameters are greater than the module parameters, cluster the multiple test task items according to the attribute information of each test task item in the reference test task group to obtain multiple test task blocks, wherein each of the test task blocks includes one or more test task items, and only one of the multiple test task items belonging to the same test task block is executed; and assign each of the test task blocks to multiple test execution modules.

[0138] Optionally, the first allocation unit is further used to: compare a test block parameter with a module parameter of the test server, wherein the test block parameter is used to indicate the number of the test task blocks; when the test block parameter is less than or equal to the module parameter, match a test execution module for each of the test task blocks and allocate each of the test task blocks to the matched test execution module, wherein the test execution modules matched by each of the test task blocks are different from each other; when the test block parameter is greater than the module parameter, allocate the multiple test task blocks to the multiple test execution modules according to the size of the complexity parameter corresponding to the multiple test task blocks, wherein the complexity parameter is used to indicate the time required to execute the corresponding test task item, and the larger the complexity parameter, the longer the time required to execute the corresponding test task item.

[0139] Optionally, the first allocation unit is further used to: poll the multiple test execution modules; when polling the multiple test execution modules for the first time, allocate a test task block to the multiple test execution modules in descending order of complexity parameters of the multiple test task blocks; when polling the multiple test execution modules in other rounds except the first polling, allocate the task blocks to be allocated to the multiple test execution modules according to the total complexity parameters of the multiple test execution modules and the complexity parameters of the task blocks to be allocated, wherein the total complexity parameter is the parameter sum of the complexity parameters of the test task blocks allocated in the corresponding test execution modules, and the task blocks to be allocated are other task blocks among the multiple test task blocks except the test task blocks that have been allocated when polling the multiple test execution modules for the first time, and the task blocks to be allocated include one or more test task blocks.

[0140] Optionally, the first allocation unit is further used to: repeatedly perform the following steps until the multiple test execution modules are polled and the next round of polling is entered to re-pollating the multiple test execution modules, or until the task blocks to be allocated have been all allocated to the multiple test execution modules and the polling of the multiple test execution modules is ended:

[0141] Assign the test task block with the largest complexity parameter in the task blocks to be assigned to the first test execution module with the smallest current total complexity parameter among the multiple test execution modules; poll the other test execution modules except the first test execution module among the multiple test execution modules, and compare the maximum total complexity parameter with the total complexity parameter of the second test execution module, wherein the maximum total complexity parameter is the largest total complexity parameter among the total complexity parameters corresponding to the multiple test execution modules, and the other test execution modules include the second test execution module; when the total complexity parameter of the second test execution module is greater than or equal to the maximum total complexity parameter, update the maximum total complexity parameter according to the total complexity parameter of the second test execution module; when the total complexity parameter of the second test execution module is less than the maximum total complexity parameter, compare the difference between the maximum total complexity parameter and the total complexity parameter of the second test execution module with the smallest complexity parameter among the multiple complexity parameters corresponding to the task block to be assigned; when the difference is greater than or equal to the smallest complexity parameter, take out the test task block with the largest corresponding complexity parameter in the task blocks to be assigned from the task blocks to be assigned and assign it to the second test execution module.

[0142] As an optional implementation, the allocation module also includes: an arrangement unit, used to arrange multiple test task sub-results of the multiple test task items according to the correspondence between the target test task and the test task item and the test time of the test task item, wherein the test task sub-result is the execution result obtained after the test execution module executes the corresponding test task item; a determination unit, used to determine the test result of the server to be tested in the target server test based on the multiple test task sub-results.

[0143] As an optional implementation, the allocation module also includes: a second allocation unit, used to allocate multiple test task items in the target test task group to multiple test execution modules for execution, wherein the multiple test execution modules are configured to allow only one test execution module to execute the test task items in the target test task group at the same time, and the test task items in the target test task group are not allowed to be executed simultaneously with other test task items.

[0144] As an optional embodiment, the testing device further includes: a calculation module, used to calculate the target number of multiple test execution modules with the highest test efficiency when the test server performs the target server test on the server to be tested based on the hardware performance parameters of the test server and the time parameters of the target test task, wherein the hardware performance parameters are used to indicate the ability of the test server to run the test execution module, and the time parameters include the execution time of multiple test task items in the target test task and the waiting time for multiple test task items to meet the execution conditions.

[0145] As an optional implementation, the calculation module calculates the target number of the plurality of test execution modules having the highest test efficiency when the test server executes the target server test on the server to be tested by the following formula:

[0146] ;

[0147] Among them, N Th is the target number, N is the number of processor cores of the test server, S is the expected utilization of the processor of the test server, W is the waiting time for waiting for multiple test task items to meet the execution conditions, and R is the execution time of multiple test task items in the target test task.

[0148] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0149] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0150] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0151] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0152] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0153] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0154] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0155] An embodiment of the present application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.

[0156] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0157] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0158] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A server testing method, characterized in that: The test server is connected to the server to be tested, and the test server executes the test task of the server to be tested through a test execution module. The method is applied to the test server, and the method includes: Converting the received target test task into a plurality of test task items, wherein the target test task is used to instruct to perform a target server test on the server to be tested, and the plurality of test task items are used to implement the target server test; According to the feasibility parameters corresponding to each of the multiple test task items, the multiple test task items are clustered to obtain one or more test task groups, wherein each of the test task groups includes one or more test task items, and the feasibility parameters are used to indicate the feasibility of executing the corresponding test task item simultaneously with other test task items in the multiple test task items; Assign the test task items in each of the test task groups to the multiple test execution modules running on the test server for execution, and obtain the test result of the server to be tested in the target server test, wherein each test execution module is used to execute the assigned test task items in the order of feasibility from high to low indicated by the feasibility parameter; Wherein, clustering the multiple test task items according to the feasibility parameters corresponding to each of the multiple test task items includes: traversing the feasibility parameters corresponding to each test task item, wherein the feasibility parameters are calculated according to the task attribute information of the corresponding test task item; when the feasibility parameter is greater than the parameter threshold, the test task item corresponding to the feasibility parameter is divided into a third test task group, wherein the test task items in the third test task group are allowed to be executed simultaneously with other test task items; when the feasibility parameter is less than or equal to the parameter threshold, the test task item corresponding to the feasibility parameter is divided into a fourth test task group, wherein the test task items in the fourth test task group are not allowed to be executed simultaneously with other test task items; The allocating the test task items in each of the test task groups to the multiple test execution modules running on the test server for execution comprises: allocating the test task items in each of the test task groups to the multiple test execution modules in the order of the feasibility parameters from large to small, wherein the higher the feasibility indicated by the feasibility parameter, the larger the feasibility parameter; and controlling the multiple test execution modules to execute the assigned test task items in the order of receiving the assigned test task items; The method of allocating the test task items in each of the test task groups to the multiple test execution modules includes: comparing the size of the task item parameters in the reference test task group and the module parameters of the test server, wherein the task item parameters are used to indicate the number of the test task items allocated by the reference test task group, and the module parameters are used to indicate the number of the test execution modules running on the test server, and the test task items in the reference test task group are allowed to be executed simultaneously with other test task items; when the task item parameters are less than or equal to the module parameters, matching a test execution module for each of the test task items in the reference test task group and allocating each of the test task items to the matched test execution module, wherein the test execution modules matched by each of the test task items are different from each other; when the task item parameters are greater than the module parameters, clustering the multiple test task items according to the attribute information of each of the test task items in the reference test task group to obtain multiple test task blocks, wherein each of the test task blocks includes one or more test task items, and only one of the multiple test task items belonging to the same test task block is executed; allocating each of the test task blocks to the multiple test execution modules.

2. The method according to claim 1, characterized in that The clustering of the multiple test task items according to the feasibility parameters corresponding to each of the multiple test task items includes: Extracting the target task item type of each test task item as the feasibility parameter; In the case where the target task item type belongs to a first type set, the test task item corresponding to the feasibility parameter is divided into a first test task group, wherein the first type set includes a task item type that is allowed to be executed simultaneously with other test task items; In the case that the target task item type belongs to a second type set, the test task item corresponding to the feasibility parameter is divided into a second test task group, wherein the second type set includes a task item type that is not allowed to be executed simultaneously with other test task items.

3. The method according to claim 1, characterized in that The allocating each of the test task blocks to the plurality of test execution modules comprises: comparing a test block parameter with a module parameter of the test server, wherein the test block parameter is used to indicate the number of the test task blocks; In the case where the test block parameter is less than or equal to the module parameter, a test execution module is matched for each of the test task blocks and each of the test task blocks is assigned to the matched test execution module, wherein the test execution modules matched by each of the test task blocks are different from each other; In the case where the test block parameter is greater than the module parameter, the multiple test task blocks are allocated to the multiple test execution modules according to the sizes of complexity parameters corresponding to the multiple test task blocks, wherein the complexity parameter is used to indicate the time required to execute the corresponding test task item, and the larger the complexity parameter is, the longer the time required to execute the corresponding test task item.

4. The method according to claim 3, characterized in that The allocating the multiple test task blocks to the multiple test execution modules according to the sizes of the complexity parameters corresponding to the multiple test task blocks includes: polling a plurality of the test execution modules; In the case of first polling of the plurality of test execution modules, allocating a test task block to the plurality of test execution modules in descending order of complexity parameters of the plurality of test task blocks; In the case of polling multiple test execution modules in other rounds except the first polling, the task blocks to be assigned are assigned to the multiple test execution modules according to the total complexity parameter of the multiple test execution modules and the complexity parameters of the task blocks to be assigned, wherein the total complexity parameter is the parameter sum of the complexity parameters of the test task blocks assigned in the corresponding test execution modules, and the task blocks to be assigned are other task blocks among the multiple test task blocks except the test task blocks that have been assigned in the first polling of the multiple test execution modules, and the task blocks to be assigned include one or more test task blocks.

5. The method according to claim 4, characterized in that In the case of polling the plurality of test execution modules in other rounds except the first polling, allocating the task blocks to be allocated to the plurality of test execution modules according to the total complexity parameters of the plurality of test execution modules and the complexity parameters of the task blocks to be allocated, including: Repeat the following steps until the multiple test execution modules are polled and the next round of polling is started to poll the multiple test execution modules again, or the polling of the multiple test execution modules is terminated when all the task blocks to be assigned have been assigned to the multiple test execution modules: Allocate the test task block with the largest complexity parameter among the task blocks to be allocated to the first test execution module with the smallest total complexity parameter among the plurality of test execution modules; Polling other test execution modules except the first test execution module among the multiple test execution modules, comparing the maximum total complexity parameter with the total complexity parameter of the second test execution module, wherein the maximum total complexity parameter is the largest total complexity parameter among the total complexity parameters corresponding to the multiple test execution modules, and the other test execution modules include the second test execution module; When the total complexity parameter of the second test execution module is greater than or equal to the maximum total complexity parameter, updating the maximum total complexity parameter according to the total complexity parameter of the second test execution module; When the total complexity parameter of the second test execution module is less than the maximum total complexity parameter, comparing the difference between the maximum total complexity parameter and the total complexity parameter of the second test execution module with the smallest complexity parameter among the multiple complexity parameters corresponding to the task block to be assigned; When the difference is greater than or equal to the minimum complexity parameter, the test task block with the largest corresponding complexity parameter in the task blocks to be assigned is taken out from the task blocks to be assigned and assigned to the second test execution module.

6. The method according to claim 1, characterized in that After controlling the plurality of test execution modules to execute the assigned test task items in the order in which the assigned test task items are received, the method further includes: Arrange multiple test task sub-results of the multiple test task items according to the correspondence between the target test task and the test task item and the test time of the test task item, wherein the test task sub-result is an execution result obtained after the test execution module executes the corresponding test task item; The test result of the server to be tested in the target server test is determined according to the multiple test task sub-results.

7. The method according to claim 1, characterized in that The step of allocating the test task items in each of the test task groups to the plurality of test execution modules running on the test server for execution includes: Multiple test task items in the target test task group are assigned to multiple test execution modules for execution, wherein the multiple test execution modules are configured to allow only one test execution module to execute the test task items in the target test task group at the same time, and the test task items in the target test task group are not allowed to be executed simultaneously with other test task items.

8. The method according to claim 1, characterized in that Before allocating the test task items in each of the test task groups to the plurality of test execution modules running on the test server for execution, the method further includes: Based on the hardware performance parameters of the test server and the time parameters of the target test task, the target number of multiple test execution modules with the highest test efficiency for the test server to execute the target server test on the server to be tested is calculated, wherein the hardware performance parameters are used to indicate the ability of the test server to run the test execution module, and the time parameters include the execution time of multiple test task items in the target test task and the waiting time for multiple test task items to meet the execution conditions.

9. The method according to claim 8, characterized in that The calculating, according to the hardware performance parameters of the test server and the time parameters of the target test task, a target number of the plurality of test execution modules with the highest test efficiency for the test server to perform the target server test on the server to be tested comprises: The target number of the plurality of test execution modules with the highest test efficiency for the test server to perform the target server test on the server to be tested is calculated by the following formula: ; Among them, N Th is the target number, N is the number of processor cores of the test server, S is the expected utilization of the processor of the test server, W is the waiting time for waiting for multiple test task items to meet the execution conditions, and R is the execution time of multiple test task items in the target test task.

10. A server testing device, characterized in that: The test server is connected to the server to be tested, and the test server executes the test task of the server to be tested through the test execution module. The device is applied to the test server, and the device includes: A conversion module, used for converting the received target test task into a plurality of test task items, wherein the target test task is used for instructing to perform a target server test on the server to be tested, and the plurality of test task items are used for implementing the target server test; A clustering module, for clustering the multiple test task items according to feasibility parameters corresponding to each of the multiple test task items to obtain one or more test task groups, wherein each of the test task groups includes one or more test task items, and the feasibility parameters are used to indicate the feasibility of executing the corresponding test task item simultaneously with other test task items in the multiple test task items; An allocation module, used for allocating the test task items in each of the test task groups to the multiple test execution modules running on the test server for execution, and obtaining the test result of the server to be tested in the target server test, wherein each test execution module is used for executing the allocated test task items in the order of feasibility from high to low indicated by the feasibility parameter; Wherein, the device is also used to traverse the feasibility parameters corresponding to each test task item, wherein the feasibility parameters are calculated based on the task attribute information of the corresponding test task item; when the feasibility parameter is greater than the parameter threshold, the test task item corresponding to the feasibility parameter is divided into a third test task group, wherein the test task items in the third test task group are allowed to be executed simultaneously with other test task items; when the feasibility parameter is less than or equal to the parameter threshold, the test task item corresponding to the feasibility parameter is divided into a fourth test task group, wherein the test task items in the fourth test task group are not allowed to be executed simultaneously with other test task items; The allocation module includes: a first allocation unit, used to allocate the test task items in each of the test task groups to the plurality of test execution modules in the order of the feasibility parameters from large to small, wherein the higher the feasibility indicated by the feasibility parameter, the larger the feasibility parameter; a control unit, used to control the plurality of test execution modules to execute the assigned test task items in the order in which the assigned test task items are received; The first allocation unit is also used to: compare the size of the task item parameters in the reference test task group and the module parameters of the test server, wherein the task item parameters are used to indicate the number of test task items allocated by the reference test task group, and the module parameters are used to indicate the number of test execution modules running on the test server, and the test task items in the reference test task group are allowed to be executed simultaneously with other test task items; when the task item parameters are less than or equal to the module parameters, match a test execution module for each test task item in the reference test task group and allocate each test task item to the matched test execution module, wherein the test execution modules matched by each test task item are different from each other; when the task item parameters are greater than the module parameters, cluster the multiple test task items according to the attribute information of each test task item in the reference test task group to obtain multiple test task blocks, wherein each test task block includes one or more test task items, and only one test task item of the multiple test task items belonging to the same test task block is executed; and allocate each test task block to multiple test execution modules.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 9 when executed by a processor.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 9 are implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Transaction test method and device, electronic equipment and storage medium

    CN113360375A

  • NFV automatic test method, apparatus and device, and storage medium

    CN114143235A