Pressure testing method, device, electronic device and readable storage medium

By establishing a communication connection between the stress testing program and the test result processing program, and combining multi-core parallel processing and step-by-step aggregation technology, the problems of stress generation capacity and latency in existing stress testing methods are solved, and efficient and timely data processing and output are achieved.

CN115757120BActive Publication Date: 2026-05-01BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2022-11-15
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing stress testing methods have poor pressure generation capacity and high latency, failing to meet the needs for efficient and convenient stress testing.

Method used

By establishing a communication connection between the stress testing program and the test result processing program, stress test results are directly transmitted, avoiding file storage transfer. Multi-core parallel processing and step-by-step aggregation technology are used to optimize the data transmission mechanism.

Benefits of technology

It improves the stress testing capacity and data processing speed, reduces waiting time, and enhances user experience and the timeliness of data output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757120B_ABST
    Figure CN115757120B_ABST
Patent Text Reader

Abstract

The present disclosure provides a pressure test method and device, electronic equipment and storage medium, relates to the technical field of cloud service, and particularly relates to the field of cloud test. The specific implementation scheme is: a pressure test program and a test result processing program are created, and a communication connection between the pressure test program and the test result processing program is established; a plurality of pressure test results are obtained by executing the pressure test program, and the plurality of pressure test results are sent to the test result processing program through the communication connection; the plurality of pressure test results received are aggregated by executing the test result processing program, and an aggregation result is output. Through the technical scheme of the present disclosure, the data transmission mechanism in the existing pressure test scheme can be optimized, and the effect of pressure test can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Pressure testing methods, apparatus, electronic equipment and readable storage media Technical Field

[0001] This disclosure relates to the field of cloud service technology, and more particularly to cloud testing technology, specifically to a stress testing method, a stress testing device, an electronic device, and a non-transitory computer-readable storage medium storing computer instructions. Background Technology

[0002] When conducting stress tests, related technologies require running a stress test process and a file processing process separately within the stress test tool. The stress test process starts multiple stress test threads to perform stress tests and synchronously records the stress data generated during the test to a configuration file under the command path. Then, the file processing process reads the data from this file into memory, aggregates and summarizes it, and then sends it back to the client side for real-time user viewing.

[0003] However, the aforementioned stress testing methods have drawbacks such as poor pressure generation capacity and high latency, which cannot meet people's growing demand for efficient and convenient stress testing. Summary of the Invention

[0004] This disclosure provides a method for stress testing, a stress testing apparatus, an electronic device, and a non-transitory computer-readable storage medium storing computer instructions.

[0005] According to one aspect of this disclosure, a stress testing method is provided, comprising:

[0006] Create a stress test program and a test result processing program, and establish a communication connection between the stress test program and the test result processing program;

[0007] The stress test program is executed to obtain multiple stress test results, and the multiple stress test results are sent to the test result processing program through the communication connection.

[0008] The received multiple stress test results are aggregated by executing the test result processing program, and the aggregated result is output.

[0009] According to one aspect of this disclosure, a pressure testing apparatus is provided, comprising:

[0010] A communication connection establishment module is used to create a stress test program and a test result processing program, and to establish a communication connection between the stress test program and the test result processing program.

[0011] The test result sending module is used to obtain multiple stress test results by executing the stress test program, and send the multiple stress test results to the test result processing program through the communication connection;

[0012] The aggregation result output module is used to aggregate the received multiple stress test results by executing the test result processing program and output the aggregated result.

[0013] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0014] At least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any embodiment of this disclosure.

[0017] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to cause a computer to perform the method as described in any embodiment of this disclosure.

[0018] According to another aspect of this disclosure, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the method as described in any embodiment of this disclosure.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0020] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0021] Figure 1a schematically illustrates an exemplary system architecture according to an embodiment of the present disclosure;

[0022] Figure 1b is a flowchart of a stress testing method provided according to an embodiment of the present disclosure;

[0023] Figure 2 is a schematic diagram of another stress testing method provided according to an embodiment of the present disclosure;

[0024] Figure 3 is a schematic diagram of another stress testing method provided according to an embodiment of the present disclosure;

[0025] Figure 4 is a stress test scenario diagram provided according to an embodiment of the present disclosure;

[0026] Figure 5 is a flowchart of a pressure testing device provided according to an embodiment of the present disclosure;

[0027] Figure 6 is a block diagram of an electronic device used to implement the pressure testing method of the embodiments of the present disclosure. Detailed Implementation

[0028] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0029] The following description, in conjunction with Figure 1a, will illustrate the system architecture of the stress testing method and stress testing device provided in this disclosure.

[0030] Figure 1a schematically illustrates an exemplary system architecture 100 according to an embodiment of the present disclosure. It should be noted that Figure 1a is merely an example of a system architecture to which embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that embodiments of the present disclosure cannot be used in other devices, systems, environments, or scenarios.

[0031] As shown in Figure 1a, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a stress testing system 105. The network 104 serves as a medium for providing a communication link between the terminal devices 101, 102, and 103 and the stress testing system 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0032] Users can use terminal devices 101, 102, and 103 to interact with the stress testing system via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0033] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0034] The stress testing system 105 may include, for example, a stress testing device that provides stress testing services to users using stress testing task configuration data uploaded by terminal devices 101, 102, and 103. The stress testing device can perform stress testing based on the received stress testing task configuration data and return the aggregated stress test results to the terminal devices 101, 102, and 103 for display.

[0035] Stress testing equipment can be cloud servers, also known as cloud computing servers or cloud hosts. It is a host product in the cloud computing service system, which solves the defects of traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short) in terms of high management difficulty and weak business scalability.

[0036] It should be noted that the stress testing method provided in this embodiment can generally be executed by the stress testing system 105. Correspondingly, the stress testing device provided in this embodiment can generally be installed in the stress testing system 105. The stress testing method provided in this embodiment can also be executed by a server or server cluster that is different from the stress testing system 105 and capable of communicating with terminal devices 101, 102, 103 and / or the stress testing system 105. Correspondingly, the stress testing device provided in this embodiment can also be installed in a server or server cluster that is different from the stress testing system and capable of communicating with terminal devices 101, 102, 103 and / or the stress testing system 105.

[0037] It should be understood that the number of terminal devices, networks, and servers in Figure 1a is merely illustrative. Any number of terminal devices, networks, and servers can be used depending on implementation needs.

[0038] Figure 1b is a flowchart of a stress testing method provided according to an embodiment of the present disclosure. This embodiment is applicable to stress testing of services under test, and is used to improve stress testing performance. The method can be executed by a stress testing device, which can be implemented in hardware and / or software, and is generally integrated into a stress testing equipment for use with the device under test configured with the service under test.

[0039] As shown in Figure 1b, a stress testing method provided in this embodiment includes the following specific steps:

[0040] S110. Create a stress test program and a test result processing program, and establish a communication connection between the stress test program and the test result processing program.

[0041] This involves pre-installing stress testing software on the stress testing equipment. Users can then create stress testing tasks using this software, and configure various stress testing parameters within those tasks.

[0042] The stress testing equipment can be configured with multiple computing cores (also known as computing units) to execute stress testing tasks efficiently and quickly.

[0043] When a user chooses to trigger a stress test task in the stress testing software, a stress test program and a test result processing program can be created accordingly.

[0044] The stress test program can be a stress test script generated based on various stress test parameters. By executing the stress test program, users can simulate stress testing on the service under test and obtain the corresponding stress test results.

[0045] The test result processing program is used to aggregate the results of various stress tests and output the corresponding aggregated results.

[0046] In this embodiment, unlike the related technologies where the stress test program writes various stress test results to a file and the test result processing program reads the stress test results from the file for aggregation processing, a method is proposed to directly establish a communication connection between the stress test program and the test result processing program. This achieves direct transmission of stress test results without using file storage as a relay.

[0047] Optionally, the communication connection between the stress testing program and the test result processing program can be established by means of establishing a communication channel, message subscription, shared memory, or establishing a socket connection, etc. This embodiment does not limit this.

[0048] S120. Obtain multiple stress test results by executing the stress test program, and send the multiple stress test results to the test result processing program through the communication connection.

[0049] The stress testing program and the test result processing program can be triggered and executed independently and in parallel. The stress testing program interacts directly with the service under test, for example, simulating users sending various service requests to the service interface of the service under test to perform stress testing. After sending service requests to the service under test, the stress testing program can obtain the stress test results based on the response of the service under test.

[0050] The stress test results may include information such as response time, whether there was packet loss, and whether retransmission was required.

[0051] The stress testing program transmits multiple stress test results to the test result processing program based on the type of communication connection between the program and the test result processing program.

[0052] Specifically, multiple stress test results can be transmitted by writing to shared memory, writing to a message queue, or sending to a pre-established communication channel.

[0053] S130. The received multiple stress test results are aggregated by executing the test result processing program, and the aggregated result is output.

[0054] In this embodiment, after obtaining the stress test results sent by the stress test program, the test result processing program needs to summarize and statistically analyze the above stress test results to obtain one or more key stress test indicators, such as throughput, packet loss rate, latency, and retransmission rate.

[0055] The process of summarizing and statistically analyzing the results of each stress test is called the aggregation process, and the above-mentioned key stress test indicators obtained by aggregation are the aggregation results.

[0056] Understandably, after triggering a stress test task, users need to view the stress test monitoring data in real time during the stress test process, i.e., the aggregated results mentioned above. Therefore, the test result processing program, after obtaining the aggregated results, needs to output them.

[0057] The optional output methods for the aggregation results include real-time transmission back to the client for immediate display, outputting the aggregation results to a file, or sending the aggregation results to a designated database for storage. This embodiment does not impose any restrictions on these methods.

[0058] The client side can be the human-machine interface in the stress testing equipment, or it can be other terminal devices that communicate with the stress testing equipment, such as the human-machine interface on a mobile phone or tablet.

[0059] The technical solution of this invention establishes a communication connection between the stress testing program and the test result processing program, eliminating the need for file storage as an intermediary, and directly realizing the inter-program transmission of stress testing results. This optimizes the data transmission mechanism in existing stress testing solutions and improves the effectiveness of stress testing.

[0060] Figure 2 is a flowchart of another stress testing method provided according to an embodiment of this disclosure. This disclosure refines the above-described embodiments, further detailing the method for establishing the communication connection, as well as the operations performed by the stress testing program and the test result processing program.

[0061] As shown in Figure 2, a stress testing method provided in this embodiment includes the following specific steps:

[0062] S210. Create a test result processing process, and create a socket server in the test result processing process to listen for socket client connections.

[0063] In this embodiment, the test result processing program and the stress testing program created in the stress testing software can be programs in the form of processes. A process can be understood as an independent unit of resource allocation and scheduling. After a software starts, one or more processes can be created to implement the corresponding process service functions.

[0064] S220. Create a stress test process, and create the socket client in the stress test process, and initiate a communication connection to the socket server through the socket client.

[0065] In an optional implementation of this embodiment, inter-process communication can be achieved through sockets to establish a communication connection between the stress testing process and the test result processing process, thereby achieving inter-process communication in a simple and convenient way.

[0066] Specifically, a socket server can be created during the test result processing, and this socket server can begin listening for socket client connections. Simultaneously, during the stress test process, a socket client is created, and after its creation, it initiates a connection request to the socket server. When the socket server receives the connection request, it completes the socket connection and sends a connection completion message to the socket client. At this point, the socket client can send the required data to the socket server as a socket data stream.

[0067] S230. By executing the stress test program, multiple stress test scheduling units are triggered to be established.

[0068] In this embodiment, to achieve effective stress testing, multiple stress test scheduling units can be created in the stress test program to perform stress tests on the service under test concurrently. A stress test scheduling unit can be understood as a basic unit that can be scheduled by a central processing unit or a computing core in the stress test equipment.

[0069] In a specific example, the stress test program can be a program implemented using the Java programming language, and correspondingly, the stress test scheduling unit can be a stress test thread.

[0070] The number of stress test threads can be determined by the number of computing cores included in the stress test equipment and the requirements of the stress test task. Those skilled in the art can preset the number of threads according to actual needs.

[0071] S240. By concurrently executing the multiple stress test scheduling units, multiple stress test requests are sent to the service under test in parallel, and multiple response data fed back by the service under test are received as stress test results.

[0072] Each stress test scheduling unit, once triggered, can independently send one or more service requests (i.e., stress test requests) to the test interface of the service under test in order to request the service under test to provide corresponding response data.

[0073] Specifically, the stress test request can be determined according to the requirements of the stress test task. For example, it can be an HTTP (Hypertext Transfer Protocol) request such as a data query request, a user login request, or an authentication request. This embodiment does not impose any restrictions on this.

[0074] Meanwhile, after each stress test scheduling unit sends a stress test request to the service under test, it can receive the response data from the service under test in response to the stress test request.

[0075] S250. The received stress test results are sent to the test result processing program through the communication connection by each stress test scheduling unit.

[0076] Each stress test scheduling unit, upon receiving the stress test results, can send the stress test results to the test result processing program via a socket data stream, based on a socket connection established in advance with the test result processing program.

[0077] It should be reiterated that in related technologies, because the stress testing program writes the received stress test results to a local file in a specified directory for the test result processing program to read, each stress test scheduling unit in the stress testing program needs to write the received stress test results to this local file. However, during the stress test, since only one stress test scheduling unit is allowed to perform a local file write operation at a time, a large number of stress test scheduling units become blocked because they cannot obtain a handle to the local file, which significantly reduces the stress testing capability.

[0078] In contrast, in this embodiment, the stress testing program no longer needs to write a large number of stress test results to local files, but can directly send the above multiple stress test results to the test result processing program, which fundamentally solves the problems of the related technologies.

[0079] In this embodiment, in order to make full use of the multi-core performance of the stress testing equipment, the test result processing program can be further divided into independently running reading subroutines, processing subroutines and output subroutines to achieve different data processing functions in parallel.

[0080] Specifically, a reading subroutine can be used to read the stress test results sent by the stress test program, a processing subroutine can be used to aggregate multiple stress test results, and an output subroutine can be used to output the aggregated results.

[0081] By using the above settings, a test result processing program that executes data processing tasks serially can be divided into multiple subroutines that execute in parallel, thereby further improving data processing speed, reducing data output latency, and enhancing user experience.

[0082] Specifically, when the test result processing program is a test result processing process, the above subroutines can be reading subprocesses, processing subprocesses, and output subprocesses, respectively.

[0083] S260. By executing the reading subroutine, the received multiple stress test results are written into the first buffer.

[0084] During execution, the reading subroutine continuously retrieves stress test results from the socket data stream and writes these results into a preset data buffer, namely the first buffer.

[0085] Specifically, when the reading subroutine writes each stress test result to the first data buffer, it simultaneously writes a timestamp corresponding to each stress test result. This timestamp can be understood as the time when the reading subroutine retrieves the stress test result, or it can be understood as the response time of the service under test to the stress test request feedback service, etc.

[0086] Specifically, by pre-setting the reading subroutine and the processing subroutine to share the first cache area, the processing subroutine can directly obtain the stress test results from the first cache area for aggregation processing.

[0087] S270. By executing the processing subroutine, the multiple stress test results are read from the first cache area, aggregated, and the aggregated results are written to the second cache area.

[0088] In this embodiment, the processing subroutine can aggregate the stress test results read in batches from the first cache according to time points, and write the aggregated results corresponding to each time point to the second cache.

[0089] As mentioned earlier, by reading the timestamp information of each stress test result from the first cache, the response time of each stress test result to the stress test request can be determined accordingly. Then, the stress test results can be grouped according to pre-set time points. Afterwards, the stress test results in each group can be aggregated to obtain the aggregated result corresponding to each time point. The aforementioned time points can be set according to the start and end times of the stress test.

[0090] In a specific example, a response time interval that matches the stress test time range can be determined based on the start and end times of the stress test. For instance, if the stress test starts at 3:00 and ends at 3:10, the corresponding response time interval can be determined to start at 3:00 and end at 3:15. Furthermore, multiple time points can be determined within this response time interval; for example, using a 5-minute interval, 3:00, 3:05, and 3:15 can be identified. After obtaining the timestamp information of each stress test result, these results can be assigned to one of the three cluster sets corresponding to the given time points according to a preset aggregation rule. Then, the stress test results can be divided into three cluster sets, and the stress test results within each cluster set can be aggregated separately to obtain the corresponding aggregation result.

[0091] The first and second caches are both located in the memory of the stress testing device and are implemented through a shared memory mechanism.

[0092] Considering the long duration of the entire stress test process, the generally large amount of stress test results to be processed, and the continuous storage of stress test results into the first cache over a continuous period, the processing subroutine can aggregate the stress test results in batches to ensure that the aggregated results are updated in real time and output immediately, typically with immediate feedback and display.

[0093] The processing subroutine can aggregate stress test results according to time points, and then statistically analyze one or more key stress test indicators as aggregated results based on time points.

[0094] Specifically, by pre-setting the processing subroutine and the output subroutine to share the second buffer, the output subroutine can directly obtain the aggregation results at each time point from the second buffer and output the aggregation results at each time point.

[0095] S280. By executing the output subroutine, the aggregation result is read from the second buffer and the aggregation result is output.

[0096] The output subroutine can sequentially obtain the aggregated results at each set time point and output the aggregated results at each time point, so that the client can view the aggregated results at different time points in real time. For example, during stress testing, the client can view information such as latency, packet loss rate, and retransmission rate at each time point in real time.

[0097] The technical solution of this invention establishes a communication connection between the test result processing process and the stress test thread, and uses multiple stress test scheduling units to send multiple stress test requests to the service under test in parallel. This can improve the concurrency of stress testing, avoid the problem that the stress test scheduling unit cannot concurrently obtain the handle to write local files and is frequently blocked, reduce the waiting time of stress testing, and improve the stress test capability.

[0098] Meanwhile, by decomposing the test result processing program into multiple independently executed subroutines, the data processing, data aggregation, and data output operations that previously needed to be executed serially can be executed independently through multiple parallel processes. This improves the data processing speed, thereby effectively increasing the data output and real-time display speed, and greatly enhancing the user experience.

[0099] Based on the above embodiments, executing the processing subroutine to read the multiple stress test results from the first cache, perform aggregation processing, and write the aggregation results to the second cache may include:

[0100] By executing the processing subroutine, whenever a new stress test result is detected stored in the first cache, the newly stored stress test result is read from the first cache, aggregated, and the aggregated result is written to the second cache.

[0101] In this embodiment, since the processing subroutine and the reading subroutine execute independently and in parallel, the data processing operation of the processing subroutine can be triggered based on changes in the data in the first buffer. For example, the processing subroutine can scan the first buffer every set interval (e.g., 1 second, 2 seconds, or 3 seconds). When it detects new data stored in the first buffer, it determines that this new data is a new stress test result written by the reading subroutine. At this time, aggregation processing is performed based on the new stress test result.

[0102] Based on the above embodiments, reading the aggregation result from the second buffer by executing the output subroutine may include:

[0103] By executing the output subroutine, whenever a new aggregation result is detected stored in the second buffer, the newly stored aggregation result is read from the second buffer.

[0104] Similarly, since the output subroutine and the processing subroutine execute independently and in parallel, the output subroutine's aggregation result output operation can be triggered based on data changes in the second buffer. For example, the output subroutine can scan the second buffer every set interval (e.g., 1 second, 2 seconds, or 3 seconds). When it detects new data in the second buffer, it determines that this new data is a new aggregation result obtained from the processing subroutine's aggregation process. At this point, these new aggregation results can be output, for example, by sending them back for display.

[0105] Through the above settings, the advantages of data interaction based on shared memory are fully utilized. The reading subroutine, processing subroutine, and output subroutine can run independently to the greatest extent without interfering with each other, maximizing the advantages of multi-core parallel computing, further improving the execution efficiency of the test result processing program, minimizing stress test time loss, and improving the timeliness of aggregated result output.

[0106] Figure 3 is a flowchart of another stress testing method provided according to an embodiment of the present disclosure; the present disclosure is based on the above-mentioned disclosed embodiments and is further refined. In this embodiment, the operations performed by reading the subprocess, processing the subprocess, and outputting the subprocess are further refined.

[0107] As shown in Figure 3, a stress testing method provided in this embodiment includes the following specific steps:

[0108] S310. Create a stress test program and a test result processing program, and establish a communication connection between the stress test program and the test result processing program.

[0109] Specifically, creating a test result processing program includes creating independently running subroutines for reading, processing, and outputting results.

[0110] S320. Create a resource pool by executing the processing subroutine, and initialize multiple data processing scheduling units in the resource pool.

[0111] In this embodiment, in order to further improve the efficiency of data processing and give full play to the multi-core advantages of the stress testing equipment, multiple data processing scheduling units can be created in the processing subroutine. These multiple data processing scheduling units can be executed in parallel and work together to further improve the aggregation efficiency in a step-by-step aggregation manner.

[0112] Optionally, if the test result processing program is a program implemented using the Python programming language, then the data processing scheduling unit can be a data processing process.

[0113] Accordingly, the processing subroutine can create a process pool and initialize multiple data processing processes within the pool. Each data processing process can then execute independently, performing its corresponding data aggregation task during execution.

[0114] S330. By executing the reading subroutine, the received multiple stress test results are written into the first buffer.

[0115] S340. By executing the processing subroutine, the stress test result set of the current batch is read from the first buffer, and the stress test result set is clustered according to time points.

[0116] As mentioned earlier, to achieve real-time output of aggregation results, the large number of stress test results generated by the stress test process can be processed in batches. Specifically, the stress test results in the first buffer can be read in batches according to the data volume or data timestamp.

[0117] Specifically, a set amount of new data (e.g., 1M, 2M, or 5M) can be read from the first buffer each time to serve as the stress test result set for the current batch. Alternatively, all new data generated within a set time interval (e.g., 5 seconds) can be read from the first buffer every set time interval to serve as the stress test result set for the current batch. This embodiment does not impose any limitations on this.

[0118] After obtaining the stress test result set for the current batch, the stress test results can be clustered according to the timestamp information of each stress test result in the stress test result set, such as the response time of the feedback response information of the service under test.

[0119] Specifically, after determining the start and end times of the stress test, a response time interval can be defined based on these times. Then, multiple time points can be selected within this interval according to a preset time span, and the stress test results can be clustered according to preset data partitioning rules. For example, if time points are selected in minutes, stress test results with timestamps between two time points can be uniformly assigned to a specific time point according to preset data partitioning rules.

[0120] For example, if we divide the time points according to the following format: 2:58 PM, 2:59 PM, and 3:00 PM on November 5, 2022, then all stress test results with timestamps between 2:58 PM and 2:59 PM on November 5, 2022, can be clustered into a cluster set matching 2:58 PM on November 5, 2022. Similarly, all stress test results with timestamps between 2:59 PM and 3:00 PM on November 5, 2022, can be clustered into an aggregate set matching 2:59 PM on November 5, 2022.

[0121] With the above settings, the current batch of stress test results can be further divided into aggregate sets at multiple time points.

[0122] S350. By executing the processing subroutine, the target cluster set at the target time point is obtained sequentially, and the target cluster set is divided into multiple data groups.

[0123] In this embodiment, considering that the number of stress test results contained in each aggregate set is also very large, it is further selected to further decompose the cluster sets at the same time point.

[0124] Optionally, the processing subroutine can sequentially obtain the cluster set at each time point in chronological order and perform parallel aggregation processing by multiple data processing scheduling units. The target cluster set at the target time point can be understood as the aggregation set at the current processing time point.

[0125] In this embodiment, the target cluster set can be divided into multiple data groups according to a preset data volume or according to the number of idle data processing scheduling units contained in the resource pool.

[0126] In a specific example, the target cluster set can be divided into multiple 1KB data groups, or, assuming that the source pool contains 128 idle data processing scheduling units, the target cluster set can be divided into 128 data groups, etc. This embodiment does not impose any restrictions on this.

[0127] S360. By executing the processing subroutine, multiple data groups are allocated to multiple data processing scheduling units in the resource pool for one aggregation process to obtain a first aggregation result.

[0128] If the number of idle data processing scheduling units in the resource pool exceeds the number of data groups, each data group can be allocated to each data processing scheduling unit at once for parallel aggregation processing. If the number of idle data processing scheduling units in the resource pool is less than the number of data groups, each data processing scheduling unit, after aggregating the currently allocated data groups, can continue to query whether there are any unprocessed data groups. If so, it can continue to perform data group aggregation processing.

[0129] The aggregation process performed by each data processing scheduling unit on its assigned data group can be understood as the unit calculating local key stress test metrics only for each stress test result included in that data group. These local key stress test metrics represent only a portion of the data sources for the final key stress test metrics to be calculated.

[0130] S370. By executing the processing subroutine, the first aggregation results of each of the plurality of data processing scheduling units are subjected to secondary aggregation processing to obtain the aggregation result corresponding to the target time point.

[0131] After the processing subroutine obtains all the first aggregation results from the grouping and calculation of all data at the target time point by each data processing scheduling unit, the above first aggregation results can be aggregated again, that is, the second aggregation process, to obtain the aggregation result corresponding to the target time point.

[0132] In this embodiment, by combining the parallel processing mechanism of the resource pool with the step-by-step aggregation technology, the aggregation efficiency can be greatly improved.

[0133] S380. By executing the processing subroutine, the aggregation result corresponding to the target time point is written to the second cache area.

[0134] S390. By executing the processing subroutine, the aggregation result corresponding to the target time point is written to the second cache area, and the process returns to execute the operation of sequentially obtaining the target cluster set under the target time point until the processing of the stress test result set of the current batch is completed.

[0135] In this embodiment, the processing subroutine can obtain the matching aggregation results of the current batch of stress test results in chronological order and write them to the second buffer to ensure that the output subroutine outputs the aggregation results in real time. Typically, the aggregation results are sent back to the client for display.

[0136] The processing subroutine can continue to obtain the next batch of stress test results after completing the aggregation processing of the current batch of stress test results, until all stress test results in the first buffer are processed.

[0137] S3100: By executing the output subroutine, the aggregation result is read from the second buffer and the aggregation result is output.

[0138] The technical solution of this invention greatly improves aggregation efficiency by creating a resource pool in the processing subroutine and having multiple data processing scheduling units in the resource pool perform the step-by-step aggregation of stress test data in parallel, thereby significantly improving the efficiency of data processing and data output.

[0139] Figure 4 is a stress test scenario diagram provided according to an embodiment of the present disclosure. As shown in Figure 4, the entire stress test process requires the coordinated execution of four programs (processes) in the stress test software. Specifically, the four programs include: a stress test program, a reading subroutine, a processing subroutine, and an output subroutine.

[0140] The complete stress test process is as follows:

[0141] 1) The subroutine creates a Socket server and starts listening for Socket client connections.

[0142] 2) When the stress test program starts to generate stress, it creates a Socket client and sends a connection request to the Socket server.

[0143] 3) Read the subroutine to create a data processing process pool, and initialize several subprocesses in the data processing process pool.

[0144] 4) The output subroutine creates a data return thread.

[0145] 5) The reading subprocess accepts the connection request, completes the connection, replies to the Socket client with a connection success message, and starts an independent thread to listen for and read the Socket data stream.

[0146] 6) After receiving the connection success message, the stress test program starts the stress test.

[0147] 7) After the stress test program sends stress test requests through multiple concurrent threads and receives response data, it writes the response data to the Socket data stream.

[0148] 8) After multiple threads in the stress test program have completed writing the results, repeat step 7) until the stress test ends.

[0149] 9) After reading the data written in the Socket data stream, the independent thread in the reading subroutine writes the data to the data processing buffer, which is shared with the processing subroutine.

[0150] 10) The processing subroutine reads a batch of data from the data processing buffer and groups it according to the time point when the data was generated.

[0151] 11) The processing subroutine reads data at a certain point in time and divides it into several groups.

[0152] 12) The processing subroutine distributes the data group at a certain point in time to each subprocess in the data processing process pool for data aggregation.

[0153] 13) The processing subroutine performs a secondary aggregation of the aggregation results of each subprocess to generate the final data at this point in time, which is the aggregation result.

[0154] 14) The processing subroutine places the processed data into the data return buffer. This data return buffer is shared with the output subroutine.

[0155] 15) The processing subroutine checks for any unprocessed groups. If there are, proceed to step 11; otherwise, proceed to step 16.

[0156] 16) The processing subroutine checks whether the data processing is complete. If not, proceed to process 10); otherwise, close the process pool.

[0157] 17) The output subroutine retrieves all data from the data return buffer and returns it to the client.

[0158] 18) The output subroutine determines whether the return transmission has ended. If it has not ended, proceed to process 17); otherwise, the return transmission ends.

[0159] The above settings optimize the data transmission mechanism of the existing stress test, and improve the efficiency of data transmission between the stress test process and the test result processing process by using Socket technology to realize inter-process communication, reduce the waiting time of the stress test thread in the stress test process, and improve the stress testing capability.

[0160] Meanwhile, the test result processing process is split into different subroutines, each of which runs independently and shares data through a cache. In addition, in the data aggregation stage, the aggregation efficiency is improved by combining process pools and step-by-step aggregation, thereby improving the overall efficiency of data processing and feedback, and enhancing the user experience.

[0161] As an implementation of the above-described stress testing methods, this disclosure also provides an optional embodiment of an execution device for implementing the above-described stress testing methods.

[0162] Figure 5 is a structural schematic diagram of a pressure testing device provided according to an embodiment of the present disclosure; as shown in Figure 5, the pressure testing device includes: a communication connection establishment module 510, a test result sending module 520, and an aggregation result output module 530, wherein:

[0163] The communication connection establishment module 510 is used to create a stress test program and a test result processing program, and to establish a communication connection between the stress test program and the test result processing program.

[0164] The test result sending module 520 is used to obtain multiple stress test results by executing the stress test program, and send the multiple stress test results to the test result processing program through the communication connection.

[0165] The aggregation result output module 530 is used to aggregate the received multiple stress test results by executing the test result processing program and output the aggregation result.

[0166] The technical solution of this invention establishes a communication connection between the stress testing program and the test result processing program, eliminating the need for file storage as an intermediary, and directly realizing the inter-program transmission of stress testing results. This optimizes the data transmission mechanism in existing stress testing solutions and improves the effectiveness of stress testing.

[0167] Based on the above embodiments, the communication connection establishment module 510 can be specifically used for:

[0168] A socket server creation unit is used to create a test result processing process and create a socket server in the test result processing process to listen for socket client connections.

[0169] A socket client creation unit is used to create a stress test process, create the socket client in the stress test process, and initiate a communication connection to the socket server through the socket client.

[0170] Based on the above embodiments, the test result sending module 520 can be specifically used for:

[0171] By executing the stress test program, multiple stress test scheduling units are triggered and established;

[0172] By concurrently executing the multiple stress test scheduling units, multiple stress test requests are sent to the service under test in parallel, and multiple response data from the service under test are received as stress test results.

[0173] Based on the above embodiments, the test result processing program includes independently running reading subroutines, processing subroutines, and output subroutines;

[0174] Accordingly, the aggregation result output module 530 may specifically include:

[0175] The reading subroutine execution unit is used to write the received multiple stress test results into the first buffer area by executing the reading subroutine;

[0176] The processing subroutine execution unit is used to read the multiple stress test results from the first cache area, perform aggregation processing, and write the aggregation results to the second cache area by executing the processing subroutine.

[0177] The output subroutine execution unit is used to read the aggregation result from the second buffer and output the aggregation result by executing the output subroutine.

[0178] Based on the above embodiments, the processing subroutine execution unit can be specifically used for:

[0179] By executing the processing subroutine, the stress test results read in batches from the first cache are aggregated according to time points, and the aggregated results corresponding to each time point are written to the second cache.

[0180] Based on the above embodiments, a resource pool creation module may also be included, used for:

[0181] A resource pool is created by executing the processing subroutine, and multiple data processing scheduling units are initialized in the resource pool;

[0182] Accordingly, the subroutine execution unit can be specifically used for:

[0183] By executing the processing subroutine, the stress test result set of the current batch is read from the first cache, and the stress test result set is clustered according to time points;

[0184] By executing the processing subroutine, the target cluster set at the target time point is obtained sequentially, and the target cluster set is divided into multiple data groups;

[0185] By executing the processing subroutine, multiple data groups are assigned to multiple data processing scheduling units in the resource pool for aggregation processing to obtain a first aggregation result;

[0186] By executing the processing subroutine, the first aggregation results of each of the plurality of data processing scheduling units are subjected to secondary aggregation processing to obtain the aggregation result corresponding to the target time point;

[0187] By executing the processing subroutine, the aggregation result corresponding to the target time point is written to the second cache area, and the process returns to execute the operation of sequentially obtaining the target cluster set under the target time point until the processing of the stress test result set of the current batch is completed.

[0188] Based on the above embodiments, the subroutine execution unit can be specifically used for:

[0189] By executing the processing subroutine, whenever a new stress test result is detected stored in the first cache, the newly stored stress test result is read from the first cache, aggregated, and the aggregated result is written to the second cache.

[0190] Based on the above embodiments, the output subroutine execution unit can be specifically used for:

[0191] By executing the output subroutine, whenever a new aggregation result is detected stored in the second buffer, the newly stored aggregation result is read from the second buffer.

[0192] The above-described products can perform the methods provided in any embodiment of this disclosure, and have the corresponding functional modules and beneficial effects for performing the methods.

[0193] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0194] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0195] Figure 6 illustrates a schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0196] As shown in Figure 6, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0197] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0198] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as implementing the stress testing methods as described in the various embodiments of the present invention. For example, in some embodiments, the stress testing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the stress testing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the stress testing methods described above by any other suitable means (e.g., by means of firmware).

[0199] That is: create a stress test program and a test result processing program, and establish a communication connection between the stress test program and the test result processing program;

[0200] The stress test program is executed to obtain multiple stress test results, and the multiple stress test results are sent to the test result processing program through the communication connection.

[0201] The received multiple stress test results are aggregated by executing the test result processing program, and the aggregated result is output.

[0202] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0203] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0204] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0205] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0206] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0207] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem that addresses the management difficulties and weak business scalability inherent in traditional physical hosting and VPS services. Servers can also be servers for distributed systems or servers integrated with blockchain technology.

[0208] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies mainly include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.

[0209] Cloud computing refers to a technology system that enables access to a shared pool of physical or virtual resources via a network. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for applications such as artificial intelligence and blockchain, as well as for model training.

[0210] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.

[0211] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A stress testing method, comprising: A stress testing program and a test result processing program are created, and a communication connection is established between the stress testing program and the test result processing program. The communication connection is established via methods such as establishing a communication pipe, message subscription, shared memory, or establishing a socket. Multiple stress testing results are obtained by executing the stress testing program, and these results are sent to the test result processing program through the communication connection. The test result processing program aggregates the received multiple stress testing results and outputs the aggregated result. The test result processing program includes independently running reading subroutines, processing subroutines, and output subroutines. Aggregating the received multiple stress testing results and outputting the aggregated result by executing the test result processing program includes: writing the received multiple stress testing results into a first buffer by executing the reading subroutine; reading the multiple stress testing results from the first buffer, aggregating them, and writing the aggregated result into a second buffer by executing the processing subroutine; and reading the aggregated result from the second buffer and outputting the aggregated result by executing the output subroutine.

2. The method according to claim 1, wherein, Creating a stress test program and a test result processing program, and establishing a communication connection between the stress test program and the test result processing program, includes: creating a test result processing process, and creating a socket server in the test result processing process to listen for socket client connections; creating a stress test process, and creating the socket client in the stress test process, and initiating a communication connection to the socket server through the socket client.

3. The method according to claim 1, wherein, The process of obtaining multiple stress test results by executing the stress test program includes: triggering the establishment of multiple stress test scheduling units by executing the stress test program; sending multiple stress test requests to the service under test in parallel by executing the multiple stress test scheduling units concurrently, and receiving multiple response data from the service under test as stress test results.

4. The method according to claim 1, wherein, By executing the processing subroutine, the multiple stress test results read from the first cache are aggregated and the aggregated results are written to the second cache. This includes: by executing the processing subroutine, the stress test results read from the first cache in batches are aggregated according to time points, and the aggregated results corresponding to each time point are written to the second cache.

5. The method according to claim 4, further comprising: A resource pool is created by executing the processing subroutine, and multiple data processing scheduling units are initialized in the resource pool; By executing the processing subroutine, the stress test results read in batches from the first cache are aggregated according to time points, and the aggregation results corresponding to each time point are written to the second cache. Specifically, this includes: by executing the processing subroutine, reading the stress test result set of the current batch from the first cache and clustering the stress test result set according to time points; by executing the processing subroutine, sequentially obtaining the target cluster set under the target time point and dividing the target cluster set into multiple data groups; by executing the processing subroutine, allocating the multiple data groups to multiple data processing scheduling units in the resource pool for one aggregation process to obtain a first aggregation result; by executing the processing subroutine, performing a second aggregation process on each of the first aggregation results of the multiple data processing scheduling units to obtain the aggregation result corresponding to the target time point; by executing the processing subroutine, writing the aggregation result corresponding to the target time point to the second cache, and returning to execute the operation of sequentially obtaining the target cluster set under the target time point until the processing of the stress test result set of the current batch is completed.

6. The method according to claim 1, wherein, By executing the processing subroutine, the multiple stress test results are read from the first cache area, aggregated, and the aggregated results are written to the second cache area. This includes: by executing the processing subroutine, whenever a new stress test result is detected in the first cache area, the newly stored stress test result is read from the first cache area, aggregated, and the aggregated result is written to the second cache area.

7. The method according to claim 1, wherein, Reading aggregation results from the second buffer by executing the output subroutine includes: reading the newly stored aggregation result from the second buffer whenever a new aggregation result is detected in the second buffer.

8. A pressure testing device, comprising: A communication connection establishment module is used to create a stress test program and a test result processing program, and establish a communication connection between the stress test program and the test result processing program; wherein, the communication connection between the stress test program and the test result processing program is established by means of establishing a communication pipe, message subscription, shared memory, or establishing a socket; a test result sending module is used to obtain multiple stress test results by executing the stress test program, and send the multiple stress test results to the test result processing program through the communication connection; an aggregation result output module is used to process the received multiple stress test results by executing the test result processing program. The test result processing program includes independently running reading, processing, and output subroutines. The output module specifically includes: a reading subroutine execution unit, used to write the received multiple stress test results into a first buffer by executing the reading subroutine; a processing subroutine execution unit, used to read the multiple stress test results from the first buffer, perform aggregation processing, and write the aggregation result into a second buffer by executing the processing subroutine; and an output subroutine execution unit, used to read the aggregation result from the second buffer and output the aggregation result by executing the output subroutine.

9. The apparatus according to claim 8, wherein the communication connection establishment module comprises: A socket server creation unit is used to create a test result processing process and create a socket server in the test result processing process to listen for socket client connections. A socket client creation unit is used to create a stress test process, create a socket client in the stress test process, and initiate a communication connection to the socket server through the socket client.

10. The apparatus according to claim 8, wherein, The test result sending module is specifically used to: trigger the establishment of multiple stress test scheduling units by executing the stress test program; By concurrently executing the multiple stress test scheduling units, multiple stress test requests are sent to the service under test in parallel, and multiple response data from the service under test are received as stress test results.

11. An electronic device, comprising: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.

13. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • DNS server pressure test method, electronic equipment and readable storage medium

    CN114465927A

  • Network data processing method and device, computer equipment and storage medium

    CN114691331A