Distributed simulation test method and device for simulating user behaviors

Through the distributed simulation testing method that simulates user behavior, assign test subtasks and configure simulation models, the problem that the existing technology is difficult to fully tap the performance limits of the business system and achieve higher testing accuracy.

CN119690790APending Publication Date: 2025-03-25ZHEJIANG HUAYUN INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411489435.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing business system performance testing technology is limited by the performance of the test computer, and it is difficult to fully tap the performance limits of the business system being tested.

Method used

A distributed simulation test method that simulates user behavior is adopted. By obtaining real-time resource information and preset testing tasks of the simulation client, testing subtasks are assigned to the simulation client, and simulation models are configured in the simulation client, testing subtasks are performed to obtain test data, analyze performance and abnormal situations, and finally integrated evaluations are integrated to generate test reports.

Benefits of technology

It significantly improves the accuracy of business system performance testing and can more fully tap the performance limits of the business system being tested.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690790A_ABST
    Figure CN119690790A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed simulation test method and device for simulating user behaviors, and belongs to the technical field of performance tests.The method comprises the steps that S1, test subtasks are allocated to simulation clients according to obtained real-time resource information of the simulation clients and preset test tasks; s2, configuring a simulation model based on the test subtasks and a preset test parameter set; s3, executing the corresponding test subtask by the simulation model to obtain corresponding test data, and storing the test data to a storage unit according to a data interaction rule; s4, the data analysis module extracts the test data analysis performance in the storage unit according to the message queue rule to obtain a performance analysis result; the monitoring module extracts the test data in the storage unit according to the message queue rule to analyze the exception to obtain an exception analysis result; s5, integrating and evaluating according to the performance analysis result and the anomaly analysis result to obtain a test report; the invention overcomes the problem that the prior art is limited by testing the computer performance and is difficult to fully mine the performance limit of the tested service system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of performance testing, and in particular to a distributed simulation testing method and device for simulating user behavior. Background Art

[0002] With the advent of the 5G era and the era of the Internet of Everything, there will be more and more cloud applications and cloud services, the amount of data will grow exponentially, and business scenarios will become more and more complex. The performance issues of the corresponding business systems have gradually become the focus of our attention; and the existing business system performance testing technology only uses one computer for testing. Due to the economic value and performance of the computer itself, there are problems such as difficulty in simulating complex business scenarios, poor scalability, and difficulty in fully exploring the performance limits of the corresponding business systems.

[0003] Chinese patent, publication number: CN115562978A, publication date: January 3, 2023, discloses a performance testing method based on business scenarios, including: step 1, identifying business scenarios; step 2, determining expected indicators and performance goals based on business scenarios, and quantifying performance goals into performance indicators; step 3, establishing a business scenario model based on business scenarios and their performance indicators in combination with test parameters, the business scenario model includes a single scenario test model, a mixed scenario test model and a business matching model; step 4, performing performance testing based on the business scenario model to obtain response indicators; and the testing method disclosed in the invention is limited by the performance of the test computer and it is difficult to fully explore the performance limits of the business system being tested. Summary of the invention

[0004] The purpose of the present invention is to address the problem that the prior art is limited by the performance of the test computer and is difficult to fully explore the performance limit of the tested business system; a distributed simulation test method and device for simulating user behavior are proposed, and different simulation models are configured in different simulation clients through the real-time resource information of the simulation client and the preset test tasks. The simulation model executes the test subtasks obtained according to the test tasks to obtain test data, and analyzes the performance of the tested business system and the running conditions during the test according to the test data to obtain performance analysis results and abnormal analysis results. Finally, an integrated evaluation is performed based on the performance analysis results and the abnormal analysis results to obtain a test report that fully explores the performance limit of the tested business system, thereby significantly improving the accuracy of the distributed simulation test method and device for simulating user behavior in testing the performance of the business system.

[0005] In a first aspect, a technical solution provided in an embodiment of the present invention is a distributed simulation test method for simulating user behavior, comprising the following steps: S1. Acquire real-time resource information of the simulation client, and the control module assigns test subtasks to the simulation client according to the real-time resource information and preset test tasks; S2. configuring a simulation model in the simulation client based on the test subtask and a preset test parameter set; S3, the simulation model executes the corresponding test subtask to obtain the corresponding test data, and stores the test data into the storage unit according to the data interaction rule; S4, the data analysis module extracts the test data in the storage unit according to the message queue rules to perform performance analysis to obtain performance analysis results; synchronously, the monitoring module extracts the test data in the storage unit according to the message queue rules to perform anomaly analysis to obtain anomaly analysis results; S5. Perform an integrated evaluation based on the performance analysis results and the abnormality analysis results to obtain a test report.

[0006] In this scheme, test subtasks are allocated to the simulation client according to the real-time resource information of the simulation client and the preset test tasks, so that multiple simulation clients can test the same business system at the same time, so that the performance test of the business system is no longer limited by the performance of a certain simulation client, and the simulation model is configured in the simulation client according to the test subtasks and the preset test parameter set, so that the adaptability of the simulation model and the test subtasks is optimal, and the simulation model executes the corresponding test subtasks to obtain corresponding test data, the data analysis module analyzes the performance of the tested business system based on the test data and outputs performance analysis results, the monitoring module analyzes the running status of the tested business system during the test process based on the test data and outputs abnormal analysis results, finally, the performance analysis results and the abnormal analysis results are integrated and evaluated to obtain a test report that fully explores the performance limit of the tested business system, thereby significantly improving the accuracy of the distributed simulation test method that simulates user behavior in testing business system performance.

[0007] Preferably, in S1, the specific process of the control module allocating test subtasks to the simulation client according to the real-time resource information and the preset test tasks is as follows: S111, classifying the simulation clients into at least superior simulation clients and inferior simulation clients according to the network information, processor information and memory information in the real-time resource information; S112, extracting the number of concurrent users in the preset test task, and allocating the test task based on the preset concurrency ratio combined with the number of superior simulation clients and the number of inferior simulation clients to obtain the initial test subtask and concurrency factor; S113, matching the initial test subtask with different simulation clients according to the concurrency factor to obtain the test subtask; the concurrency factor represents the degree of correlation between the number of concurrent users of the test task and the different simulation clients.

[0008] In this solution, the simulation clients are divided into different levels to allocate concurrent users to different simulation clients, and then allocate test subtasks to different simulation clients, which can fully utilize the performance resources of each simulation client and deeply explore the performance of the business system under test.

[0009] Preferably, in S2, the specific process of configuring the simulation model in the simulation client based on the test subtask and the preset test parameter set is: S211, extracting the number of concurrent users in the test subtask, and matching the test parameters in a preset test parameter set according to the number of concurrent users; S212, installing a simulation model in a simulation client according to the concurrent user volume and test parameters; The test parameters include at least request frequency and test duration.

[0010] Preferably, in S3, the specific process of storing the test data in the storage unit according to the data interaction rule is as follows: S311, encrypting the test data according to the asymmetric encryption mechanism, and establishing an access token for the encrypted test data according to the access token mechanism; S312: The control module extracts the encrypted test data according to the access token and stores it in a storage unit.

[0011] In this solution, an asymmetric encryption mechanism is used to encrypt the test data to prevent the data from being stolen or tampered with, and an access token is established for the encrypted test data based on the access token mechanism to ensure that only authorized users can access specific data. At the same time, the asymmetric encryption mechanism and the access token mechanism are used to construct the order of the test data.

[0012] Preferably, in S4, the data analysis module extracts the test data in the storage unit according to the message queue rule to perform performance analysis to obtain the performance analysis result in the following specific process: S411, the data analysis module extracts the request start time, request end time, request type and response status in the test data from the storage unit according to the access token for statistics and classification; S412, calculating the performance index based on the statistically and classified test data and the performance index formula, and performing statistics according to the calculation results of the performance index; S413: sorting out the statistically and classified test data, the calculation results of the performance indicators, and the statistically completed performance indicator calculation results to obtain the performance analysis results; The performance indicators include at least response time, throughput, and error rate.

[0013] In this solution, the performance indicators response time, throughput and error rate are calculated respectively to verify the performance of the business system under test from multiple aspects, effectively improving the accuracy of the distributed simulation test method that simulates user behavior in testing the performance of the business system.

[0014] Preferably, in S4, the monitoring module extracts the test data in the storage unit according to the message queue rule to perform abnormal analysis to obtain the abnormal analysis result in the following specific process: S421, the monitoring module extracts the request start time and the request end time in the test data from the storage unit according to the access token to determine the online status of the corresponding simulation client; When the online status of the simulation client is normal, the monitoring module collects the processor usage rate, memory usage rate and response time of the simulation client to judge the working status; Synchronously, when the online status of the simulation client is abnormal, the simulation client performs abnormal recovery according to a preset self-healing action; S422: When the working state of the simulation client is abnormal, the simulation client performs abnormal recovery according to a preset self-healing action; S423, sorting out the online status judgment result and the working status judgment result of the simulation client to obtain an abnormality analysis result.

[0015] In this solution, the online status of the corresponding simulation client is determined according to the request start time and the request end time, and the working status of the corresponding simulation client is determined according to the processor usage, memory usage and response time of the simulation client, so as to avoid test errors caused by the network and performance of the simulation client. At the same time, when the state of the simulation client is abnormal, the abnormal recovery is performed according to the preset self-healing action, so as to avoid the test missing caused by the network and performance of the simulation client, and effectively improve the accuracy of the distributed simulation test method that simulates user behavior in testing the performance of the business system.

[0016] Preferably, in S422, according to the processor usage rate, memory usage rate and response time of the simulation client, the working status of the simulation client is judged into three types, including: When the processor usage rate is greater than a preset processor usage threshold, the working state of the simulation client is determined to be abnormal; synchronously, when the response time is greater than a preset response time threshold, the working state of the simulation client is determined to be abnormal; synchronously, when the memory usage rate is greater than a preset memory usage threshold, the working state of the simulation client is determined to be abnormal.

[0017] In this solution, the working status of the simulation client is divided into different judgments to obtain the working status of the simulation client, combined with different performance indicators and computing resource usage of the simulation client, namely, the processor usage, memory usage and response time of the simulation client. This greatly avoids the simulation client from executing test subtasks under overload, thereby causing errors in the test results.

[0018] Preferably, in S4, when the online state of the simulation client is abnormal or the working state is determined to be abnormal, risk level classification is also required, specifically: When the online state of the simulation client is abnormal, determining that the risk level of the simulation client is level one; When the working state of the simulation client is abnormal, determining that the risk level of the simulation client is level one; When the risk level of the simulated client is level one, and the abnormal online state time of the simulated client is greater than a preset abnormal time threshold, the risk level of the simulated client is determined to be level two; When the risk level of the simulation client is level one, and the abnormal time of the working state of the simulation client is greater than a preset abnormal time threshold, the risk level of the simulation client is determined to be level two.

[0019] In this solution, the abnormal state of the simulation client is risk graded to prevent the false overload of the simulation client from being treated as a real overload, thereby avoiding the waste of computing resources and avoiding test errors caused by increased computing burden.

[0020] Preferably, in S5, the specific process of integrating and evaluating the performance analysis results and the abnormality analysis results to obtain the test report is as follows: S511, counting the changing trend of performance indicators and the success rates of different request types according to the performance analysis results, and visualizing the statistical results to obtain a performance analysis chart; Synchronously, according to the abnormal analysis result, the status data, risk level data and real-time resource information corresponding to the status data of the simulation client are counted and visualized to obtain an abnormal analysis chart; S512, analyzing the bottleneck of the simulation model based on the performance analysis chart to obtain a bottleneck analysis result, and analyzing the resource usage rate of the simulation client based on the abnormal analysis chart; S513, collating the performance analysis chart, exception analysis chart, bottleneck analysis results and resource usage rate to obtain a test report.

[0021] On the other hand, a technical solution also provided in an embodiment of the present invention is a test device for simulating user behavior, comprising: a control module, a storage unit, a simulation client, a data analysis module and a monitoring module; The data transmission end of the control module is electrically connected to the data transmission end of the storage unit, the control module is communicatively connected to the simulation client via a digital link, the data analysis module is communicatively connected to the control module via a digital link, and the monitoring module is communicatively connected to the control module via a digital link.

[0022] The present invention has at least the following substantial effects: The present application allocates test subtasks to the simulation client according to the real-time resource information of the simulation client and the preset test tasks, so that multiple simulation clients can test the same business system at the same time, so that the performance test of the business system is no longer limited to the performance of a certain simulation client, and configures the simulation model in the simulation client according to the test subtasks and the preset test parameter set, so that the adaptation degree of the simulation model and the test subtask is optimal, and the simulation model executes the corresponding test subtask to obtain the corresponding test data, the data analysis module analyzes the performance of the tested business system based on the test data and outputs the performance analysis result, and the monitoring module analyzes the running status of the tested business system during the test process based on the test data and outputs the abnormality analysis result. The analysis results are finally integrated and evaluated based on the performance analysis results and the abnormality analysis results to obtain a test report that fully explores the performance limits of the tested business system, thereby significantly improving the accuracy of the distributed simulation test method that simulates user behavior in testing the performance of the business system; in addition, in the process of testing the performance of the business system in the present application, that is, in the process of executing the preset test tasks, according to the test data order constructed according to the asymmetric encryption mechanism and the access token mechanism, when the monitoring module finds that the test data is abnormal, the corresponding simulation client can be quickly locked in combination with the test data order, and then the corresponding node in the test task can be found through the test subtask corresponding to the simulation client, thereby discovering the excellent position for improving the performance of the tested business system. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the drawings to represent the same parts.

[0024] Figure 1 This is a flow chart of a distributed simulation test method for simulating user behavior according to the present invention. DETAILED DESCRIPTION

[0025] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation method described herein is only an optimal embodiment of the present invention, which is only used to explain the present invention and does not limit the scope of protection of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0026] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the drawings; the process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0027] Embodiment 1: like Figure 1 As shown, this embodiment provides a distributed simulation test method for simulating user behavior, including the following steps: S1. Acquire real-time resource information of a simulation client, and a control module allocates test subtasks to the simulation client according to the real-time resource information and a preset test task.

[0028] S111, classifying the simulation clients into at least superior simulation clients and inferior simulation clients according to the network information, processor information and memory information in the real-time resource information; S112, extracting the number of concurrent users in the preset test task, and allocating the test task based on the preset concurrency ratio combined with the number of superior simulation clients and the number of inferior simulation clients to obtain the initial test subtask and concurrency factor; S113, matching the initial test subtask with different simulation clients according to the concurrency factor to obtain the test subtask; the concurrency factor represents the degree of correlation between the number of concurrent users of the test task and the different simulation clients.

[0029] In this embodiment, the concurrency ratio is set according to the concurrent user volume and simulation client of the test task. If the concurrent user volume in a test task is one thousand and there are twenty simulation clients, when the network information, processor information and memory information of the twenty simulation clients are exactly the same, that is, the simulation clients have only one level, the concurrency ratio is set so that the concurrent user volume borne by each simulation client is fifty. When the simulation clients have two levels, that is, the simulation clients are divided into superior simulation clients and inferior simulation clients, and there are twelve superior simulation clients and eight inferior simulation clients, the concurrency ratio is set so that the concurrent user volume borne by each superior simulation client is at least 56, the concurrent user volume borne by some superior simulation clients is 57, and the concurrent user volume borne by each inferior simulation client is 40. In addition, when setting the concurrency ratio, the corresponding test parameter set is set according to the concurrency ratio.

[0030] S2. configuring a simulation model in the simulation client based on the test subtask and a preset test parameter set.

[0031] S211, extracting the number of concurrent users in the test subtask, and matching the test parameters in a preset test parameter set according to the number of concurrent users; S212, installing a simulation model in a simulation client according to the concurrent user volume and test parameters; The test parameters include at least request frequency and test duration.

[0032] In this embodiment, the simulation model is a test script installed in the simulation client to simulate user behavior. It can be set according to customized user behavior or downloaded through a wireless network. Different test scripts can test different functions of the corresponding business system under test according to different simulated user behaviors. At the same time, more complex scenarios can be expanded in the simulation client according to the test script to obtain test data close to the real thing.

[0033] S3. The simulation model executes corresponding test subtasks to obtain corresponding test data, and stores the test data in a storage unit according to data interaction rules.

[0034] S311, encrypting the test data according to an asymmetric encryption mechanism, and creating an access token for the encrypted test data according to an access token mechanism; S312: The control module extracts the encrypted test data according to the access token and stores it in a storage unit.

[0035] In this embodiment, the asymmetric encryption mechanism adopts the TLS / SSL protocol to protect the transmission security of the test data. After the asymmetric encryption mechanism encrypts the test data, it will generate corresponding public keys and private keys. According to the private key corresponding to the test data and the access token mechanism, that is, the role-based access control method, the access rules and tokens of the test data are constructed, so that only specific users with access tokens can read the corresponding test data, preventing data transmission confusion in high concurrency mode, and thereby establishing the order of test data corresponding to different test subtasks.

[0036] S4. The data analysis module extracts the test data in the storage unit according to the message queue rules to perform performance analysis to obtain performance analysis results; synchronously, the monitoring module extracts the test data in the storage unit according to the message queue rules to perform anomaly analysis to obtain anomaly analysis results.

[0037] S411, the data analysis module extracts the request start time, request end time, request type and response status in the test data from the storage unit according to the access token for statistics and classification; S412, calculating the performance index based on the statistically and classified test data and the performance index formula, and performing statistics according to the calculation results of the performance index; S413: sorting out the statistically and classified test data, the calculation results of the performance indicators, and the statistically completed performance indicator calculation results to obtain the performance analysis results; The performance indicators include at least response time, throughput, and error rate.

[0038] In this embodiment, the response time refers to the time interval from when the user sends a request to when the user receives a response, which is used to measure the speed of the business system under test. The response time calculation formula is as follows: T re =T end -T start ; Where, T re is the response time, T end is the time to receive the response, T start Send the time for the request; The throughput indicates the number of requests that the business system under test can process in a unit of time, reflecting the processing capacity of the business system under test. The throughput calculation formula is as follows: Where Th is the throughput, N r is the total number of user requests, T test is the test duration; The error rate is the proportion of errors that occur when the tested business system processes user requests, indicating the stability of the tested business system under the current number of concurrent users. The calculation formula of the error rate is as follows: Where ER is the error rate, N e is the number of user requests with errors, N r The total number of user requests.

[0039] S421, the monitoring module extracts the request start time and the request end time in the test data from the storage unit according to the access token to determine the online status of the corresponding simulation client; When the online status of the simulation client is normal, the monitoring module collects the processor usage rate, memory usage rate and response time of the simulation client to judge the working status; Synchronously, when the online status of the simulation client is abnormal, the simulation client performs abnormal recovery according to a preset self-healing action; S422: When the working state of the simulation client is abnormal, the simulation client performs abnormal recovery according to a preset self-healing action; There are three types of working status judgments for the simulation client, specifically including: When the processor usage rate is greater than a preset processor usage threshold, the working state of the simulation client is determined to be abnormal; synchronously, when the response time is greater than a preset response time threshold, the working state of the simulation client is determined to be abnormal; synchronously, when the memory usage rate is greater than a preset memory usage threshold, the working state of the simulation client is determined to be abnormal.

[0040] In this scheme, the monitoring module extracts the "heartbeat packet" periodically sent by the simulation client to the control module to determine the online status of the corresponding simulation client. The "heartbeat packet" at least includes the request start time, request end time and device information of the corresponding simulation client in the test data. If the monitoring module does not extract a new "heartbeat packet" for more than two cycles, the online status of the simulation client is judged to be abnormal. If the online status of the simulation client is judged to be normal, the monitoring module collects the processor usage rate, memory usage rate, response time and other data in the test data uploaded by the simulation client to the control module in real time to determine the working status of the simulation client. When the processor usage rate is greater than 80%, the working status of the simulation client is judged to be abnormal, or when the memory usage rate is greater than 90%, the working status of the simulation client is judged to be abnormal, or when the response time is greater than 300ms, the working status of the simulation client is judged to be abnormal. In addition, the self-healing action is to automatically restart the corresponding simulation client.

[0041] S423, sorting out the online status judgment result and the working status judgment result of the simulation client to obtain an abnormality analysis result.

[0042] When the online state of the simulation client is abnormal or the working state is determined to be abnormal, risk level classification is also required, which specifically includes the following steps: When the online state of the simulation client is abnormal, determining that the risk level of the simulation client is level one; When the working state of the simulation client is abnormal, determining that the risk level of the simulation client is level one; When the risk level of the simulated client is level one, and the abnormal online state time of the simulated client is greater than a preset abnormal time threshold, the risk level of the simulated client is determined to be level two; When the risk level of the simulation client is level one, and the abnormal time of the working state of the simulation client is greater than a preset abnormal time threshold, the risk level of the simulation client is determined to be level two.

[0043] In this embodiment, when the online status of the simulation client is abnormal and the monitoring module has not extracted a new "heartbeat packet" for more than 20 consecutive time periods, the risk level of the simulation client is determined to be level two; when the working status of the simulation client is abnormal, if it is an abnormal judgment corresponding to a processor usage rate greater than 80%, when the processor usage rate exceeds 80% for three consecutive minutes, the risk level of the simulation client is determined to be level two; if it is an abnormal judgment corresponding to a memory usage rate greater than 90%, when the memory usage rate exceeds 90% for three consecutive minutes, the risk level of the simulation client is determined to be level two; if it is an abnormal judgment corresponding to a response time greater than 300ms, when the response time of 20 consecutive user requests is greater than 300ms, the risk level of the simulation client is determined to be level two.

[0044] S5. Perform an integrated evaluation based on the performance analysis results and the abnormality analysis results to obtain a test report.

[0045] S511, counting the changing trend of performance indicators and the success rates of different request types according to the performance analysis results, and visualizing the statistical results to obtain a performance analysis chart; Synchronously, according to the abnormal analysis result, the status data, risk level data and real-time resource information corresponding to the status data of the simulation client are counted and visualized to obtain an abnormal analysis chart; S512, analyzing the bottleneck of the simulation model based on the performance analysis chart to obtain a bottleneck analysis result, and analyzing the resource usage rate of the simulation client based on the abnormal analysis chart; S513, collating the performance analysis chart, exception analysis chart, bottleneck analysis results and resource usage rate to obtain a test report.

[0046] A technical solution also provided in an embodiment of the present invention is a test device for simulating user behavior, comprising: a control module, a storage unit, a simulation client, a data analysis module and a monitoring module; The data transmission end of the control module is electrically connected to the data transmission end of the storage unit, the control module is communicatively connected to the simulation client via a digital link, the data analysis module is communicatively connected to the control module via a digital link, and the monitoring module is communicatively connected to the control module via a digital link.

[0047] This embodiment has at least the following substantial effects: This embodiment allocates test subtasks to the simulation client according to the real-time resource information of the simulation client and the preset test tasks, so that multiple simulation clients can test the same business system at the same time, so that the performance test of the business system is no longer limited by the performance of a certain simulation client, and configures the simulation model in the simulation client according to the test subtasks and the preset test parameter set, so that the adaptability of the simulation model and the test subtask is optimal, and the simulation model executes the corresponding test subtask to obtain the corresponding test data, the data analysis module analyzes the performance of the tested business system based on the test data and outputs the performance analysis results, and the monitoring module analyzes the running status of the tested business system during the test process based on the test data and outputs the abnormality The analysis results are finally integrated and evaluated based on the performance analysis results and the abnormality analysis results to obtain a test report that fully explores the performance limits of the business system under test, thereby significantly improving the accuracy of the distributed simulation test method that simulates user behavior in testing the performance of the business system; in addition, in the process of testing the performance of the business system in the present application, that is, in the process of executing the preset test tasks, according to the test data order constructed according to the asymmetric encryption mechanism and the access token mechanism, when the monitoring module finds that the test data is abnormal, the corresponding simulation client can be quickly locked in combination with the test data order, and then the corresponding node in the test task can be found through the test subtask corresponding to the simulation client, thereby discovering the excellent position for improving the performance of the business system under test.

[0048] The above specific embodiments are preferred embodiments of the present invention, and are not intended to limit the specific implementation scope of the present invention. The scope of the present invention includes but is not limited to the present specific embodiments. All equivalent changes made in accordance with the shape, structure, and method of the present invention are within the protection scope of the present invention.

Claims

1. A distributed simulation test method for simulating user behavior, characterized in that: The method comprises the following steps: S1. Acquire real-time resource information of the simulation client, and the control module assigns test subtasks to the simulation client according to the real-time resource information and preset test tasks; S2. configuring a simulation model in the simulation client based on the test subtask and a preset test parameter set; S3, the simulation model executes the corresponding test subtask to obtain the corresponding test data, and stores the test data into the storage unit according to the data interaction rule; S4, the data analysis module extracts the test data in the storage unit according to the message queue rules to perform performance analysis to obtain performance analysis results; synchronously, the monitoring module extracts the test data in the storage unit according to the message queue rules to perform anomaly analysis to obtain anomaly analysis results; S5. Perform an integrated evaluation based on the performance analysis results and the abnormality analysis results to obtain a test report.

2. A distributed simulation test method for simulating user behavior according to claim 1, characterized in that: In S1, the specific process of the control module allocating test subtasks to the simulation client according to the real-time resource information and the preset test tasks is as follows: S111, classifying the simulation clients into at least superior simulation clients and inferior simulation clients according to the network information, processor information and memory information in the real-time resource information; S112, extracting the number of concurrent users in the preset test task, and allocating the test task based on the preset concurrency ratio combined with the number of superior simulation clients and the number of inferior simulation clients to obtain the initial test subtask and concurrency factor; S113, matching the initial test subtask with different simulation clients according to the concurrency factor to obtain a test subtask; The concurrency factor represents the degree of correlation between the number of concurrent users of the test task and different simulation clients.

3. A distributed simulation test method for simulating user behavior according to claim 1, characterized in that: In S2, the specific process of configuring the simulation model in the simulation client based on the test subtask and the preset test parameter set is: S211, extracting the number of concurrent users in the test subtask, and matching the test parameters in a preset test parameter set according to the number of concurrent users; S212, installing a simulation model in a simulation client according to the concurrent user volume and test parameters; The test parameters include at least request frequency and test duration.

4. A distributed simulation test method for simulating user behavior according to claim 1, characterized in that: In S3, the specific process of storing the test data in the storage unit according to the data interaction rule is as follows: S311, encrypting the test data according to an asymmetric encryption mechanism, and creating an access token for the encrypted test data according to an access token mechanism; S312: The control module extracts the encrypted test data according to the access token and stores it in a storage unit.

5. A distributed simulation test method for simulating user behavior according to claim 4, characterized in that: In S4, the data analysis module extracts the test data in the storage unit according to the message queue rule to perform performance analysis to obtain the performance analysis result. The specific process is: S411, the data analysis module extracts the request start time, request end time, request type and response status in the test data from the storage unit according to the access token for statistics and classification; S412, calculating the performance index based on the statistically and classified test data and the performance index formula, and performing statistics according to the calculation results of the performance index; S413: sorting out the statistically and classified test data, the calculation results of the performance indicators, and the statistically completed performance indicator calculation results to obtain the performance analysis results; The performance indicators include at least response time, throughput, and error rate.

6. A distributed simulation test method for simulating user behavior according to claim 5, characterized in that: In S4, the monitoring module extracts the test data in the storage unit according to the message queue rule to perform abnormal analysis to obtain the abnormal analysis result. The specific process is: S421, the monitoring module extracts the request start time and the request end time in the test data from the storage unit according to the access token to determine the online status of the corresponding simulation client; When the online status of the simulation client is normal, the monitoring module collects the processor usage rate, memory usage rate and response time of the simulation client to judge the working status; Synchronously, when the online status of the simulation client is abnormal, the simulation client performs abnormal recovery according to a preset self-healing action; S422: When the working state of the simulation client is abnormal, the simulation client performs abnormal recovery according to a preset self-healing action; S423, sorting out the online status judgment result and the working status judgment result of the simulation client to obtain an abnormality analysis result.

7. A distributed simulation test method for simulating user behavior according to claim 6, characterized in that: In S422, according to the processor usage rate, memory usage rate and response time of the simulation client, the working status of the simulation client is judged into three types, including: When the processor usage rate is greater than a preset processor usage threshold, determining that the working state of the simulation client is abnormal; Synchronously, when the response time is greater than a preset response time threshold, the working state of the simulation client is determined to be abnormal; synchronously, when the memory usage rate is greater than a preset memory usage threshold, the working state of the simulation client is determined to be abnormal.

8. A distributed simulation test method for simulating user behavior according to claim 6, characterized in that: In S4, when the online status of the simulation client is abnormal or the working status is determined to be abnormal, risk level classification is required, specifically: When the online state of the simulation client is abnormal, determining that the risk level of the simulation client is level one; When the working state of the simulation client is abnormal, determining that the risk level of the simulation client is level one; When the risk level of the simulated client is level one, and the abnormal online state time of the simulated client is greater than a preset abnormal time threshold, the risk level of the simulated client is determined to be level two; When the risk level of the simulation client is level one, and the abnormal time of the working state of the simulation client is greater than a preset abnormal time threshold, the risk level of the simulation client is determined to be level two.

9. A distributed simulation test method for simulating user behavior according to claim 6, characterized in that: In S5, the specific process of integrating and evaluating the performance analysis results and the abnormality analysis results to obtain the test report is as follows: S511, counting the changing trend of performance indicators and the success rates of different request types according to the performance analysis results, and visualizing the statistical results to obtain a performance analysis chart; Synchronously, according to the abnormal analysis result, the status data, risk level data and real-time resource information corresponding to the status data of the simulation client are counted and visualized to obtain an abnormal analysis chart; S512, analyzing the bottleneck of the simulation model based on the performance analysis chart to obtain a bottleneck analysis result, and analyzing the resource usage rate of the simulation client based on the abnormal analysis chart; S513, collating the performance analysis chart, exception analysis chart, bottleneck analysis results and resource usage rate to obtain a test report.

10. A test device for simulating user behavior, applicable to a distributed simulation test method for simulating user behavior as claimed in any one of claims 1 to 9, characterized in that: It includes: control module, storage unit, simulation client, data analysis module and monitoring module; The data transmission end of the control module is electrically connected to the data transmission end of the storage unit, the control module is communicatively connected to the simulation client via a digital link, the data analysis module is communicatively connected to the control module via a digital link, and the monitoring module is communicatively connected to the control module via a digital link.

Citation Information

Patent Citations

  • Performance test system and method based on business scene

    CN115562978A