Performance testing method and equipment, communication system
By acquiring and forwarding the client's processing request at the first node of the communication system, the problem of assembling the request to occupy performance at the same time when sending the processing request from the client is solved, and the performance detection efficiency of the target interface is improved.
Patent Information
- Application Number
- CN202111092167.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-09-17
AI Technical Summary
The performance detection efficiency of the target interface in the communication system is low, mainly because the client performs the assembly of processing requests at the same time during the process of sending the processing request, which occupies the client's performance and leads to inefficient efficiency.
By obtaining the corresponding processing request of the client at the first node and sending the processing request to the client, the client does not need to assemble processing requests, thereby avoiding the performance occupied by the assembly processing request.
This improves the efficiency of the client sending processing requests to the server, and thus improves the performance detection efficiency of the target interface.
Smart Images

Figure CN115842763B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a performance detection method and device, and a communication system. Background Art
[0002] The communication system includes a client and a server. The client is used to send a processing request to the server, and the processing request carries the address of the target interface (logical interface) in the server. After receiving the processing request, the server uses the function module corresponding to the target interface to process the processing request according to the address of the target interface, and returns a processing response of the processing request to the client. However, the performance of the target interface of the server is limited (that is, the performance of the function module corresponding to the target interface is limited). Therefore, the staff needs to perform performance testing on the target interface and improve the performance of the target interface according to the results of the performance testing.
[0003] Usually, the clients in the communication system are divided into master clients and slave clients. Before the staff performs performance testing on the target interface, they need to configure files related to processing requests on the slave client. During the performance test, the slave client assembles multiple processing requests carrying the address of the target interface in sequence according to the configured files, and sends the processing request to the server after each processing request is assembled. Afterwards, the slave client will feedback the processing information of these processing requests to the master client based on the processing responses of these processing requests sent by the server. Among them, the processing information of the processing request is used to indicate the processing status of the processing request. After receiving the processing information fed back by all the slave clients, the master client can determine the performance parameters of the target interface in the server based on these processing information. It should be noted that while the slave client sends the processing request to the server, it will assemble the next processing request.
[0004] Since the client assembles the processing request while sending the processing request, assembling the processing request will occupy the performance of the client, resulting in low efficiency in sending the processing request from the client to the server and low efficiency in performance detection of the target interface. Summary of the invention
[0005] The present application provides a performance detection method and device, and a communication system, which can solve the problem of low performance detection efficiency of a target interface in a communication system. The technical solution is as follows:
[0006] In a first aspect, a performance detection device is provided, wherein the performance detection device is used to:
[0007] Obtain at least one processing request corresponding to each client in the at least one client, wherein the processing request carries the address of the target interface of the server;
[0008] Sending the corresponding processing request to each client;
[0009] receiving at least one processing information sent by each client, wherein the at least one processing information corresponds to the at least one processing request one by one, and the processing information is used to indicate: a processing status of the processing request corresponding to the processing information by the server;
[0010] Determine the performance parameters of the target interface according to the processing information sent by the at least one client.
[0011] In a second aspect, another performance detection device is provided, wherein the performance detection device is used for:
[0012] receiving at least one processing request sent by the first node;
[0013] Sending the at least one processing request to the server, wherein the processing request carries the address of the target interface of the server;
[0014] receiving a processing response for each processing request in the at least one processing request sent by the server;
[0015] According to the received processing response, at least one processing information is sent to the first node, the at least one processing information corresponds to the at least one processing request one by one, and the processing information is used to indicate the processing status of the corresponding processing request.
[0016] In a third aspect, a performance detection method is provided for a first node in a communication system, the communication system further comprising: at least one client connected to the first node for communication, and a server connected to the at least one client for communication; the method comprising:
[0017] Obtain at least one processing request corresponding to each client of at least one client, wherein the processing request carries an address of a target interface of the server;
[0018] Sending the corresponding processing request to each client;
[0019] receiving at least one processing information sent by each client, wherein the at least one processing information corresponds to the at least one processing request one by one, and the processing information is used to indicate: a processing status of the processing request corresponding to the processing information by the server;
[0020] Determine the performance parameters of the target interface according to the processing information sent by the at least one client.
[0021] In a fourth aspect, another performance detection method is provided, which is used for a target client in a communication system, the communication system comprising: a first node, at least one client connected to the first node for communication, and a server connected to the at least one client for communication; the target client is any one of the at least one client; the method comprising:
[0022] receiving at least one processing request sent by the first node;
[0023] Sending the at least one processing request to the server, wherein the processing request carries the address of the target interface of the server;
[0024] receiving a processing response for each processing request in the at least one processing request sent by the server;
[0025] According to the received processing response, at least one processing information is sent to the first node, the at least one processing information corresponds to the at least one processing request one by one, and the processing information is used to indicate the processing status of the corresponding processing request.
[0026] In a fifth aspect, a communication system is provided, comprising: a first node, a server and at least one client, wherein the first node is communicatively connected to the at least one client, the at least one client is communicatively connected to the server, the first node comprises the performance detection device described in any one of the first aspect, and the client comprises the performance detection device described in any one of the second aspect.
[0027] In a sixth aspect, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the performance detection method of the third aspect or the fourth aspect as described above.
[0028] In a seventh aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the performance detection method of the third aspect or the fourth aspect.
[0029] In an eighth aspect, a performance detection device is provided, the performance detection device comprising a processor, and the processor is used to execute the performance detection method provided in the third aspect or the fourth aspect.
[0030] Optionally, the performance detection device further includes a memory having a computer program stored therein, and the processor implements the performance detection method provided in the third aspect or the fourth aspect when loading and executing the computer program.
[0031] The beneficial effects of the technical solution provided by this application include at least:
[0032] In summary, in the performance detection method provided in the embodiment of the present application, the first node can obtain the processing request corresponding to the client and send the processing request to the client. In this way, the client does not need to assemble the processing request. Therefore, the client avoids the occupation of performance by assembling the processing request, so the efficiency of the client sending the processing request to the server is higher, and then the performance detection efficiency of the target interface is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 It is a structural diagram of a communication system provided in an embodiment of the present application;
[0035] Figure 2 is a schematic diagram of the structure of another communication system provided in an embodiment of the present application;
[0036] Figure 3 is a flow chart of a performance detection method provided in an embodiment of the present application;
[0037] Figure 4 is a schematic diagram of an initial CSV file provided in an embodiment of the present application;
[0038] Figure 5 is a schematic diagram of a request processing script provided in an embodiment of the present application;
[0039] Figure 6 is a schematic diagram of a request for processing after assembly provided by an embodiment of the present application;
[0040] Figure 7 It is a schematic diagram of the initial CSV file segmentation provided in an embodiment of the present application;
[0041] Figure 8 is a structural diagram of another communication system provided in an embodiment of the present application;
[0042] Fig. 9 is a schematic diagram of a form entered in the second node provided in an embodiment of the present application;
[0043] Fig.10 is a structural diagram of another communication system provided in an embodiment of the present application;
[0044] Fig.11 It is a structural schematic diagram of a performance testing device provided in an embodiment of the present application;
[0045] Fig.12 It is a structural schematic diagram of another performance testing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the principles, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0047] Figure 1 A structural schematic diagram of a communication system provided in an embodiment of the present application, the communication system may be an Internet system or an Internet of Things system, etc.
[0048] like Figure 1 As shown, the communication system includes a client and a server. It should be noted that the number of clients can be one or a value greater than one. When the number of clients is greater than 1, the communication system is a distributed system. The client can be a terminal device such as a mobile phone or a computer, and the server can be a server or a server cluster composed of multiple servers.
[0049] The client can establish a communication connection with the server. For example, the client can establish a communication connection with the server by registering on the server. The server corresponds to the application program (APP) and is used to implement the functions of the APP. The APP has hundreds of interfaces, and different interfaces are used to implement different functions. In other words, the server has these interfaces (logical interfaces), and different interfaces are used to implement different functions of the multiple functions of the APP.
[0050] However, the performance of each interface in the server is limited, and the number of processing requests sent by the client that each interface can accept at the same time is limited. In the case of high concurrency (the server receives a large number of processing requests at the same time), the server interface may have performance problems. Therefore, the staff needs to perform performance testing on the target interface of the server (any interface of the APP). The performance testing of the target interface can also be called the stress test of the target interface.
[0051] Optionally, the communication system includes multiple clients, one of which is a master client and the other clients are slave clients. The master client is connected to each slave client, and each slave client is connected to the server. The master client and each slave client are installed with a stress testing tool (such as jmeter). Before the target interface of the server is subjected to performance testing, the staff needs to configure files related to the processing request on the slave client. When the target interface is subjected to performance testing, the slave client sequentially assembles multiple processing requests carrying the address of the target interface according to the configured files, and sends the processing request to the server after each assembly of a processing request is completed. Afterwards, the slave client will feedback the processing information of these processing requests to the master client according to the processing response of these processing requests sent by the server. Wherein, the processing information of the processing request is used to indicate the processing status of the processing request. After receiving the processing information fed back by all slave clients, the master client can determine the performance parameters of the target interface in the server according to these processing information.
[0052] It should be noted that when the slave client sends a processing request to the server, it will assemble the next processing request. Since the slave client assembles the processing request while sending the processing request, assembling the processing request will occupy the performance of the slave client, resulting in low efficiency in sending the processing request from the client to the server and low efficiency in performance detection of the target interface. In addition, the staff needs to configure the files related to the processing request on each slave client, which causes a large workload for the staff.
[0053] Optionally, when the number of clients is one, the client is connected to the server for communication. The client is installed with jmeter. Before the staff performs performance testing on the target interface, they also need to configure files related to the processing request on the client, and send the processing request to the server after completing the assembly of each processing request. While the client sends the processing request to the server, it will assemble the next processing request. After receiving the processing request, the server uses the functional module corresponding to the target interface to process the processing request according to the address of the target interface, and returns the processing response of the processing request to the client. Afterwards, the client receives the processing response sent by the server and generates processing information of the processing request. Among them, the processing information of the processing request is used to indicate the processing status of the processing request. Afterwards, the client can determine the performance parameters of the target interface in the server based on the generated processing information.
[0054] However, the performance of the client is limited, and its corresponding number of queries per second (QPS) is also limited, resulting in low efficiency of the client sending processing requests to the server. In addition, the client also assembles processing requests while sending processing requests, and assembling processing requests will occupy the performance of the client, reducing the efficiency of the client sending processing requests to the server, thereby resulting in lower efficiency of performance detection of the target interface.
[0055] Based on the above problems, the present application embodiment provides another communication system, such as Figure 2 As shown, in Figure 1 On the basis of, the communication system also includes: a first node, the first node is connected to the client in the communication system. The first node is different from the server, and the first node can be a server or a server cluster composed of multiple servers. The first node can also be called a server cloud.
[0056] The first node can obtain the processing request corresponding to the client and send the processing request to the client. In this way, the client does not need to assemble the processing request. Therefore, the client avoids the occupation of performance by assembling the processing request, so the efficiency of the client sending the processing request to the server is higher, and then the performance detection efficiency of the target interface is higher. In addition, the communication system does not limit the number of clients. The communication system can improve the efficiency of the client sending the processing request to the server by increasing the client, thereby improving the performance detection efficiency (also known as stress testing efficiency) of the target interface. Therefore, the communication system has a high stress testing efficiency and can be used as a fast stress testing platform. In addition, the staff does not need to configure files related to the processing request on the client, so the workload of the staff is small.
[0057] For example, Figure 3 A flow chart of a performance detection method provided in an embodiment of the present application, which can be used in a communication system (such as Figure 2 The communication system shown).
[0058] like Figure 3 As shown, the method includes:
[0059] Step 101: A first node obtains at least one processing request corresponding to each of at least one client, where the processing request carries an address of a target interface of a server.
[0060] It should be noted that the at least one client here may be all clients in the communication system or some clients in the communication system, and this embodiment of the present application is not limited to this. Figure 3Only one of the at least one client is shown in FIG. 1 . If the at least one client also includes other clients, the operations related to the other clients can refer to FIG. 1 . Figure 3 Client-related operations are shown.
[0061] The at least one client is used to send a processing request to the server in a subsequent step. Optionally, when the at least one client cannot meet the efficiency of sending a processing request to the server required in the subsequent step, if the communication system is a distributed system, and the distributed system has scalability (the number of clients in the communication system can be expanded), then the staff can increase the number of the at least one client to improve the efficiency of the client sending the processing request to the server in the subsequent step. For example, assuming that the at least one client includes two clients, each client can send 1000 processing requests to the server per second, and the two clients can send 2000 processing requests to the server per second. When the at least one client is required to send 10,000 processing requests to the server per second, the staff can increase the number of the at least one client to 10, so that the at least one client can send 10,000 processing requests to the server per second.
[0062] The processing requests in step 101 carry the address of the target interface of the server. Therefore, these processing requests are used to process in the functional module corresponding to the target interface of the server. These processing requests are used for performance detection of the target interface of the server in subsequent operations.
[0063] The server may have at least one interface, and the target interface may be any one of the at least one interface. Furthermore, when the at least one interface is a plurality of interfaces, the performance detection method of each interface may refer to the performance detection method of the target interface. Furthermore, when the at least one interface is a plurality of interfaces, the performance detection process of the plurality of interfaces may be performed sequentially or simultaneously.
[0064] Optionally, before step 101, the staff configures a processing request script and an initial comma-separated values (CSV) file on the first node. In step 101, the first node can obtain at least one processing request corresponding to each client in at least one client based on the processing request script and the initial CSV file.
[0065] Optionally, when the at least one client includes one client, the first node assembles at least one processing request corresponding to the client according to the processing request script and the initial CSV file.
[0066] For example, Figure 4 This is a schematic diagram of CSV file 1 (initial CSV file), such as Figure 4As shown, CSV file 1 includes multiple lines of content ( Figure 4 In the example, CSV file 1 includes 31 lines of content. The first line of content in CSV file 1 is a user ID, indicating that the character string in CSV file 1 is used to represent the user ID; each line of content after the first line of content in CSV file 1 is a character string, and each character string in CSV file 1 is different, and each character string represents a different user ID. Figure 4 The CSV file 1 shown includes 30 different character strings in total, which are used to represent 30 different user IDs.
[0067] As another example, Figure 5 This is a schematic diagram of the request processing script, such as Figure 5 As shown, the request processing script includes the request address part, the request method part, the request header part and the request body part. Among them, the request address part includes the address of the target interface; the request method part includes the communication protocol used to process the request, such as the post (POST) protocol in the Hyper Text Transfer Protocol (HTTP). Both the request header part and the request body part contain the necessary fields for processing the request, such as the first field for carrying the above-mentioned user identifier. Please continue to refer to Figure 5 , the first field includes "string to be replaced", wherein the string to be replaced can be replaced by any string in the CSV file, so that the first field carries the user identifier represented by the any string. The request header part and the request body part may also include a second field, the second field includes "user identifier:", and the second field is located before the first field, and is used to indicate that the first field is used to carry the user identifier.
[0068] For example, in Figure 4 and Figure 5 On the basis of Figure 6 is a schematic diagram of the assembled processing request. Figure 6 As shown, the first node can replace the content of the first field in the processing request script from "string to be replaced" to "string 1" in CSV file 1, thereby obtaining a processing request, and the processing request is used to simulate the processing request sent by the user corresponding to the user identifier represented by string 1. In addition, Figure 4 There are 30 lines of character strings representing user identifiers in the CSV file 1, so the first node can complete the assembly of 30 processing requests in sequence to obtain 30 processing requests to simulate the processing requests sent by 30 users.
[0069] Figures 4 to 6Taking 30 processing requests corresponding to the client as an example, in an embodiment of the present application, the client may correspond to one or more processing requests, and the embodiment of the present application does not limit the number of processing requests corresponding to the client. Optionally, when the client corresponds to multiple processing requests, at least two of the multiple processing requests are different, such as, all the processing requests in the multiple processing requests are different. Of course, all the processing requests in the multiple processing requests may also be the same. In the embodiment of the present application, taking all the processing requests in the multiple processing requests as an example, they are different. When each processing request is different, since the processing request is used to be processed by the functional module corresponding to the target interface of the server, the processing requests processed by the server are also different. In this way, it is possible to avoid the processing request (such as a login request containing a verification code) that is not allowed to be repeatedly processed from being repeatedly processed, which is more in line with the actual situation.
[0070] Optionally, when the at least one client includes at least two clients, the first node first divides the initial CSV file into at least two target CSV files corresponding to at least two clients, and then obtains at least one processing request corresponding to each client based on the processing request script and the target CSV files corresponding to each client.
[0071] For example, suppose the initial CSV file is Figure 4 As shown in the CSV file 1, at least two clients include client 1 and client 2, such as Figure 7 As shown, the above CSV file 1 is divided into CSV file 2 and CSV file 3. Among them, CSV file 2 is the target CSV file corresponding to client 1, and CSV file 3 is the target CSV file corresponding to client 2. CSV file 2 and CSV file 3 both include 16 lines of content, wherein the first line of content is the user identification, and each line of content after the first line of content is a string. Moreover, the 15 lines of strings in CSV file 2 are the first 15 lines of strings in the 30 lines of strings in CSV file 1 arranged in sequence, and the 15 lines of strings in CSV file 3 are the last 15 lines of strings in the 30 lines of strings in CSV file 1 arranged in sequence.
[0072] After obtaining the target CSV file corresponding to each client, the first node can assemble at least one processing request corresponding to each client according to the processing request script and the target CSV file corresponding to each client. This process can refer to the process of assembling the processing request according to the processing request script and the initial CSV file of the first node, and the embodiment of the present application will not be repeated here.
[0073] Optionally, when the at least one client includes at least two clients, at least two of all processing requests corresponding to the at least two clients are different. For example, these processing requests are different. Since these processing requests are used to be processed by the functional module corresponding to the target interface of the server, when these processing requests are different, it is possible to avoid processing requests that are not allowed to be repeatedly processed (such as login requests containing verification codes) from being repeatedly processed. If the first node does not split the initial CSV file and uses the initial CSV file as the target CSV file corresponding to each client, then the processing requests corresponding to at least two clients are the same, which may result in many processing requests failing to be successfully processed, which is inconsistent with the actual situation, and further leads to a low accuracy in the performance detection of the target interface.
[0074] Furthermore, the initial CSV file can be split in various ways.
[0075] In an optional splitting method, the first node evenly splits the initial CSV file according to the number of clients, and at least two clients have the same number of strings in the target CSV files. For example, assuming that the number of strings in the initial CSV file is 30 and the number of clients is 2, the first node can split the initial CSV file into two target CSV files, each with 15 strings.
[0076] In another optional segmentation method, the first node segments the initial CSV file according to the performance of the client. For example, the number of strings in the target CSV file corresponding to the client with strong performance is larger, and the number of strings in the target CSV file corresponding to the client with weak performance is smaller. For example, assuming that the number of strings in the initial CSV file is 30, assuming that the number of clients is 2 (the communication system includes client 1 and client 2), and the performance of client 1 of the two clients is stronger than that of client 2. The first node can divide the initial CSV file into two target CSV files, and the number of strings in the target CSV file corresponding to client 1 is 16, and the number of strings in the target CSV file corresponding to client 2 is 14.
[0077] It should be noted that any of the above splitting methods are automatically implemented by the first node, and the staff does not need to make any modifications to the CSV file and request processing script. Figure 1 In the communication system shown, the staff needs to manually split the CSV file and configure the split CSV file and the request processing script on each slave client. In the embodiment of the present application, the efficiency of obtaining the target CSV file corresponding to each client is high, and thus the performance detection efficiency of the target interface is high.
[0078] In the embodiment of the present application, the first node obtains at least one processing request corresponding to each client in at least one client according to the processing request script and the initial CSV file as an example. Optionally, at least one processing request corresponding to each client in at least one client can also be configured on the first node, and the first node can directly obtain at least one processing request corresponding to each client in at least one client. The processing requests corresponding to different clients can be the same or different.
[0079] Step 102: The first node sends at least one corresponding processing request to each of at least one client.
[0080] In step 102, since the first node sends a processing request corresponding to the client to each of the at least one client, each of the at least one client does not need to assemble a corresponding processing request. Figure 1 In the communication system shown, the client avoids the performance occupation of assembling processing requests.
[0081] Step 103: Each of the at least one client sends at least one processing request corresponding to the client to the server.
[0082] Optionally, each of the at least one client sends the at least one processing request to the server after receiving the at least one processing request corresponding to the client sent by the first node (that is, all processing requests corresponding to the client). In this way, the client can avoid the occupation of performance by receiving the processing request, and then the efficiency of the client sending the corresponding processing request to the server is higher. Of course, the client can also send the processing request to the server after receiving each processing request sent by the first node.
[0083] Step 104: The server sends, to each client, a processing response for each processing request sent by the client.
[0084] Optionally, the processing response of the processing request is used to indicate the server's processing result of the processing request. The processing response may include information that can be recognized by the client, such as a status code (including a success status code or a failure status code), keywords (such as success or failure), etc.
[0085] Step 105, each of the at least one client sends at least one processing information to the first node based on the received processing response; wherein, the at least one processing information sent by the client to the first node corresponds one-to-one to at least one processing request corresponding to the client, and the processing information is used to indicate the processing status of the corresponding processing request.
[0086] The processing information of the processing request includes: the processing result of the processing request. The client can verify the processing response according to the verification standard to obtain the processing result of the processing request (such as processing success or processing failure). For example, the verification standard can be: if the status code in the processing response of the processing request is a success status code (such as 200) and the keyword is success, then the processing result of the processing request is processing success.
[0087] In addition, the processing information may also include the response time of the processing request, and the response time is the time from when the client sends the processing request to the server to when the client receives the processing response of the processing request sent by the server. The client may start timing when sending the processing request to the server, and end timing when the client receives the processing response of the processing request sent by the server, and use the time obtained by timing as the response time.
[0088] There are various ways for the client to send the processing information to the first node.
[0089] In the first optional sending mode, the client can send n processing information to the first node every target duration according to n processing responses received within the target duration. The n processing information corresponds to n processing requests one by one, the n processing responses include processing responses of n processing requests, n≥1, and the target duration is greater than the average duration for the target client to obtain a processing response.
[0090] In the second optional sending mode, the client may send m processing information to the first node after receiving m processing responses, wherein the m processing information corresponds to m processing requests one by one, and the m processing responses include processing responses to the m processing requests, and m≥2.
[0091] In a third optional sending manner, the client may send processing information corresponding to all processing requests to the first node after receiving processing responses to all processing requests corresponding to the client.
[0092] When the client uses any of the three optional sending methods to send processing information to the first node, the sending frequency of the processing information is higher than Figure 1 In the communication system, the frequency of sending processing information is lower when the client sends processing information to the main client in real time. Therefore, the client's performance occupation when sending processing information to the first node is small, the efficiency of the client sending processing requests to the server is high, and the performance detection efficiency of the target interface is also high.
[0093] Step 106: The first node determines the performance parameters of the target interface of the server according to the received processing information.
[0094] Optionally, the first node may receive processing information sent by each of the at least one client, and the first node may collect statistics on the received processing information to determine the performance parameters of the target interface of the server.
[0095] For example, assuming that at least one client includes client 1 and client 2, and each client corresponds to 900 processing requests, the performance parameters of the target interface of the server are shown in Table 1. The first node can obtain the following statistics: performance parameters corresponding to client 1, performance parameters corresponding to client 2, and performance parameters of the target interface. Among them, the performance parameters of the target interface are comprehensive statistics of performance parameters corresponding to all clients in at least one client.
[0096] Performance parameters include the number of successes, the number of failures, the success rate, the minimum response time, the maximum response time, and the average response time. The number of successes refers to the number of processing requests corresponding to the client that are successfully processed by the server, the number of failures refers to the number of processing requests corresponding to the client that are not successfully processed by the server, and the success rate refers to the proportion of processing requests corresponding to the client that are successfully processed by the server. The minimum response time refers to the minimum response time of all processing requests corresponding to the client, the maximum response time refers to the maximum response time of all processing requests corresponding to the client, and the average response time refers to the average response time of all processing requests corresponding to the client. The units of the minimum response time, maximum response time, and average response time are all milliseconds.
[0097] Table 1
[0098]
[0099] Optionally, the communication system may repeat the process of performing the above steps 101 to 105 at least once, and the first node determines the performance parameters of the target interface according to all the processing information received by performing the above steps 101 to 105 at least once.
[0100] Optionally, the first node can also determine: the target interface name, request address, concurrency, number of requests, interval time and test time according to the received processing information. The target interface name is the name of the target interface function; the request address is the address of the target interface; the concurrency is the number of processing requests sent by the at least one client to the server during the communication system executing the above steps 101 to 105 once; the number of requests is the number of times the communication system repeatedly executes the above steps 101 to 105; the interval time is the time interval for the communication system to repeatedly execute the above steps 101 to 105; the test time is the moment when the communication system executes step 101 for the first time.
[0101] Step 107: The first node stores the performance parameters of the target interface in a database.
[0102] In step 107, the database may be a distributed document database (such as Elasticsearch) and / or a relational database (such as my Structured Query Language). The database may be located on the first node or on a device other than the first node, which is not limited in the embodiment of the present application.
[0103] In the related art, the performance parameters of the target interface are stored in an Extensible Markup Language (xml) file, and the staff needs to install a java (a computer programming language) environment and jmeter on the relevant equipment to view the performance parameters of the target interface. In the embodiment of the present application, since the performance parameters of the target interface are stored in a database, the staff does not need to install a java environment and jmeter on the relevant equipment, and can view the performance parameters of the target interface on the web page through the relevant equipment.
[0104] Alternatively, if Figure 8 As shown, in Figure 2 On the basis of, the communication system provided in the embodiment of the present application also includes a second node. The second node is communicatively connected to the first node, and the second node is a device operated by the staff (such as a computer, a mobile phone, etc.). It should be noted that the present application does not limit the number of second nodes, and the second node can be one or more. The embodiment of the present application takes a second node as an example. After determining the performance parameters of the target interface, the first node sends the performance parameters to the second node. Optionally, the staff can log in to the webpage on the second node, and trigger the second node on the webpage to send a viewing request to the first node; the first node can send the performance parameters to the second node according to the viewing request, so that the second node displays the performance parameters, so that the staff can view the performance parameters from the second node.
[0105] Further, in the above content, the staff configures the processing request script and the CSV file on the first node as an example. Optionally, when the communication system also includes a second node (such as Figure 8 As shown), before step 101, the second node may send a detection request to the first node, the detection request carrying a processing request script and a CSV file. Optionally, the first node saves the detection request in a database.
[0106] For example, the staff can operate on the second node to make the second node send the detection request to the first node. For example, the staff can input the processing request script and CSV file to the second node by entering a form on a web page, and trigger the second node to send the detection request to the first node. Fig. 9 is a schematic diagram of the form entered in the second node, such as Fig. 9 As shown, the form includes: a test project row, a use case name row, a request address row, a request method row, a request header row and a request body row, a verification row, a concurrency row, a request number row, a request interval row, a start time row, a CSV file row, a creation time row, and an update time row.
[0107] The test project line records the project A to which the function of the target interface belongs, the use case name line records the function A1 of the target interface, the request address line records the address 1 of the target interface, the request method line records the content of the above request method part, the request header line records the content of the above request header part, and the request body line records the content of the above request body part.
[0108] The concurrency row records the number of processing requests sent by the at least one client to the server during the process of the communication system executing the above steps 101 to 105 once. The request count row records the number of times the communication system repeatedly executes the above steps 101 to 105. The request interval row records the time interval between the communication system repeatedly executing the above steps 101 to 105. Fig. 9 The time interval of 1000 milliseconds is taken as an example. The start time line records the time interval between the staff completing the input form and the second node sending the detection request to the first node, which can play a timing role. Fig. 9 The startup time of 0 milliseconds is taken as an example, that is, when the staff completes the input form, the second node sends a detection request to the first node.
[0109] The CSV file line consists of: Current column and Modified column. Please refer to Fig. 9 , the current column of the CSV file row contains the CSV file selected by the staff (such as CSV file 1), a box and a clear button. Fig. 9 , staff can clear CSV file 1 in the form by checking the box after CSV file 1 and clicking the Clear button. Please continue to refer to Fig. 9 There is a Select File button in the modification column record of the CSV file row. When there is already a CSV file in the current column, the staff can click this button to select another CSV file to replace the existing CSV file (CSV file 1) in the current column as the CSV file in the current column; when there is no CSV file in the current column, the staff can click this button to select the CSV file required for the detection request as the CSV file in the current column.
[0110] The creation time row records the time when the above form is created, and the update time row records the time when the staff last edited the form.
[0111] Optionally, the above form further includes a verification row recording the verification standard of the client mentioned in step 105, and the client determines the processing information of the processing request according to the verification standard and the processing response of the server.
[0112] The above content takes the communication system including one second node as an example. Optionally, the number of the second nodes is multiple. For example, Fig.10 As shown, the communication system includes three second nodes. In the communication system, three staff members can control the three second nodes to send three detection requests to the first node at the same time, and the three detection requests correspond to three test items. For each detection request, the first node can perform the above steps 101 to 107 according to the detection request. In addition, when the communication system includes multiple second nodes, if the multiple second nodes send detection requests to the first node at the same time, the target interfaces targeted by these detection requests can be the same or different.
[0113] According to the above, the first node in the communication system mainly includes an input module, a CSV file cutting module, a processing request assembly module and a processing information recovery module. The client in the communication system mainly includes: a task monitoring module, a task execution module and a processing information reporting module.
[0114] The input module is used to receive the above-mentioned processing request script and the initial CSV file; the CSV file cutting module is used to cut the initial CSV file to obtain the target CSV file corresponding to each client in at least one client; the processing request assembly module is used to assemble at least one processing request corresponding to the client according to the processing request script and the target CSV file corresponding to each client, and send the at least one processing request to the client. The task monitoring module is used to receive at least one processing request corresponding to the client sent by the first node; the task execution module is used to send these processing requests to the server, and receive the processing response sent by the server, and then generate processing information of these processing requests; the processing information reporting module is used to report these processing information to the first node. The processing information recovery module is used to receive the processing information sent by the client, and obtain the performance parameters of the target interface based on these processing information.
[0115] It should be noted that the target interface in the above embodiment is any logical interface in the server, and the functional module corresponding to the target interface in the server is used to implement the function of the APP corresponding to the server. The server may also include other interfaces besides the target interface, and the performance detection method of other interfaces can refer to the performance detection method of the target interface, which will not be described in detail in the embodiments of this application.
[0116] The present application embodiment provides a performance detection device, such as Fig.11 As shown, the performance detection device is a first node in a communication system, and the communication system further includes: at least one client connected to the first node for communication, and a server connected to the at least one client for communication; the performance detection device may include:
[0117] A first acquisition module 1101 acquires at least one processing request corresponding to each of the at least one client, wherein the processing request carries an address of a target interface of the server;
[0118] A first sending module 1102 sends the corresponding processing request to each client;
[0119] The first receiving module 1103 is used to receive at least one processing information sent by each client, where the at least one processing information corresponds to the at least one processing request, and the processing information is used to indicate: the processing status of the processing request corresponding to the processing information by the server;
[0120] The determination module 1104 is configured to determine the performance parameters of the target interface according to the processing information sent by the at least one client.
[0121] Optionally, the at least one client includes: at least two clients; and the performance detection device further includes:
[0122] The second acquisition module ( Fig.11 ), used to obtain the initial comma-separated value CSV file;
[0123] Split Module( Fig.11 ), for dividing the initial CSV file into at least two target CSV files corresponding to the at least two clients one by one;
[0124] Processing Module( Fig.11 ), which is used to obtain the at least one processing request corresponding to each client according to the processing request script and the target CSV file corresponding to each client.
[0125] Optionally, the communication system further includes a second node, which is communicatively connected to the first node; and the performance detection device further includes:
[0126] The second receiving module ( Fig.11 (not shown), for receiving a detection request sent by the second node, the detection request carrying the processing request script and the initial CSV file;
[0127] The second sending module ( Fig.11 ), and configured to send the performance parameter to the second node after determining the performance parameter.
[0128] Optionally, the performance detection device further includes:
[0129] Storage Module( Fig.11 ), which is not shown in the figure, is used to store the performance parameters in a database.
[0130] In summary, the embodiment of the present application provides a performance detection device, in which the first node can obtain the processing request corresponding to the client and send the processing request to the client. In this way, the client does not need to assemble the processing request. Therefore, the client avoids the occupation of performance by assembling the processing request, so the efficiency of the client sending the processing request to the server is higher, and then the performance detection efficiency of the target interface is higher.
[0131] The present application embodiment provides another performance detection device, such as Fig.12 As shown, the performance detection device is a target client in a communication system, and the communication system includes: a first node, at least one client connected to the first node for communication, and a server connected to the at least one client for communication; the target client is any client in the at least one client; the performance detection device includes:
[0132] A first receiving module 1201, configured to receive at least one processing request sent by the first node;
[0133] A first sending module 1202, configured to send the at least one processing request to the server, wherein the processing request carries the address of the target interface of the server;
[0134] The second receiving module 1203 is used to receive a processing response of each processing request in the at least one processing request sent by the server;
[0135] The second sending module 1204 is used to send at least one processing information to the first node according to the received processing response, where the at least one processing information corresponds one-to-one to the at least one processing request, and the processing information is used to indicate the processing status of the corresponding processing request.
[0136] Optionally, the first sending module 1202 is used to: after receiving the at least one processing request, send the at least one processing request to the server.
[0137] Optionally, the second sending module 1204 is used to: send n processing information to the first node every target duration according to n processing responses received within the target duration, the n processing information corresponding one-to-one to n processing requests, the n processing responses including processing responses of the n processing requests, n≥1, and the target duration is greater than the average duration for the target client to obtain a processing response;
[0138] Alternatively, after receiving each of m processing responses, m processing information is sent to the first node, the m processing information corresponds one-to-one to the m processing requests, the m processing responses include processing responses to the m processing requests, and m≥2.
[0139] In summary, the embodiment of the present application provides a performance detection device, in which the first node can obtain the processing request corresponding to the client and send the processing request to the client. In this way, the client does not need to assemble the processing request. Therefore, the client avoids the occupation of performance by assembling the processing request, so the efficiency of the client sending the processing request to the server is higher, and then the performance detection efficiency of the target interface is higher.
[0140] The embodiment of the present application provides another performance detection device, which may include a processor, and the processor is used to execute any one of the performance detection methods for a first node or a client provided in the embodiment of the present application, such as Figure 3 The performance detection method shown is a method executed by the first node or the client.
[0141] Optionally, the performance detection device may further include a memory storing a computer program, and the processor implements any one of the performance detection methods for the first node or the client provided in the above embodiments when loading and executing the computer program, such as Figure 3 The performance detection method shown is a method executed by the first node or the client.
[0142] The embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded by a processor and executes any one of the performance detection methods performed by the first node or the client provided in the above embodiments, such as Figure 3 The performance detection method shown is a method executed by the first node or the client.
[0143] The present application also provides a computer program product including instructions. When the computer program product is run on a computer, the computer executes any one of the performance detection methods performed by the first node or the client provided in the above method embodiments, for example: Figure 3 The performance detection method shown is a method executed by the first node or the client.
[0144] In this application, "at least one" refers to one or more, and "plurality" refers to two or more. The term "and / or" in the present invention is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and subsequent associated objects are in an "or" relationship. In this disclosure, the terms "first", "second", etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
[0145] It should be noted that the method embodiments provided in the embodiments of the present invention can be referenced with the corresponding device embodiments, and the embodiments of the present invention are not limited thereto. The sequence of steps of the method embodiments provided in the embodiments of the present invention can be appropriately adjusted, and the steps can be increased or decreased accordingly according to the circumstances. Any technician familiar with the technical field can easily think of a method of change within the technical scope disclosed in the present invention, and it should be covered within the protection scope of the present invention, so it will not be repeated.
[0146] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A performance testing device, characterized in that: The performance detection device is a first node in a communication system, and the communication system further includes: at least one client connected to the first node in communication, and a server connected to the at least one client in communication; the performance detection device is used to: Obtain at least one processing request corresponding to each client in the at least one client, wherein the processing request carries the address of the target interface of the server; Sending the corresponding processing request to each client; receiving at least one processing information sent by each client, wherein the at least one processing information corresponds to the at least one processing request one by one, and the processing information is used to indicate the processing status of the server on the processing request corresponding to the processing information; determining a performance parameter of the target interface according to the processing information sent by the at least one client; Wherein, in the case where the at least one client includes at least two clients, the performance detection device is used to: Obtain an initial comma-separated value CSV file, wherein the initial CSV file includes a plurality of character strings, each of which represents a user ID; Splitting the initial CSV file into at least two target CSV files corresponding to the at least two clients one by one; According to the processing request script and the target CSV file corresponding to each client, at least one processing request corresponding to each client is obtained; wherein each processing request is used to simulate a processing request sent by a user corresponding to a user identifier represented by a string, and there are at least two different processing requests among the processing requests corresponding to the at least two clients.
2. The performance testing device according to claim 1, characterized in that: The communication system further includes a second node, the second node being communicatively connected to the first node; and the performance detection device is used for: receiving a detection request sent by the second node, wherein the detection request carries the processing request script and the initial CSV file; After determining the performance parameter, the performance parameter is sent to the second node.
3. The performance testing device according to claim 1, characterized in that: The performance testing equipment is also used for: The performance parameters are stored in a database.
4. A performance testing device, characterized in that: The performance detection device is a target client in a communication system, the communication system comprising: a first node, at least one client in communication connection with the first node, and a server in communication connection with the at least one client; the target client is any client in the at least one client; the performance detection device is used to: Receive at least one processing request sent by the first node; wherein, in the case where the at least one client includes at least two clients, the at least one processing request received by the target client is generated by the first node based on a target comma-separated value CSV file corresponding to the target client and a processing request script, and the target CSV file is obtained by the first node by segmenting an initial CSV file based on the at least two clients; the initial CVS file includes a plurality of strings, each string represents a user identifier, each processing request is used to simulate a processing request sent by a user corresponding to the user identifier represented by a string, and there are at least two different processing requests among the processing requests corresponding to the at least two clients; Sending the at least one processing request to the server, wherein the processing request carries the address of the target interface of the server; receiving a processing response for each processing request in the at least one processing request sent by the server; According to the received processing response, at least one processing information is sent to the first node, the at least one processing information corresponds to the at least one processing request one by one, and the processing information is used to indicate the processing status of the corresponding processing request.
5. The performance testing device according to claim 4, characterized in that: The sending the at least one processing request to the server comprises: After receiving the at least one processing request, the at least one processing request is sent to the server.
6. The performance testing device according to claim 4 or 5, characterized in that: The sending at least one processing information to the first node according to the received processing response includes: At every target duration, according to n processing responses received within the target duration, n processing information is sent to the first node, the n processing information corresponds one-to-one to n processing requests, the n processing responses include processing responses to the n processing requests, n≥1, and the target duration is greater than an average duration for the target client to obtain a processing response; Alternatively, after receiving each of m processing responses, m processing information is sent to the first node, the m processing information corresponds one-to-one to the m processing requests, the m processing responses include processing responses to the m processing requests, and m≥2.
7. A performance detection method, characterized in that: A method for a first node in a communication system, wherein the communication system further comprises: at least one client connected to the first node for communication, and a server connected to the at least one client for communication; wherein the method comprises: Obtain at least one processing request corresponding to each client of at least one client, wherein the processing request carries an address of a target interface of the server; Sending the corresponding processing request to each client; receiving at least one processing information sent by each client, wherein the at least one processing information corresponds to the at least one processing request one by one, and the processing information is used to indicate the processing status of the server on the processing request corresponding to the processing information; determining a performance parameter of the target interface according to the processing information sent by the at least one client; Wherein, in the case where the at least one client includes at least two clients, obtaining at least one processing request corresponding to each of the at least one client includes: Obtain an initial comma-separated value CSV file, wherein the initial CSV file includes a plurality of character strings, each of which represents a user ID; Splitting the initial CSV file into at least two target CSV files corresponding to the at least two clients one by one; According to the processing request script and the target CSV file corresponding to each client, at least one processing request corresponding to each client is obtained; wherein each processing request is used to simulate a processing request sent by a user corresponding to a user identifier represented by a string, and there are at least two different processing requests among the processing requests corresponding to the at least two clients.
8. A performance detection method, characterized in that: A target client in a communication system, the communication system comprising: a first node, at least one client in communication connection with the first node, and a server in communication connection with the at least one client; the target client is any one of the at least one client; the method comprising: Receive at least one processing request sent by the first node; wherein, in the case where the at least one client includes at least two clients, the at least one processing request received by the target client is generated by the first node based on a target comma-separated value CSV file corresponding to the target client and a processing request script, and the target CSV file is obtained by the first node by segmenting an initial CSV file based on the at least two clients; the initial CVS file includes a plurality of strings, each string represents a user identifier, each processing request is used to simulate a processing request sent by a user corresponding to the user identifier represented by a string, and there are at least two different processing requests among the processing requests corresponding to the at least two clients; Sending the at least one processing request to the server, wherein the processing request carries the address of the target interface of the server; receiving a processing response for each processing request in the at least one processing request sent by the server; According to the received processing response, at least one processing information is sent to the first node, the at least one processing information corresponds to the at least one processing request one by one, and the processing information is used to indicate the processing status of the corresponding processing request.
9. A communication system, characterized in that: include: A first node, a server and at least one client, the first node is communicatively connected to the at least one client, the at least one client is communicatively connected to the server, the first node includes the performance detection device described in any one of claims 1 to 3, and the client includes the performance detection device described in any one of claims 4 to 6.
Citation Information
Patent Citations
Electronic device testing system and electronic device testing method
CN102905034A
Interface testing method, device, computer system and computer readable storage medium
CN113032244A