Performance testing method, device, equipment and computer-readable storage medium
By using the evaluation model to select the most suitable press resource for testing in performance testing, the problem of low matching between the press and the system under test is solved, and the accuracy of the test results is improved.
Patent Information
- Application Number
- CN202111180067.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-09
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-10-09
AI Technical Summary
In the existing performance test, the matching degree between the press and the system under test is not high, resulting in a great impact on the test results. Especially in test scenarios with a level 10,000 TPS or QPS or above, the accuracy of the test results is affected.
By obtaining the required parameters and the system parameters under test when receiving the test instructions, the evaluation model is used to determine the candidate press resources in the press resource pool, and select the most suitable target press resources for performance testing based on the network evaluation indicators and weight values.
The matching degree between the press resources and the system under test is improved, the impact of the press resources on the test results is reduced, and the accuracy of the test results is ensured.
Smart Images

Figure CN113971118B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of testing, and particularly to a performance testing method, device, equipment and computer-readable storage medium. Background Art
[0002] There is a large randomness in the method of selecting a press in existing performance testing. The selection of the press, the start / stop and synchronization of high-concurrency pressure all rely on manual operations by testers. In test scenarios with more than ten thousand TPS (Transactions Per Second, the number of transactions processed by the system per second) or QPS (Queries Per Second, the number of requests processed by the system per second), due to the low matching degree between the press manually selected by the tester and the system under test, the press has a great influence on the test results obtained from performance testing.
[0003] Therefore, how to improve the matching degree between the press and the system under test in performance testing to reduce the influence of the press on the test results is an urgent problem to be solved. Summary of the Invention
[0004] The main object of the present invention is to propose a performance testing method, device, equipment and computer-readable storage medium, aiming to solve the problem of how to improve the matching degree between the press and the system under test in performance testing to reduce the influence of the press on the test results.
[0005] To achieve the above object, the present invention provides a performance testing method, and the performance testing method includes the following steps:
[0006] When receiving a test instruction, obtain the requirement parameters and the system parameters of the system under test corresponding to the test instruction, and input the system parameters of the system under test into an evaluation model to determine candidate press resources in a press resource pool through the evaluation model;
[0007] According to the requirement parameters, determine target press resources from the candidate press resources, and perform performance testing on the system under test based on the target press resources.
[0008] Preferably, before the step of, when receiving a test instruction, obtaining the requirement parameters and the system parameters of the system under test corresponding to the test instruction, and inputting the system parameters of the system under test into an evaluation model to determine candidate press resources in a press resource pool through the evaluation model, the performance testing method includes:
[0009] Obtain the press parameters corresponding to the press resources, and based on the press parameters, construct a press resource pool to manage the press resources.
[0010] Preferably, the step of inputting the system parameters to be measured into the evaluation model to determine candidate press resources in the press resource pool through the evaluation model includes:
[0011] Input the system parameters to be measured into the evaluation model, and calculate network evaluation indicators through the evaluation model;
[0012] Determine candidate press resources in the press resource pool according to the network evaluation indicators.
[0013] Preferably, the step of inputting the system parameters to be measured into the evaluation model and calculating network evaluation indicators through the evaluation model includes:
[0014] Input the system parameters to be measured into the evaluation model to obtain the corresponding IP address and protocol information in the system parameters to be measured through the evaluation model, and determine the spatial physical distance between each press resource in the press resource pool and the system to be measured;
[0015] Calculate network evaluation indicators based on the IP address, the protocol information, and the spatial physical distance.
[0016] Preferably, the step of determining candidate press resources in the press resource pool according to the network evaluation indicators includes:
[0017] Compare the network evaluation indicators with the preset threshold to obtain a comparison result, and determine candidate press resources in the press resource pool according to the comparison result.
[0018] Preferably, the step of determining target press resources from the candidate press resources according to the demand parameters includes:
[0019] Determine the weight value between each candidate press resource in the candidate press resources and the system to be measured according to the demand parameters;
[0020] Determine target press resources from the candidate press resources according to the weight value.
[0021] Preferably, after the step of determining target press resources from the candidate press resources according to the demand parameters and performing a performance test on the system to be measured based on the target press resources, the performance test method further includes:
[0022] When a test completion instruction is received, recycle the target press resources and release the target press resources to update the press resource pool.
[0023] In addition, to achieve the above object, the present invention further provides a performance test device, and the performance test device includes:
[0024] The first determination module is configured to, when receiving a test instruction, obtain the requirement parameters and the parameters of the system under test corresponding to the test instruction, and input the parameters of the system under test into an evaluation model to determine candidate press resources in a press resource pool through the evaluation model;
[0025] The second determination module is configured to determine target press resources from the candidate press resources according to the requirement parameters, and perform a performance test on the system under test based on the target press resources.
[0026] Further, the first determination module further includes a management module, and the management module is configured to:
[0027] Obtain the press parameters corresponding to the press resources, and based on the press parameters, construct a press resource pool to manage the press resources.
[0028] Further, the first determination module is further configured to:
[0029] Input the parameters of the system under test into the evaluation model, and calculate network evaluation indicators through the evaluation model;
[0030] Determine candidate press resources in the press resource pool according to the network evaluation indicators.
[0031] Further, the first determination module is further configured to:
[0032] Input the parameters of the system under test into the evaluation model to obtain the corresponding IP address and protocol information in the parameters of the system under test through the evaluation model, and determine the spatial physical distance between each press resource in the press resource pool and the system under test;
[0033] Calculate network evaluation indicators based on the IP address, the protocol information, and the spatial physical distance.
[0034] Further, the first determination module is further configured to:
[0035] Compare the network evaluation indicators with a preset threshold to obtain a comparison result, and determine candidate press resources in the press resource pool according to the comparison result.
[0036] Further, the second determination module is further configured to:
[0037] Determine the weight value between each candidate press resource in the candidate press resources and the system under test according to the requirement parameters;
[0038] Determine target press resources from the candidate press resources according to the weight value.
[0039] Further, the second determination module further includes an update module, and the update module is configured to:
[0040] When receiving a test completion instruction, recycle the target press resources and release the target press resources to update the press resource pool.
[0041] In addition, to achieve the above object, the present invention further provides a performance testing device, which includes: a memory, a processor, and a performance testing program stored on the memory and executable on the processor. When the performance testing program is executed by the processor, the steps of the performance testing method as described above are implemented.
[0042] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a performance testing program is stored. When the performance testing program is executed by a processor, the steps of the performance testing method as described above are implemented.
[0043] In the performance testing method proposed by the present invention, when receiving a test instruction, obtain the requirement parameters and the system-under-test parameters corresponding to the test instruction, and input the system-under-test parameters into the evaluation model to determine candidate press resources in the press resource pool through the evaluation model; according to the requirement parameters, determine target press resources among the candidate press resources, and perform performance testing on the system under test based on the target press resources; the present invention determines candidate press resources in the press resource pool according to the system-under-test parameters, and determines target press resources among the candidate press resources according to the requirement parameters, improving the matching degree between the press resources and the system under test in performance testing and reducing the influence of the press resources on the test results. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment solution of the present invention;
[0045] Figure 2 is a schematic flowchart of the first embodiment of the performance testing method of the present invention;
[0046] Figure 3 is a schematic flowchart of a pressure model construction of the present invention;
[0047] Figure 4 is a schematic diagram of the management of the press resource pool of the present invention.
[0048] The realization, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0049] It should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0050] As Figure 1 shown, Figure 1 is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment solution of the present invention.
[0051] The device in the embodiment of the present invention can be a PC or a server device.
[0052] As Figure 1 shown, the device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the foregoing processor 1001.
[0053] Those skilled in the art can understand that Figure 1 the device structure shown in
[0054] As Figure 1 shown, in the memory 1005 as a computer storage medium, there may be included an operating system, a network communication module, a user interface module, and a performance test program.
[0055] Among them, the operating system is a program for managing and controlling the portable performance test device and software resources, and supports the operation of the network communication module, the user interface module, the performance test program, and other programs or software; the network communication module is used to manage and control the network interface 1004; the user interface module is used to manage and control the user interface 1003.
[0056] In Figure 1 the performance test device shown, the performance test device calls the performance test program stored in the memory 1005 through the processor 1001 and executes the operations in each embodiment of the following performance test method.
[0057] Based on the above hardware structure, an embodiment of the performance test method of the present invention is proposed.
[0058] Reference Figure 2 , Figure 2 is a schematic flowchart of the first embodiment of the performance testing method of the present invention. The method includes:
[0059] Step S10, when receiving a test instruction, obtain the requirement parameters and the system under test parameters corresponding to the test instruction, and input the system under test parameters into the evaluation model to determine candidate press resources in the press resource pool through the evaluation model;
[0060] Step S20, determine the target press resource from the candidate press resources according to the requirement parameters, and perform a performance test on the system under test based on the target press resource.
[0061] The performance testing method of this embodiment is applied to the performance testing device of a financial institution. The performance testing device can be a PC or a terminal. For the convenience of description, the performance testing device is taken as an example for description below. When the performance testing device receives a test instruction, it obtains the requirement parameters and the system under test parameters corresponding to the test instruction, and inputs the system under test parameters into the evaluation model. The network evaluation index is calculated through the evaluation model. According to the network evaluation index, candidate press resources are determined in the press resource pool. The performance testing device determines the weight value between each candidate press resource in the candidate press resources and the system under test according to the requirement parameters, and determines the target press resource from the candidate press resources according to the weight value. The performance testing device performs a performance test on the system under test through the target press resource. It should be noted that the requirement parameters are set by relevant users and are mainly used to describe the conditions under which the system under test performs a performance test. The system under test parameters can be input into the performance testing device by relevant users, or can be automatically obtained after the performance testing device is connected to the system under test. The system under test parameters include, but are not limited to, the IP address and protocol information of the system under test. The evaluation model is set by relevant R & D personnel and includes, but is not limited to, the calculation formula of the network evaluation index.
[0062] For the performance testing method of this embodiment, when receiving a test instruction, obtain the requirement parameters and the system under test parameters corresponding to the test instruction, and input the system under test parameters into the evaluation model to determine candidate press resources in the press resource pool; determine the target press resource from the candidate press resources according to the requirement parameters, and perform a performance test on the system under test based on the target press resource. The present invention determines candidate press resources in the press resource pool according to the system under test parameters, and determines the target press resource from the candidate press resources according to the requirement parameters, improving the matching degree between the press resources and the system under test in performance testing to reduce the influence of the press resources on the test results.
[0063] The following will explain each step in detail:
[0064] Step S10, when a test instruction is received, obtain the requirement parameters and the parameters of the system under test corresponding to the test instruction, and input the parameters of the system under test into the evaluation model to determine candidate press resources in the press resource pool through the evaluation model;
[0065] In this embodiment, when the performance testing device receives a test instruction, it obtains the requirement parameters and the parameters of the system under test corresponding to the test instruction, and inputs the parameters of the system under test into the evaluation model to determine candidate press resources in the press resource pool through the evaluation model. For example, optionally, when generating the corresponding test instruction, the relevant tester sets the corresponding requirement parameters and the parameters of the system under test in the test instruction. When the performance testing device receives the test instruction, it directly obtains the corresponding requirement parameters and the parameters of the system under test from the test instruction. Optionally, when generating the test instruction, the relevant tester does not set the requirement parameters and the parameters of the system under test in the test instruction, but first inputs the requirement parameters and the parameters of the system under test into the performance testing device, and then sends the test instruction to the performance testing device. When the performance testing device receives the test instruction, it directly obtains the corresponding requirement parameters and the parameters of the system under test. When the performance testing device obtains the corresponding requirement parameters and the parameters of the system under test, it inputs the parameters of the system under test into the evaluation model to determine candidate press resources in the press resource pool through the evaluation model.
[0066] Specifically, the step of inputting the parameters of the system under test into the evaluation model to determine candidate press resources in the press resource pool includes:
[0067] Step a, input the parameters of the system under test into the evaluation model, and calculate the network evaluation index through the evaluation model;
[0068] In this step, the performance testing device inputs the parameters of the system under test into the evaluation model, and calculates the network evaluation metrics through the evaluation model. The network evaluation metrics are calculated based on four metric values corresponding to each press resource in the press resource pool and the system under test, namely, network delay, network hop count, network similarity, and network status. For example, the performance testing device inputs the parameters of the system under test into the evaluation model. The evaluation model executes the ping command on each press resource according to the IP address in the parameters of the system under test to connect to the system under test, and obtains the network delay between the press resource and the system under test according to the filtering rules. The evaluation model executes the traceroute command on each press resource according to the IP address in the parameters of the system under test to determine the connection path between the press resource and the system under test, detects the number of gateways passed from the press resource that sends the data packet to the system under test, and counts the network hop count between the press resource and the system under test within a certain time period according to the number of gateways. The evaluation model evaluates the network similarity between the press resource and the system under test by performing similarity matching between the IP address of the press resource and the IP address of the system under test, and combining the physical distance between the press resource and the server. The evaluation model obtains the baseline average response time metric through a baseline pressure probing test between the press resource and the network of the system under test, and determines the network status between the press resource and the network of the system under test according to the baseline average response time. After the evaluation model determines the network delay, network hop count, network similarity, and network status corresponding to each press resource and the system under test, it calculates the network evaluation metric corresponding to each press resource according to the network delay, network hop count, network similarity, and network status. It should be noted that the ping command is used to determine whether two systems can successfully exchange (send and receive) data packets. According to the returned information, it can be inferred whether the TCP / IP parameters are set correctly, whether the operation is normal, and whether the network is unobstructed, etc. The traceroute command can be used to determine the routing path of network data packets from one system to another system. The IP address (Internet Protocol Address) refers to the Internet protocol address. The IP address is usually expressed in the form of "dotted decimal" as (a.b.c.d), where a, b, c, and d are all decimal integers between 0 and 255. For example: 192.168.0.1, 192.168.1.1, 192.127.0.1, etc. When the system under test contains multiple servers, that is, correspondingly, the system under test contains multiple IP addresses, the evaluation model needs to calculate the network evaluation metrics corresponding to each press resource and each server in the system under test.
[0069] Further, step a includes:
[0070] Input the parameters of the system under test into the evaluation model to obtain the corresponding IP address and protocol information in the parameters of the system under test through the evaluation model, and determine the spatial physical distance between each press resource in the press resource pool and the system under test;
[0071] In this step, the performance testing device inputs the parameters of the system under test into the evaluation model to obtain the corresponding IP address and protocol information in the parameters of the system under test through the evaluation model, and determine the spatial physical distance between each press resource in the press resource pool and the system under test. Further, when there are multiple servers in the system under test, correspondingly, there are multiple IP addresses and multiple protocol information in the system under test, and there are also differences in the spatial physical distance between each press resource in the press resource pool and each server in the system under test.
[0072] Calculate network evaluation metrics based on the IP address, the protocol information, and the spatial physical distance.
[0073] In this step, after the performance testing device obtains the corresponding IP address and protocol information in the parameters of the system under test through the evaluation model, and determines the spatial physical distance between each press resource in the press resource pool and the system under test, it calculates network evaluation metrics based on the IP address, the protocol information, and the spatial physical distance;
[0074] In one embodiment, the performance testing device executes the ping command on each press resource, where the parameters of the ping command include the IP address of the system under test and the number of executions n. To exclude the influence of network jitter on network latency, after obtaining the ping values of n executions, discard the first m values, and take the average of the remaining n - m ping values to obtain the network latency Lat ps :
[0075] Lat ps = ∑ping / (n - m)
[0076] where n and m are set in advance by relevant R & D personnel in the performance testing device. If an error or timeout occurs such that the press resource cannot ping the system under test, set the network latency Lat ps to -1.
[0077] The performance testing device executes the traceroute command on each press resource. The parameters of the traceroute command include the IP address of the system under test and the execution time period [t b , t e, determine the connection path between the press resources and the system under test, detect the number of gateways passed from the press resources sending data packets to the system under test, and count the number of hops during the execution period based on the number of gateways. For situations where the number of gateways cannot be detected, etc., set the network hop count Cnt ns to -1.
[0078] Based on obtaining the spatial physical distance Dis py between the press resources and the system under test, where the spatial physical distance includes whether the press resources and the system under test belong to the same network domain, the area size of the network domain, whether they are in the same city, in the same computer room, etc., calculate the network similarity Sim ip between the IPs of the press resources and the system under test. For example, if three different press resources are in different cities or different computer rooms, and their IPv4 network IP addresses are 192.168.0.1, 192.168.1.1, and 192.127.0.1 respectively, and the IP address of the system under test is 192.168.1.2, then starting from the first bit field, compare the IP address corresponding to the press resource with the IP address corresponding to the system under test, and take the absolute value difference IP pt -IP sr | of each bit field similarity distance, and calculate the ratio of the product of the 4-bit field differences corresponding to each press resource and the spatial physical distance to obtain the network similarity Sim ip :
[0079]
[0080] where n represents the number of bit fields in the IP address, IP pt represents the bit field corresponding to the IP address of the system under test, IP sr represents the bit field corresponding to the IP address of the press resource, and Dis py is the spatial physical distance between the press resources and the system under test.
[0081] The performance testing device determines the network condition Arc pnWhen it comes to the simulated network speed measurement between the press resources and the system under test, the simulated network speed measurement process mainly includes three steps: benchmark script preparation, Mock system deployment, and benchmark testing: (1) The performance testing device obtains the protocol information of the system under test and sets up a basic script on the press resources. The benchmark script includes simple HTTP protocol requests and socket protocol requests; (2) The performance testing device deploys a Mock system in the system under test. The Mock system includes short request-response HTTP and socket baffle applications with the request message size less than the preset byte length; (3) The performance testing device sends data packets to the Mock system deployed on the system under test through the basic script set on the pressure resources respectively with a quantitative concurrency and a fixed-length growth increment of concurrency to conduct a benchmark stress test, obtains the average response time Avt of the network between the press resources and the system under test under the benchmark test conditions, and then takes the value of the distribution dispersion of the average response time under all concurrency conditions by region to obtain the network condition Arc pn , and the calculation formula is as follows:
[0082]
[0083] where n is the total number of concurrent users, Δt is the fixed-length growth increment of concurrent users, Avt is the average response time under different numbers of concurrent users, and t represents the distribution dispersion. If it is impossible to perform automatic deployment and benchmark testing due to permissions in the environment under test or other factors, then the network condition Arc pn is set to -1.
[0084] The performance testing device calculates the network evaluation index Net corresponding to each press resource based on network delay, network hop count, network similarity, and network condition s , and the calculation formula is as follows:
[0085] Net s =(AVG(Lat ps / min(Lat ps )))*(AVG(Cnt ns / max(Cnt ns )))+Sim ip +Arc pn
[0086] where AVG represents taking the mean value. Lat ps and Cnt ns will have multiple groups of test records. Therefore, the mean values need to be taken separately and then used to calculate the network evaluation index. The smaller the network evaluation index Net s , the better the network condition. When the value of some parameters is -1, they are not put into the above formula for calculation.
[0087] Step b: Determine candidate press resources in the press resource pool according to the network evaluation metrics.
[0088] In this step, after obtaining the network evaluation metrics corresponding to each press resource, the performance testing device compares the network evaluation metrics with a preset threshold to obtain a comparison result, and determines candidate press resources in the press resource pool according to the comparison result.
[0089] Further, step b includes:
[0090] Compare the network evaluation metrics with the preset threshold to obtain a comparison result, and determine candidate press resources in the press resource pool according to the comparison result.
[0091] In this step, the performance testing device compares each press resource in the press resource pool with the network evaluation metrics corresponding to the system under test and the preset threshold to obtain a comparison result, and determines candidate press resources in the press resource pool according to the comparison result. For example, relevant personnel set a preset threshold in the performance testing device. After the performance testing device obtains the network evaluation metrics corresponding to each press resource in the press resource pool and the system under test, it compares the network evaluation metrics with the preset threshold, and takes the press resources whose network evaluation metrics are greater than or equal to the preset threshold as candidate press resources. Optionally, the preset thresholds set by relevant personnel on the performance testing device include network delay threshold, network hop count threshold, network similarity threshold, and network status threshold. The performance testing device determines candidate press resources by comparing the network delay, network hop count, network similarity, and network status corresponding to each press resource with the corresponding network delay threshold, network hop count threshold, network similarity threshold, and network status threshold respectively.
[0092] Step S20: Determine target press resources from the candidate press resources according to the demand parameters, and perform performance testing on the system under test based on the target press resources.
[0093] In this embodiment, after the performance testing device obtains the requirement parameters, it determines the target press resource from the candidate press resources according to the requirement parameters, and performs performance testing on the system under test based on the target press resource. For example, the performance testing device determines the requirements of the test scenario corresponding to the system under test according to the requirement parameters, obtains the distribution of the servers in the system under test and the availability of the press resources, and determines the weight value between the candidate press resources and the system under test according to the requirements of the test scenario, the distribution of the servers in the system under test, and the availability of the candidate press resources. Sort the weights corresponding to the candidate press resources, and determine the target press resource from the candidate press resources according to the sorting result, and send data packets to the system under test based on the target press resource to perform performance testing on the system under test.
[0094] Specifically, the step of determining the target press resource from the candidate press resources according to the requirement parameters includes:
[0095] Step c, determining the weight value between each candidate press resource in the candidate press resources and the system under test according to the requirement parameters;
[0096] In this step, the performance testing device determines the requirements of the test scenario corresponding to the system under test according to the requirement parameters, obtains the distribution of the servers in the system under test and the availability of the press resources, and determines the weight value between each candidate press resource in the candidate press resources and the system under test. For example, for the requirements of the test scenario corresponding to the system under test that the TPS / QPS needs to reach a certain threshold and the network latency needs to reach the target threshold, the performance testing device compares the network latency corresponding to each candidate press resource with the target threshold, and then combines the distribution of the servers in the system under test and the availability of the press resources to further determine the weight value corresponding to each candidate press resource. For the requirements of the test scenario corresponding to the system under test that the TPS / QPS needs to reach a certain threshold and multiple network latencies are required, and each network latency needs to reach the corresponding target threshold, the performance testing device groups the candidate press resources according to the requirements of the multiple network latencies, compares the network latency corresponding to each candidate press resource with the corresponding target threshold, and then combines the distribution of the servers in the system under test and the availability of the press resources to further determine the weight value corresponding to each candidate press resource in each group. For the requirements of the test scenario corresponding to the system under test that the TPS / QPS needs to reach a certain threshold and multiple network latencies are not required, the performance testing device directly determines the weight value corresponding to each candidate press resource according to the network evaluation index corresponding to each press resource in the candidate press resources.
[0097] Step d, determining the target press resource from the candidate press resources according to the weight value.
[0098] In this step, after obtaining the weight value corresponding to each candidate press resource, the performance testing device sorts the weight values in descending order. According to the sorting result, it selects the candidate press resource ranked first, and determines the target press resource based on the sorting and the network delay, network hop count, network similarity, and network status corresponding to the candidate press resource. For example, the performance testing device compares the network delay, network hop count, network similarity, and network status corresponding to the candidate press resources ranked before the weight threshold with the corresponding network delay threshold, network hop count threshold, network similarity threshold, and network status threshold respectively according to the sorting, and determines the target press resource based on the comparison result.
[0099] Optionally, (1) if the comparison result shows that the network delay, network hop count, network similarity, and network status corresponding to the candidate press resources ranked before the weight threshold are all greater than the corresponding network delay threshold, network hop count threshold, network similarity threshold, and network status threshold respectively, then directly determine the corresponding target press resource at this time; if there are multiple target press resources, select the candidate press resource with the shortest network delay, the fewest network hop counts, the most similar network similarity, and the best network status as the target press resource; if there are multiple servers in the system under test and multiple target press resources need to be determined, then select the candidate press resource with the shortest network delay, the fewest network hop counts, the most similar network similarity, and the best network status between each server and the target press resource respectively as the target press resource.
[0100] (2) If the comparison result shows that the network delay, network hop count, network similarity, and network status corresponding to the candidate press resources ranked before the weight threshold are not all greater than the corresponding network delay threshold, network hop count threshold, network similarity threshold, and network status threshold, then display all the candidate press resources ranked before the weight threshold to the user, and the user selects the network delay, network hop count, network similarity, and network status, and then determines the target press resource.
[0101] (3) If the comparison result shows that the network delay, network hop count, network similarity, and network status corresponding to the candidate press resources ranked before the weight threshold are all less than the corresponding network delay threshold, network hop count threshold, network similarity threshold, and network status threshold, that is, the network status between all the press resources in the current candidate press resources and the server under test is poor, then it can be prompted that the system administrator maintains the press resource pool, and re-determine the target press resource according to the requirement parameters and the system parameters under test. It can also display all the candidate press resources to the user, and the user independently determines the corresponding target press resource.
[0102] When the performance testing device in this embodiment receives a test instruction, it obtains the required parameters corresponding to the test instruction and the parameters of the system under test, and inputs the parameters of the system under test into the evaluation model. The network evaluation index is calculated through the evaluation model, and according to the network evaluation index, candidate press resources are determined in the press resource pool; the performance testing device determines the weight value between each candidate press resource in the candidate press resources and the system under test according to the required parameters, and determines the target press resource among the candidate press resources according to the weight value; the performance testing device performs performance testing on the system under test through the target press resource, improving the matching degree between the press resource and the system under test in performance testing and reducing the influence of the press resource on the test result.
[0103] Further, based on the first embodiment of the performance testing method of the present invention, a second embodiment of the performance testing method of the present invention is proposed.
[0104] The difference between the second embodiment of the performance testing method and the first embodiment of the performance testing method is that before step S10, the performance testing method further includes:
[0105] Step e, obtaining the press parameters corresponding to the press resources, and constructing a press resource pool based on the press parameters to manage the press resources.
[0106] In this embodiment, the performance testing device obtains the press parameters corresponding to the press resources, and constructs a press resource pool based on the press parameters to manage the press resources; for example, the performance testing device obtains the press parameters corresponding to the press resources, and the press parameters include the IP address corresponding to the press resources, etc., and constructs a press resource pool according to the press parameters. When there are newly added, deleted, or changed press resources, the newly added, deleted, or changed press resources uniformly provide the corresponding press parameters to the performance testing device, and the performance testing device can detect the usage situation of each press resource in the press resource pool to uniformly manage the press resources.
[0107] In this embodiment, the performance testing device obtains the press parameters corresponding to the press resources, and constructs a press resource pool based on the press parameters to manage the press resources, enabling the performance testing device to efficiently obtain press resources, helping to improve the matching degree between the press resources and the system under test in performance testing, and reducing the influence of the press resources on the test result.
[0108] Further, based on the first and second embodiments of the performance testing method of the present invention, a third embodiment of the performance testing method of the present invention is proposed.
[0109] The difference between the third embodiment of the performance testing method and the first and second embodiments of the performance testing method is that after step S20, the performance testing method further includes:
[0110] Step f, when receiving a test completion instruction, recycle the target press resources and release the target press resources to update the press resource pool.
[0111] In this embodiment, when the performance testing device receives a test completion instruction, it recycles the target press resources and releases the target press resources to update the press resource pool. For example, in a performance test in progress, 3 target press resources are used. At this time, if other performance tests need to be carried out, the 3 target press resources that have been called cannot be called again. When the ongoing performance test ends, the performance testing device will receive the corresponding test completion instruction. The performance testing device determines and recycles the 3 target press resources called by the corresponding performance test according to the corresponding test completion instruction, and releases the 3 target press resources to update the press resource pool. When other performance tests need to be carried out, the corresponding target press resources can be determined from the updated press resource pool.
[0112] In this embodiment, when the performance testing device receives a test completion instruction, it recycles the target press resources and releases the target press resources to update the press resource pool, so that the press resource pool can be updated in time, improving the reuse efficiency of the press resources, helping to improve the matching degree between the press resources and the system under test in the performance test, and reducing the impact of the press resources on the test results.
[0113] In specific implementation, as Figure 3 shown, a user who needs to perform a performance test on the system initiates a user application. The user application includes user requirements and a test instruction. When the performance testing device receives the test instruction, it decomposes the user requirements to obtain the resources of the system under test (parameters of the system under test), pressure requirements, and concurrency mode (requirement parameters). The performance testing device evaluates each press resource in the press resource pool according to the resources of the system under test, pressure requirements, and concurrency mode. The evaluation mainly includes the network delay, network hop count, network similarity, and network status between each press resource and the system under test. The network status is obtained through a benchmark test between the press resource and the system under test. The performance testing device performs press allocation according to the results of the press evaluation. The press allocation mainly includes concurrency model matching and weight allocation to determine the press resource that best matches the system under test, and performs a performance test on the system under test through this press resource. After the test is completed, the press resources are maintained and the press resource pool is updated.
[0114] As Figure 4As shown, the performance testing device (stress testing platform) establishes a press resource pool. The press resources for new addition, deletion, and change uniformly provide registration information to the performance testing device. The performance testing device can detect the usage of press resources and centrally manage the press resource pool. When a user applies for press resources from the performance testing device, the performance testing device evaluates the press resources in the press resource pool according to the evaluation model and allocation strategy, calculates the press weights, constructs a pressure model in combination with the user's performance golden index requirements, and allocates press resources to the user. After the use of the press resources ends, the user returns the press resources, and the performance testing device releases the press resources and updates the press resource pool.
[0115] The present invention also provides a performance testing device. The performance testing device of the present invention includes:
[0116] A first determination module, configured to, when receiving a test instruction, obtain the demand parameters and the measured system parameters corresponding to the test instruction, and input the measured system parameters into an evaluation model to determine candidate press resources in the press resource pool through the evaluation model;
[0117] A second determination module, configured to determine target press resources from the candidate press resources according to the demand parameters, and perform performance testing on the measured system based on the target press resources.
[0118] Further, the first determination module further includes a management module, and the management module is configured to:
[0119] Obtain the press parameters corresponding to the press resources, and construct a press resource pool based on the press parameters to manage the press resources.
[0120] Further, the first determination module is further configured to:
[0121] Input the measured system parameters into the evaluation model, and calculate network evaluation indicators through the evaluation model;
[0122] Determine candidate press resources in the press resource pool according to the network evaluation indicators.
[0123] Further, the first determination module is further configured to:
[0124] Input the measured system parameters into the evaluation model to obtain the corresponding IP address and protocol information in the measured system parameters through the evaluation model, and determine the spatial physical distance between each press resource in the press resource pool and the measured system;
[0125] Calculate network evaluation indicators based on the IP address, the protocol information, and the spatial physical distance.
[0126] Further, the first determination module is further configured to:
[0127] Compare the network evaluation metrics with the preset threshold to obtain a comparison result, and determine candidate press resources in the press resource pool according to the comparison result.
[0128] Further, the second determination module is further configured to:
[0129] Determine the weight value between each candidate press resource in the candidate press resources and the system under test according to the demand parameters;
[0130] Determine the target press resource from the candidate press resources according to the weight value.
[0131] Further, the second determination module further includes an update module, and the update module is configured to:
[0132] When receiving a test completion instruction, recycle the target press resource and release the target press resource to update the press resource pool.
[0133] The present invention also provides a performance testing device.
[0134] The performance testing device includes: a memory, a processor, and a performance testing program stored on the memory and executable on the processor. When the performance testing program is executed by the processor, the steps of the performance testing method as described above are implemented.
[0135] Wherein, the method implemented when the performance testing program running on the processor is executed can refer to the various embodiments of the performance testing method of the present invention, which will not be elaborated here.
[0136] The present invention also provides a computer-readable storage medium.
[0137] A performance testing program is stored on the computer-readable storage medium. When the performance testing program is executed by a processor, the steps of the performance testing method as described above are implemented.
[0138] Wherein, the method implemented when the performance testing program running on the processor is executed can refer to the various embodiments of the performance testing method of the present invention, which will not be elaborated here.
[0139] It should be noted that, in this text, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or system comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or system. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or system comprising such element.
[0140] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0141] From the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0142] The above are only the preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the description and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A performance testing method, characterized in that, The performance testing method includes the following steps: When receiving a test instruction, obtain the requirement parameters and the system under test parameters corresponding to the test instruction, and input the system under test parameters into an evaluation model to determine candidate press resources in the press resource pool through the evaluation model; According to the requirement parameters, determine the target press resources from the candidate press resources, and perform performance testing on the system under test based on the target press resources; The step of inputting the system under test parameters into an evaluation model to determine candidate press resources in the press resource pool through the evaluation model includes: Input the system under test parameters into the evaluation model, and calculate network evaluation indicators through the evaluation model, where the network evaluation indicators are calculated from four indicator values of the network delay, network hop count, network similarity, and network status corresponding to each press resource in the press resource pool and the system under test; Determine candidate press resources in the press resource pool according to the network evaluation indicators; Among them, through the evaluation model, according to the IP address in the system under test parameters, execute the traceroute command on each press resource to determine the connection path between the press resource and the system under test, detect the number of gateways passed between the press resource sending the data packet and the system under test, and count the network hop count between the press resource and the system under test within a certain time period according to the number of gateways.
2. The performance testing method according to claim 1, wherein Before the step of when receiving a test instruction, obtaining the requirement parameters and the system under test parameters corresponding to the test instruction, and inputting the system under test parameters into an evaluation model to determine candidate press resources in the press resource pool through the evaluation model, the performance testing method includes: Obtain the press parameters corresponding to the press resources, and based on the press parameters, construct a press resource pool to manage the press resources.
3. The performance testing method according to claim 1, wherein The step of inputting the system under test parameters into the evaluation model and calculating network evaluation indicators through the evaluation model includes: Input the system under test parameters into the evaluation model to obtain the corresponding IP address and protocol information in the system under test parameters through the evaluation model, and determine the spatial physical distance between each press resource in the press resource pool and the system under test; Calculate network evaluation indicators based on the IP address, the protocol information, and the spatial physical distance.
4. The performance testing method according to claim 1, wherein The step of determining candidate press resources in the press resource pool according to the network evaluation indicators includes: Compare the network evaluation indicators with a preset threshold to obtain a comparison result, and determine candidate press resources in the press resource pool according to the comparison result.
5. The performance testing method according to claim 1, wherein The step of determining target press resources from the candidate press resources according to the requirement parameters includes: According to the requirement parameters, determine the weight value between each candidate press resource in the candidate press resources and the system under test; Determine the target press resources from the candidate press resources according to the weight value.
6. The performance testing method according to claim 1, wherein, After the step of determining a target press resource from the candidate press resources according to the demand parameter and performing a performance test on the system under test based on the target press resource, the performance test method further includes: When a test completion instruction is received, recycle the target press resource and release the target press resource to update the press resource pool.
7. A performance testing device, characterized in that, The performance test device includes: A first determination module, configured to, when a test instruction is received, obtain a demand parameter and a system under test parameter corresponding to the test instruction, and input the system under test parameter into an evaluation model to determine candidate press resources from a press resource pool through the evaluation model; A second determination module, configured to determine a target press resource from the candidate press resources according to the demand parameter, and perform a performance test on the system under test based on the target press resource; The second determination module is further configured to input the system under test parameter into the evaluation model, and calculate a network evaluation index through the evaluation model, where the network evaluation index is calculated from four index values of network delay, network hop count, network similarity, and network status corresponding to each press resource in the press resource pool and the system under test; determine candidate press resources from the press resource pool according to the network evaluation index; where the evaluation model executes a traceroute command on each press resource according to the IP address in the system under test parameter to determine the connection path between the press resource and the system under test, detect the number of gateways passed between the press resource that sends the data packet and the system under test, and count the network hop count between the press resource and the system under test within a certain time period according to the number of gateways.
8. A performance testing device, characterized in that, The performance test device includes: a memory, a processor, and a performance test program stored on the memory and executable on the processor, where when the performance test program is executed by the processor, the steps of the performance test method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that, A performance test program is stored on the computer-readable storage medium, and when the performance test program is executed by a processor, the steps of the performance test method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Automatic performance testing method, device and system
CN107992362A