System performance test method and system based on user behavior simulation
Through a system performance testing method based on user behavior simulation, combined with a random walk algorithm and traffic model, a real user behavior sequence and dynamic traffic curve are generated, which solves the problem that existing testing methods cannot truly reflect the actual scenarios, and achieves more accurate and comprehensive system performance testing.
Patent Information
- Application Number
- CN202411878101.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-11
AI Technical Summary
Existing system performance testing methods rely on historical data or fixed test data, and cannot truly reflect the complex scenarios in the system's carrying environment and user behavior in actual scenarios, resulting in large deviations from the actual operation, which may lead to performance problems being exposed, causing system crashes or major business losses.
The system performance testing method based on user behavior simulation is adopted. By obtaining the business nodes and business logic of the system under test, the user behavior sequence is generated by combining heuristic weights and random perturbation random walk algorithm, and the traffic growth and fallback process is simulated through the logical Stie growth model and entropy increase model, a dynamic traffic peak curve is generated, and the user behavior sequence is scheduled according to the curve for stress testing.
It can more realistically simulate the user's complex operation paths, cover diverse scenarios, accurately test the performance of the system under complex traffic conditions, discover potential performance bottlenecks and abnormalities of the system, improve the accuracy and coverage of the test, and avoid test blind spots and inaccurate results caused by fixed behavior patterns.
Smart Images

Figure CN119806985A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system testing, and in particular to a system performance testing method and system based on user behavior simulation. Background Art
[0002] System performance testing is a testing method that verifies the system's responsiveness, stability, resource utilization and other performance indicators under different load conditions by simulating actual usage scenarios (such as user behavior and load conditions). The purpose is to ensure that the system can still operate normally under high load or complex scenarios and meet the expected performance standards. The system can be an operating system, application, security component or third-party service program.
[0003] Testing system performance can ensure that the system can run stably and efficiently in actual use. Performance testing can identify bottlenecks, optimize resource utilization, and prevent performance degradation or system crashes caused by high concurrency or sudden loads, thereby improving user experience, reducing downtime risks, and ensuring business continuity.
[0004] However, the existing system performance testing process is mostly based on the system's historical operating data, or uses fixed test data for testing. However, there is no historical data for newly launched systems or applications, or the historical data is seriously insufficient. Therefore, if you only rely on historical data for testing or use fixed test data for testing, it will not be able to reflect the system's carrying environment in real scenarios, and it will not be able to cover the complex scenarios in real user behavior, resulting in a large deviation between the test results and the actual operation status, which may directly lead to performance problems being exposed after going online, causing system crashes or significant business losses. Summary of the invention
[0005] In order to solve the technical problems that the prior art only relies on historical data for testing or uses fixed test data for testing, which cannot reflect the system's carrying environment in real scenarios and cannot cover complex scenarios in real user behaviors, resulting in a large deviation between the test results and the actual operating conditions, which may directly lead to performance problems being exposed after going online, causing system crashes or major business losses, the present invention provides a system performance testing method and system based on user behavior simulation.
[0006] The technical solution provided by the embodiment of the present invention is as follows:
[0007] First aspect
[0008] An embodiment of the present invention provides a system performance testing method based on user behavior simulation, comprising:
[0009] S1: Obtain the business nodes of the system under test and the business logic that describes the jump paths between each business node;
[0010] S2: Based on business logic, a random walk algorithm with heuristic weights and random perturbations is used to generate a user behavior sequence that describes the order in which users visit each business node;
[0011] S3: Taking the maximum carrying capacity of the system under test as a constraint, the logistic growth model and entropy increase model are used to simulate the flow growth process and flow decline process respectively, and a dynamic flow peak curve that conforms to the natural behavior of users is generated;
[0012] S4: Schedule user behavior sequences according to the dynamic traffic peak curve to perform multiple test types of stress tests on the system under test;
[0013] S5: Collect performance data during the test;
[0014] S6: extract mutation data from performance data through sliding window;
[0015] S7: Output the performance data and the corresponding mutation data as the performance test result of the system under test.
[0016] Second aspect
[0017] An embodiment of the present invention provides a system performance testing system based on user behavior simulation, comprising:
[0018] processor;
[0019] A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the system performance testing method based on user behavior simulation as described in the first aspect is implemented.
[0020] The third aspect
[0021] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the system performance testing method based on user behavior simulation as described in the first aspect is implemented.
[0022] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0023] In the present invention, the service nodes of the system under test and the service logic describing the jump paths between the service nodes are first obtained, and then the user behavior sequence describing the order of users accessing the service nodes is generated based on the service logic combined with the random walk algorithm with heuristic weights and random perturbations, which can more realistically simulate the complex operation paths of actual users, cover a variety of scenarios, and avoid test blind spots and inaccurate test results caused by fixed behavior patterns during the test. Then, with the maximum carrying capacity of the system under test as a constraint, the flow growth process and the flow decline process are simulated respectively by the logistic growth model and the entropy increase model, and a dynamic flow peak curve that conforms to the natural behavior of the user is generated. Finally, the injection test of the user behavior sequence is performed according to the peak curve, which can be closer to the fluctuation characteristics of the actual user flow, especially in peak and burst flow scenarios, and the system's carrying capacity and stability can be tested more accurately, thereby comprehensively evaluating the system's performance under complex flow conditions. In addition, a sliding window is used to extract mutation data from the performance data obtained from the test, which can better discover abnormal performance of the system under test during the test process, rather than just focusing on the final test results. This helps to discover more detailed vulnerabilities in the system under test, and can assist developers in making more targeted improvements to the system under test, thereby improving test effectiveness and pertinence, helping to quickly discover potential vulnerabilities in the system under test, and completing more accurate system testing. In the absence of historical data, accurate and efficient system testing can be performed using data that conforms to actual user behavior. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 A flowchart of a system performance testing method based on user behavior simulation provided by an embodiment of the present invention;
[0026] Figure 2 A schematic diagram of the structure of a system performance testing system based on user behavior simulation provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0028] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0029] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0030] Reference Manual Attached Figure 1 , shows a flow chart of a system performance testing method based on user behavior simulation provided by an embodiment of the present invention.
[0031] The embodiment of the present invention provides a system performance testing method based on user behavior simulation, which can be implemented by a system performance testing device based on user behavior simulation, and the system performance testing device based on user behavior simulation can be a terminal or a server. The processing flow of the system performance testing method based on user behavior simulation can include the following steps:
[0032] S1: Obtain the business nodes of the system under test and the business logic that describes the jump paths between the business nodes.
[0033] Among them, the system under test refers to the target system that needs to be performance tested, such as e-commerce websites, banking systems, enterprise application systems, etc., including its software, hardware and related services. Business nodes refer to modules or operation points in the system that perform specific functions, such as login pages, product browsing pages, shopping carts, payment pages, etc. Jump paths refer to the operation paths of users from one business node to another, such as jumping from the login page to the product browsing page, and then to the shopping cart page. Business logic refers to the rules and processes for jumping between various business nodes in the system, reflecting the functional structure of the system and the sequence of user operations, such as the process of "login first and then pay". By obtaining the business nodes of the system under test and its jump paths and business logic, the functional operation model of the system can be clearly constructed, which provides a basis for the real simulation of subsequent user behavior and ensures that the performance test covers all key processes and functional scenarios.
[0034] In a possible implementation, the service node includes multiple start nodes, multiple intermediate nodes, and multiple end nodes, and the service logic is a jump path from the start node through different intermediate nodes to the end node.
[0035] Among them, the starting node is the starting point of the user operation, such as the login page, home page, etc., which is the starting position of the process in the business logic. The intermediate node is the functional point or page that the user may pass through during the operation, such as the product browsing page, search results page, shopping cart, etc., which is the intermediate link in the process. The terminal node is the end point of the user operation, such as the payment completion page, order confirmation page, etc., which is the final goal of the process in the business logic. The business node consists of the starting node, the intermediate node and the terminal node. The business logic describes the complete process of the user operation by defining the jump path of the user from the starting node to the terminal node through different intermediate nodes, ensuring that the test covers all functional paths and user behavior scenarios of the system.
[0036] S2: Based on business logic, a random walk algorithm with heuristic weights and random perturbations is used to generate a user behavior sequence that describes the order in which users visit each business node.
[0037] Among them, the heuristic weight is the weight assigned to the priority of jumping between business nodes according to the business logic, reflecting the possibility of actual user operations. For example, the probability of a user jumping from a browsing page to a shopping cart may be higher than directly jumping to a payment page. In the random walk process, in order to increase unpredictability, a random factor is added to make the jump behavior have a certain degree of randomness, thereby simulating irrational operations or sudden behaviors of users. The random walk algorithm is a probability-based path generation algorithm. Starting from the starting node, according to the jump probability (heuristic weight) and random perturbation, the next node is selected in turn until the end node is reached, generating a complete user operation path. The user behavior sequence refers to the order of business nodes that a user passes through when accessing the system, such as "login → browse products → add shopping cart → pay". This sequence simulates the real operation behavior of users.
[0038] It should be noted that by combining heuristic weights with a random walk algorithm with random perturbations, a user behavior sequence is generated that describes the order in which users visit each business node. This not only ensures the diversity and rationality of the operation paths, but also covers possible complex paths in real scenarios, especially for efficient simulation of uncommon but possible paths, thereby improving the comprehensiveness and coverage of performance testing.
[0039] In a possible implementation, S2 specifically includes:
[0040] S201: Construct a directed graph about business logic:
[0041] G=(V,E)
[0042] Among them, G represents a directed graph, V represents a set of business nodes, and E represents a set of edges obtained based on business logic.
[0043] S202: Determine the jump probability of each service node in the directed graph by combining the heuristic weight and the random disturbance:
[0044]
[0045]
[0046] Where P(j|i) represents the jump probability from service node i to service node j, and w ij represents the weight of jumping from service node i to service node j, N(i) represents the set of neighboring service nodes of node i in the directed graph, and w ik represents the weight of the neighbor node k that jumps from business node i to business node i, dist(j,s end ) represents the jth node to the terminal node s that conforms to the business logic end The shortest distance between represents the heuristic weight, out degree (i) represents the out-degree of the i-th node, δ represents the perturbation amplitude control parameter, and rand(-δ,δ) represents a random perturbation in the interval (-δ,δ).
[0047] It should be noted that According to the node j to the terminal node s end The weight is adjusted by the shortest path distance. The shorter the distance, the higher the weight, which is in line with the actual situation that users will click purposefully during the operation to reach the end node, that is, the target page. Out-degree refers to how many other nodes node i can reach. The higher the out-degree, the lower the probability of selecting node j, ensuring that the generated paths are more uniform and avoiding the situation of being too biased towards popular paths, which is consistent with the situation where users randomly select a node in the actual process. It also satisfies randomness and rationality. By combining heuristic weights with random perturbations, the jump probability between business nodes is dynamically determined, which can comprehensively consider the logical relationship between nodes, jump distance and path distribution to ensure the rationality of path selection. At the same time, randomness is introduced to avoid paths being too concentrated on high-weight nodes, which improves the diversity and coverage of paths, is suitable for simulating real user behavior, and can more comprehensively test system performance and discover potential problems.
[0048] Optionally, δ∈[0.1, 0.5].
[0049] S203: Taking the jump termination condition as a constraint, a plurality of user behavior sequences are generated by a random walk algorithm, wherein the jump termination condition includes that the jump path length is greater than a preset jump path length and reaches any termination node:
[0050]
[0051] Among them, H p represents the pth user behavior sequence, Indicates H p The initial business node, Indicates H p The business node of the qth time step in the process, q = 1, 2, ..., t, t represents the maximum time step that satisfies the jump termination condition, len(H p ) indicates H p The jump path length, L 阈值 Indicates the preset jump path length, s end represents the terminal node and ∪ represents the union symbol.
[0052] In actual application, multiple user behavior sequences are generated through the random walk algorithm, and the path length and termination node are controlled in combination with the jump termination condition, which not only ensures the diversity of behavior sequences, but also covers the complex paths in actual scenarios, effectively improving the test coverage, especially for efficient simulation of uncommon but possible paths, helping to comprehensively evaluate system performance.
[0053] It should be noted that those skilled in the art can set the size of the preset jump path length according to actual needs, and the present invention is not limited here.
[0054] Specifically, a directed graph based on business logic is constructed through S201, and business nodes and their jump relationships are defined to provide a structured basis for user behavior path generation. In S202, the jump probability is calculated by combining heuristic weights and random perturbations, which not only ensures the rationality of the path, but also avoids excessive concentration on popular paths through randomness, thereby improving test coverage. S203 uses a random walk algorithm to generate multiple user behavior sequences that meet jump termination conditions such as path length and simulate real user operation behavior. The entire process effectively avoids the limitations of fixed test data, can fully cover uncommon but possible paths, improves the authenticity and accuracy of the test results, and helps discover potential performance bottlenecks and problems in the system.
[0055] S3: Taking the maximum carrying capacity of the system under test as a constraint, the flow growth process and flow decline process are simulated through the logistic growth model and the entropy increase model respectively, and a dynamic flow peak curve that conforms to the natural behavior of users is generated.
[0056] Among them, the maximum carrying capacity is the maximum number of concurrent user requests or throughput that the system can handle within a specific period of time. It is a key parameter for system design and testing, and reflects the performance limit of the system. The logistic growth model is a mathematical model that describes the process of traffic growth. It is usually used to simulate the natural change process of user traffic from slow growth in the early stage to rapid growth and then gradually stabilizing. The entropy increase model is used to simulate the process of traffic decline. By introducing entropy (the degree of disorder in the system), it describes the natural attenuation law of user traffic over time and reflects the transition of the system from peak to trough.
[0057] It should be noted that the logistic growth model is used to simulate the peak stage of traffic from slow growth in the early stage to rapid growth and then stabilization, and the entropy increase model is used to simulate the natural attenuation process of traffic from peak to trough, to generate a dynamic traffic peak curve, accurately restore the real fluctuation law of user traffic, and ensure the stability and reliability of the system. It can truly reproduce the traffic fluctuation of the system at peak and trough, so as to help more accurately discover the performance bottleneck, delay problem or stability defect of the system in traffic fluctuation, and improve the comprehensiveness and authenticity of the test.
[0058] In a possible implementation, S3 specifically includes:
[0059] S301: Based on the maximum carrying capacity, a logistic growth model describing the flow growth process is established to obtain the rising flow curve:
[0060]
[0061] Among them, C(t) represents the flow rate at time t, that is, the flow rate curve during the rising period, and K max represents the maximum traffic carrying capacity, r represents the traffic growth rate, e represents the base of the natural logarithm, and t0 represents the time center point when the rapid growth of the control traffic starts.
[0062] Specifically, the logistic growth model can accurately simulate the growth pattern of actual user traffic by describing the process of traffic growth from slow growth in the initial stage to rapid growth and then stabilization. It is in line with the characteristics of the gradual influx of users before the peak period, and provides a reliable reference for testing the system's carrying capacity and performance stability under gradually increasing traffic.
[0063] S302: A flow curve describing the flow decline process is established based on the entropy increase model to obtain a flow curve during the decline period:
[0064]
[0065] ΔS(t)=-b·ln(P'(t))
[0066]
[0067] Among them, C'(t) represents the flow at time t after entropy increase correction, that is, the flow curve during the fall period, ΔS(t) represents the entropy increase that describes the uncertainty of flow distribution at time t, and ΔS max It represents the maximum entropy increase that describes the flow drop limit, t1 represents the flow drop time, γ represents the flow drop rate, b represents the proportional constant that controls the entropy increase rate, ln represents the natural logarithm, and P'(t) represents the flow attenuation probability at time t.
[0068] Specifically, the traffic curve during the decline period based on the entropy increase model introduces the concept of entropy to accurately describe the uncertainty and attenuation law in the process of traffic decline. Combined with the traffic decline rate and distribution probability, it truly reproduces the dynamic changes of users gradually leaving the system, ensuring that the test scenario is more realistic and comprehensively evaluating the performance and stability of the system during the traffic decline stage.
[0069] S303: Superimpose the burst traffic on the rising period traffic curve and the falling period traffic curve to obtain a dynamic traffic peak curve:
[0070] C final (t) = C (t) + C' (t) + C burst (t)
[0071]
[0072] Among them, C final (t) represents the dynamic flow peak curve, C burst (t) represents the burst traffic at time t that conforms to the Gaussian distribution, A represents the peak value of the burst traffic, and t peak represents the time when the burst traffic peak is reached, and θ represents the burst traffic standard deviation that controls the width of the burst traffic distribution.
[0073] It should be noted that superimposing burst traffic that conforms to the Gaussian distribution on the traffic curves during the rising and falling periods can simulate abnormal peak scenarios in user access, truly restore the dynamic changes in traffic under sudden loads, help test the system's carrying capacity and stability in complex scenarios, provide support for identifying performance bottlenecks in sudden traffic, and improve the comprehensiveness and authenticity of the test.
[0074] Specifically, through steps S301 to S303, a logistic growth model is first established in combination with the maximum carrying capacity of the system to describe the rising curve of the traffic from slow growth to rapid growth and then stabilization. Then, based on the entropy increase model, the natural attenuation process of the traffic gradually falling from the peak to the trough is simulated. Finally, the burst traffic that conforms to the Gaussian distribution is superimposed on the rising and falling traffic curves to generate a dynamic traffic peak curve. This process accurately reproduces the dynamic change law of actual user traffic, simulates real scenarios such as peak periods, troughs and burst traffic, and can help discover potential performance bottlenecks of the system in a complex traffic environment, thereby improving the authenticity and comprehensiveness of the test.
[0075] S4: Schedule user behavior sequences according to the dynamic traffic peak curve to perform multiple test types of stress tests on the system under test.
[0076] It should be noted that by scheduling user behavior sequences through dynamic traffic peak curves and performing various types of stress tests, such as high concurrency, peak load, continuous load, etc., it is possible to comprehensively evaluate the performance stability, throughput capacity and fault recovery capability of the system under test under different traffic conditions, thereby improving test coverage and discovering potential problems.
[0077] In a possible implementation, the test types include high concurrency test, peak load test, continuous load test, burst load test, blocking test and disaster recovery test. S4 specifically includes:
[0078] S401: Determine the test type.
[0079] S402: Calculate the number of users according to the dynamic traffic peak curve.
[0080] S403: Allocate each user behavior sequence according to the number of users to the moment when the user is in the dynamic traffic peak curve for stress testing.
[0081] It should be noted that, through steps S401 to S403, the specific test type is first determined, such as high concurrency test, peak load test, etc., to cover the performance evaluation requirements of different traffic scenarios. Then, based on the dynamic traffic peak curve, the number distribution of users at different time points is calculated to accurately simulate the dynamic changes of user traffic. Finally, the generated user behavior sequence is distributed to the corresponding time points according to the number of users for stress testing, which can fully restore the real traffic scenario, accurately test the performance stability and responsiveness of the system under high load, continuous load and burst traffic, and help discover potential problems and optimize system design.
[0082] S5: Collect performance data during the test.
[0083] It should be noted that collecting performance data such as response time, throughput, error rate and resource utilization during the test can comprehensively record the operating status of the system under different test scenarios, provide key basis for subsequent performance analysis, bottleneck location and optimization, and ensure the accuracy and completeness of the test results.
[0084] In one possible implementation, the performance data includes response time, throughput, error rate, and resource utilization.
[0085] S6: Extract mutation data from performance data through sliding windows.
[0086] Among them, the sliding window is a fixed-size window used to analyze continuous subsets in time series data piece by piece. The window slides forward one unit each time, calculates the statistical characteristics of the data in the window (such as mean, standard deviation), and dynamically monitors the changing trend of the data. Mutation data refers to abnormal points in performance data that deviate significantly from the normal trend, such as a sudden increase in response time, a sharp drop in throughput, or a significant increase in error rate. These data reflect possible performance anomalies or bottlenecks in the system during testing.
[0087] It should be noted that by dynamically analyzing the local features of performance data through a sliding window and extracting mutation data with significant deviations, it is possible to promptly discover abnormal conditions of the system during the test process, rather than relying solely on the final results. This can help locate potential performance problems in the system, help developers perform targeted optimization of the system under test, and improve system stability and reliability.
[0088] In a possible implementation, S6 specifically includes:
[0089] S601: Initialize the sliding window.
[0090] S602: Calculate the mean and standard deviation within the sliding window:
[0091]
[0092]
[0093] Among them, μ t and σ t They represent the sliding window mean and sliding window standard deviation in the sliding window at time t, N represents the sliding window size, that is, the number of data points included in the sliding window, and x i represents the i-th data point in the sliding window, t represents the current time, and t-N+1 represents the starting data point index of the sliding window.
[0094] S603: Determine a mutation data screening function based on the mean and the standard deviation, and screen the mutation data in the performance data according to the mutation data screening function. The mutation data screening function is specifically:
[0095] |x t -μ t |>ρ·σ t
[0096] Among them, x t It represents the data point value at time t, that is, the performance data value at time t, and ρ represents the threshold constant used to control the sensitivity of the chart data.
[0097] Specifically, through steps S601 to S603, the sliding window is first initialized and the window size is defined to analyze the data features in segments. Then the mean and standard deviation in the sliding window are calculated to dynamically describe the central trend and dispersion of the local data. Finally, a mutation data screening function is designed based on the mean and standard deviation, and the significantly deviated mutation data is screened out by thresholding the deviation of each data point. This process utilizes the local statistical characteristics of the sliding window to efficiently extract abnormal points in the performance data, which helps to quickly discover sudden problems in system testing and provide precise support for performance optimization.
[0098] Optionally, the threshold constant may be 2 or 3.
[0099] S7: Output the performance data and the corresponding mutation data as the performance test result of the system under test.
[0100] In a possible implementation manner, after S7, the method further includes:
[0101] Visualize performance test results.
[0102] It is understandable that in the visualization of performance test results, test data such as response time, throughput, error rate, etc. are intuitively presented through charts, which makes it easier for testers to quickly discover abnormal trends, locate problems and analyze system performance bottlenecks, thereby improving the efficiency and accuracy of performance optimization.
[0103] In the actual application process, through steps S1 to S7, the business nodes, jump paths and business logic of the system under test are first obtained to build a comprehensive functional operation model for the test to ensure that all key processes are covered. The random walk algorithm based on business logic combined with heuristic weights and random perturbations generates user behavior sequences, which not only ensures the diversity and rationality of the operation paths, but also covers the complex paths in real scenarios. Then, with the maximum carrying traffic as a constraint, the dynamic traffic peak curve is generated using the logistic growth model and the entropy increase model to accurately restore the growth and decline rules of real user traffic and ensure that the test conforms to the actual load characteristics. According to the dynamic traffic peak curve, the user behavior sequence is scheduled to perform various types of stress tests to comprehensively evaluate the stability and bottleneck performance of the system in peak loads and burst traffic. During the test, performance data such as response time and throughput are collected, and mutation points (S6) are extracted through sliding windows to quickly locate abnormal states and potential problems. Finally, comprehensive performance data and mutation point data are output to provide a reliable basis for system performance optimization and improve the accuracy and coverage of the test.
[0104] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0105] In the present invention, the service nodes of the system under test and the service logic describing the jump paths between the service nodes are first obtained, and then the user behavior sequence describing the order of users accessing the service nodes is generated based on the service logic combined with the random walk algorithm with heuristic weights and random perturbations, which can more realistically simulate the complex operation paths of actual users, cover a variety of scenarios, and avoid test blind spots and inaccurate test results caused by fixed behavior patterns during the test. Then, with the maximum carrying capacity of the system under test as a constraint, the flow growth process and the flow decline process are simulated respectively through the logistic growth model and the entropy increase model, and a dynamic flow peak curve that conforms to the natural behavior of the user is generated. Finally, the injection test of the user behavior sequence is performed according to the peak curve, which can be closer to the fluctuation characteristics of the actual user flow, especially in peak and burst flow scenarios, and the carrying capacity and stability of the system can be tested more accurately, so as to comprehensively evaluate the performance of the system under complex flow conditions. In addition, a sliding window is used to extract mutation data from the performance data obtained from the test, which can better discover abnormal performance of the system under test during the test process, rather than just focusing on the final test results. This helps to discover more detailed vulnerabilities in the system under test, and can assist developers in making more targeted improvements to the system under test, thereby improving test effectiveness and pertinence, helping to quickly discover potential vulnerabilities in the system under test, and completing more accurate system testing. In the absence of historical data, accurate and efficient system testing can be performed using data that conforms to actual user behavior.
[0106] Reference Manual Attached Figure 2, showing a structural schematic diagram of a system performance testing system based on user behavior simulation provided by the present invention.
[0107] The present invention further provides a system performance testing system 20 based on user behavior simulation, which is applied to the above-mentioned system performance testing method based on user behavior simulation, and comprises:
[0108] Processor 201.
[0109] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201 , the system performance testing method based on user behavior simulation in the method embodiment is implemented.
[0110] The system performance testing system 20 based on user behavior simulation provided by the present invention can execute the above-mentioned system performance testing method based on user behavior simulation and achieve the same or similar technical effects. To avoid repetition, the present invention will not go into details.
[0111] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0112] In the present invention, the service nodes of the system under test and the service logic describing the jump paths between the service nodes are first obtained, and then the user behavior sequence describing the order of users accessing the service nodes is generated based on the service logic combined with the random walk algorithm with heuristic weights and random perturbations, which can more realistically simulate the complex operation paths of actual users, cover a variety of scenarios, and avoid test blind spots and inaccurate test results caused by fixed behavior patterns during the test. Then, with the maximum carrying capacity of the system under test as a constraint, the flow growth process and the flow decline process are simulated respectively through the logistic growth model and the entropy increase model, and a dynamic flow peak curve that conforms to the natural behavior of the user is generated. Finally, the injection test of the user behavior sequence is performed according to the peak curve, which can be closer to the fluctuation characteristics of the actual user flow, especially in peak and burst flow scenarios, and the carrying capacity and stability of the system can be tested more accurately, so as to comprehensively evaluate the performance of the system under complex flow conditions. In addition, a sliding window is used to extract mutation data from the performance data obtained from the test, which can better discover abnormal performance of the system under test during the test process, rather than just focusing on the final test results. This helps to discover more detailed vulnerabilities in the system under test, and can assist developers in making more targeted improvements to the system under test, thereby improving test effectiveness and pertinence, helping to quickly discover potential vulnerabilities in the system under test, and completing more accurate system testing. In the absence of historical data, accurate and efficient system testing can be performed using data that conforms to actual user behavior.
[0113] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0114] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0115] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0116] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0117] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0118] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0119] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0120] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0121] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0123] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0124] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc., various media that can store program codes.
[0125] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the system performance testing method based on user behavior simulation as described in the method embodiment is implemented.
[0126] A computer-readable storage medium provided by the present invention can implement the steps and effects of the system performance testing method based on user behavior simulation of the above method embodiment. To avoid repetition, the present invention will not go into details.
[0127] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0128] In the present invention, the service nodes of the system under test and the service logic describing the jump paths between the service nodes are first obtained, and then the user behavior sequence describing the order of users accessing the service nodes is generated based on the service logic combined with the random walk algorithm with heuristic weights and random perturbations, which can more realistically simulate the complex operation paths of actual users, cover a variety of scenarios, and avoid test blind spots and inaccurate test results caused by fixed behavior patterns during the test. Then, with the maximum carrying capacity of the system under test as a constraint, the flow growth process and the flow decline process are simulated respectively by the logistic growth model and the entropy increase model, and a dynamic flow peak curve that conforms to the natural behavior of the user is generated. Finally, the injection test of the user behavior sequence is performed according to the peak curve, which can be closer to the fluctuation characteristics of the actual user flow, especially in peak and burst flow scenarios, and the system's carrying capacity and stability can be tested more accurately, thereby comprehensively evaluating the system's performance under complex flow conditions. In addition, a sliding window is used to extract mutation data from the performance data obtained from the test, which can better discover abnormal performance of the system under test during the test process, rather than just focusing on the final test results. This helps to discover more detailed vulnerabilities in the system under test, and can assist developers in making more targeted improvements to the system under test, thereby improving test effectiveness and pertinence, helping to quickly discover potential vulnerabilities in the system under test, and completing more accurate system testing. In the absence of historical data, accurate and efficient system testing can be performed using data that conforms to actual user behavior.
[0129] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0130] There are a few points to note:
[0131] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention, and other structures may refer to the general design.
[0132] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of the layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or there may be intermediate elements.
[0133] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.
[0134] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A system performance testing method based on user behavior simulation, characterized in that: Methods include: S1: Obtain the business nodes of the system under test and the business logic that describes the jump paths between each business node; S2: Based on the business logic, a random walk algorithm with heuristic weights and random perturbations is combined to generate a user behavior sequence that describes the order in which users visit each business node; S3: Taking the maximum carrying capacity of the system under test as a constraint, the flow growth process and the flow decline process are simulated by the logistic growth model and the entropy increase model respectively, so as to generate a dynamic flow peak curve that conforms to the natural behavior of the user; S4: performing stress tests of multiple test types on the system under test according to the user behavior sequence scheduled by the dynamic traffic peak curve; S5: Collect performance data during the test; S6: extracting mutation data from the performance data through a sliding window; S7: Output the performance data and the corresponding mutation data as the performance test result of the system under test.
2. The system performance testing method based on user behavior simulation according to claim 1 is characterized in that: The service nodes include a plurality of start nodes, a plurality of intermediate nodes and a plurality of end nodes, and the service logic is a jump path from the start node through different intermediate nodes to the end node.
3. The system performance testing method based on user behavior simulation according to claim 2 is characterized in that: The S2 specifically includes: S201: Constructing a directed graph about the business logic: G=(V,E) Wherein, G represents a directed graph, V represents a set of business nodes, and E represents a set of edges obtained based on the business logic; S202: Determine the jump probability of each service node in the directed graph by combining the heuristic weight and the random disturbance: Where P(j|i) represents the jump probability from service node i to service node j, and w ij represents the weight of jumping from service node i to service node j, N(i) represents the set of neighboring service nodes of node i in the directed graph, and w ik represents the weight of the neighbor node k that jumps from business node i to business node i, dist(j,s end ) represents the jth node to the terminal node s that conforms to the business logic end The shortest distance between represents the heuristic weight, out degree (i) represents the out-degree of the i-th node, δ represents the perturbation amplitude control parameter, and rand(-δ,δ) represents a random perturbation in the interval (-δ,δ). S203: Taking the jump termination condition as a constraint, a plurality of user behavior sequences are generated by a random walk algorithm, wherein the jump termination condition includes that the jump path length is greater than a preset jump path length and reaches any termination node: Among them, H p represents the pth user behavior sequence, Indicates H p The initial business node, Indicates H p The business node of the qth time step in the process, q = 1, 2, ..., t, t represents the maximum time step that satisfies the jump termination condition, len(H p ) indicates H p The jump path length, L 阈值 Indicates the preset jump path length, s end represents the terminal node and ∪ represents the union symbol.
4. The system performance testing method based on user behavior simulation according to claim 1 is characterized in that: The S3 specifically includes: S301: Based on the maximum carrying capacity, a logistic growth model describing the flow growth process is established to obtain the rising flow curve: Among them, C(t) represents the flow rate at time t, that is, the flow rate curve during the rising period, and K max represents the maximum traffic carrying capacity, r represents the traffic growth rate, e represents the base of the natural logarithm, and t0 represents the time center point when the control traffic starts to grow rapidly; S302: A flow curve describing the flow decline process is established based on the entropy increase model to obtain a flow curve during the decline period: ΔS(t)=-b·ln(P'(t)) Among them, C'(t) represents the flow at time t after entropy increase correction, that is, the flow curve during the fall period, ΔS(t) represents the entropy increase that describes the uncertainty of flow distribution at time t, and ΔS max represents the maximum entropy increase that describes the flow drop limit, t1 represents the flow drop time, γ represents the flow drop rate, b represents the proportional constant that controls the entropy increase rate, ln represents the natural logarithm, and P'(t) represents the flow attenuation probability at time t; S303: superimposing the burst traffic on the rising period traffic curve and the falling period traffic curve to obtain the dynamic traffic peak curve: C final (t)=C(t)+C'(t)+C burst (t) Among them, C final (t) represents the dynamic flow peak curve, C burst (t) represents the burst traffic at time t that conforms to the Gaussian distribution, A represents the peak value of the burst traffic, and t peak represents the time when the burst traffic peak is reached, and θ represents the burst traffic standard deviation that controls the width of the burst traffic distribution.
5. The system performance testing method based on user behavior simulation according to claim 1 is characterized in that: The test types include high concurrency test, peak load test, continuous load test, burst load test, blocking test and disaster recovery test; S4 specifically includes: S401: Determine the test type; S402: Calculating the number of users according to the dynamic traffic peak curve; S403: Allocate each user behavior sequence according to the number of users to the moment when the user is in the dynamic traffic peak curve to perform stress testing.
6. The system performance testing method based on user behavior simulation according to claim 1 is characterized in that: The performance data includes response time, throughput, error rate, and resource utilization.
7. The system performance testing method based on user behavior simulation according to claim 1 is characterized in that: The S6 specifically includes: S601: Initialize the sliding window; S602: Calculate the mean and standard deviation within the sliding window: Among them, μ t and σ t They represent the sliding window mean and sliding window standard deviation in the sliding window at time t, N represents the sliding window size, that is, the number of data points included in the sliding window, and x i represents the i-th data point in the sliding window, t represents the current time, and t-N+1 represents the starting data point index of the sliding window; S603: Determine a mutation data screening function based on the mean and the standard deviation, and screen the mutation data in the performance data according to the mutation data screening function. The mutation data screening function is specifically: |x t -m t |>r·s t Among them, x t It represents the data point value at time t, that is, the performance data value at time t, and ρ represents the threshold constant used to control the sensitivity of the chart data.
8. The system performance testing method based on user behavior simulation according to claim 1 is characterized in that: After S7, the method further includes: The performance test results are visualized.
9. A system performance testing system based on user behavior simulation, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the system performance testing method based on user behavior simulation as described in any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the system performance testing method based on user behavior simulation as described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Server test method, electronic equipment, storage medium and program product
CN120639659A
User behavior-based performance testing method and system, medium, terminal
CN122507655A
User behavior-based performance testing method and system, medium, terminal
CN122507655B