WO2018120722A1 - 异步接口测试方法、终端、设备、系统及存储介质 - Google Patents
异步接口测试方法、终端、设备、系统及存储介质 Download PDFInfo
- Publication number
- WO2018120722A1 WO2018120722A1 PCT/CN2017/091257 CN2017091257W WO2018120722A1 WO 2018120722 A1 WO2018120722 A1 WO 2018120722A1 CN 2017091257 W CN2017091257 W CN 2017091257W WO 2018120722 A1 WO2018120722 A1 WO 2018120722A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- http
- asynchronous
- information
- data
- request
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
Definitions
- the present invention relates to the field of communications technologies, and in particular, to an asynchronous interface testing method, a testing terminal, a device, a system, and a storage medium.
- the Internet uses the Internet to browse information, consume shopping, etc., which will generate a large amount of personal information, including personal credit information, shopping consumption records, and the like.
- many service providers use crawler technology to capture and collect these personal information into an APP account.
- the solution adopted is: the service provider sends the captured personal information to a third party for storage by a third party, so that even the technical administrator cannot access the personal information.
- the uncomputed first-hand data returned by the asynchronous HTTP callback interface without interruption is required to store the first-hand data into the database.
- the existing test solution for the HTTP interface is usually for the synchronous HTTP interface, and is built in the case that the data in the inbound is accessible, and the asynchronous HTTP callback interface does not directly return the data to the caller, but directly into the database.
- the caller In the secure database, the caller cannot directly retrieve the first-hand data returned. Therefore, the asynchronous HTTP callback interface cannot be tested, which makes the use and management of personal information based on crawler technology have great security risks.
- the object of the present invention is to provide an asynchronous interface test method, a test terminal, a device, a system, and a storage medium, which are designed to implement testing of an asynchronous HTTP callback interface, and improve the security of personal information that is uniformly applied and managed based on crawler technology.
- the present invention provides a method for asynchronous interface testing, and the method for testing the asynchronous interface includes:
- the test terminal sends a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested.
- the service terminal receives the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and sends the returned HTTP data to the test terminal.
- the test terminal acquires pre-stored standard HTTP data corresponding to the HTTP request, and performs the asynchronous HTTP callback according to the received return HTTP data and the standard HTTP data. The interface is tested.
- the present invention further provides a system for asynchronous interface testing, the system for testing the asynchronous interface includes a service terminal and the above test terminal, and the service terminal is configured to receive each sent by the asynchronous HTTP callback interface device. And returning HTTP data corresponding to the HTTP request, and sending the returned HTTP data to the test terminal.
- the present invention also provides an asynchronous interface test device including a memory, a processor, and an asynchronous interface test program stored on the memory and operable on the processor,
- the asynchronous interface test program is implemented by the processor to implement the following steps:
- the present invention further provides a computer readable storage medium having an asynchronous interface test program stored therein, and the asynchronous interface test program is implemented by the processor to implement the following steps:
- the invention has the beneficial effects that the test terminal sends an HTTP request to the asynchronous HTTP callback interface device, and after the asynchronous HTTP callback interface obtains the returned HTTP data corresponding to the HTTP request, it sends the HTTP request to the service terminal, so that the service terminal can Sending the returned HTTP data to the test terminal, the test terminal tests the asynchronous HTTP callback interface based on the returned HTTP data and the standard HTTP data, implements testing of the asynchronous HTTP callback interface, and improves personal information based on the unified use and management of the crawler technology. Security.
- FIG. 1 is a schematic flowchart of a first embodiment of a method for asynchronous interface testing according to the present invention
- step S1 shown in FIG. 1;
- step S3 is a schematic diagram of a refinement process of step S3 shown in FIG. 1;
- FIG. 4 is a schematic flowchart diagram of a second embodiment of a method for asynchronous interface testing according to the present invention.
- FIG. 5 is a schematic structural diagram of an embodiment of a test terminal according to the present invention.
- FIG. 6 is a block diagram showing the hardware structure of an asynchronous interface test device according to the present invention.
- FIG. 1 is a schematic flowchart of a method for testing an asynchronous interface according to an embodiment of the present invention.
- the method for testing an asynchronous interface includes the following steps:
- Step S1 The test terminal sends a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested one by one;
- the test terminal may be any applicable electronic device such as a mobile phone, a computer, a tablet computer, or a personal digital assistant.
- the test terminal sends a predetermined HTTP request to the HTTP request for testing, and the test terminal prestores the standard HTTP data corresponding to the HTTP request for testing. Or can obtain the standard HTTP data corresponding to the HTTP request for testing by other means.
- the HTTP request for testing is a request for acquiring a certain webpage or a picture resource
- the corresponding standard HTTP data is the data of the webpage or the image resource.
- the test terminal After the test terminal sends a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested, the asynchronous HTTP callback interface immediately responds, and returns a request success or failure information to the test terminal, and the HTTP request and the corresponding response.
- the process ends, but the data that is valid for the HTTP request can be returned to the specified Http interface address after a predetermined period of processing. That is, the test terminal needs a period of time after receiving the response information of the request success or failure information. In order to receive the data corresponding to the HTTP request.
- Step S2 The service terminal receives the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and sends the returned HTTP data to the test terminal.
- the asynchronous HTTP callback interface device after receiving the HTTP request sent by the test terminal, obtains the returned HTTP data corresponding to the HTTP request, and then sends the returned HTTP data to the service terminal, specifically, the asynchronous HTTP callback interface device.
- the return HTTP data is sent to a service terminal corresponding to a predetermined Http service address, and the service terminal may be, for example, an HTTP server.
- the service terminal sends the returned HTTP data to the test terminal, so that the test terminal performs the test based on the returned HTTP data.
- Step S3 The test terminal acquires pre-stored standard HTTP data corresponding to the HTTP request, and tests the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data.
- the standard HTTP data corresponding to the above HTTP request is pre-stored on the test terminal, or the standard HTTP data corresponding to the HTTP request is obtained from other devices by means of network communication.
- the asynchronous HTTP callback interface is tested based on the received return HTTP data and standard HTTP data.
- the specific test process may be to determine whether the returned HTTP data and the standard HTTP data are the same. If the two are the same, the test is successful, and the corresponding test success information is generated for the tester to view. If the test fails, the corresponding test failure information is also generated. Remind testers.
- the test terminal sends an HTTP request to the asynchronous HTTP callback interface device, and the asynchronous HTTP callback interface sends the HTTP data corresponding to the HTTP request to the service terminal, so that the service terminal
- the return HTTP data can be sent to the test terminal, and the test terminal tests the asynchronous HTTP callback interface based on the returned HTTP data and the standard HTTP data, implements testing of the asynchronous HTTP callback interface, and improves the individual who uses the crawler technology for unified application and management. Information security.
- the step S1 includes:
- test terminal After the test terminal sends the first predetermined HTTP request to the asynchronous HTTP callback interface device to be tested, the test terminal receives the response information corresponding to the first predetermined HTTP request returned by the asynchronous HTTP callback interface device.
- response information is information that the request is successful, send the next predetermined HTTP request to the asynchronous HTTP callback interface device to be tested.
- the asynchronous HTTP callback interface returns corresponding response information to the asynchronous HTTP callback interface, and if the response information is the information that the request is successful, The test terminal can continue to send the next HTTP request to the asynchronous HTTP callback interface device, and then receive the response information corresponding to the next HTTP request returned by the asynchronous HTTP callback interface device, and so on, and send the HTTP request one by one until all the predetermined HTTP requests are sent.
- the request is sent to the asynchronous HTTP callback interface device.
- the test terminal If the response information is information that the request fails, the test terminal generates a reminder message that the HTTP request fails, so that the tester can perform related processing in time.
- the response information is the information that the request is successful
- whether the information about the success of the request includes the key field information may be that the asynchronous HTTP callback interface device is only in the test state, not in the work.
- Status information to prevent asynchronous HTTP callback interface devices from generating confusing information due to different states; if the request successful information contains keyword segment information, analyze whether the key segment information is predetermined field information, for example, analysis
- the key field information is information that the asynchronous HTTP callback interface device is only in the test state. If it is the predetermined field information, the next predetermined HTTP request is sent to the asynchronous HTTP callback interface device to be tested, and then the asynchronous HTTP callback interface device is received.
- the response information corresponding to the next HTTP request returned, and so on, is sent one by one, until all the predetermined HTTP requests are sent to the asynchronous HTTP callback interface device; if the above request succeeds, the information does not contain the keyword. Segment information, generate reminder information for testers and The relevant processing is performed and the HTTP request is no longer sent to the asynchronous HTTP callback interface device to be tested.
- the step S3 includes:
- the test terminal compares the received return HTTP data with corresponding standard HTTP data.
- the test terminal tests the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data
- the returned HTTP data is compared with the corresponding standard HTTP data, for example, X1.
- the corresponding HTTP data returned by the request is Y1, and the returned HTTP data corresponding to the X2 request is Y2;
- the standard HTTP data corresponding to the X1 request is Z1, and the standard HTTP data corresponding to the X2 request is Z2; then Y1 is compared with Z1, and Y2 is compared.
- Z2 if Y1 is consistent with Z1, and Y2 is consistent with Z2, the test is successful, and the test result of the test is successful. If the returned HTTP data is inconsistent with the corresponding standard HTTP data, the test fails, and the test fails. Test Results.
- the method further includes:
- the service terminal performs a rule operation on the returned HTTP data based on a predetermined data rule, and stores the returned HTTP data after the rule operation into a predetermined third-party security database.
- the return HTTP data may be subjected to a rule operation based on a predetermined data rule, for example, performing an encryption operation on the returned HTTP data, or performing compression on the returned HTTP data, and the like, where the encryption algorithm may be, for example, Use symmetric encryption algorithms or other encryption algorithms.
- the returned HTTP data after the regular operation is then stored in a predetermined third-party secure database, for example, to an independent third-party secure database.
- FIG. 5 is a schematic structural diagram of an embodiment of an asynchronous interface test terminal according to the present invention.
- the test terminal includes:
- the sending module 101 is configured to send a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested.
- the test terminal may be any applicable electronic device such as a mobile phone, a computer, a tablet computer, or a personal digital assistant.
- the test terminal sends a predetermined HTTP request to the HTTP request for testing, and the test terminal prestores the standard HTTP data corresponding to the HTTP request for testing. Or can obtain the standard HTTP data corresponding to the HTTP request for testing by other means.
- the HTTP request for testing is a request for acquiring a certain webpage or a picture resource
- the corresponding standard HTTP data is the data of the webpage or the image resource.
- the asynchronous HTTP callback interface After the test terminal sends a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested, the asynchronous HTTP callback interface immediately responds, and returns a request success or failure information to the test terminal, and the HTTP request and the corresponding response. The process ends, but the actual valid data corresponding to the HTTP request takes a period of predetermined processing before returning to the specified Http.
- the interface address that is, after the test terminal receives the response information of the request success or failure information, it takes a period of time to receive the data corresponding to the HTTP request.
- the test module 102 is configured to receive the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and send the returned HTTP data to the test terminal, and obtain the pre-stored and the The standard HTTP data corresponding to the HTTP request is tested on the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data.
- the asynchronous HTTP callback interface device after receiving the HTTP request sent by the test terminal, obtains the returned HTTP data corresponding to the HTTP request, and then sends the returned HTTP data to the service terminal, specifically, the asynchronous HTTP callback interface device.
- the return HTTP data is sent to a service terminal corresponding to a predetermined Http service address, and the service terminal may be, for example, an HTTP server.
- the service terminal sends the returned HTTP data to the test terminal, so that the test terminal performs the test based on the returned HTTP data.
- the standard HTTP data corresponding to the above HTTP request is pre-stored on the test terminal, or the standard HTTP data corresponding to the HTTP request is obtained from other devices by means of network communication.
- the asynchronous HTTP callback interface is tested based on the received return HTTP data and standard HTTP data.
- the specific test process may be to determine whether the returned HTTP data and the standard HTTP data are the same. If the two are the same, the test is successful, and the corresponding test success information is generated for the tester to view. If the test fails, the corresponding test failure information is also generated. Remind testers.
- the sending module 101 is specifically configured to receive the first reservation returned by the asynchronous HTTP callback interface device after sending the first predetermined HTTP request to the asynchronous HTTP callback interface device to be tested.
- the asynchronous HTTP callback interface returns corresponding response information to the asynchronous HTTP callback interface, and if the response information is the information that the request is successful, The test terminal can continue to send the next HTTP request to the asynchronous HTTP callback interface device, and then receive the response information corresponding to the next HTTP request returned by the asynchronous HTTP callback interface device, and so on, and send the HTTP request one by one until all the predetermined HTTP requests are sent.
- the request is sent to the asynchronous HTTP callback interface device.
- the test terminal If the response information is information that the request fails, the test terminal generates a reminder message that the HTTP request fails, so that the tester can perform related processing in time.
- the response information is the information that the request is successful
- whether the information about the success of the request includes the key field information may be that the asynchronous HTTP callback interface device is only in the test state, not in the work.
- Status information to prevent asynchronous HTTP callbacks
- the interface device generates confusing information because it is in different states. If the information about the successful request includes keyword segment information, it analyzes whether the keyword segment information is predetermined field information, for example, analyzing the keyword segment information as an asynchronous HTTP callback. The interface device is only in the test state information.
- the next predetermined HTTP request is sent to the asynchronous HTTP callback interface device to be tested, and then the next HTTP request returned by the asynchronous HTTP callback interface device is received.
- the response information, and so on, is sent one by one to the HTTP request until all the predetermined HTTP requests are sent to the asynchronous HTTP callback interface device; if the above request successful information does not include the key field information, the reminder information is generated.
- the tester makes relevant processing in time, and no longer sends an HTTP request to the asynchronous HTTP callback interface device to be tested.
- the test module 102 is specifically configured to compare the received return HTTP data with the corresponding standard HTTP data; if the returned HTTP data is inconsistent with the corresponding standard HTTP data, generate a test. The test result information of the failure; if all the returned HTTP data are consistent with the corresponding standard HTTP data, the test result information of the test success is generated.
- the test terminal tests the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data
- the returned HTTP data is compared with the corresponding standard HTTP data, for example, X1.
- the corresponding HTTP data returned by the request is Y1, and the returned HTTP data corresponding to the X2 request is Y2;
- the standard HTTP data corresponding to the X1 request is Z1, and the standard HTTP data corresponding to the X2 request is Z2; then Y1 is compared with Z1, and Y2 is compared.
- Z2 if Y1 is consistent with Z1, and Y2 is consistent with Z2, the test is successful, and the test result of the test is successful. If the returned HTTP data is inconsistent with the corresponding standard HTTP data, the test fails, and the test fails. Test Results.
- the present invention provides a system for asynchronous interface testing, the system for testing the asynchronous interface includes a service terminal and the test terminal, and the service terminal is configured to receive each HTTP request corresponding to the asynchronous HTTP callback interface device. Returning HTTP data and transmitting the returned HTTP data to the test terminal.
- FIG. 6 it is a hardware block diagram of the asynchronous interface test device of the present invention.
- the asynchronous interface test device may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, or a portable computer.
- PC Personal Computer
- terminal device such as a smart phone, a tablet computer, or a portable computer.
- the asynchronous interface test device includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
- the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
- the memory 11 may be an internal storage unit of an asynchronous interface test device, such as a hard disk of the asynchronous interface test device, in some embodiments.
- the memory 11 may also be an external storage device of the asynchronous interface test device in other embodiments, such as a plug-in hard device provided on the asynchronous interface test device. Disk, Smart Memory Card (SMC), Secure Digital (SD) card, Flash Card, etc.
- the memory 11 may also include both an internal storage unit of the asynchronous interface test device and an external storage device.
- the memory 11 can be used not only for storing application software installed on the asynchronous interface test device and various types of data, such as code of an asynchronous interface test program, but also for temporarily storing data that has been output or will be output.
- the processor 12 in some embodiments, may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. Data, such as executing an asynchronous interface test program.
- CPU Central Processing Unit
- controller microcontroller
- microprocessor or other data processing chip for running program code or processing stored in the memory 11.
- Data such as executing an asynchronous interface test program.
- Communication bus 13 is used to implement connection communication between these components.
- the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
- asynchronous interface test device can establish a communication connection with the external asynchronous HTTP callback interface device to be tested and the service terminal through the network interface 14.
- Figure 6 shows only the asynchronous interface test equipment with components 11-14 and the asynchronous interface test program, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
- the device may further include a user interface
- the user interface may include a display
- an input unit such as a keyboard
- the optional user interface may further include a standard wired interface and a wireless interface.
- the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
- the display may also be suitably referred to as a display or display unit for displaying information processed in the asynchronous interface test device and a user interface for displaying the visualization.
- an asynchronous interface test program is stored in the memory 11;
- the network interface 14 is mainly used to connect to a server, and performs data communication with the server; and the processor 12 executes an asynchronous interface test program stored in the memory 11. The following steps are implemented:
- processor is further configured to execute the asynchronous interface test program to implement the following steps:
- the response information is information that the request is successful, the next predetermined HTTP request is sent to the asynchronous HTTP callback interface device to be tested.
- processor is further configured to execute the asynchronous interface test program to implement the following step:
- response information is the information that the request is successful, analyze whether the information about the success of the request includes the key field information
- the information about the success of the request includes keyword segment information, analyze whether the keyword segment information is predetermined field information, and if it is predetermined field information, send the next reservation to the asynchronous HTTP callback interface device to be tested. HTTP request.
- processor is further configured to execute the asynchronous interface test program to implement the following steps:
- test result information of the test success is generated.
- the invention further provides a computer readable storage medium, on which the asynchronous interface test program is stored, and the asynchronous interface test program is implemented by the processor to:
- the response information is information that the request is successful, the next predetermined HTTP request is sent to the asynchronous HTTP callback interface device to be tested.
- response information is the information that the request is successful, analyze whether the information about the success of the request includes the key field information
- the information about the success of the request includes keyword segment information, analyze whether the keyword segment information is predetermined field information, and if it is predetermined field information, send the next reservation to the asynchronous HTTP callback interface device to be tested. HTTP request.
- portions of the technical solution of the present invention that contribute substantially or to the prior art may be embodied in the form of a software product stored in a storage medium (such as a ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
- a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明涉及一种异步接口测试方法、测试终端、设备、系统及存储介质,所述异步接口测试的方法包括:测试终端向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端;所述测试终端获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。本发明能够实现对异步HTTP回调接口的测试,提高基于爬虫技术进行统一运用和管理的个人信息的安全性。
Description
优先权申明
本申请基于巴黎公约申明享有2016年12月30日递交的申请号为CN201611265709.X、名称为“异步接口测试的方法、测试终端及系统”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
本发明涉及通信技术领域,尤其涉及一种异步接口测试方法、测试终端、设备、系统及存储介质。
目前,用户利用互联网进行浏览资讯、消费购物等会产生大量的个人信息,包括个人信用信息、购物消费记录等。为了把这些零散的个人信息进行统一运用和管理,在经用户允许的情况下,很多服务提供商利用爬虫技术把这些个人信息抓取了下来聚合到一个APP账号下。为了提高安全性,所采用的方案是:服务提供商把抓取的个人信息发送给第三方,以便第三方进行存储,这样即便技术管理人员都无法查阅这些个人信息。在该方案中,需要运用异步HTTP回调接口不间断返回的未经过运算的第一手数据,以将该第一手数据入库。
现有的针对HTTP接口的测试方案通常是针对同步HTTP接口的,且是建立在入库的数据可访问的情况下,而异步HTTP回调接口不直接返回数据给调用方,而是直接入库到安全数据库中,调用方无法直接获取返回的第一手数据,因此,无法对异步HTTP回调接口进行测试,使得基于爬虫技术的个人信息的运用和管理存在极大的安全隐患。
发明内容
本发明的目的在于提供一种异步接口测试方法、测试终端、设备、系统及存储介质,旨在实现对异步HTTP回调接口的测试,提高基于爬虫技术进行统一运用和管理的个人信息的安全性。
为实现上述目的,本发明提供一种异步接口测试的方法,所述异步接口测试的方法包括:
S1,测试终端向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;
S2,服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端;
S3,所述测试终端获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调
接口进行测试。
为实现上述目的,本发明还提供一种异步接口测试的系统,所述异步接口测试的系统包括服务终端及上述的测试终端,所述服务终端用于接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端。
为实现上述目的,本发明还提供一种异步接口测试设备,该异步接口测试设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的异步接口测试程序,所述异步接口测试程序被所述处理器执行时实现如下步骤:
向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;
在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
为实现上述目的,本发明还提供一种计算机可读存储介质,该计算机可读存储介质中存储有异步接口测试程序,所述异步接口测试程序被处理器执行时实现如下步骤:
向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;
在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
本发明的有益效果是:本发明由测试终端向异步HTTP回调接口设备发送HTTP请求,异步HTTP回调接口在获取到该HTTP请求对应的返回HTTP数据后,将其发送给服务终端,以便服务终端能够将该返回HTTP数据发送给测试终端,测试终端基于该返回HTTP数据及标准HTTP数据对异步HTTP回调接口进行测试,实现对异步HTTP回调接口的测试,提高基于爬虫技术进行统一运用和管理的个人信息的安全性。
图1为本发明异步接口测试的方法第一实施例的流程示意图;
图2为图1所示步骤S1的细化流程示意图;
图3为图1所示步骤S3的细化流程示意图;
图4为本发明异步接口测试的方法第二实施例的流程示意图;
图5为本发明测试终端一实施例的结构示意图;
图6为本发明异步接口测试设备的硬件结构框图。
以下结合附图对本发明的原理和特征进行描述,所举实例只用于解释本
发明,并非用于限定本发明的范围。
如图1所示,图1为本发明异步接口测试的方法一实施例的流程示意图,该异步接口测试的方法包括以下步骤:
步骤S1,测试终端向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;
本实施例中,测试终端可以是手机、计算机、平板电脑、个人数字助理等任意适用的电子设备。对于待测试的异步HTTP回调接口,测试终端向其逐一发送预定的HTTP请求,该预定的HTTP请求为用于测试的HTTP请求,测试终端中预存有该用于测试的HTTP请求对应的标准HTTP数据,或者能够通过其他途径获取到该用于测试的HTTP请求对应的标准HTTP数据。例如该用于测试的HTTP请求为请求获取某一网页或者图片资源的请求,则对应的标准HTTP数据即为该网页或者图片资源的数据。
其中,在测试终端向待测的异步HTTP回调接口设备发送预定的HTTP请求后,该异步HTTP回调接口会立即响应,并返回请求成功或失败信息给测试终端,这时该HTTP请求和对应的响应过程结束,但真正的有效的该HTTP请求对应的数据,需要一段时间预定的处理后才能返回到指定的Http接口地址,即测试终端在接收到请求成功或失败信息的响应信息后,需要一段时间才能接收到该HTTP请求对应的数据。
步骤S2,服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端;
本实施例中,异步HTTP回调接口设备在接收到测试终端发送的HTTP请求后,获取该HTTP请求对应的返回HTTP数据,然后将该返回HTTP数据发送给服务终端,具体地,异步HTTP回调接口设备将该返回HTTP数据发送给预定的Http服务地址对应的服务终端,该服务终端例如可以是HTTP服务器。
为了使得测试终端能够得到经异步HTTP回调接口获取的HTTP请求对应的返回HTTP数据,该服务终端将该返回HTTP数据发送给测试终端,以供测试终端基于该返回HTTP数据进行测试。
步骤S3,所述测试终端获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
本实施例中,测试终端上预先存储有上述的HTTP请求对应的标准HTTP数据,或者通过网络通信的方式从其他设备中获取该HTTP请求对应的标准HTTP数据。在接收到服务终端发送的返回HTTP数据后,基于接收到的该返回HTTP数据及标准HTTP数据对异步HTTP回调接口进行测试。
具体的测试过程可以是判断返回HTTP数据及标准HTTP数据是否相同,如果两者相同则测试成功,生成对应的测试成功信息以供测试人员查看,如果测试失败,同样生成对应的测试失败信息,以提醒测试人员。
与现有技术相比,本实施例由测试终端向异步HTTP回调接口设备发送HTTP请求,异步HTTP回调接口在获取到该HTTP请求对应的返回HTTP数据后,将其发送给服务终端,以便服务终端能够将该返回HTTP数据发送给测试终端,测试终端基于该返回HTTP数据及标准HTTP数据对异步HTTP回调接口进行测试,实现对异步HTTP回调接口的测试,提高基于爬虫技术进行统一运用和管理的个人信息的安全性。
在一优选的实施例中,如图2所示,在上述图1的实施例的基础上,所述步骤S1包括:
S11,所述测试终端向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;
S12,若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
本实施例中,测试终端向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,异步HTTP回调接口即向其返回对应的响应信息,如果该响应信息为请求成功的信息,则测试终端可以继续向异步HTTP回调接口设备发送下一个HTTP请求,然后接收异步HTTP回调接口设备返回的该下一个HTTP请求对应的响应信息,以此类推,逐个HTTP请求发送,直至将所有预定的HTTP请求均向异步HTTP回调接口设备发送完。
如果该响应信息为请求失败的信息,则测试终端生成HTTP请求失败的提醒信息,以供测试人员及时作出相关的处理。
优选地,若上述的响应信息为请求成功的信息,分析该请求成功的信息中是否包含关键字段信息,该关键字段信息例如可以是表征异步HTTP回调接口设备仅处于测试状态而非处于工作状态的信息,以防止异步HTTP回调接口设备由于处于不同的状态而产生容易混淆的信息;若请求成功的信息中包含关键字段信息,则分析关键字段信息是否为预定的字段信息,例如分析该关键字段信息为异步HTTP回调接口设备仅处于测试状态的信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求,然后接收异步HTTP回调接口设备返回的该下一个HTTP请求对应的响应信息,以此类推,逐个HTTP请求发送,直至将所有预定的HTTP请求均向异步HTTP回调接口设备发送完;若上述的请求成功的信息中不包含关键字段信息,则生成提醒信息,以供测试人员及时作出相关的处理,且不再向待测的异步HTTP回调接口设备发送HTTP请求。
在一优选的实施例中,如图3所示,在上述图1的实施例的基础上,所述步骤S3包括:
S31,所述测试终端将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;
S32,若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;
S33,若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。
本实施例中,在测试终端根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试时,将各返回HTTP数据与对应的标准HTTP数据进行比对,例如,X1请求对应的返回HTTP数据为Y1,X2请求对应的返回HTTP数据为Y2;X1请求对应的标准HTTP数据为Z1,X2请求对应的标准HTTP数据为Z2;则将Y1与Z1进行比对,将Y2与Z2进行比对,如果Y1与Z1一致,且Y2与Z2一致,则测试成功,生成测试成功的测试结果,如果有返回HTTP数据与对应的标准HTTP数据不一致,则测试失败,生成测试失败的测试结果。
在一优选的实施例中,如图4所示,在上述图1的实施例的基础上,所述步骤S2之后还包括:
S4,所述服务终端基于预定的数据规则对所述返回HTTP数据进行规则运算,并将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中。
本实施例中,可以基于预定的数据规则对返回HTTP数据进行规则运算,例如,对返回HTTP数据进行加密运算,或者对返回HTTP数据进行压缩后再进行加密运算等,其中,加密的算法例如可以采用对称加密算法或者其他加密算法等。然后将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中,例如保存至一个独立的第三方安全数据库中。
如图5所示,图5为本发明异步接口测试终端一实施例的结构示意图,该测试终端包括:
发送模块101,用于向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;
本实施例中,测试终端可以是手机、计算机、平板电脑、个人数字助理等任意适用的电子设备。对于待测试的异步HTTP回调接口,测试终端向其逐一发送预定的HTTP请求,该预定的HTTP请求为用于测试的HTTP请求,测试终端中预存有该用于测试的HTTP请求对应的标准HTTP数据,或者能够通过其他途径获取到该用于测试的HTTP请求对应的标准HTTP数据。例如该用于测试的HTTP请求为请求获取某一网页或者图片资源的请求,则对应的标准HTTP数据即为该网页或者图片资源的数据。
其中,在测试终端向待测的异步HTTP回调接口设备发送预定的HTTP请求后,该异步HTTP回调接口会立即响应,并返回请求成功或失败信息给测试终端,这时该HTTP请求和对应的响应过程结束,但真正的有效的该HTTP请求对应的数据,需要一段时间预定的处理后才能返回到指定的Http
接口地址,即测试终端在接收到请求成功或失败信息的响应信息后,需要一段时间才能接收到该HTTP请求对应的数据。
测试模块102,用于在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
本实施例中,异步HTTP回调接口设备在接收到测试终端发送的HTTP请求后,获取该HTTP请求对应的返回HTTP数据,然后将该返回HTTP数据发送给服务终端,具体地,异步HTTP回调接口设备将该返回HTTP数据发送给预定的Http服务地址对应的服务终端,该服务终端例如可以是HTTP服务器。
为了使得测试终端能够得到经异步HTTP回调接口获取的HTTP请求对应的返回HTTP数据,该服务终端将该返回HTTP数据发送给测试终端,以供测试终端基于该返回HTTP数据进行测试。
本实施例中,测试终端上预先存储有上述的HTTP请求对应的标准HTTP数据,或者通过网络通信的方式从其他设备中获取该HTTP请求对应的标准HTTP数据。在接收到服务终端发送的返回HTTP数据后,基于接收到的该返回HTTP数据及标准HTTP数据对异步HTTP回调接口进行测试。
具体的测试过程可以是判断返回HTTP数据及标准HTTP数据是否相同,如果两者相同则测试成功,生成对应的测试成功信息以供测试人员查看,如果测试失败,同样生成对应的测试失败信息,以提醒测试人员。
在一优选的实施例中,上述发送模块101具体用于向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
本实施例中,测试终端向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,异步HTTP回调接口即向其返回对应的响应信息,如果该响应信息为请求成功的信息,则测试终端可以继续向异步HTTP回调接口设备发送下一个HTTP请求,然后接收异步HTTP回调接口设备返回的该下一个HTTP请求对应的响应信息,以此类推,逐个HTTP请求发送,直至将所有预定的HTTP请求均向异步HTTP回调接口设备发送完。
如果该响应信息为请求失败的信息,则测试终端生成HTTP请求失败的提醒信息,以供测试人员及时作出相关的处理。
优选地,若上述的响应信息为请求成功的信息,分析该请求成功的信息中是否包含关键字段信息,该关键字段信息例如可以是表征异步HTTP回调接口设备仅处于测试状态而非处于工作状态的信息,以防止异步HTTP回调
接口设备由于处于不同的状态而产生容易混淆的信息;若请求成功的信息中包含关键字段信息,则分析关键字段信息是否为预定的字段信息,例如分析该关键字段信息为异步HTTP回调接口设备仅处于测试状态的信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求,然后接收异步HTTP回调接口设备返回的该下一个HTTP请求对应的响应信息,以此类推,逐个HTTP请求发送,直至将所有预定的HTTP请求均向异步HTTP回调接口设备发送完;若上述的请求成功的信息中不包含关键字段信息,则生成提醒信息,以供测试人员及时作出相关的处理,且不再向待测的异步HTTP回调接口设备发送HTTP请求。
在一优选的实施例中,上述测试模块102具体用于将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。
本实施例中,在测试终端根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试时,将各返回HTTP数据与对应的标准HTTP数据进行比对,例如,X1请求对应的返回HTTP数据为Y1,X2请求对应的返回HTTP数据为Y2;X1请求对应的标准HTTP数据为Z1,X2请求对应的标准HTTP数据为Z2;则将Y1与Z1进行比对,将Y2与Z2进行比对,如果Y1与Z1一致,且Y2与Z2一致,则测试成功,生成测试成功的测试结果,如果有返回HTTP数据与对应的标准HTTP数据不一致,则测试失败,生成测试失败的测试结果。
本发明提供一种异步接口测试的系统,所述异步接口测试的系统包括服务终端及上述的测试终端,所述服务终端用于接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端。
参照图6所示,为本发明的异步接口测试设备的硬件结构框图。
在该实施例中,异步接口测试设备可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等终端设备。
该异步接口测试设备包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。
存储器11在一些实施例中可以是异步接口测试设备的内部存储单元,例如该异步接口测试设备的硬盘。存储器11在另一些实施例中也可以是异步接口测试设备的外部存储设备,例如异步接口测试设备上配备的插接式硬
盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括异步接口测试设备的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于异步接口测试设备的应用软件及各类数据,例如异步接口测试程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行异步接口测试程序等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该设备与其他电子设备之间建立通信连接。例如,在该实施例中,异步接口测试设备可以通过网络接口14与外部的待测的异步HTTP回调接口设备以及服务终端建立通信连接。
图6仅示出了具有组件11-14以及异步接口测试程序的异步接口测试设备,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,该设备还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在异步接口测试设备中处理的信息以及用于显示可视化的用户界面。
在图6所示的异步接口测试设备中,存储器11中存储有异步接口测试程序;网络接口14主要用于连接服务器,与服务器进行数据通信;处理器12执行存储器11中存储的异步接口测试程序时实现如下步骤:
向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;
在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
进一步地,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:
向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;
若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
进一步地,所述处理器还用于执行所述异步接口测试程序,以实现如下
步骤:
若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;
若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
进一步地,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:
将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;
若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;
若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。
本发明还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有异步接口测试程序,所述异步接口测试程序被处理器执行时实现如下操作:
向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;
在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
进一步地,所述异步接口测试程序被处理器执行时,还实现如下步骤:
向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;
若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
进一步地,所述异步接口测试程序被处理器执行时,还实现如下步骤:
若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;
若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
进一步地,所述异步接口测试程序被处理器执行时,还实现如下步骤:
将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;
若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;
若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成
测试成功的测试结果信息。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
Claims (20)
- 一种异步接口测试的方法,其特征在于,所述异步接口测试的方法包括:S1,测试终端向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;S2,服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端;S3,所述测试终端获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
- 根据权利要求1所述的异步接口测试的方法,其特征在于,所述步骤S1包括:S11,所述测试终端向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;S12,若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
- 根据权利要求2所述的异步接口测试的方法,其特征在于,所述步骤S12进一步包括:若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
- 根据权利要求1所述的异步接口测试的方法,其特征在于,所述步骤S3包括:S31,所述测试终端将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;S32,若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;S33,若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。
- 根据权利要求1所述的异步接口测试的方法,其特征在于,所述步骤S2之后还包括:S4,所述服务终端基于预定的数据规则对所述返回HTTP数据进行规则运算,并将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中。
- 根据权利要求2所述的异步接口测试的方法,其特征在于,所述步骤S2之后还包括:S4,所述服务终端基于预定的数据规则对所述返回HTTP数据进行规则运算,并将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中。
- 根据权利要求3所述的异步接口测试的方法,其特征在于,所述步骤S2之后还包括:S4,所述服务终端基于预定的数据规则对所述返回HTTP数据进行规则运算,并将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中。
- 一种异步接口测试终端,其特征在于,所述测试终端包括:发送模块,用于向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;测试模块,用于在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
- 根据权利要求8所述的测试终端,其特征在于,所述发送模块具体用于向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
- 根据权利要求9所述的测试终端,其特征在于,所述发送模块进一步用于若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
- 根据权利要求8所述的测试终端,其特征在于,所述测试模块具体用于将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;若有所 述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。
- 一种异步接口测试的系统,其特征在于,所述异步接口测试的系统包括服务终端及权利要求8至11任一项所述的测试终端,所述服务终端用于接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端。
- 一种异步接口测试设备,其特征在于,所述异步接口测试设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的异步接口测试程序,所述异步接口测试程序被所述处理器执行时实现如下步骤:向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
- 根据权利要求13所述的异步接口测试设备,其特征在于,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
- 根据权利要求14所述的异步接口测试设备,其特征在于,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
- 根据权利要求13所述的异步接口测试设备,其特征在于,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有异步接口测试程序,所述异步接口测试程序被处理器执行时实现如下步骤:向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。
- 根据权利要求17所述的计算机可读存储介质,其特征在于,所述异步接口测试程序被处理器执行时,还实现如下步骤:向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
- 根据权利要求18所述的计算机可读存储介质,其特征在于,所述异步接口测试程序被处理器执行时,还实现如下步骤:若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。
- 根据权利要求17所述的计算机可读存储介质,其特征在于,所述异步接口测试程序被处理器执行时,还实现如下步骤:将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611265709.X | 2016-12-30 | ||
| CN201611265709.XA CN107070735B (zh) | 2016-12-30 | 2016-12-30 | 异步接口测试的方法、测试终端及系统 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018120722A1 true WO2018120722A1 (zh) | 2018-07-05 |
Family
ID=59624105
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/091257 Ceased WO2018120722A1 (zh) | 2016-12-30 | 2017-06-30 | 异步接口测试方法、终端、设备、系统及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107070735B (zh) |
| WO (1) | WO2018120722A1 (zh) |
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110032511A (zh) * | 2019-03-19 | 2019-07-19 | 深圳市买买提信息科技有限公司 | 一种接口测试方法及接口测试设备 |
| CN110297761A (zh) * | 2019-05-23 | 2019-10-01 | 深圳壹账通智能科技有限公司 | 返回数据的获取方法、装置、计算机设备及存储介质 |
| CN110377471A (zh) * | 2019-07-17 | 2019-10-25 | 江苏满运软件科技有限公司 | 接口校验数据的生成方法、装置、存储介质及电子设备 |
| CN111581109A (zh) * | 2020-05-15 | 2020-08-25 | 杭州安恒信息技术股份有限公司 | 一种接口返回数据校验的方法、系统及设备 |
| CN111651342A (zh) * | 2019-03-04 | 2020-09-11 | 复旦大学 | 基于Charles录制会话的HTTP接口自动化测试框架 |
| CN111860719A (zh) * | 2020-07-21 | 2020-10-30 | 上海仪电数字技术股份有限公司 | 待测试产品的序列化处理方法 |
| CN111913820A (zh) * | 2020-08-11 | 2020-11-10 | 傲普(上海)新能源有限公司 | 一种处理http超时任务的方法 |
| CN112416708A (zh) * | 2020-11-17 | 2021-02-26 | 中国工商银行股份有限公司 | 异步调用链路监控方法及系统 |
| CN114138528A (zh) * | 2021-11-22 | 2022-03-04 | 杉数科技(北京)有限公司 | 远程调用容错处理方法、终端设备及存储介质 |
| CN114153744A (zh) * | 2021-12-14 | 2022-03-08 | 平安付科技服务有限公司 | 一种单元测试方法、装置、终端设备及存储介质 |
| CN114666301A (zh) * | 2020-12-22 | 2022-06-24 | 深圳Tcl新技术有限公司 | 一种基于mock服务器的APP测试方法及系统 |
| CN115632817A (zh) * | 2022-09-22 | 2023-01-20 | 浪潮卓数大数据产业发展有限公司 | 一种安卓端反爬方法及装置 |
| CN116663580A (zh) * | 2023-05-19 | 2023-08-29 | 深圳市铨顺宏科技有限公司 | 模块的测试方法、终端及系统 |
Families Citing this family (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108848000B (zh) * | 2018-05-07 | 2021-05-11 | 深圳壹账通智能科技有限公司 | 网络请求测试方法、装置、计算机设备和存储介质 |
| CN108920346A (zh) * | 2018-06-05 | 2018-11-30 | 北京奇安信科技有限公司 | web服务器接口耗时统计方法及装置 |
| CN109165165A (zh) * | 2018-09-04 | 2019-01-08 | 中国平安人寿保险股份有限公司 | 接口测试方法、装置、计算机设备和存储介质 |
| CN109446071A (zh) * | 2018-09-26 | 2019-03-08 | 深圳壹账通智能科技有限公司 | 接口测试方法、接口测试装置、电子设备及存储介质 |
| CN110069395B (zh) * | 2019-03-12 | 2023-07-25 | 平安科技(深圳)有限公司 | 一种模拟异步接口的方法、装置、存储介质及计算机设备 |
| CN110445688B (zh) * | 2019-08-12 | 2021-04-23 | 珠海格力电器股份有限公司 | 基于数据收集的接口服务功能监测方法及系统 |
| CN111274137A (zh) * | 2020-01-16 | 2020-06-12 | 北大方正集团有限公司 | 异步接口检测方法、异步接口检测系统和可读存储介质 |
| CN111290897A (zh) * | 2020-02-19 | 2020-06-16 | 深圳壹账通智能科技有限公司 | 异步存储测试方法、电子装置、计算机设备及存储介质 |
| CN116126674A (zh) * | 2022-07-27 | 2023-05-16 | 马上消费金融股份有限公司 | 接口测试方法及装置 |
| CN117370216A (zh) * | 2023-12-08 | 2024-01-09 | 天津华来科技股份有限公司 | 一种基于python语言的回调接口性能测试方法 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110302454A1 (en) * | 2010-06-07 | 2011-12-08 | Salesforce.Com, Inc. | Performing asynchronous testing of an application occasionally connected to an online services system |
| CN104572469A (zh) * | 2015-01-23 | 2015-04-29 | 广东能龙教育股份有限公司 | 一种基于模拟http请求的接口自动化测试方法和系统 |
| CN104615534A (zh) * | 2015-01-28 | 2015-05-13 | 广州酷狗计算机科技有限公司 | 接口测试方法和装置 |
| CN105162646A (zh) * | 2015-07-29 | 2015-12-16 | 北京京东尚科信息技术有限公司 | 一种多协议接口测试系统及方法 |
| CN106095673A (zh) * | 2016-06-07 | 2016-11-09 | 深圳市泰久信息系统股份有限公司 | 基于web接口的自动化测试方法及系统 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6981180B1 (en) * | 2000-03-16 | 2005-12-27 | Akamai Technologies, Inc. | Method and apparatus for testing request-response service using live connection traffic |
| CN101217425A (zh) * | 2008-01-04 | 2008-07-09 | 中兴通讯股份有限公司 | Web测试的方法及装置 |
| CN101572632B (zh) * | 2009-03-04 | 2012-02-01 | 公安部第三研究所 | 信息安全管理系统管理端接口的测试方法 |
| CN205786933U (zh) * | 2016-07-19 | 2016-12-07 | 湖北广兴通信科技有限公司 | 一种多种类型接口测试模具 |
-
2016
- 2016-12-30 CN CN201611265709.XA patent/CN107070735B/zh active Active
-
2017
- 2017-06-30 WO PCT/CN2017/091257 patent/WO2018120722A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110302454A1 (en) * | 2010-06-07 | 2011-12-08 | Salesforce.Com, Inc. | Performing asynchronous testing of an application occasionally connected to an online services system |
| CN104572469A (zh) * | 2015-01-23 | 2015-04-29 | 广东能龙教育股份有限公司 | 一种基于模拟http请求的接口自动化测试方法和系统 |
| CN104615534A (zh) * | 2015-01-28 | 2015-05-13 | 广州酷狗计算机科技有限公司 | 接口测试方法和装置 |
| CN105162646A (zh) * | 2015-07-29 | 2015-12-16 | 北京京东尚科信息技术有限公司 | 一种多协议接口测试系统及方法 |
| CN106095673A (zh) * | 2016-06-07 | 2016-11-09 | 深圳市泰久信息系统股份有限公司 | 基于web接口的自动化测试方法及系统 |
Cited By (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111651342A (zh) * | 2019-03-04 | 2020-09-11 | 复旦大学 | 基于Charles录制会话的HTTP接口自动化测试框架 |
| CN110032511A (zh) * | 2019-03-19 | 2019-07-19 | 深圳市买买提信息科技有限公司 | 一种接口测试方法及接口测试设备 |
| CN110297761A (zh) * | 2019-05-23 | 2019-10-01 | 深圳壹账通智能科技有限公司 | 返回数据的获取方法、装置、计算机设备及存储介质 |
| CN110377471A (zh) * | 2019-07-17 | 2019-10-25 | 江苏满运软件科技有限公司 | 接口校验数据的生成方法、装置、存储介质及电子设备 |
| CN110377471B (zh) * | 2019-07-17 | 2022-08-23 | 江苏满运软件科技有限公司 | 接口校验数据的生成方法、装置、存储介质及电子设备 |
| CN111581109A (zh) * | 2020-05-15 | 2020-08-25 | 杭州安恒信息技术股份有限公司 | 一种接口返回数据校验的方法、系统及设备 |
| CN111860719B (zh) * | 2020-07-21 | 2023-10-27 | 上海仪电数字技术股份有限公司 | 待测试产品的序列化处理方法 |
| CN111860719A (zh) * | 2020-07-21 | 2020-10-30 | 上海仪电数字技术股份有限公司 | 待测试产品的序列化处理方法 |
| CN111913820A (zh) * | 2020-08-11 | 2020-11-10 | 傲普(上海)新能源有限公司 | 一种处理http超时任务的方法 |
| CN111913820B (zh) * | 2020-08-11 | 2023-04-07 | 傲普(上海)新能源有限公司 | 一种处理http超时任务的方法 |
| CN112416708A (zh) * | 2020-11-17 | 2021-02-26 | 中国工商银行股份有限公司 | 异步调用链路监控方法及系统 |
| CN112416708B (zh) * | 2020-11-17 | 2023-09-22 | 中国工商银行股份有限公司 | 异步调用链路监控方法及系统 |
| CN114666301A (zh) * | 2020-12-22 | 2022-06-24 | 深圳Tcl新技术有限公司 | 一种基于mock服务器的APP测试方法及系统 |
| CN114138528A (zh) * | 2021-11-22 | 2022-03-04 | 杉数科技(北京)有限公司 | 远程调用容错处理方法、终端设备及存储介质 |
| CN114153744A (zh) * | 2021-12-14 | 2022-03-08 | 平安付科技服务有限公司 | 一种单元测试方法、装置、终端设备及存储介质 |
| CN115632817B (zh) * | 2022-09-22 | 2023-09-05 | 浪潮卓数大数据产业发展有限公司 | 一种安卓端反爬方法及装置 |
| CN115632817A (zh) * | 2022-09-22 | 2023-01-20 | 浪潮卓数大数据产业发展有限公司 | 一种安卓端反爬方法及装置 |
| CN116663580A (zh) * | 2023-05-19 | 2023-08-29 | 深圳市铨顺宏科技有限公司 | 模块的测试方法、终端及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107070735A (zh) | 2017-08-18 |
| CN107070735B (zh) | 2018-04-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2018120722A1 (zh) | 异步接口测试方法、终端、设备、系统及存储介质 | |
| CN108052334B (zh) | 页面跳转方法、装置、计算机设备和存储介质 | |
| US10362067B2 (en) | Method of and system for privacy awareness | |
| WO2019200792A1 (zh) | 会话消息质检方法及装置 | |
| WO2019037417A1 (zh) | 网页数据爬取方法、装置、网页数据爬取平台及存储介质 | |
| CN110188159B (zh) | 征信数据接入方法、装置、设备及计算机可读存储介质 | |
| CN107688533A (zh) | 应用程序测试方法、装置、计算机设备和存储介质 | |
| CN112286815A (zh) | 一种接口测试脚本的生成方法及其相关设备 | |
| CN104579830A (zh) | 服务监控方法及装置 | |
| CN104537049B (zh) | 一种图片浏览方法及装置 | |
| CN111371643B (zh) | 验证方法、设备及存储介质 | |
| CN107357562A (zh) | 一种信息填充方法、装置及客户端 | |
| CN114841815A (zh) | 交易分析方法及装置、电子设备和计算机可读存储介质 | |
| CN114861054A (zh) | 信息采集方法、装置、电子设备及存储介质 | |
| WO2019153586A1 (zh) | 聊天数据处理方法、装置、计算机设备及存储介质 | |
| CN105228139B (zh) | 一种基于智能设备的呼叫处理方法、装置及设备 | |
| US20120101829A1 (en) | Wholesale device registration system, method, and program product | |
| CN107766232B (zh) | 一种插件管理方法及装置 | |
| WO2015039585A1 (en) | Method and device for testing software reliability | |
| CN115442135A (zh) | 基于区块链的资源数据处理方法、装置和服务器 | |
| CN111737129B (zh) | 服务控制方法、装置、计算机可读介质及电子设备 | |
| US9858549B2 (en) | Business transaction resource usage tracking | |
| CN109756393B (zh) | 信息处理方法、系统、介质和计算设备 | |
| CN108471635B (zh) | 用于连接无线接入点的方法和设备 | |
| US9935856B2 (en) | System and method for determining end user timing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17885829 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17885829 Country of ref document: EP Kind code of ref document: A1 |