Movatterモバイル変換


[0]ホーム

URL:


CN113282511B - Test methods and equipment - Google Patents

Test methods and equipment
Download PDF

Info

Publication number
CN113282511B
CN113282511BCN202110704385.XACN202110704385ACN113282511BCN 113282511 BCN113282511 BCN 113282511BCN 202110704385 ACN202110704385 ACN 202110704385ACN 113282511 BCN113282511 BCN 113282511B
Authority
CN
China
Prior art keywords
test
server
program
access request
mobile terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110704385.XA
Other languages
Chinese (zh)
Other versions
CN113282511A (en
Inventor
马骁雄
王欣
苏畅
周荣林
高建瓴
王成
阮绍臣
姚锴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of ChinafiledCriticalAgricultural Bank of China
Priority to CN202110704385.XApriorityCriticalpatent/CN113282511B/en
Publication of CN113282511ApublicationCriticalpatent/CN113282511A/en
Application grantedgrantedCritical
Publication of CN113282511BpublicationCriticalpatent/CN113282511B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本申请提供一种测试方法及设备,包括接收移动终端发送的测试请求,其中,测试请求包括测试参数,根据测试参数和预先加载的测试程序生成访问请求,向被测服务器发送访问请求,并获取被测服务器响应访问请求的响应性能数据,向移动终端发送被测服务器响应访问请求的响应性能数据,从而可实现在任意空间位置对被测服务器进行性能测试。

The present application provides a testing method and device, including receiving a test request sent by a mobile terminal, wherein the test request includes test parameters, generating an access request according to the test parameters and a pre-loaded test program, sending the access request to a server under test, and obtaining response performance data of the server under test in response to the access request, and sending the response performance data of the server under test in response to the access request to the mobile terminal, thereby realizing performance testing of the server under test at any spatial location.

Description

Translated fromChinese
测试方法及设备Test methods and equipment

技术领域Technical Field

本申请涉及通信技术领域,尤其涉及一种测试方法及设备。The present application relates to the field of communication technology, and in particular to a testing method and device.

背景技术Background technique

随着互联网的发展,服务器可以向用户提供多种应用服务,用户也可以通过移动终端使用服务器提供的应用服务。With the development of the Internet, servers can provide users with a variety of application services, and users can also use the application services provided by servers through mobile terminals.

然而,随着用户数量增加,服务器必然会承受高并发的访问压力,若服务器无法承受高并发的访问压力,则无法持续向用户提供应用服务,因此,对服务器进行高并发压力测试十分有必要。However, as the number of users increases, the server will inevitably be under high concurrent access pressure. If the server cannot withstand high concurrent access pressure, it will not be able to continue to provide application services to users. Therefore, it is very necessary to perform high concurrent stress testing on the server.

发明内容Summary of the invention

本申请提供一种测试方法及设备,用以提供一种不受空间限制的测试方法。The present application provides a testing method and a device, which are used to provide a testing method that is not limited by space.

第一方面,本申请提供一种测试方法,方法应用于中转服务器,方法包括:In a first aspect, the present application provides a testing method, which is applied to a transit server and includes:

接收移动终端发送的测试请求,其中,测试请求包括测试参数;Receiving a test request sent by a mobile terminal, wherein the test request includes a test parameter;

根据测试参数和预先加载的测试程序生成访问请求;Generate access requests based on test parameters and pre-loaded test programs;

向被测服务器发送访问请求,并获取被测服务器响应访问请求的响应性能数据;Sending an access request to the server under test and obtaining response performance data of the server under test in response to the access request;

向移动终端发送被测服务器响应访问请求的响应性能数据。Send the response performance data of the tested server in response to the access request to the mobile terminal.

在一实施例中,测试参数包括并发数、发压时长、程序标识以及服务器标识;根据测试参数和预先加载的测试程序生成访问请求,具体包括:In one embodiment, the test parameters include the number of concurrent connections, the duration of the pressure release, the program identifier, and the server identifier; and generating an access request according to the test parameters and the pre-loaded test program specifically includes:

根据并发数和发压时长确定生成访问请求的发送数量;Determine the number of access requests to be sent based on the number of concurrent requests and the duration of the request.

根据程序标识对应的测试程序和服务器标识生成发送数量的访问请求。Generate and send a number of access requests according to the test program and server identifier corresponding to the program identifier.

在一实施例中,向被测服务器发送访问请求,具体包括:In one embodiment, sending an access request to the server under test specifically includes:

持续以并发数向被测服务器发送访问请求,其中,持续时间为发压时长。Continue to send access requests to the server under test at a concurrent number, where the duration is the duration of the pressure.

在一实施例中,获取被测服务器响应访问请求的响应性能数据,具体包括:In one embodiment, obtaining response performance data of the tested server in response to an access request specifically includes:

使用测试程序监控被测服务器返回的响应消息;Use the test program to monitor the response messages returned by the server under test;

根据测试程序的监控结果生成响应性能数据。Generate response performance data based on the monitoring results of the test program.

在一实施例中,根据测试程序输出的监控结果生成响应性能数据,具体包括:In one embodiment, generating response performance data according to the monitoring results output by the test program specifically includes:

显示测试程序输出的监控结果,并对显示的监控结果进行截屏处理输出截屏图像,所述截屏图像用于发送至移动终端,并由所述移动终端对所述截屏图像进行识别处理。The monitoring results output by the test program are displayed, and a screenshot is taken of the displayed monitoring results to output a screenshot image, which is sent to a mobile terminal, and the mobile terminal recognizes and processes the screenshot image.

第二方面,本申请提供一种测试方法,方法应用于移动终端,方法包括:In a second aspect, the present application provides a testing method, which is applied to a mobile terminal and includes:

获取用户输入的测试参数;Get the test parameters entered by the user;

根据测试参数生成测试请求,并向中转服务器发送测试请求,以使中转服务器生成并向被测服务器发送访问请求,并获取被测服务器响应访问请求时的响应性能;Generate a test request according to the test parameters, and send the test request to the transit server, so that the transit server generates and sends an access request to the server under test, and obtains the response performance of the server under test when responding to the access request;

接收中转服务器返回的被测服务器的响应性能数据。Receive the response performance data of the tested server returned by the relay server.

在一实施例中,测试参数包括并发数、发压时长、程序标识以及服务器标识一种或多种组合。In one embodiment, the test parameters include one or more combinations of the number of concurrent requests, the duration of the pressure request, the program identifier, and the server identifier.

第三方面,本申请提供一种中转服务器,存储器,处理器;In a third aspect, the present application provides a transit server, a memory, and a processor;

存储器;用于存储处理器可执行指令的存储器;Memory; Memory for storing processor executable instructions;

其中,处理器被配置为执行第一方面及可选方案所涉及的测试方法。The processor is configured to execute the test method involved in the first aspect and the optional solution.

第四方面,本申请提供一种移动终端,存储器,处理器;In a fourth aspect, the present application provides a mobile terminal, a memory, and a processor;

存储器;用于存储处理器可执行指令的存储器;Memory; Memory for storing processor executable instructions;

其中,处理器被配置为执行第二方面及可选方案所涉及的测试方法。The processor is configured to execute the testing method involved in the second aspect and the optional solution.

第五方面,本申请提供一种测试系统,包括第三方面所涉及的中转服务器、第四方面所涉及的移动终端以及被测服务器。In a fifth aspect, the present application provides a test system, including the transit server involved in the third aspect, the mobile terminal involved in the fourth aspect, and a server under test.

第六方面,本申请提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,计算机执行指令被处理器执行时用于实现第一方面及可选方案所涉及或者第二方面及可选方案所涉及的测试方法。In a sixth aspect, the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement the test method involved in the first aspect and optional scheme or the second aspect and optional scheme.

第七方面,本申请提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现第一方面及可选方案所涉及或者第二方面及可选方案所涉及的测试方法。In a seventh aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the testing method involved in the first aspect and optional scheme or the second aspect and optional scheme.

本申请提供的测试方法及设备,中转服务器接收移动终端发送的测试请求,根据测试请求获取测试参数,并根据测试参数和预先加载的测试程序生成访问请求,再向被测服务器发送访问请求,以获得被测服务器在响应访问请求时的响应性能数据,用以提供一种不受空间限制的测试方法。向移动终端返回响应性能数据,从而可实现在任意空间位置对被测服务器进行性能测试。The test method and device provided by the present application, the transit server receives the test request sent by the mobile terminal, obtains the test parameters according to the test request, generates an access request according to the test parameters and the pre-loaded test program, and then sends the access request to the server under test to obtain the response performance data of the server under test when responding to the access request, so as to provide a test method that is not limited by space. The response performance data is returned to the mobile terminal, so that the performance test of the server under test can be realized at any spatial location.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

图1为本申请一实施例提供的测试系统的结构示意图;FIG1 is a schematic diagram of the structure of a test system provided in an embodiment of the present application;

图2为本申请一实施例提供的测试方法的交互示意图;FIG2 is an interactive schematic diagram of a test method provided in an embodiment of the present application;

图3为本申请另一实施例提供的测试方法的交互示意图;FIG3 is an interactive schematic diagram of a testing method provided in another embodiment of the present application;

图4为本申请一实施例提供的测试装置的结构示意图;FIG4 is a schematic diagram of the structure of a testing device provided in an embodiment of the present application;

图5为本申请另一实施例提供的测试装置的结构示意图;FIG5 is a schematic diagram of the structure of a testing device provided in another embodiment of the present application;

图6为本申请另一实施例提供的中转服务器的结构示意图;FIG6 is a schematic diagram of the structure of a transfer server provided in another embodiment of the present application;

图7为本申请另一实施例提供的移动终端的结构示意图。FIG. 7 is a schematic diagram of the structure of a mobile terminal provided in another embodiment of the present application.

通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本申请构思的范围,而是通过参考特定实施例为本领域技术人员说明本申请的概念。The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments.

具体实施方式Detailed ways

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

本申请一实施例提供一种数据处理方法及设备,旨在提供一种远程测试的方案,本申请的技术构思是:通过移动终端接收用户输入的测试参数,并由移动终端发起测试请求,中转服务器在接收到测试请求后,从测试请求中解析出测试参数,并根据本地存储的测试程序和测试参数生成访问请求,以模拟被测服务器接收高并发的访问请求的情况,并获取被测服务器的响应性能数据,以返回至移动终端,从而实现在移动终端对被测服务器进行高并发测试,并实时监控测试性能。An embodiment of the present application provides a data processing method and device, aiming to provide a remote testing solution. The technical concept of the present application is: a test parameter input by a user is received through a mobile terminal, and a test request is initiated by the mobile terminal. After receiving the test request, the transit server parses the test parameter from the test request, and generates an access request according to the locally stored test program and test parameters to simulate the situation where the server under test receives high-concurrency access requests, and obtains the response performance data of the server under test to return it to the mobile terminal, thereby realizing high-concurrency testing of the server under test on the mobile terminal and real-time monitoring of the test performance.

如图1所示,本申请一实施例提供一种数据处理系统,该数据处理系统包括移动终端101、中转服务器102以及被测服务器103。其中,移动终端101与中转服务器102之间通信连接,中转服务器102与被测服务器103之间通信连接。As shown in Fig. 1, an embodiment of the present application provides a data processing system, which includes a mobile terminal 101, a transit server 102, and a server under test 103. The mobile terminal 101 is connected to the transit server 102 for communication, and the transit server 102 is connected to the server under test 103 for communication.

移动终端101用于接收测试参数,根据测试参数生成测试请求,并向中转服务器102发送测试请求。中转服务器102内加载有测试程序,中转服务器在接收到测试请求后,从测试请求中解析出测试参数,并根据测试参数和预先加载的测试程序生成访问请求,并以预设频率向被测服务器103发送访问请求,并采集服务器响应访问请求的响应性能,例如:被测服务器的内存、CPU等资源占用情况、吞吐量、响应时间等。中转服务器102还用于将采集到的响应性能回传至移动终端101。The mobile terminal 101 is used to receive test parameters, generate a test request according to the test parameters, and send the test request to the relay server 102. The relay server 102 is loaded with a test program. After receiving the test request, the relay server parses the test parameters from the test request, generates an access request according to the test parameters and the pre-loaded test program, and sends the access request to the server under test 103 at a preset frequency, and collects the response performance of the server in response to the access request, such as: the memory, CPU and other resource usage of the server under test, throughput, response time, etc. The relay server 102 is also used to transmit the collected response performance back to the mobile terminal 101.

在一实施例中,中转服务器102可以是一个设备,中转服务器也可以是多个设备。当中转服务器是一个设备时,这个设备即与移动终端之间通信连接,也与被测服务器之间通信连接,该设备即接收移动终端发送的测试请求,向被测服务器发送访问请求。In one embodiment, the transit server 102 may be a device, or may be multiple devices. When the transit server is a device, the device is connected to the mobile terminal for communication and is also connected to the server under test for communication. The device receives the test request sent by the mobile terminal and sends an access request to the server under test.

当中转服务器可以是多个设备时,该多个设备分为第一组设备和第二组设备,每组设备内的各个设备之间通信连接,两组设备之间也通信连接,第一组设备用于接收移动终端发送的测试请求,第一组设备内加载有测试程序,在接收到测试请求后,从测试请求中解析出测试参数,并将并根据测试参数和预先加载的测试程序转发至第二组设备,第二组设备根据测试参数和预先加载的测试程序生成访问请求,并以预设频率向被测服务器103发送访问请求,并采集服务器响应访问请求的响应性能,例如:被测服务器的内存、CPU等资源占用情况、吞吐量、响应时间等。第二组设备104还用于将采集到的响应性能回传至第一组设备,由第一组设备将响应性能回传至移动终端101。When the transit server can be a plurality of devices, the plurality of devices are divided into a first group of devices and a second group of devices. The devices in each group of devices are connected to each other in communication, and the two groups of devices are also connected to each other in communication. The first group of devices is used to receive the test request sent by the mobile terminal. The first group of devices is loaded with a test program. After receiving the test request, the test parameters are parsed from the test request, and the test parameters and the pre-loaded test program are forwarded to the second group of devices. The second group of devices generates an access request according to the test parameters and the pre-loaded test program, and sends the access request to the server under test 103 at a preset frequency, and collects the response performance of the server in response to the access request, for example: the memory, CPU and other resource usage of the server under test, throughput, response time, etc. The second group of devices 104 is also used to transmit the collected response performance back to the first group of devices, and the first group of devices transmits the response performance back to the mobile terminal 101.

如图2所示,本申请一实施例提供一种测试方法,该测试方法应用于上述测试系统,该测试方法包括如下步骤:As shown in FIG. 2 , an embodiment of the present application provides a testing method, which is applied to the above-mentioned testing system and includes the following steps:

S201、中转服务器接收移动终端发送的测试请求。S201. The transit server receives a test request sent by a mobile terminal.

在该步骤中,移动终端获取预先设置的测试参数,该测试参数可以是用户输入的,也可以是预先存储在移动终端内的测试参数。In this step, the mobile terminal obtains a preset test parameter, which may be input by a user or may be a test parameter pre-stored in the mobile terminal.

测试参数包括并发数、发压时长、程序标识和服务器标识中一种或多种组合,其中,并发数表示服务器同时接收到的访问请求的数量,发压时长是指服务器同时接收到多个访问请求的持续时间,程序标识用于唯一标识测试程序,服务器标识用于唯一标识中转服务器。The test parameters include one or more combinations of concurrency number, stress duration, program ID and server ID, where the concurrency number indicates the number of access requests received by the server at the same time, the stress duration refers to the duration for which the server receives multiple access requests at the same time, the program ID is used to uniquely identify the test program, and the server ID is used to uniquely identify the transit server.

移动终端在接收到测试参数后,根据测试参数生成测试请求,并向服务器标识对应的中转服务器发送测试请求。After receiving the test parameters, the mobile terminal generates a test request according to the test parameters, and sends the test request to the transit server corresponding to the server identifier.

S202、中转服务器根据测试参数和预先加载的测试程序生成访问请求。S202: The transit server generates an access request according to the test parameters and the pre-loaded test program.

在该步骤中,在中转服务器内加载有测试程序,测试程序用于生成用于访问被测服务器的访问请求。In this step, a test program is loaded into the transit server, and the test program is used to generate an access request for accessing the server under test.

中转服务器在接收到测试请求后,从测试请求中解析出测试参数,并根据测试参数和预先加载的测试程序生成访问请求。After receiving the test request, the transit server parses the test parameters from the test request and generates an access request according to the test parameters and the pre-loaded test program.

在一实施例中,中转服务器通过持续生成多个访问请求,以模拟被测服务器在被多个终端访问的场景,从而测试被测服务器在接收到高并发的访问请求时的性能。In one embodiment, the transit server continuously generates multiple access requests to simulate a scenario where the server under test is accessed by multiple terminals, thereby testing the performance of the server under test when receiving high-concurrency access requests.

S203、中转服务器向被测服务器发送访问请求。S203: The transit server sends an access request to the server under test.

在该步骤中,中转服务器可以向被测服务器发送多个访问请求,以模拟被测服务器在被多个终端访问的场景。In this step, the transit server may send multiple access requests to the server under test to simulate a scenario in which the server under test is accessed by multiple terminals.

S204、被测服务器向中转服务器返回响应消息。S204: The server under test returns a response message to the transit server.

在该步骤中,被测服务器在接收到多个访问请求后,根据访问请求生成响应消息,并向中转服务器返回响应消息。In this step, after receiving multiple access requests, the server under test generates a response message according to the access requests and returns the response message to the transit server.

S205、中转服务器获取被测服务器响应访问请求的响应性能数据。S205: The transit server obtains response performance data of the tested server in response to the access request.

在该步骤中,中转服务器从接收到的响应消息提取被测服务器的响应性能。服务器响应访问请求的响应性能,例如:被测服务器的内存、CPU等资源占用情况、吞吐量、响应时间中一种或多种组合。In this step, the transit server extracts the response performance of the tested server from the received response message. The response performance of the server in response to the access request, for example, one or more combinations of the memory, CPU and other resource usage, throughput, and response time of the tested server.

S206、中转服务器向移动终端发送被测服务器响应访问请求的响应性能数据。S206: The transit server sends the response performance data of the tested server in response to the access request to the mobile terminal.

在上述技术方案中,中转服务器接收移动终端发送的测试请求,并根据测试请求中测试参数和预先加载的测试程序生成访问请求,模拟被测服务器在被多个终端访问的场景,并获取被测服务器在接收到访问请求后的响应性能数据,以实现在任意空间场景对被测服务器进行性能测试。In the above technical solution, the relay server receives the test request sent by the mobile terminal, and generates an access request based on the test parameters in the test request and the pre-loaded test program, simulates the scenario in which the server under test is accessed by multiple terminals, and obtains the response performance data of the server under test after receiving the access request, so as to realize performance testing of the server under test in any spatial scenario.

如图3所示,本申请一实施例提供一种测试方法,该测试方法应用于上述测试系统,该测试方法包括如下步骤:As shown in FIG3 , an embodiment of the present application provides a testing method, which is applied to the above-mentioned testing system and includes the following steps:

S301、中转服务器接收移动终端发送的测试请求。S301. The transit server receives a test request sent by a mobile terminal.

在该步骤中,用户通过配置界面输入测试参数,测试参数包括并发数、发压时长、程序标识和服务器标识。移动终端在接收到测试参数后,根据测试参数生成测试请求,并向服务器标识对应的中转服务器发送测试请求。In this step, the user enters the test parameters through the configuration interface, including the number of concurrent calls, compression duration, program ID and server ID. After receiving the test parameters, the mobile terminal generates a test request according to the test parameters and sends the test request to the transfer server corresponding to the server ID.

在一实施例中,在移动终端上运行基于Jmeter测试工具开发的应用程序,在应用程序的界面上输入中转服务器的标识、测试程序的标识、并发数和发压时长等。In one embodiment, an application developed based on the Jmeter test tool is run on a mobile terminal, and the ID of the transit server, the ID of the test program, the number of concurrent tests, the stress duration, etc. are input on the interface of the application.

S302、中转服务器根据测试参数和预先加载的测试程序生成访问请求。S302: The transit server generates an access request according to the test parameters and the pre-loaded test program.

在该步骤中,预先在中转服务器内加载有测试程序,其中,测试程序包括Jmeter脚本和参数化文件。In this step, a test program is pre-loaded in the transit server, wherein the test program includes a Jmeter script and a parameterized file.

在一实施例中,中转服务器根据并发数和发压时长确定生成访问请求的发送数量,并根据程序标识对应的测试程序和服务器标识生成发送数量的访问请求。In one embodiment, the transit server determines the number of access requests to be sent according to the number of concurrent requests and the duration of the pressure, and generates the number of access requests to be sent according to the test program and the server identifier corresponding to the program identifier.

在一实施例中,中转服务器根据并发数和发压时长确定访问请求的发送频率,中转服务器根据程序标识对应的测试程序和服务器标识生成一个访问请求。In one embodiment, the relay server determines the frequency of sending access requests according to the number of concurrent requests and the duration of the pressure transmission, and the relay server generates an access request according to the test program and the server identifier corresponding to the program identifier.

此处还需要说明的是,若中转服务器包括多个设备,由第一组设备接收移动终端发送的测试请求,且第一组设备内存储有测试程序,第一组设备在解析出测试参数后,将测试参数和测试程序转发至第二组设备,由第二组设备根据测试参数和测试程序生成访问请求。It should also be noted here that if the transit server includes multiple devices, the first group of devices receives the test request sent by the mobile terminal, and the first group of devices stores a test program. After parsing the test parameters, the first group of devices forwards the test parameters and the test program to the second group of devices, and the second group of devices generates an access request based on the test parameters and the test program.

S303、中转服务器向被测服务器发送访问请求。S303: The transit server sends an access request to the server under test.

在该步骤中,持续以并发数向被测服务器发送访问请求,其中,持续时间为发压时长。当中转服务器生成一个访问请求时,持续以并发数向被测服务器发送同一个访问请求。当中转服务器生成多个访问请求时,持续以并发数向被测服务器发送不同的访问请求。In this step, access requests are continuously sent to the server under test at the concurrency number, where the duration is the duration of the pressure. When the transit server generates an access request, the same access request is continuously sent to the server under test at the concurrency number. When the transit server generates multiple access requests, different access requests are continuously sent to the server under test at the concurrency number.

S304、被测服务器向中转服务器返回响应消息。S304: The server under test returns a response message to the transit server.

在该步骤中,被测服务器在接收到多个访问请求后,根据访问请求生成响应消息,并向中转服务器返回响应消息。In this step, after receiving multiple access requests, the server under test generates a response message according to the access requests and returns the response message to the transit server.

S305、中转服务器使用测试程序监控被测服务器返回的响应消息。S305: The transit server uses a test program to monitor the response message returned by the tested server.

在该步骤中,中转服务器在接收到响应信息后,从响应信息提取出响应时间、被测服务器的资源使用量等性能数据,并对提取出的响应时间、被测服务器的资源使用量等性能数据进行统计分析,获得监控结果。In this step, after receiving the response information, the transit server extracts performance data such as response time and resource usage of the server under test from the response information, and performs statistical analysis on the extracted performance data such as response time and resource usage of the server under test to obtain monitoring results.

S306、中转服务器根据测试程序的监控结果生成响应性能数据。S306. The transit server generates response performance data according to the monitoring results of the test program.

在上述步骤中,显示测试程序输出的监控结果,并对显示的监控结果进行截屏处理输出截屏图像。In the above steps, the monitoring results output by the test program are displayed, and the displayed monitoring results are captured and a screenshot image is output.

在一实施例中,可按照一定时间间隔对显示的监控结果进行截屏,并将截屏图片返回至移动终端,完成监控数据的采集;In one embodiment, the displayed monitoring results can be screenshotted at a certain time interval, and the screenshot image can be returned to the mobile terminal to complete the collection of monitoring data;

S307、中转服务器向移动终端发送截屏图像。S307: The transfer server sends the screenshot image to the mobile terminal.

S308、移动终端对截屏图像进行识别处理,获得响应性能数据。S308: The mobile terminal recognizes and processes the screenshot image to obtain response performance data.

在该步骤中,利用图像识别对截屏图片中的关键字,比如CPU、Mem、TPS等关键字进行识别以及记录,以获得指标随时间变化而变化的动态响应性能数据。In this step, image recognition is used to identify and record keywords in the screenshot, such as CPU, Mem, TPS, etc., to obtain dynamic response performance data of indicators changing over time.

S309、当响应性能数据满足预警条件时生成预警信息。S309. Generate warning information when the response performance data meets the warning condition.

在该步骤中,对于满足预警条件的响应性能数据可生成预警信息。In this step, warning information may be generated for response performance data that meets the warning conditions.

在一实施例中,当某一响应性能数据超过阈值后,生成相应的预警信息。In one embodiment, when a certain response performance data exceeds a threshold, a corresponding warning message is generated.

在上述技术方案中,测试人员通过移动终端对中转服务器进行远程操控,并对性能指标数据进行监控,方便了性能测试人员的日常工作,极大改善了空间对性能测试的限制。In the above technical solution, testers remotely control the transit server through mobile terminals and monitor performance indicator data, which facilitates the daily work of performance testers and greatly improves the limitations of space on performance testing.

如图4所示,本申请一实施例提供一种测试装置400,该测试装置400包括:As shown in FIG. 4 , an embodiment of the present application provides a testing device 400 , which includes:

第一接收模块401,用于接收移动终端发送的测试请求,其中,测试请求包括测试参数;The first receiving module 401 is used to receive a test request sent by a mobile terminal, wherein the test request includes a test parameter;

处理模块402,用于根据测试参数和预先加载的测试程序生成访问请求;Processing module 402, for generating an access request according to test parameters and a pre-loaded test program;

处理模块402还用于向被测服务器发送访问请求,并获取被测服务器响应访问请求的响应性能数据;The processing module 402 is also used to send an access request to the server under test and obtain response performance data of the server under test in response to the access request;

第一发送模块403,用于向移动终端发送被测服务器响应访问请求的响应性能数据。The first sending module 403 is used to send the response performance data of the tested server in response to the access request to the mobile terminal.

在一实施例中,测试参数包括并发数、发压时长、程序标识以及服务器标识;处理模块402具体用于:In one embodiment, the test parameters include the number of concurrent connections, the duration of the pressure release, the program identifier, and the server identifier; the processing module 402 is specifically used to:

根据并发数和发压时长确定生成访问请求的发送数量;Determine the number of access requests to be sent based on the number of concurrent requests and the duration of the request.

根据程序标识对应的测试程序和服务器标识生成发送数量的访问请求。Generate and send a number of access requests according to the test program and server identifier corresponding to the program identifier.

在一实施例中,处理模块402具体用于:In one embodiment, the processing module 402 is specifically configured to:

持续以并发数向被测服务器发送访问请求,其中,持续时间为发压时长。Continue to send access requests to the server under test at a concurrent number, where the duration is the duration of the pressure.

在一实施例中,处理模块402具体用于:In one embodiment, the processing module 402 is specifically configured to:

使用测试程序监控被测服务器返回的响应消息;Use the test program to monitor the response messages returned by the server under test;

根据测试程序的监控结果生成响应性能数据。Generate response performance data based on the monitoring results of the test program.

在一实施例中,处理模块402具体用于:In one embodiment, the processing module 402 is specifically configured to:

显示测试程序输出的监控结果,并对显示的监控结果进行截屏处理输出截屏图像;Display the monitoring results output by the test program, and take screenshots of the displayed monitoring results to output screenshot images;

对截屏图像进行识别处理,获得响应性能数据。The screenshot image is recognized and processed to obtain response performance data.

如图5所示,本申请一实施例提供一种测试装置500,该测试装置500包括:As shown in FIG5 , an embodiment of the present application provides a testing device 500, which includes:

获取模块501,用于获取用户输入的测试参数;The acquisition module 501 is used to acquire the test parameters input by the user;

第二发送模块502,用于根据测试参数生成测试请求,并向中转服务器发送测试请求,以使中转服务器生成并向被测服务器发送访问请求,并获取被测服务器响应访问请求时的响应性能;The second sending module 502 is used to generate a test request according to the test parameters, and send the test request to the transit server, so that the transit server generates and sends an access request to the server under test, and obtains the response performance of the server under test when responding to the access request;

第二接收模块503,用于接收中转服务器返回的被测服务器的响应性能。The second receiving module 503 is used to receive the response performance of the tested server returned by the transit server.

在一实施例中,测试参数包括并发数、发压时长、程序标识以及服务器标识。In one embodiment, the test parameters include the number of concurrent requests, the duration of the pressure request, the program identifier, and the server identifier.

如图6所示,本申请一实施例提供一种调度设备600,调度设备600包括存储器601和处理器602。As shown in FIG. 6 , an embodiment of the present application provides a scheduling device 600 , and the scheduling device 600 includes a memory 601 and a processor 602 .

存储器601,用于存储计算机执行指令;Memory 601, used for storing computer-executable instructions;

处理器602,用于执行存储器存储的计算机执行指令,以实现上述实施例中测试方法所执行的各个步骤。具体可以参见前述测试方法实施例中的相关描述。The processor 602 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the test method in the above embodiment. For details, please refer to the relevant description in the above test method embodiment.

可选地,上述存储器601既可以是独立的,也可以跟处理器602集成在一起。当存储器601独立设置时,该处理设备还包括总线,用于连接存储器601和处理器602。Optionally, the memory 601 can be independent or integrated with the processor 602. When the memory 601 is independently provided, the processing device further includes a bus for connecting the memory 601 and the processor 602.

如图7所示,本申请一实施例提供一种调度设备700,调度设备700包括存储器701和处理器702。As shown in FIG. 7 , an embodiment of the present application provides a scheduling device 700 , and the scheduling device 700 includes a memory 701 and a processor 702 .

存储器701,用于存储计算机执行指令;Memory 701, used for storing computer-executable instructions;

处理器702,用于执行存储器存储的计算机执行指令,以实现上述实施例中测试方法所执行的各个步骤。具体可以参见前述测试方法实施例中的相关描述。The processor 702 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the test method in the above embodiment. For details, please refer to the relevant description in the above test method embodiment.

可选地,上述存储器701既可以是独立的,也可以跟处理器702集成在一起。当存储器701独立设置时,该处理设备还包括总线,用于连接存储器701和处理器702。Optionally, the memory 701 can be independent or integrated with the processor 702. When the memory 701 is independently provided, the processing device further includes a bus for connecting the memory 701 and the processor 702.

本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,当处理器执行计算机执行指令时,实现如上处理设备所执行的测试方法。An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the test method executed by the above processing device is implemented.

本申请实施例还提供一种计算机程序产品,包括计算机指令,该计算机指令被处理器执行时实现如上处理设备所执行的测试方法。An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the test method performed by the above processing device.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求书指出。Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求书来限制。It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims (8)

Translated fromChinese
1.一种测试方法,其特征在于,所述方法应用于中转服务器,所述方法包括:1. A testing method, characterized in that the method is applied to a transit server, and the method comprises:接收移动终端发送的测试请求,其中,所述测试请求包括测试参数;所述测试参数包括程序标识以及服务器标识,所述程序标识用于唯一标识测试程序,所述服务器标识用于唯一标识所述中转服务器;Receiving a test request sent by a mobile terminal, wherein the test request includes test parameters; the test parameters include a program identifier and a server identifier, the program identifier is used to uniquely identify the test program, and the server identifier is used to uniquely identify the transit server;根据所述测试参数和目标测试程序生成访问请求;generating an access request according to the test parameters and the target test program;向被测服务器发送所述访问请求,并获取所述被测服务器响应所述访问请求的响应性能数据;Sending the access request to the server under test, and obtaining response performance data of the server under test in response to the access request;向所述移动终端发送所述被测服务器响应所述访问请求的响应性能数据;Sending response performance data of the tested server in response to the access request to the mobile terminal;获取所述被测服务器响应所述访问请求的响应性能数据,具体包括:Acquiring response performance data of the tested server in response to the access request, specifically including:使用所述目标测试程序监控所述被测服务器返回的响应消息;Using the target test program to monitor the response message returned by the server under test;显示所述测试程序输出的监控结果,并对显示的监控结果进行截屏处理输出截屏图像,所述截屏图像用于发送至移动终端,并由所述移动终端对所述截屏图像进行识别处理;Display the monitoring results output by the test program, and take screenshots of the displayed monitoring results to output screenshot images, wherein the screenshot images are sent to a mobile terminal, and the mobile terminal recognizes and processes the screenshot images;所述中转服务器包括第一组设备和第二组设备;所述第一组设备内存储有测试程序;所述接收移动终端发送的测试请求,包括:The transfer server includes a first group of devices and a second group of devices; the first group of devices stores a test program; and the receiving a test request sent by a mobile terminal includes:所述第一组设备接收移动终端发送的测试请求;The first group of devices receives a test request sent by a mobile terminal;所述根据所述测试参数和目标测试程序生成访问请求,包括:Generating an access request according to the test parameters and the target test program includes:所述第一组设备解析所述测试参数,并将所述测试参数和所述程序标识指示的目标测试程序转发至第二组设备;The first group of devices parses the test parameters, and forwards the test parameters and the target test program indicated by the program identifier to the second group of devices;所述第二组设备根据所述测试参数和所述目标测试程序生成所述访问请求。The second group of devices generates the access request according to the test parameters and the target test program.2.根据权利要求1所述的方法,其特征在于,所述测试参数还包括并发数以及发压时长;2. The method according to claim 1, characterized in that the test parameters also include the number of concurrent calls and the duration of the pressure;根据所述测试参数和目标测试程序生成访问请求,具体包括:Generate an access request according to the test parameters and the target test program, specifically including:根据所述并发数和所述发压时长确定生成所述访问请求的发送数量;Determine the number of sending the access request to generate according to the concurrent number and the pressure duration;根据所述目标测试程序和所述服务器标识生成所述发送数量的访问请求。The sending number of access requests is generated according to the target test program and the server identifier.3.根据权利要求2所述的方法,其特征在于,向被测服务器发送所述访问请求,具体包括:3. The method according to claim 2, wherein sending the access request to the server under test comprises:持续以所述并发数向所述被测服务器发送所述访问请求,其中,持续时间为所述发压时长。The access request is continuously sent to the server under test at the concurrent number, wherein the duration is the pressure sending time.4.一种测试方法,其特征在于,所述方法应用于移动终端,所述方法包括:4. A testing method, characterized in that the method is applied to a mobile terminal, and the method comprises:获取用户输入的测试参数,所述测试参数包括程序标识以及服务器标识;所述程序标识用于唯一标识测试程序,服务器标识用于唯一标识中转服务器;Acquire test parameters input by a user, wherein the test parameters include a program identifier and a server identifier; the program identifier is used to uniquely identify the test program, and the server identifier is used to uniquely identify the transfer server;根据所述测试参数生成测试请求,并向所述服务器标识指示的中转服务器发送所述测试请求,以使所述中转服务器根据所述程序标识对应的目标测试程序和所述测试参数生成访问请求,向被测服务器发送访问请求,并使用所述目标测试程序监控所述被测服务器返回的响应消息,显示所述测试程序输出的监控结果,并对显示的监控结果进行截屏处理输出截屏图像;Generate a test request according to the test parameters, and send the test request to the transit server indicated by the server identifier, so that the transit server generates an access request according to the target test program corresponding to the program identifier and the test parameters, sends the access request to the server under test, and uses the target test program to monitor the response message returned by the server under test, displays the monitoring results output by the test program, and takes a screenshot of the displayed monitoring results to output a screenshot image;接收所述中转服务器返回的截屏图像,并对所述截屏图像进行识别处理以获取所述被测服务器的响应性能;Receiving the screenshot image returned by the transit server, and performing recognition processing on the screenshot image to obtain the response performance of the server under test;其中,所述中转服务器包括第一组设备和第二组设备;第一组设备内存储有测试程序;所述测试参数是所述第一组设备解析的,所述访问请求是所述第二组设备在接收到所述第一组设备发送的所述测试参数和所述程序标识指示的目标测试程序后,根据所述测试参数和所述目标测试程序生成的。Among them, the transit server includes a first group of devices and a second group of devices; the first group of devices stores a test program; the test parameters are parsed by the first group of devices, and the access request is generated by the second group of devices based on the test parameters and the target test program after receiving the test parameters sent by the first group of devices and the target test program indicated by the program identifier.5.根据权利要求4所述的测试方法,其特征在于,所述测试参数还包括并发数和发压时长。5. The test method according to claim 4 is characterized in that the test parameters also include the number of concurrency and the duration of pressure.6.一种中转服务器,其特征在于,存储器,处理器;6. A transit server, characterized by a memory and a processor;存储器;用于存储所述处理器可执行指令的存储器;Memory; Memory for storing instructions executable by the processor;其中,所述处理器被配置为执行如权利要求1至3中任意一项所述的测试方法。The processor is configured to execute the testing method as claimed in any one of claims 1 to 3.7.一种移动终端,其特征在于,存储器,处理器;7. A mobile terminal, characterized by a memory and a processor;存储器;用于存储所述处理器可执行指令的存储器;Memory; Memory for storing instructions executable by the processor;其中,所述处理器被配置为执行如权利要求4或5所述的测试方法。The processor is configured to execute the testing method as claimed in claim 4 or 5.8.一种测试系统,其特征在于,包括如权利要求6所述的中转服务器、如权利要求7所述的移动终端以及被测服务器。8. A test system, comprising the transit server as claimed in claim 6, the mobile terminal as claimed in claim 7 and a server under test.
CN202110704385.XA2021-06-242021-06-24 Test methods and equipmentActiveCN113282511B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110704385.XACN113282511B (en)2021-06-242021-06-24 Test methods and equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110704385.XACN113282511B (en)2021-06-242021-06-24 Test methods and equipment

Publications (2)

Publication NumberPublication Date
CN113282511A CN113282511A (en)2021-08-20
CN113282511Btrue CN113282511B (en)2024-05-07

Family

ID=77285463

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110704385.XAActiveCN113282511B (en)2021-06-242021-06-24 Test methods and equipment

Country Status (1)

CountryLink
CN (1)CN113282511B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114629888B (en)*2022-03-182024-09-17中国农业银行股份有限公司Method and device for testing server load

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106470133A (en)*2015-08-202017-03-01阿里巴巴集团控股有限公司System pressure method of testing and device
CN109408348A (en)*2018-09-302019-03-01北京奇虎科技有限公司A kind of the visual testing method and server of application program
CN111611166A (en)*2020-05-222020-09-01厦门理工学院 Software testing method and system based on mobile internet
CN112988589A (en)*2021-03-262021-06-18北京金山云网络技术有限公司Interface testing method, device and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20210182183A1 (en)*2019-12-112021-06-17Sap SeEnhanced Performance Testing Script Conversion

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106470133A (en)*2015-08-202017-03-01阿里巴巴集团控股有限公司System pressure method of testing and device
CN109408348A (en)*2018-09-302019-03-01北京奇虎科技有限公司A kind of the visual testing method and server of application program
CN111611166A (en)*2020-05-222020-09-01厦门理工学院 Software testing method and system based on mobile internet
CN112988589A (en)*2021-03-262021-06-18北京金山云网络技术有限公司Interface testing method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于WLAN的轨道通信系统的数据中转方法;刘洪武等;《计算机系统应用》;20120430;第21卷(第04期);229-233*

Also Published As

Publication numberPublication date
CN113282511A (en)2021-08-20

Similar Documents

PublicationPublication DateTitle
CN109302522B (en)Test method, test device, computer system, and computer medium
CN110378749B (en) Client similarity assessment method, device, terminal equipment and storage medium
CN111159046B (en)Test method, test device, electronic equipment, test system and storage medium
CN110798380B (en)Data acquisition method, system, device, test equipment and test server
CN111352836A (en) A pressure test method and related device
CN105793860A (en) Anti-debugging method
CN111966556B (en)Performance pressure measurement method and device, server and computer readable storage medium
CN108052440B (en)Method, device, equipment and storage medium for correcting operation logic of business system
CN115221071A (en)Chip verification method and device, electronic equipment and storage medium
CN109960644A (en) An SDK testing method and system
CN111045934A (en)Page analysis method, device, client, storage medium and electronic equipment
CN112685285B (en) User interface test case generation method and device
CN104102578A (en)Test method and system and operation terminal
CN113282511B (en) Test methods and equipment
CN105515887A (en)Application test method, server and system
CN114416508A (en) Application performance monitoring method and device, storage medium and electronic device
CN114040189A (en)Multimedia test method, device, storage medium and electronic equipment
CN103152216B (en)The method of testing of system and device in a kind of the Internet
CN111078477A (en)Interface test method and device, storage medium and electronic equipment
CN112882948A (en)Stability testing method, device and system for application and storage medium
CN111552634A (en)Method and device for testing front-end system and storage medium
CN110933070A (en)User identification method, system, equipment and computer readable storage medium
CN111782291B (en)Method and device for starting test page
CN112256564B (en)Application program running method and device and electronic equipment
CN116841884A (en)Interface calling method, device, equipment and readable storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp