WO2018120722A1 - Asynchronous interface testing method, terminal, device, system, and storage medium - Google Patents

Asynchronous interface testing method, terminal, device, system, and storage medium Download PDF

Info

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
Application number
PCT/CN2017/091257
Other languages
French (fr)
Chinese (zh)
Inventor
吕小立
徐志成
Original Assignee
上海壹账通金融科技有限公司
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 上海壹账通金融科技有限公司 filed Critical 上海壹账通金融科技有限公司
Publication of WO2018120722A1 publication Critical patent/WO2018120722A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing 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

The present invention relates to an asynchronous interface testing method, a testing terminal, a device, a system, and a storage medium. The asynchronous interface testing method comprises: a testing terminal sends predetermined HTTP requests one by one to asynchronous HTTP callback interface devices to be tested; a serving terminal receives returned HTTP data corresponding to the HTTP requests and sent by the asynchronous HTTP callback interface devices, and sends the returned HTTP data to the testing terminal; the testing terminal acquires prestored standard HTTP data corresponding to the HTTP requests, and tests the asynchronous HTTP callback interfaces according to the received returned HTTP data and the standard HTTP data. The present invention can test asynchronous HTTP callback interfaces, and improve the security of personal information that is unifiedly applied and managed based on the crawler technology.

Description

异步接口测试方法、终端、设备、***及存储介质Asynchronous interface test method, terminal, device, system and storage medium
优先权申明Priority claim
本申请基于巴黎公约申明享有2016年12月30日递交的申请号为CN201611265709.X、名称为“异步接口测试的方法、测试终端及***”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。This application is based on the priority of the Chinese Patent Application entitled "Methods, Test Terminals and Systems for Asynchronous Interface Testing" filed on December 30, 2016, with the application number CN201611265709.X, which is filed on December 30, 2016. The content is incorporated herein by reference.
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种异步接口测试方法、测试终端、设备、***及存储介质。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.
背景技术Background technique
目前,用户利用互联网进行浏览资讯、消费购物等会产生大量的个人信息,包括个人信用信息、购物消费记录等。为了把这些零散的个人信息进行统一运用和管理,在经用户允许的情况下,很多服务提供商利用爬虫技术把这些个人信息抓取了下来聚合到一个APP账号下。为了提高安全性,所采用的方案是:服务提供商把抓取的个人信息发送给第三方,以便第三方进行存储,这样即便技术管理人员都无法查阅这些个人信息。在该方案中,需要运用异步HTTP回调接口不间断返回的未经过运算的第一手数据,以将该第一手数据入库。At present, users use 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. In order to uniformly use and manage these scattered personal information, many service providers use crawler technology to capture and collect these personal information into an APP account. In order to improve security, 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. In this solution, 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.
现有的针对HTTP接口的测试方案通常是针对同步HTTP接口的,且是建立在入库的数据可访问的情况下,而异步HTTP回调接口不直接返回数据给调用方,而是直接入库到安全数据库中,调用方无法直接获取返回的第一手数据,因此,无法对异步HTTP回调接口进行测试,使得基于爬虫技术的个人信息的运用和管理存在极大的安全隐患。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. 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.
发明内容Summary of the invention
本发明的目的在于提供一种异步接口测试方法、测试终端、设备、***及存储介质,旨在实现对异步HTTP回调接口的测试,提高基于爬虫技术进行统一运用和管理的个人信息的安全性。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.
为实现上述目的,本发明提供一种异步接口测试的方法,所述异步接口测试的方法包括:To achieve the above objective, the present invention provides a method for asynchronous interface testing, and the method for testing the asynchronous interface includes:
S1,测试终端向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;S1. The test terminal sends a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested.
S2,服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端;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.
S3,所述测试终端获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调 接口进行测试。S3. 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.
为实现上述目的,本发明还提供一种异步接口测试的***,所述异步接口测试的***包括服务终端及上述的测试终端,所述服务终端用于接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端。To achieve the above objective, 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.
为实现上述目的,本发明还提供一种异步接口测试设备,该异步接口测试设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的异步接口测试程序,所述异步接口测试程序被所述处理器执行时实现如下步骤:To achieve the above object, 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:
向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;Sending a predetermined HTTP request one by one to the asynchronous HTTP callback interface device to be tested;
在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。Receiving, by the service terminal, the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and sending the returned HTTP data to the test terminal, and acquiring the pre-stored standard HTTP corresponding to the HTTP request. Data, testing the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data.
为实现上述目的,本发明还提供一种计算机可读存储介质,该计算机可读存储介质中存储有异步接口测试程序,所述异步接口测试程序被处理器执行时实现如下步骤:To achieve the above objective, 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:
向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;Sending a predetermined HTTP request one by one to the asynchronous HTTP callback interface device to be tested;
在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。Receiving, by the service terminal, the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and sending the returned HTTP data to the test terminal, and acquiring the pre-stored standard HTTP corresponding to the HTTP request. Data, testing the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data.
本发明的有益效果是:本发明由测试终端向异步HTTP回调接口设备发送HTTP请求,异步HTTP回调接口在获取到该HTTP请求对应的返回HTTP数据后,将其发送给服务终端,以便服务终端能够将该返回HTTP数据发送给测试终端,测试终端基于该返回HTTP数据及标准HTTP数据对异步HTTP回调接口进行测试,实现对异步HTTP回调接口的测试,提高基于爬虫技术进行统一运用和管理的个人信息的安全性。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.
附图说明DRAWINGS
图1为本发明异步接口测试的方法第一实施例的流程示意图;1 is a schematic flowchart of a first embodiment of a method for asynchronous interface testing according to the present invention;
图2为图1所示步骤S1的细化流程示意图;2 is a schematic flow chart of the refinement of step S1 shown in FIG. 1;
图3为图1所示步骤S3的细化流程示意图;3 is a schematic diagram of a refinement process of step S3 shown in FIG. 1;
图4为本发明异步接口测试的方法第二实施例的流程示意图;4 is a schematic flowchart diagram of a second embodiment of a method for asynchronous interface testing according to the present invention;
图5为本发明测试终端一实施例的结构示意图;FIG. 5 is a schematic structural diagram of an embodiment of a test terminal according to the present invention; FIG.
图6为本发明异步接口测试设备的硬件结构框图。6 is a block diagram showing the hardware structure of an asynchronous interface test device according to the present invention.
具体实施方式detailed description
以下结合附图对本发明的原理和特征进行描述,所举实例只用于解释本 发明,并非用于限定本发明的范围。The principles and features of the present invention are described below in conjunction with the accompanying drawings. The invention is not intended to limit the scope of the invention.
如图1所示,图1为本发明异步接口测试的方法一实施例的流程示意图,该异步接口测试的方法包括以下步骤:As shown in FIG. 1 , 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:
步骤S1,测试终端向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;Step S1: The test terminal sends a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested one by one;
本实施例中,测试终端可以是手机、计算机、平板电脑、个人数字助理等任意适用的电子设备。对于待测试的异步HTTP回调接口,测试终端向其逐一发送预定的HTTP请求,该预定的HTTP请求为用于测试的HTTP请求,测试终端中预存有该用于测试的HTTP请求对应的标准HTTP数据,或者能够通过其他途径获取到该用于测试的HTTP请求对应的标准HTTP数据。例如该用于测试的HTTP请求为请求获取某一网页或者图片资源的请求,则对应的标准HTTP数据即为该网页或者图片资源的数据。In this embodiment, the test terminal may be any applicable electronic device such as a mobile phone, a computer, a tablet computer, or a personal digital assistant. For the asynchronous HTTP callback interface to be tested, 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. For example, the HTTP request for testing is a request for acquiring a certain webpage or a picture resource, and the corresponding standard HTTP data is the data of the webpage or the image resource.
其中,在测试终端向待测的异步HTTP回调接口设备发送预定的HTTP请求后,该异步HTTP回调接口会立即响应,并返回请求成功或失败信息给测试终端,这时该HTTP请求和对应的响应过程结束,但真正的有效的该HTTP请求对应的数据,需要一段时间预定的处理后才能返回到指定的Http接口地址,即测试终端在接收到请求成功或失败信息的响应信息后,需要一段时间才能接收到该HTTP请求对应的数据。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.
步骤S2,服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端;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.
本实施例中,异步HTTP回调接口设备在接收到测试终端发送的HTTP请求后,获取该HTTP请求对应的返回HTTP数据,然后将该返回HTTP数据发送给服务终端,具体地,异步HTTP回调接口设备将该返回HTTP数据发送给预定的Http服务地址对应的服务终端,该服务终端例如可以是HTTP服务器。In this embodiment, after receiving the HTTP request sent by the test terminal, the asynchronous HTTP callback interface device 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.
为了使得测试终端能够得到经异步HTTP回调接口获取的HTTP请求对应的返回HTTP数据,该服务终端将该返回HTTP数据发送给测试终端,以供测试终端基于该返回HTTP数据进行测试。In order to enable the test terminal to obtain the returned HTTP data corresponding to the HTTP request obtained by the asynchronous HTTP callback interface, 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.
步骤S3,所述测试终端获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。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.
本实施例中,测试终端上预先存储有上述的HTTP请求对应的标准HTTP数据,或者通过网络通信的方式从其他设备中获取该HTTP请求对应的标准HTTP数据。在接收到服务终端发送的返回HTTP数据后,基于接收到的该返回HTTP数据及标准HTTP数据对异步HTTP回调接口进行测试。In this embodiment, 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. After receiving the returned HTTP data sent by the service terminal, the asynchronous HTTP callback interface is tested based on the received return HTTP data and standard HTTP data.
具体的测试过程可以是判断返回HTTP数据及标准HTTP数据是否相同,如果两者相同则测试成功,生成对应的测试成功信息以供测试人员查看,如果测试失败,同样生成对应的测试失败信息,以提醒测试人员。 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.
与现有技术相比,本实施例由测试终端向异步HTTP回调接口设备发送HTTP请求,异步HTTP回调接口在获取到该HTTP请求对应的返回HTTP数据后,将其发送给服务终端,以便服务终端能够将该返回HTTP数据发送给测试终端,测试终端基于该返回HTTP数据及标准HTTP数据对异步HTTP回调接口进行测试,实现对异步HTTP回调接口的测试,提高基于爬虫技术进行统一运用和管理的个人信息的安全性。Compared with the prior art, 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.
在一优选的实施例中,如图2所示,在上述图1的实施例的基础上,所述步骤S1包括:In a preferred embodiment, as shown in FIG. 2, based on the above embodiment of FIG. 1, the step S1 includes:
S11,所述测试终端向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;S11. 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.
S12,若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。S12. If the 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.
本实施例中,测试终端向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,异步HTTP回调接口即向其返回对应的响应信息,如果该响应信息为请求成功的信息,则测试终端可以继续向异步HTTP回调接口设备发送下一个HTTP请求,然后接收异步HTTP回调接口设备返回的该下一个HTTP请求对应的响应信息,以此类推,逐个HTTP请求发送,直至将所有预定的HTTP请求均向异步HTTP回调接口设备发送完。In this embodiment, after the test terminal sends 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.
如果该响应信息为请求失败的信息,则测试终端生成HTTP请求失败的提醒信息,以供测试人员及时作出相关的处理。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.
优选地,若上述的响应信息为请求成功的信息,分析该请求成功的信息中是否包含关键字段信息,该关键字段信息例如可以是表征异步HTTP回调接口设备仅处于测试状态而非处于工作状态的信息,以防止异步HTTP回调接口设备由于处于不同的状态而产生容易混淆的信息;若请求成功的信息中包含关键字段信息,则分析关键字段信息是否为预定的字段信息,例如分析该关键字段信息为异步HTTP回调接口设备仅处于测试状态的信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求,然后接收异步HTTP回调接口设备返回的该下一个HTTP请求对应的响应信息,以此类推,逐个HTTP请求发送,直至将所有预定的HTTP请求均向异步HTTP回调接口设备发送完;若上述的请求成功的信息中不包含关键字段信息,则生成提醒信息,以供测试人员及时作出相关的处理,且不再向待测的异步HTTP回调接口设备发送HTTP请求。Preferably, if 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, for example, the key segment 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.
在一优选的实施例中,如图3所示,在上述图1的实施例的基础上,所述步骤S3包括:In a preferred embodiment, as shown in FIG. 3, based on the foregoing embodiment of FIG. 1, the step S3 includes:
S31,所述测试终端将所接收的返回HTTP数据与对应的标准HTTP数据进行比对; S31. The test terminal compares the received return HTTP data with corresponding standard HTTP data.
S32,若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;S32. If the returned HTTP data is inconsistent with the corresponding standard HTTP data, generate test result information that fails the test.
S33,若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。S33. If all the returned HTTP data are consistent with the corresponding standard HTTP data, generate test result information of the test success.
本实施例中,在测试终端根据所接收的返回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数据不一致,则测试失败,生成测试失败的测试结果。In this embodiment, when 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. Compared with 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.
在一优选的实施例中,如图4所示,在上述图1的实施例的基础上,所述步骤S2之后还包括:In a preferred embodiment, as shown in FIG. 4, on the basis of the foregoing embodiment of FIG. 1, after the step S2, the method further includes:
S4,所述服务终端基于预定的数据规则对所述返回HTTP数据进行规则运算,并将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中。S4. 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.
本实施例中,可以基于预定的数据规则对返回HTTP数据进行规则运算,例如,对返回HTTP数据进行加密运算,或者对返回HTTP数据进行压缩后再进行加密运算等,其中,加密的算法例如可以采用对称加密算法或者其他加密算法等。然后将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中,例如保存至一个独立的第三方安全数据库中。In this embodiment, 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.
如图5所示,图5为本发明异步接口测试终端一实施例的结构示意图,该测试终端包括:As shown in FIG. 5, 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:
发送模块101,用于向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;The sending module 101 is configured to send a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested.
本实施例中,测试终端可以是手机、计算机、平板电脑、个人数字助理等任意适用的电子设备。对于待测试的异步HTTP回调接口,测试终端向其逐一发送预定的HTTP请求,该预定的HTTP请求为用于测试的HTTP请求,测试终端中预存有该用于测试的HTTP请求对应的标准HTTP数据,或者能够通过其他途径获取到该用于测试的HTTP请求对应的标准HTTP数据。例如该用于测试的HTTP请求为请求获取某一网页或者图片资源的请求,则对应的标准HTTP数据即为该网页或者图片资源的数据。In this embodiment, the test terminal may be any applicable electronic device such as a mobile phone, a computer, a tablet computer, or a personal digital assistant. For the asynchronous HTTP callback interface to be tested, 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. For example, the HTTP request for testing is a request for acquiring a certain webpage or a picture resource, and the corresponding standard HTTP data is the data of the webpage or the image resource.
其中,在测试终端向待测的异步HTTP回调接口设备发送预定的HTTP请求后,该异步HTTP回调接口会立即响应,并返回请求成功或失败信息给测试终端,这时该HTTP请求和对应的响应过程结束,但真正的有效的该HTTP请求对应的数据,需要一段时间预定的处理后才能返回到指定的Http 接口地址,即测试终端在接收到请求成功或失败信息的响应信息后,需要一段时间才能接收到该HTTP请求对应的数据。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.
测试模块102,用于在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。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.
本实施例中,异步HTTP回调接口设备在接收到测试终端发送的HTTP请求后,获取该HTTP请求对应的返回HTTP数据,然后将该返回HTTP数据发送给服务终端,具体地,异步HTTP回调接口设备将该返回HTTP数据发送给预定的Http服务地址对应的服务终端,该服务终端例如可以是HTTP服务器。In this embodiment, after receiving the HTTP request sent by the test terminal, the asynchronous HTTP callback interface device 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.
为了使得测试终端能够得到经异步HTTP回调接口获取的HTTP请求对应的返回HTTP数据,该服务终端将该返回HTTP数据发送给测试终端,以供测试终端基于该返回HTTP数据进行测试。In order to enable the test terminal to obtain the returned HTTP data corresponding to the HTTP request obtained by the asynchronous HTTP callback interface, 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.
本实施例中,测试终端上预先存储有上述的HTTP请求对应的标准HTTP数据,或者通过网络通信的方式从其他设备中获取该HTTP请求对应的标准HTTP数据。在接收到服务终端发送的返回HTTP数据后,基于接收到的该返回HTTP数据及标准HTTP数据对异步HTTP回调接口进行测试。In this embodiment, 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. After receiving the returned HTTP data sent by the service terminal, the asynchronous HTTP callback interface is tested based on the received return HTTP data and standard HTTP data.
具体的测试过程可以是判断返回HTTP数据及标准HTTP数据是否相同,如果两者相同则测试成功,生成对应的测试成功信息以供测试人员查看,如果测试失败,同样生成对应的测试失败信息,以提醒测试人员。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.
在一优选的实施例中,上述发送模块101具体用于向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。In a preferred embodiment, 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 response information corresponding to the HTTP request; if the response information is the information of the request success, the next predetermined HTTP request is sent to the asynchronous HTTP callback interface device to be tested.
本实施例中,测试终端向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,异步HTTP回调接口即向其返回对应的响应信息,如果该响应信息为请求成功的信息,则测试终端可以继续向异步HTTP回调接口设备发送下一个HTTP请求,然后接收异步HTTP回调接口设备返回的该下一个HTTP请求对应的响应信息,以此类推,逐个HTTP请求发送,直至将所有预定的HTTP请求均向异步HTTP回调接口设备发送完。In this embodiment, after the test terminal sends 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.
如果该响应信息为请求失败的信息,则测试终端生成HTTP请求失败的提醒信息,以供测试人员及时作出相关的处理。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.
优选地,若上述的响应信息为请求成功的信息,分析该请求成功的信息中是否包含关键字段信息,该关键字段信息例如可以是表征异步HTTP回调接口设备仅处于测试状态而非处于工作状态的信息,以防止异步HTTP回调 接口设备由于处于不同的状态而产生容易混淆的信息;若请求成功的信息中包含关键字段信息,则分析关键字段信息是否为预定的字段信息,例如分析该关键字段信息为异步HTTP回调接口设备仅处于测试状态的信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求,然后接收异步HTTP回调接口设备返回的该下一个HTTP请求对应的响应信息,以此类推,逐个HTTP请求发送,直至将所有预定的HTTP请求均向异步HTTP回调接口设备发送完;若上述的请求成功的信息中不包含关键字段信息,则生成提醒信息,以供测试人员及时作出相关的处理,且不再向待测的异步HTTP回调接口设备发送HTTP请求。Preferably, if 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, for example, the key segment 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. 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 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.
在一优选的实施例中,上述测试模块102具体用于将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。In a preferred embodiment, 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.
本实施例中,在测试终端根据所接收的返回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数据不一致,则测试失败,生成测试失败的测试结果。In this embodiment, when 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. Compared with 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.
本发明提供一种异步接口测试的***,所述异步接口测试的***包括服务终端及上述的测试终端,所述服务终端用于接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端。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.
参照图6所示,为本发明的异步接口测试设备的硬件结构框图。Referring to FIG. 6, it is a hardware block diagram of the asynchronous interface test device of the present invention.
在该实施例中,异步接口测试设备可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、便携计算机等终端设备。In this embodiment, 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.
该异步接口测试设备包括存储器11、处理器12,通信总线13,以及网络接口14。The asynchronous interface test device includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。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.
存储器11在一些实施例中可以是异步接口测试设备的内部存储单元,例如该异步接口测试设备的硬盘。存储器11在另一些实施例中也可以是异步接口测试设备的外部存储设备,例如异步接口测试设备上配备的插接式硬 盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括异步接口测试设备的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于异步接口测试设备的应用软件及各类数据,例如异步接口测试程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。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. Further, 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.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行异步接口测试程序等。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.
通信总线13用于实现这些组件之间的连接通信。 Communication bus 13 is used to implement connection communication between these components.
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该设备与其他电子设备之间建立通信连接。例如,在该实施例中,异步接口测试设备可以通过网络接口14与外部的待测的异步HTTP回调接口设备以及服务终端建立通信连接。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. For example, in this embodiment, the 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.
图6仅示出了具有组件11-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.
可选地,该设备还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在异步接口测试设备中处理的信息以及用于显示可视化的用户界面。Optionally, the device may further include a user interface, the user interface may include a display, an input unit such as a keyboard, and the optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, 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.
在图6所示的异步接口测试设备中,存储器11中存储有异步接口测试程序;网络接口14主要用于连接服务器,与服务器进行数据通信;处理器12执行存储器11中存储的异步接口测试程序时实现如下步骤:In the asynchronous interface test device shown in FIG. 6, 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:
向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;Sending a predetermined HTTP request one by one to the asynchronous HTTP callback interface device to be tested;
在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。Receiving, by the service terminal, the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and sending the returned HTTP data to the test terminal, and acquiring the pre-stored standard HTTP corresponding to the HTTP request. Data, testing the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data.
进一步地,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:Further, the processor is further configured to execute the asynchronous interface test program to implement the following steps:
向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;Receiving the first predetermined HTTP request to the asynchronous HTTP callback interface device to be tested, and receiving the response information corresponding to the first predetermined HTTP request returned by the asynchronous HTTP callback interface device;
若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
进一步地,所述处理器还用于执行所述异步接口测试程序,以实现如下 步骤:Further, the processor is further configured to execute the asynchronous interface test program to implement the following step:
若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;If the 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;
若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
进一步地,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:Further, the processor is further configured to execute the asynchronous interface test program to implement the following steps:
将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;Comparing the received return HTTP data with the corresponding standard HTTP data;
若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;If the returned HTTP data is inconsistent with the corresponding standard HTTP data, generating test result information of the test failure;
若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。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 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:
向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;Sending a predetermined HTTP request one by one to the asynchronous HTTP callback interface device to be tested;
在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。Receiving, by the service terminal, the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and sending the returned HTTP data to the test terminal, and acquiring the pre-stored standard HTTP corresponding to the HTTP request. Data, testing the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data.
进一步地,所述异步接口测试程序被处理器执行时,还实现如下步骤:Further, when the asynchronous interface test program is executed by the processor, the following steps are also implemented:
向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;Receiving the first predetermined HTTP request to the asynchronous HTTP callback interface device to be tested, and receiving the response information corresponding to the first predetermined HTTP request returned by the asynchronous HTTP callback interface device;
若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
进一步地,所述异步接口测试程序被处理器执行时,还实现如下步骤:Further, when the asynchronous interface test program is executed by the processor, the following steps are also implemented:
若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;If the 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;
若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
进一步地,所述异步接口测试程序被处理器执行时,还实现如下步骤:Further, when the asynchronous interface test program is executed by the processor, the following steps are also implemented:
将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;Comparing the received return HTTP data with the corresponding standard HTTP data;
若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;If the returned HTTP data is inconsistent with the corresponding standard HTTP data, generating test result information of the test failure;
若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成 测试成功的测试结果信息。If all of the returned HTTP data is consistent with the corresponding standard HTTP data, generate Test successful test result information.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, 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.
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are within the spirit and scope of the present invention, should be included in the protection of the present invention. Within the scope.

Claims (20)

  1. 一种异步接口测试的方法,其特征在于,所述异步接口测试的方法包括:A method for testing an asynchronous interface, the method for testing the asynchronous interface includes:
    S1,测试终端向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;S1. The test terminal sends a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested.
    S2,服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端;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.
    S3,所述测试终端获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。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.
  2. 根据权利要求1所述的异步接口测试的方法,其特征在于,所述步骤S1包括:The method for testing an asynchronous interface according to claim 1, wherein the step S1 comprises:
    S11,所述测试终端向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;S11. 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.
    S12,若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。S12. If the 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.
  3. 根据权利要求2所述的异步接口测试的方法,其特征在于,所述步骤S12进一步包括:The method of testing the asynchronous interface according to claim 2, wherein the step S12 further comprises:
    若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;If the 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;
    若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
  4. 根据权利要求1所述的异步接口测试的方法,其特征在于,所述步骤S3包括:The method for testing an asynchronous interface according to claim 1, wherein the step S3 comprises:
    S31,所述测试终端将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;S31. The test terminal compares the received return HTTP data with corresponding standard HTTP data.
    S32,若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;S32. If the returned HTTP data is inconsistent with the corresponding standard HTTP data, generate test result information that fails the test.
    S33,若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。S33. If all the returned HTTP data are consistent with the corresponding standard HTTP data, generate test result information of the test success.
  5. 根据权利要求1所述的异步接口测试的方法,其特征在于,所述步骤S2之后还包括: The method for testing an asynchronous interface according to claim 1, wherein the step S2 further comprises:
    S4,所述服务终端基于预定的数据规则对所述返回HTTP数据进行规则运算,并将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中。S4. 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.
  6. 根据权利要求2所述的异步接口测试的方法,其特征在于,所述步骤S2之后还包括:The method for testing an asynchronous interface according to claim 2, wherein the step S2 further comprises:
    S4,所述服务终端基于预定的数据规则对所述返回HTTP数据进行规则运算,并将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中。S4. 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.
  7. 根据权利要求3所述的异步接口测试的方法,其特征在于,所述步骤S2之后还包括:The method for testing an asynchronous interface according to claim 3, wherein the step S2 further comprises:
    S4,所述服务终端基于预定的数据规则对所述返回HTTP数据进行规则运算,并将经规则运算后的返回HTTP数据存储至预定的第三方安全数据库中。S4. 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.
  8. 一种异步接口测试终端,其特征在于,所述测试终端包括:An asynchronous interface test terminal, wherein the test terminal includes:
    发送模块,用于向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;a sending module, configured to send a predetermined HTTP request to the asynchronous HTTP callback interface device to be tested one by one;
    测试模块,用于在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。a test module, configured to receive, by the service terminal, 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 HTTP Corresponding standard HTTP data is requested, and the asynchronous HTTP callback interface is tested according to the received return HTTP data and the standard HTTP data.
  9. 根据权利要求8所述的测试终端,其特征在于,所述发送模块具体用于向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。The test terminal according to claim 8, wherein the sending module is specifically configured to: after sending the first predetermined HTTP request to the asynchronous HTTP callback interface device to be tested, receive the returned by the asynchronous HTTP callback interface device The response information corresponding to the first predetermined HTTP request; if the response information is information indicating that the request is successful, sending the next predetermined HTTP request to the asynchronous HTTP callback interface device to be tested.
  10. 根据权利要求9所述的测试终端,其特征在于,所述发送模块进一步用于若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。The test terminal according to claim 9, wherein the sending module is further configured to: if the response information is information that the request is successful, analyze whether the information about the success of the request includes key field information; If the information about the success of the request includes keyword segment information, it is analyzed whether the keyword segment information is predetermined field information, and if the predetermined field information is, the next predetermined HTTP request is sent to the asynchronous HTTP callback interface device to be tested. .
  11. 根据权利要求8所述的测试终端,其特征在于,所述测试模块具体用于将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;若有所 述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。The test terminal according to claim 8, wherein the test module is specifically configured to compare the received return HTTP data with corresponding standard HTTP data; If the returned HTTP data is inconsistent with the corresponding standard HTTP data, the test result information of the test failure is generated; if all the returned HTTP data are consistent with the corresponding standard HTTP data, the test result information of the test success is generated.
  12. 一种异步接口测试的***,其特征在于,所述异步接口测试的***包括服务终端及权利要求8至11任一项所述的测试终端,所述服务终端用于接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端。A system for asynchronous interface testing, characterized in that the system for testing the asynchronous interface comprises a service terminal and the test terminal according to any one of claims 8 to 11, the service terminal is configured to receive the asynchronous HTTP callback interface The HTTP data corresponding to each HTTP request sent by the device is returned, and the returned HTTP data is sent to the test terminal.
  13. 一种异步接口测试设备,其特征在于,所述异步接口测试设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的异步接口测试程序,所述异步接口测试程序被所述处理器执行时实现如下步骤:An asynchronous interface test device, comprising: a memory, a processor, and an asynchronous interface test program stored on the memory and operable on the processor, the asynchronous interface test program The following steps are implemented when executed by the processor:
    向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;Sending a predetermined HTTP request one by one to the asynchronous HTTP callback interface device to be tested;
    在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。Receiving, by the service terminal, the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and sending the returned HTTP data to the test terminal, and acquiring the pre-stored standard HTTP corresponding to the HTTP request. Data, testing the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data.
  14. 根据权利要求13所述的异步接口测试设备,其特征在于,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:The asynchronous interface test device according to claim 13, wherein the processor is further configured to execute the asynchronous interface test program to implement the following steps:
    向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;Receiving the first predetermined HTTP request to the asynchronous HTTP callback interface device to be tested, and receiving the response information corresponding to the first predetermined HTTP request returned by the asynchronous HTTP callback interface device;
    若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
  15. 根据权利要求14所述的异步接口测试设备,其特征在于,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:The asynchronous interface test device according to claim 14, wherein the processor is further configured to execute the asynchronous interface test program to implement the following steps:
    若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;If the 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;
    若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
  16. 根据权利要求13所述的异步接口测试设备,其特征在于,所述处理器还用于执行所述异步接口测试程序,以实现如下步骤:The asynchronous interface test device according to claim 13, wherein the processor is further configured to execute the asynchronous interface test program to implement the following steps:
    将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;Comparing the received return HTTP data with the corresponding standard HTTP data;
    若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息; If the returned HTTP data is inconsistent with the corresponding standard HTTP data, generating test result information of the test failure;
    若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。If all the returned HTTP data are consistent with the corresponding standard HTTP data, the test result information of the test success is generated.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有异步接口测试程序,所述异步接口测试程序被处理器执行时实现如下步骤:A computer readable storage medium, wherein the computer readable storage medium stores an asynchronous interface test program, and the asynchronous interface test program is executed by the processor to implement the following steps:
    向待测的异步HTTP回调接口设备逐一发送预定的HTTP请求;Sending a predetermined HTTP request one by one to the asynchronous HTTP callback interface device to be tested;
    在服务终端接收所述异步HTTP回调接口设备发送的各所述HTTP请求对应的返回HTTP数据,并将所述返回HTTP数据发送给所述测试终端后,获取预存的与该HTTP请求对应的标准HTTP数据,根据所接收的返回HTTP数据及所述标准HTTP数据对所述异步HTTP回调接口进行测试。Receiving, by the service terminal, the returned HTTP data corresponding to each HTTP request sent by the asynchronous HTTP callback interface device, and sending the returned HTTP data to the test terminal, and acquiring the pre-stored standard HTTP corresponding to the HTTP request. Data, testing the asynchronous HTTP callback interface according to the received return HTTP data and the standard HTTP data.
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述异步接口测试程序被处理器执行时,还实现如下步骤:The computer readable storage medium according to claim 17, wherein when the asynchronous interface test program is executed by the processor, the following steps are further implemented:
    向待测的异步HTTP回调接口设备发送第一个预定的HTTP请求后,接收所述异步HTTP回调接口设备返回的所述第一个预定的HTTP请求对应的响应信息;Receiving the first predetermined HTTP request to the asynchronous HTTP callback interface device to be tested, and receiving the response information corresponding to the first predetermined HTTP request returned by the asynchronous HTTP callback interface device;
    若所述响应信息为请求成功的信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述异步接口测试程序被处理器执行时,还实现如下步骤:The computer readable storage medium according to claim 18, wherein when the asynchronous interface test program is executed by the processor, the following steps are further implemented:
    若所述响应信息为请求成功的信息,分析所述请求成功的信息中是否包含关键字段信息;If the 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;
    若所述请求成功的信息中包含关键字段信息,则分析所述关键字段信息是否为预定的字段信息,若为预定的字段信息,则向待测的异步HTTP回调接口设备发送下一个预定的HTTP请求。If 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.
  20. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述异步接口测试程序被处理器执行时,还实现如下步骤:The computer readable storage medium according to claim 17, wherein when the asynchronous interface test program is executed by the processor, the following steps are further implemented:
    将所接收的返回HTTP数据与对应的标准HTTP数据进行比对;Comparing the received return HTTP data with the corresponding standard HTTP data;
    若有所述返回HTTP数据与对应的标准HTTP数据不一致,则生成测试失败的测试结果信息;If the returned HTTP data is inconsistent with the corresponding standard HTTP data, generating test result information of the test failure;
    若所有的所述返回HTTP数据与对应的标准HTTP数据均一致,则生成测试成功的测试结果信息。 If all the returned HTTP data are consistent with the corresponding standard HTTP data, the test result information of the test success is generated.
PCT/CN2017/091257 2016-12-30 2017-06-30 Asynchronous interface testing method, terminal, device, system, and storage medium WO2018120722A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611265709.X 2016-12-30
CN201611265709.XA CN107070735B (en) 2016-12-30 2016-12-30 Method, test terminal and the system of asynchronous interface test

Publications (1)

Publication Number Publication Date
WO2018120722A1 true WO2018120722A1 (en) 2018-07-05

Family

ID=59624105

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/091257 WO2018120722A1 (en) 2016-12-30 2017-06-30 Asynchronous interface testing method, terminal, device, system, and storage medium

Country Status (2)

Country Link
CN (1) CN107070735B (en)
WO (1) WO2018120722A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN110297761A (en) * 2019-05-23 2019-10-01 深圳壹账通智能科技有限公司 Acquisition methods, device, computer equipment and the storage medium of returned data
CN110377471A (en) * 2019-07-17 2019-10-25 江苏满运软件科技有限公司 Generation method, device, storage medium and the electronic equipment of interface check data
CN111581109A (en) * 2020-05-15 2020-08-25 杭州安恒信息技术股份有限公司 Method, system and equipment for checking interface return data
CN111651342A (en) * 2019-03-04 2020-09-11 复旦大学 HTTP interface automation testing framework based on Charles recording session
CN111860719A (en) * 2020-07-21 2020-10-30 上海仪电数字技术股份有限公司 Serialization processing method for product to be tested
CN111913820A (en) * 2020-08-11 2020-11-10 傲普(上海)新能源有限公司 Method for processing http overtime task
CN112416708A (en) * 2020-11-17 2021-02-26 中国工商银行股份有限公司 Asynchronous call link monitoring method and system
CN115632817A (en) * 2022-09-22 2023-01-20 浪潮卓数大数据产业发展有限公司 Android terminal reverse climbing method and device

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848000B (en) * 2018-05-07 2021-05-11 深圳壹账通智能科技有限公司 Network request testing method and device, computer equipment and storage medium
CN108920346A (en) * 2018-06-05 2018-11-30 北京奇安信科技有限公司 Web server interface time-consuming statistical method and device
CN109165165A (en) * 2018-09-04 2019-01-08 中国平安人寿保险股份有限公司 Interface test method, device, computer equipment and storage medium
CN109446071A (en) * 2018-09-26 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, interface test device, electronic equipment and storage medium
CN110069395B (en) * 2019-03-12 2023-07-25 平安科技(深圳)有限公司 Method and device for simulating asynchronous interface, storage medium and computer equipment
CN110445688B (en) * 2019-08-12 2021-04-23 珠海格力电器股份有限公司 Interface service function monitoring method and system based on data collection
CN111274137A (en) * 2020-01-16 2020-06-12 北大方正集团有限公司 Asynchronous interface detection method, asynchronous interface detection system and readable storage medium
CN117370216A (en) * 2023-12-08 2024-01-09 天津华来科技股份有限公司 Callback interface performance test method based on python language

Citations (5)

* Cited by examiner, † Cited by third party
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 (en) * 2015-01-23 2015-04-29 广东能龙教育股份有限公司 Automatic interface testing method and system based on simulative http requests
CN104615534A (en) * 2015-01-28 2015-05-13 广州酷狗计算机科技有限公司 Interface test method and device
CN105162646A (en) * 2015-07-29 2015-12-16 北京京东尚科信息技术有限公司 Multi-protocol interface test system and method
CN106095673A (en) * 2016-06-07 2016-11-09 深圳市泰久信息***股份有限公司 Automated testing method based on WEB interface and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
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 (en) * 2008-01-04 2008-07-09 中兴通讯股份有限公司 Web testing method and device
CN101572632B (en) * 2009-03-04 2012-02-01 公安部第三研究所 Method for testing management end interface of information security management system
CN205786933U (en) * 2016-07-19 2016-12-07 湖北广兴通信科技有限公司 One kind of multiple style interface testing moulds

Patent Citations (5)

* Cited by examiner, † Cited by third party
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 (en) * 2015-01-23 2015-04-29 广东能龙教育股份有限公司 Automatic interface testing method and system based on simulative http requests
CN104615534A (en) * 2015-01-28 2015-05-13 广州酷狗计算机科技有限公司 Interface test method and device
CN105162646A (en) * 2015-07-29 2015-12-16 北京京东尚科信息技术有限公司 Multi-protocol interface test system and method
CN106095673A (en) * 2016-06-07 2016-11-09 深圳市泰久信息***股份有限公司 Automated testing method based on WEB interface and system

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651342A (en) * 2019-03-04 2020-09-11 复旦大学 HTTP interface automation testing framework based on Charles recording session
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN110297761A (en) * 2019-05-23 2019-10-01 深圳壹账通智能科技有限公司 Acquisition methods, device, computer equipment and the storage medium of returned data
CN110377471B (en) * 2019-07-17 2022-08-23 江苏满运软件科技有限公司 Interface verification data generation method and device, storage medium and electronic equipment
CN110377471A (en) * 2019-07-17 2019-10-25 江苏满运软件科技有限公司 Generation method, device, storage medium and the electronic equipment of interface check data
CN111581109A (en) * 2020-05-15 2020-08-25 杭州安恒信息技术股份有限公司 Method, system and equipment for checking interface return data
CN111860719A (en) * 2020-07-21 2020-10-30 上海仪电数字技术股份有限公司 Serialization processing method for product to be tested
CN111860719B (en) * 2020-07-21 2023-10-27 上海仪电数字技术股份有限公司 Serialization processing method for product to be tested
CN111913820A (en) * 2020-08-11 2020-11-10 傲普(上海)新能源有限公司 Method for processing http overtime task
CN111913820B (en) * 2020-08-11 2023-04-07 傲普(上海)新能源有限公司 Method for processing http overtime task
CN112416708B (en) * 2020-11-17 2023-09-22 中国工商银行股份有限公司 Asynchronous call link monitoring method and system
CN112416708A (en) * 2020-11-17 2021-02-26 中国工商银行股份有限公司 Asynchronous call link monitoring method and system
CN115632817A (en) * 2022-09-22 2023-01-20 浪潮卓数大数据产业发展有限公司 Android terminal reverse climbing method and device
CN115632817B (en) * 2022-09-22 2023-09-05 浪潮卓数大数据产业发展有限公司 Method and device for preventing climbing of An Zhuo Duan

Also Published As

Publication number Publication date
CN107070735B (en) 2018-04-20
CN107070735A (en) 2017-08-18

Similar Documents

Publication Publication Date Title
WO2018120722A1 (en) Asynchronous interface testing method, terminal, device, system, and storage medium
US10362067B2 (en) Method of and system for privacy awareness
US20210081524A1 (en) Systems and methods of establishing secure passwords using real-time dynamic feedback.
CN111782492B (en) Page first screen loading duration testing method and device, computer equipment and medium
WO2019037417A1 (en) Webpage data crawling method and apparatus, webpage data crawling platform, and storage medium
WO2019200792A1 (en) Session message quality inspection method and device
CN110798445B (en) Public gateway interface testing method and device, computer equipment and storage medium
CN110149363A (en) A kind of information push method, device and storage medium
US20140337536A1 (en) Method and apparatus for data communication
US10067862B2 (en) Tracking asynchronous entry points for an application
CN109542764B (en) Webpage automatic testing method and device, computer equipment and storage medium
CN105701198B (en) Page verification method and device
WO2019153586A1 (en) Chat data processing method and apparatus, computer device and storage medium
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
WO2015039585A1 (en) Method and device for testing software reliability
CN111371643B (en) Authentication method, device and storage medium
CN115328764A (en) Test code optimization method based on automatic test and related equipment thereof
US20120101829A1 (en) Wholesale device registration system, method, and program product
CN109756393B (en) Information processing method, system, medium, and computing device
US9858549B2 (en) Business transaction resource usage tracking
CN108471635B (en) Method and apparatus for connecting wireless access points
US9935856B2 (en) System and method for determining end user timing
CN111131369A (en) APP use condition transmission method and device, electronic equipment and storage medium
CN115604041B (en) Security agent method, system, apparatus, computer device, and storage medium
CN114866342B (en) Flow characteristic identification method and device, computer equipment and storage medium

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