CN108574604A - test method and device - Google Patents
test method and device Download PDFInfo
- Publication number
- CN108574604A CN108574604A CN201710130628.7A CN201710130628A CN108574604A CN 108574604 A CN108574604 A CN 108574604A CN 201710130628 A CN201710130628 A CN 201710130628A CN 108574604 A CN108574604 A CN 108574604A
- Authority
- CN
- China
- Prior art keywords
- target server
- information
- test
- server
- domain name
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/04—Processing captured monitoring data, e.g. for logfile generation
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
Description
技术领域technical field
本申请涉及计算机技术领域,具体涉及互联网技术领域,尤其涉及测试方法和装置。The present application relates to the field of computer technology, specifically to the field of Internet technology, especially to a testing method and device.
背景技术Background technique
接口测试通常是测试系统组件间接口的一种测试。主要用于检测外部系统与系统之间以及内部各个子系统之间的交互点。尤其在多系统间交互开发,或者拥有多个子系统的应用系统开发的测试中,接口测试通常适用于为其他系统提供服务的底层系统和中心服务系统,主要测试这些系统对外部提供的接口,验证其正确性和稳定性。Interface testing is usually a type of testing that tests the interfaces between system components. It is mainly used to detect the interaction points between external systems and systems and between internal subsystems. Especially in the interactive development between multiple systems, or the development of application systems with multiple subsystems, interface testing is usually applicable to the underlying systems and central service systems that provide services for other systems, mainly testing the interfaces provided by these systems to the outside, verifying its correctness and stability.
目前,在进行测试之前,测试人员通常需要根据待测试服务的格式要求编写测试数据。由于不同服务的格式要求常常是不同的,所以当增加新的待测试服务时,测试人员需要增加新的测试数据或者修改现有的测试数据,影响测试效率。At present, before testing, testers usually need to write test data according to the format requirements of the service to be tested. Since the format requirements of different services are often different, when adding a new service to be tested, testers need to add new test data or modify existing test data, which affects test efficiency.
发明内容Contents of the invention
本申请的目的在于提出一种改进的测试方法和装置,来解决以上背景技术部分提到的技术问题。The purpose of this application is to propose an improved testing method and device to solve the technical problems mentioned in the above background technology section.
第一方面,本申请实施例提供了一种测试方法,该方法包括:接收用户终端发送的互联网协议IP地址,并将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配;将与IP地址匹配的域名所指示的待测试服务器作为目标服务器,获取目标服务器的端口信息;基于目标服务器的域名和端口信息生成测试信息,并将测试信息发送至目标服务器;基于目标服务器的反馈信息生成测试结果,向用户终端返回测试结果,其中,反馈信息为与测试信息相关的信息。In the first aspect, the embodiment of the present application provides a testing method, the method including: receiving the Internet protocol IP address sent by the user terminal, and matching the IP address with the domain name of each server to be tested in the server cluster to be tested; The server to be tested indicated by the domain name matching the IP address is used as the target server, and the port information of the target server is obtained; test information is generated based on the domain name and port information of the target server, and the test information is sent to the target server; feedback information based on the target server A test result is generated, and the test result is returned to the user terminal, wherein the feedback information is information related to the test information.
在一些实施例中,基于目标服务器的域名和端口信息生成测试信息,并将测试信息发送至目标服务器,包括:基于目标服务器的域名和端口信息生成统一资源定位符URL;将URL作为测试信息发送至目标服务器。In some embodiments, generating test information based on the domain name and port information of the target server, and sending the test information to the target server includes: generating a Uniform Resource Locator URL based on the domain name and port information of the target server; sending the URL as test information to the target server.
在一些实施例中,基于目标服务器的反馈信息生成测试结果,向用户终端返回测试结果,包括:若目标服务器的反馈信息为URL对应的页面内容,将页面内容作为测试结果,并返回至用户终端。In some embodiments, the test result is generated based on the feedback information of the target server, and the test result is returned to the user terminal, including: if the feedback information of the target server is the page content corresponding to the URL, the page content is used as the test result, and returned to the user terminal .
在一些实施例中,基于目标服务器的反馈信息生成测试结果,向用户终端返回测试结果,包括:若目标服务器的反馈信息为URL对应的页面内容,将目标服务器的域名和端口信息作为测试结果,并返回至用户终端。In some embodiments, the test result is generated based on the feedback information of the target server, and the test result is returned to the user terminal, including: if the feedback information of the target server is the page content corresponding to the URL, using the domain name and port information of the target server as the test result, and return to the user terminal.
在一些实施例中,基于目标服务器的域名和端口信息生成测试信息,包括:确定目标服务器的端口信息所指示的端口的数量是否大于第一预设值;若是,从目标服务器的端口信息所指示的端口中选取出预定数目个端口,基于目标服务器的域名和所选取出的端口的端口信息生成预定数目个测试信息。In some embodiments, generating test information based on the domain name and port information of the target server includes: determining whether the number of ports indicated by the port information of the target server is greater than a first preset value; Select a predetermined number of ports from the ports, and generate a predetermined number of test information based on the domain name of the target server and the port information of the selected ports.
第二方面,本申请实施例提供了一种测试装置,该装置包括:接收单元,配置用于接收用户终端发送的互联网协议IP地址,并将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配;获取单元,配置用于将与IP地址匹配的域名所指示的待测试服务器作为目标服务器,获取目标服务器的端口信息;生成单元,配置用于基于目标服务器的域名和端口信息生成测试信息,并将测试信息发送至目标服务器;反馈单元,配置用于基于目标服务器的反馈信息生成测试结果,向用户终端返回测试结果,其中,反馈信息为与测试信息相关的信息。In a second aspect, the embodiment of the present application provides a test device, which includes: a receiving unit configured to receive the Internet Protocol IP address sent by the user terminal, and connect the IP address to each server to be tested in the server cluster to be tested The domain name is matched; the acquisition unit is configured to use the server to be tested indicated by the domain name matched with the IP address as the target server to obtain the port information of the target server; the generation unit is configured to generate based on the domain name and port information of the target server Test information, and send the test information to the target server; the feedback unit is configured to generate a test result based on the feedback information of the target server, and return the test result to the user terminal, wherein the feedback information is information related to the test information.
在一些实施例中,生成单元还包括:生成子单元,配置用于基于目标服务器的域名和端口信息生成统一资源定位符URL;发送子单元,配置用于将URL作为测试信息发送至目标服务器。In some embodiments, the generating unit further includes: a generating subunit configured to generate a Uniform Resource Locator URL based on the domain name and port information of the target server; a sending subunit configured to send the URL to the target server as test information.
在一些实施例中,反馈单元进一步配置用于:若目标服务器的反馈信息为URL对应的页面内容,将页面内容作为测试结果,并返回至用户终端。In some embodiments, the feedback unit is further configured to: if the feedback information from the target server is the page content corresponding to the URL, take the page content as the test result and return it to the user terminal.
在一些实施例中,反馈单元进一步配置用于:若目标服务器的反馈信息为URL对应的页面内容,将目标服务器的域名和端口信息作为测试结果,并返回至用户终端。In some embodiments, the feedback unit is further configured to: if the feedback information of the target server is the page content corresponding to the URL, take the domain name and port information of the target server as the test result and return it to the user terminal.
在一些实施例中,生成单元进一步配置用于:确定目标服务器的端口信息所指示的端口的数量是否大于第一预设值;若是,从目标服务器的端口信息所指示的端口中选取出预定数目个端口,基于目标服务器的域名和所选取出的端口的端口信息生成预定数目个测试信息。In some embodiments, the generating unit is further configured to: determine whether the number of ports indicated by the port information of the target server is greater than a first preset value; if so, select a predetermined number from the ports indicated by the port information of the target server port, and generate a predetermined number of test information based on the domain name of the target server and the port information of the selected port.
第三方面,本申请实施例提供了一种服务器,该服务器包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一实现方式描述的测试方法。In a third aspect, the embodiment of the present application provides a server, the server includes: one or more processors; a storage device for storing one or more programs, when one or more programs are processed by one or more processors Execute, so that one or more processors implement the testing method described in any implementation manner in the first aspect.
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现如第一方面中任一实现方式描述的测试方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the testing method described in any implementation manner in the first aspect is implemented.
本申请实施例提供的测试方法和装置,通过将用户终端发送的IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配,将匹配的域名所指示的待测试服务器作为目标服务器;而后获取目标服务器的端口信息;再基于目标服务器的域名和端口信息生成测试信息,并发送至目标服务器;基于目标服务器的反馈信息生成测试结果,以返回用户终端。这样,即使待测试服务器集群中增加新的待测试服务器,基于新的待测试服务器的域名和端口信息,也可以生成相应的测试信息。从而可以减少对测试数据的修改,提高了测试效率。The test method and device provided in the embodiments of the present application match the IP address sent by the user terminal with the domain name of each server to be tested in the server cluster to be tested, and use the server to be tested indicated by the matched domain name as the target server; and then Obtain the port information of the target server; generate test information based on the domain name and port information of the target server, and send it to the target server; generate test results based on the feedback information of the target server, and return to the user terminal. In this way, even if a new server to be tested is added to the cluster of servers to be tested, corresponding test information can be generated based on the domain name and port information of the new server to be tested. Therefore, modification of test data can be reduced, and test efficiency can be improved.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other characteristics, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1是本申请可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which the present application can be applied;
图2是根据本申请的测试方法的一个实施例的流程图;Fig. 2 is a flow chart according to one embodiment of the testing method of the present application;
图3是根据本申请的测试方法的又一个实施例的流程图;Fig. 3 is a flowchart according to another embodiment of the testing method of the present application;
图4是图3实施例中的测试方法的一个应用场景的示意图;Fig. 4 is a schematic diagram of an application scenario of the testing method in the embodiment of Fig. 3;
图5是根据本申请的测试装置的一个实施例的结构示意图;Fig. 5 is a schematic structural view of an embodiment of a testing device according to the present application;
图6是适于用来实现本申请实施例的服务器的计算机系统的结构示意图。Fig. 6 is a schematic structural diagram of a computer system suitable for implementing the server of the embodiment of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain related inventions, rather than to limit the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.
图1示出了可以应用本申请的测试方法或测试装置的实施例的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 to which embodiments of the testing method or testing device of the present application can be applied.
如图1所示,系统架构100可以包括用户终端101、102、103,网络104、106,服务器105和待测试服务器107、108。网络104用以在用户终端101、102、103和服务器105之间提供通信链路的介质。网络106用以在服务器105和待测试服务器107、108之间提供通信链路的介质。网络104、106可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , the system architecture 100 may include user terminals 101 , 102 , 103 , networks 104 , 106 , server 105 and servers 107 , 108 to be tested. The network 104 is used as a medium for providing communication links between the user terminals 101 , 102 , 103 and the server 105 . The network 106 is used as a medium for providing communication links between the server 105 and the servers 107 and 108 to be tested. The networks 104, 106 may include various connection types, such as wire, wireless communication links, or fiber optic cables, among others.
用户可以使用用户终端101、102、103通过网络104与服务器105交互,以接收或发送消息等。用户终端101、102、103上可以安装有各种通讯客户端应用,例如网页浏览器应用、应用服务测试工具、购物类应用、搜索类应用、即时通信工具、邮箱客户端等。Users can use user terminals 101, 102, 103 to interact with server 105 over network 104 to receive or send messages and the like. Various communication client applications can be installed on the user terminals 101, 102, 103, such as web browser applications, application service testing tools, shopping applications, search applications, instant messaging tools, email clients, and the like.
用户终端101、102、103可以是具有显示屏的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。The user terminals 101, 102, 103 may be various electronic devices with display screens, including but not limited to smartphones, tablet computers, e-book readers, laptops and desktop computers, and the like.
待测试服务器107、108可以是提供各种服务的服务器,例如对用户终端101、102、103上的各种应用提供支持的后台应用服务器。The servers to be tested 107 and 108 may be servers that provide various services, such as background application servers that support various applications on the user terminals 101 , 102 and 103 .
服务器105可以是提供各种服务的服务器,例如对用户终端101、102、103发送的包含IP(Internet Protocol,互联网协议)地址的测试请求进行处理的后台处理服务器。后台处理服务器可以对接收到的IP地址和待测试服务器107、108的域名及端口信息等数据进行分析处理,并将处理结果(例如测试结果)反馈给用户终端。The server 105 may be a server that provides various services, for example, a background processing server that processes test requests sent by user terminals 101 , 102 , and 103 that include IP (Internet Protocol, Internet Protocol) addresses. The background processing server can analyze and process the received data such as IP addresses, domain names and port information of the servers to be tested 107 and 108, and feed back the processing results (such as test results) to the user terminal.
需要说明的是,本申请实施例所提供的测试方法一般由服务器105执行,相应地,测试装置一般设置于服务器105中。It should be noted that the testing method provided by the embodiment of the present application is generally executed by the server 105 , and correspondingly, the testing device is generally set in the server 105 .
应该理解,图1中的用户终端、网络、服务器和待测试服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络、服务器和待测试服务器。需要说明的是,服务器105和待测试服务器107、108可以是同一服务器中的子服务器,以实现不同的服务功能。It should be understood that the numbers of user terminals, networks, servers and servers to be tested in Fig. 1 are only illustrative. According to the realization requirements, there may be any number of terminal devices, networks, servers and servers to be tested. It should be noted that the server 105 and the servers to be tested 107 and 108 may be sub-servers in the same server, so as to realize different service functions.
继续参考图2,示出了根据本申请的测试方法的一个实施例的流程200。该测试方法包括以下步骤:Continuing to refer to FIG. 2 , a flow 200 of an embodiment of the testing method according to the present application is shown. This test method includes the following steps:
步骤201,接收用户终端发送的互联网协议IP地址,并将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配。Step 201, receiving an Internet protocol IP address sent by a user terminal, and matching the IP address with the domain name of each server to be tested in the server cluster to be tested.
在本实施例中,测试方法运行于其上的电子设备(例如图1所示的服务器105)可以通过有线连接方式或者无线连接方式从用户终端接收IP地址。并且将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配。其中,上述电子设备与待测试服务器集群中的各待测试服务器通信连接。In this embodiment, the electronic device on which the test method runs (for example, the server 105 shown in FIG. 1 ) can receive an IP address from a user terminal through a wired connection or a wireless connection. And match the IP address with the domain name of each server to be tested in the server cluster to be tested. Wherein, the electronic device is communicatively connected to each server to be tested in the server cluster to be tested.
在本实施例中,用户可以在用户终端上利用各种方式发送IP地址。例如用户可以在用户终端上的浏览器或者测试平台的输入栏中输入IP地址等。测试平台可以是利用网页Web框架工具构建的。例如基于面向对象、直译式计算机程序设计语言python的Web应用框架,比如:Django、Tornado、Bottle或web.py等Web应用框架。此外,用户还可以同时发送多个IP地址,各个IP地址之间可以用逗号(但不限定)隔开以区分。In this embodiment, the user can send the IP address in various ways on the user terminal. For example, the user may input the IP address or the like in the browser on the user terminal or the input field of the test platform. The test platform can be built using web framework tools. For example, a web application framework based on object-oriented, literal translation computer programming language python, such as Django, Tornado, Bottle or web.py and other web application frameworks. In addition, users can also send multiple IP addresses at the same time, and each IP address can be separated by commas (but not limited) to distinguish them.
在本实施例中,对IP地址的IP版本并不限定。IP地址的IP版本可以是IPv4,也可以是IPv6。而且用户终端发送的IP地址可以是与待测试服务器的域名对应的IP地址,也可以是与其他服务器的域名对应的IP地址。这样在进行测试之前,可以先对运行在上述电子设备上的测试方法进行初步测试验证。In this embodiment, the IP version of the IP address is not limited. The IP version of the IP address can be IPv4 or IPv6. Moreover, the IP address sent by the user terminal may be the IP address corresponding to the domain name of the server to be tested, or the IP address corresponding to the domain name of other servers. In this way, before testing, a preliminary test verification can be performed on the test method running on the above-mentioned electronic equipment.
在本实施例中,由于一个待测试服务器的域名通常会对应一个IP地址,所以上述电子设备在接收用户终端发送的IP地址后,可以与各待测试服务器的域名所对应的IP地址进行匹配。上述电子设备可以预先存储与其通信连接的待测试服务器集群中的各待测试服务器的域名和IP地址。如果各待测试服务器的域名所对应的IP地址中,存在与用户终端发送的IP地址相同的IP地址,则可以确定存在与用户终端发送的IP地址匹配的待测试服务器的域名。如果不存在与用户终端发送的IP地址匹配的待测试服务器的域名,则可以向用户终端发送提示信息(如IP地址不存在或匹配失败等)。可以理解的是,本申请对各待测试服务器的域名和IP地址的存储位置并不限定,上述电子设备也可以从各待测试服务器中获取相应信息。In this embodiment, since a domain name of a server to be tested usually corresponds to an IP address, the electronic device may match the IP address corresponding to the domain name of each server to be tested after receiving the IP address sent by the user terminal. The above-mentioned electronic device may pre-store the domain name and IP address of each server to be tested in the server cluster to be tested that is communicatively connected to it. If there is an IP address identical to the IP address sent by the user terminal among the IP addresses corresponding to the domain names of the servers to be tested, it can be determined that there is a domain name of the server to be tested that matches the IP address sent by the user terminal. If there is no domain name of the server to be tested that matches the IP address sent by the user terminal, prompt information may be sent to the user terminal (such as the IP address does not exist or the matching fails, etc.). It can be understood that this application does not limit the storage locations of the domain names and IP addresses of the servers to be tested, and the above-mentioned electronic devices can also obtain corresponding information from the servers to be tested.
步骤202,将与IP地址匹配的域名所指示的待测试服务器作为目标服务器,获取目标服务器的端口信息。Step 202, using the server to be tested indicated by the domain name matching the IP address as the target server, and obtaining port information of the target server.
在本实施例中,基于步骤201接收到的IP地址,上述电子设备可以首先将与IP地址匹配的域名所指示的待测试服务器确定为目标服务器,然后获取该目标服务器的端口信息。In this embodiment, based on the IP address received in step 201, the electronic device may first determine the server to be tested indicated by the domain name matching the IP address as the target server, and then obtain port information of the target server.
在本实施例中,目标服务器上既可以有物理端口(如串行端口、并行端口等),也可以有虚拟端口(如协议端口)。上述电子设备主要获取目标服务器对外所提供的端口(例如分配给WWW(World Wide Web,万维网)服务的80端口,或分配给FTP(File TransferProtocol,文件传输)服务的21端口等)的端口信息。其中,端口信息可以包括但不限定通信协议、端口地址、端口名称等等。通信协议可以包括HTTP(Hypertext Transfer Protocol,超文本传输)协议、FTP协议和SMTP(Simple Mail Transfer Protocol,简单邮件传送)协议等。In this embodiment, there may be physical ports (such as serial ports, parallel ports, etc.) and virtual ports (such as protocol ports) on the target server. The above-mentioned electronic device mainly obtains port information provided by the target server (for example, port 80 assigned to WWW (World Wide Web, World Wide Web) service, or port 21 assigned to FTP (File Transfer Protocol, file transfer) service, etc.). Wherein, the port information may include but not limited to communication protocol, port address, port name and so on. The communication protocol may include HTTP (Hypertext Transfer Protocol, hypertext transfer) protocol, FTP protocol, SMTP (Simple Mail Transfer Protocol, simple mail transfer) protocol, and the like.
在本实施例中,上述电子设备可以通过各种方式获取目标服务器的端口信息。例如,上述电子设备中可以预先存储各待测试服务器的端口信息,并在这些信息中查找到目标服务器的端口信息。作为示例,上述电子设备也可以利用服务导向架构技术Web service来获取各待测试服务器的端口信息。因为现有的Web service服务中通常会包含SOAP(Simple Object Access Protocol,简单对象访问协议)和WSDL(Web ServicesDescription Language,网络服务描述语言)。这些端口信息以XML(Extensible MarkupLanguage,可扩展标记语言)文件形式传输,从而可以在不同服务器之间传输并被读取。In this embodiment, the above-mentioned electronic device may acquire the port information of the target server in various ways. For example, the above-mentioned electronic device may pre-store the port information of each server to be tested, and find the port information of the target server from the information. As an example, the above-mentioned electronic device may also use the service-oriented architecture technology Web service to obtain port information of each server to be tested. Because the existing Web service usually includes SOAP (Simple Object Access Protocol, Simple Object Access Protocol) and WSDL (Web Services Description Language, Web Services Description Language). The port information is transmitted in the form of an XML (Extensible Markup Language, Extensible Markup Language) file, so that it can be transmitted and read between different servers.
步骤203,基于目标服务器的域名和端口信息生成测试信息,并将测试信息发送至目标服务器。Step 203, generating test information based on the domain name and port information of the target server, and sending the test information to the target server.
在本实施例中,基于步骤202获取的目标服务器的域名和端口信息,上述电子设备可以生成目标服务器可识别的测试信息。并将测试信息发送至目标服务器。In this embodiment, based on the domain name and port information of the target server acquired in step 202, the electronic device may generate test information that can be identified by the target server. And send the test information to the target server.
在本实施例中,上述电子设备可以根据目标服务器的端口信息所描述的服务功能的不同,而生成不同的测试信息。例如:目标服务器的端口地址为21,通常为FTP服务。此时,上述电子设备可以发送被动模式PASV命令(即测试信息)到目标服务器。当控制链接建立成功之后,目标服务器将会发一个端口号给上述电子设备。如果上述电子设备收到目标服务器发送的端口号(即反馈信息),可以初步确定测试通过。进一步,上述电子设备可以向目标服务器发起数据链接请求,并在成功之后向目标服务器发送数据(作为测试信息)。当目标服务器反馈状态码后,上述电子设备可以根据状态码(作为反馈信息)来进一步确定测试是否通过。比如:2xx表示当前的操作成功,可以确定测试通过。再例如:目标服务器的端口地址为25,通常为SMTP服务。此时,上述电子设备在与目标服务器建立链接后,如果收到目标服务器返回220的状态码时,可以初步确定测试通过。进一步,上述电子设备可以向目标服务器发出HELO或者EHLO命令(即测试信息)。其中,HELO命令指默认的SMTP服务,EHLO指除了默认的服务之外还要支持扩展服务。HELO命令和EHLO命令是现有技术SMTP服务中常用的程序语言,这些程序是可市售的。上述电子设备可以根据目标服务器反馈的状态码(即反馈信息)来进一步确定测试是否通过。In this embodiment, the electronic device may generate different test information according to different service functions described by the port information of the target server. For example: the port address of the target server is 21, usually FTP service. At this time, the above-mentioned electronic device may send a passive mode PASV command (that is, test information) to the target server. After the control link is successfully established, the target server will send a port number to the above-mentioned electronic device. If the above-mentioned electronic device receives the port number (that is, the feedback information) sent by the target server, it can preliminarily determine that the test is passed. Further, the above-mentioned electronic device may initiate a data link request to the target server, and send data (as test information) to the target server after success. After the target server feeds back the status code, the electronic device may further determine whether the test passes according to the status code (as feedback information). For example: 2xx indicates that the current operation is successful, and it can be determined that the test is passed. Another example: the port address of the target server is 25, usually SMTP service. At this point, after the electronic device establishes a link with the target server, if it receives the status code 220 returned by the target server, it can preliminarily determine that the test has passed. Further, the above-mentioned electronic device may send a HELO or EHLO command (that is, test information) to the target server. Among them, the HELO command refers to the default SMTP service, and EHLO refers to supporting extended services in addition to the default service. The HELO command and the EHLO command are programming languages commonly used in prior art SMTP services, and these programs are commercially available. The above-mentioned electronic device may further determine whether the test passes according to the status code (ie, feedback information) fed back by the target server.
在本实施例的一些可选的实现方式中,上述电子设备可以采用以下步骤来基于目标服务器的域名和端口信息生成测试信息:确定目标服务器的端口信息所指示的端口的数量是否大于第一预设值;若是,从目标服务器的端口信息所指示的端口中选取出预定数目个端口,基于目标服务器的域名和所选取出的端口的端口信息生成预定数目个测试信息。需要说明的是,选取预定数目个端口的方法在本实施例中并不限定,可以是随机选取,也可以是按照预设方法选取,比如按照端口地址由小到大的顺序选取。In some optional implementations of this embodiment, the above-mentioned electronic device may use the following steps to generate test information based on the domain name and port information of the target server: determine whether the number of ports indicated by the port information of the target server is greater than the first preset Set a value; if so, select a predetermined number of ports from the ports indicated by the port information of the target server, and generate a predetermined number of test information based on the domain name of the target server and the port information of the selected ports. It should be noted that the method for selecting a predetermined number of ports is not limited in this embodiment, and may be selected randomly, or may be selected according to a preset method, such as selecting according to the order of port addresses from small to large.
步骤204,基于目标服务器的反馈信息生成测试结果,向用户终端返回测试结果。Step 204: Generate a test result based on the feedback information from the target server, and return the test result to the user terminal.
在本实施例中,上述电子设备可以基于目标服务器的反馈信息生成测试结果。并且上述电子设备可以通过有线连接或无线连接的方式向用户终端返回测试结果。其中,反馈信息可以为与测试信息相关的信息(如步骤203中所示实施例)。测试结果可以包括但不限于测试通过或测试不通过。作为示例,上述电子设备还可以将目标服务器的域名和端口信息以及是否通过测试等信息生成测试报告,以作为测试结果。测试报告的模版可以预先存储在上述电子设备中。这样便于管理维护,并且便于及时发现和解决测试不通过的目标服务器及端口。In this embodiment, the electronic device may generate a test result based on the feedback information from the target server. And the above-mentioned electronic device can return the test result to the user terminal through a wired connection or a wireless connection. Wherein, the feedback information may be information related to test information (such as the embodiment shown in step 203). Test results may include, but are not limited to, test pass or test fail. As an example, the above-mentioned electronic device may also generate a test report based on information such as the domain name and port information of the target server and whether the test has passed the test, as the test result. The template of the test report can be pre-stored in the above-mentioned electronic device. This facilitates management and maintenance, and facilitates timely discovery and resolution of target servers and ports that fail the test.
在本实施例中,用户终端可以通过各种方式向用户展示测试结果,例如浏览器或测试平台等。In this embodiment, the user terminal can display the test results to the user in various ways, such as a browser or a test platform.
本申请的上述实施例提供的测试方法通过将用户终端发送的IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配,将匹配的域名所指示的待测试服务器作为目标服务器;而后获取目标服务器的端口信息;再基于目标服务器的域名和端口信息生成测试信息,并发送至目标服务器;最后基于目标服务器的反馈信息生成测试结果,以返回用户终端。这样,即使待测试服务器集群中增加新的待测试服务器,基于新的待测试服务器的域名和端口信息,也可以生成相应的测试信息。从而可以减少对测试数据的修改,提高了测试效率。The test method provided by the foregoing embodiments of the present application matches the IP address sent by the user terminal with the domain name of each server to be tested in the server cluster to be tested, and uses the server to be tested indicated by the matched domain name as the target server; then obtains The port information of the target server; then generate test information based on the domain name and port information of the target server and send it to the target server; finally generate test results based on the feedback information of the target server to return to the user terminal. In this way, even if a new server to be tested is added to the cluster of servers to be tested, corresponding test information can be generated based on the domain name and port information of the new server to be tested. Therefore, modification of test data can be reduced, and test efficiency can be improved.
进一步参考图3,其示出了本申请的测试方法的又一个实施例的流程300。该测试方法的流程300,包括以下步骤:Further referring to FIG. 3 , it shows a flow 300 of another embodiment of the testing method of the present application. The flow 300 of the test method includes the following steps:
步骤301,接收用户终端发送的IP地址,并将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配。Step 301, receiving the IP address sent by the user terminal, and matching the IP address with the domain name of each server to be tested in the server cluster to be tested.
在本实施例中,测试方法运行于其上的电子设备(例如图1所示的服务器105)可以通过有线连接或无线连接的方式接收用户终端发送的IP地址。并且上述电子设备可以将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配。具体可参见图2所示实施例中的步骤201,此处不再赘述。In this embodiment, the electronic device on which the test method runs (for example, the server 105 shown in FIG. 1 ) can receive the IP address sent by the user terminal through a wired connection or a wireless connection. And the above-mentioned electronic device can match the IP address with the domain name of each server to be tested in the server cluster to be tested. For details, refer to step 201 in the embodiment shown in FIG. 2 , which will not be repeated here.
步骤302,将与IP地址匹配的域名所指示的待测试服务器作为目标服务器,获取目标服务器的端口信息。Step 302, using the server to be tested indicated by the domain name matching the IP address as the target server, and obtaining port information of the target server.
在本实施例中,上述电子设备可以将与IP地址匹配的域名所指示的待测试服务器作为目标服务器,获取目标服务器的端口信息。其中,端口信息可以包括但不限于通信协议、端口地址、端口名称等等。具体可参见图2所示实施例中的步骤202,此处不再赘述。In this embodiment, the above-mentioned electronic device may use the server to be tested indicated by the domain name matching the IP address as the target server, and obtain the port information of the target server. Wherein, the port information may include but not limited to communication protocol, port address, port name and so on. For details, refer to step 202 in the embodiment shown in FIG. 2 , which will not be repeated here.
步骤303,基于目标服务器的域名和端口信息生成统一资源定位符URL,将URL作为测试信息发送至目标服务器。Step 303, generating a Uniform Resource Locator URL based on the domain name and port information of the target server, and sending the URL to the target server as test information.
在本实施例中,上述电子设备可以基于目标服务器的域名和端口信息生成URL。例如:目标服务器的域名为***.com,端口信息包括HTTP协议、端口号80,可以生成URL为http://www.***.com:80或者http://www.***.com。并且上述电子设备可以将URL作为测试信息,以向目标服务器发送包含URL的测试请求。此外,上述电子设备还可以利用Python中的httplib模块中Get方法从目标服务器获取内容,或Post方法向目标服务器提交信息。需要说明的是,Python及httplib模块是目前广泛研究和应用的公知技术,在此不再赘述。In this embodiment, the electronic device may generate a URL based on the domain name and port information of the target server. For example: the domain name of the target server is ***.com, the port information includes HTTP protocol, port number 80, and the URL can be generated as http://www.***.com:80 or http://www.*** .com. And the above-mentioned electronic device can use the URL as the test information, so as to send a test request including the URL to the target server. In addition, the above-mentioned electronic device can also use the Get method in the httplib module in Python to obtain content from the target server, or the Post method to submit information to the target server. It should be noted that the Python and httplib modules are well-known technologies widely researched and applied at present, and will not be repeated here.
步骤304,若目标服务器的反馈信息为URL对应的页面内容,将页面内容作为测试结果,并返回至用户终端。Step 304, if the feedback information from the target server is the page content corresponding to the URL, take the page content as the test result and return it to the user terminal.
在本实施例中,上述电子设备在收到目标服务器反馈的URL对应的页面内容的信息后,可以将页面内容作为测试结果,通过有线连接或无线连接的方式返回至用户终端。In this embodiment, after receiving the page content information corresponding to the URL fed back by the target server, the electronic device may return the page content as a test result to the user terminal through a wired connection or a wireless connection.
在本实施例中,用户终端可以在浏览器或测试平台向用户展示URL对应的页面内容。测试平台可以根据页面内容的数据结构选取适当的HTML(Hypertext MarkupLanguage,超文本标记语言)模版,以展示页面内容。In this embodiment, the user terminal can display the page content corresponding to the URL to the user on the browser or the test platform. The test platform can select an appropriate HTML (Hypertext Markup Language, Hypertext Markup Language) template according to the data structure of the page content to display the page content.
在本实施例的一些可选的实现方式中,若目标服务器的反馈信息为URL对应的页面内容,上述电子设备可以将目标服务器的域名和端口信息作为测试结果,并返回至用户终端。In some optional implementations of this embodiment, if the feedback information from the target server is the page content corresponding to the URL, the electronic device may use the domain name and port information of the target server as the test result and return it to the user terminal.
从图3中可以看出,与图2对应的实施例相比,本实施例中的测试方法的流程300突出了对测试信息和测试结果的生成步骤。由此,本实施例描述的方案可以引入更多的待测试服务器的应用服务,从而实现更全面的测试信息和更丰富的测试结果。It can be seen from FIG. 3 that, compared with the embodiment corresponding to FIG. 2 , the process 300 of the test method in this embodiment highlights the steps of generating test information and test results. Therefore, the solution described in this embodiment can introduce more application services of the server to be tested, so as to achieve more comprehensive test information and richer test results.
继续参见图4,图4是根据图3所示实施例的测试方法的应用场景的一个示意图。在图4的应用场景中,用户首先可以在测试平台上的输入栏内输入172.###.##的IP地址,点击“测试”按钮(如标号401所示)。此后,用户终端可以将该IP地址发送至服务器。服务器首先可以将接收到的172.###.##的IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配。然后可以在确定与172.###.##匹配的域名为www.A**.com后,将域名为www.A**.com的待测试服务器作为目标服务器,并获取该目标服务器的端口信息。而后生成http://www.A**.com的测试信息,并将其发送至目标服务器。最后服务器将目标服务器返回的页面内容作为测试结果,返回至用户终端。用户终端可以根据页面内容的数据结构,在测试平台上的结果1处以网页形式将其(如邮箱账号登录页面)展示给用户,测试主页为测试平台的主页。邮箱账号登录页面包括“邮箱账号或手机号@163.com”、“密码”、“登录”按钮和“注册”按钮(如标号402所示)。Continue to refer to FIG. 4 , which is a schematic diagram of an application scenario of the testing method according to the embodiment shown in FIG. 3 . In the application scenario shown in FIG. 4 , the user can first input the IP address of 172.###.## in the input field on the test platform, and click the "Test" button (shown by reference number 401 ). Thereafter, the user terminal can send the IP address to the server. The server may first match the received IP address of 172.###.## with the domain names of the servers to be tested in the server cluster to be tested. Then, after determining that the domain name matching 172.###.## is www.A**.com, use the server to be tested with the domain name www.A**.com as the target server, and obtain the port information. Then generate the test information of http://www.A**.com and send it to the target server. Finally, the server returns the page content returned by the target server to the user terminal as the test result. According to the data structure of the page content, the user terminal can display it (such as the email account login page) to the user in the form of a webpage at the result 1 on the test platform, and the test homepage is the homepage of the test platform. The email account login page includes "email account or mobile phone number@163.com", "password", a "login" button and a "register" button (shown by reference numeral 402).
进一步参考图5,作为对上述各图所示方法的实现,本申请提供了一种测试装置的一个实施例。该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。Further referring to FIG. 5 , as an implementation of the methods shown in the above figures, the present application provides an embodiment of a testing device. The embodiment of the device corresponds to the embodiment of the method shown in FIG. 2 , and the device can be specifically applied to various electronic devices.
如图5所示,本实施例的测试装置500包括:接收单元501、获取单元502、生成单元503和反馈单元504。其中,接收单元501配置用于接收用户终端发送的互联网协议IP地址,并将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配;获取单元502配置用于将与IP地址匹配的域名所指示的待测试服务器作为目标服务器,获取目标服务器的端口信息;生成单元503配置用于基于目标服务器的域名和端口信息生成测试信息,并将测试信息发送至目标服务器;反馈单元504配置用于基于目标服务器的反馈信息生成测试结果,向用户终端返回测试结果,其中,反馈信息为与测试信息相关的信息。As shown in FIG. 5 , the testing device 500 of this embodiment includes: a receiving unit 501 , an acquiring unit 502 , a generating unit 503 and a feedback unit 504 . Wherein, the receiving unit 501 is configured to receive the Internet Protocol IP address sent by the user terminal, and matches the IP address with the domain name of each server to be tested in the server cluster to be tested; the obtaining unit 502 is configured to match the IP address with the IP address The server to be tested indicated by the domain name is used as the target server to obtain the port information of the target server; the generation unit 503 is configured to generate test information based on the domain name and port information of the target server, and send the test information to the target server; the feedback unit 504 is configured for The test result is generated based on the feedback information of the target server, and the test result is returned to the user terminal, wherein the feedback information is information related to the test information.
在本实施例中,接收单元501、获取单元502、生成单元503和反馈单元504的具体实现方式及产生的有益效果可以分别参见图2实施例中的步骤201、步骤202、步骤203和步骤204,此处不再赘述。In this embodiment, the specific implementations and beneficial effects of the receiving unit 501, the acquiring unit 502, the generating unit 503 and the feedback unit 504 can be referred to step 201, step 202, step 203 and step 204 in the embodiment of Fig. 2 respectively , which will not be repeated here.
在本实施例的一些可选的实现方式中,生成单元503还可以包括:生成子单元(图中未示出),配置用于基于目标服务器的域名和端口信息生成统一资源定位符URL;发送子单元(图中未示出),配置用于将URL作为测试信息发送至目标服务器。In some optional implementations of this embodiment, the generation unit 503 may also include: a generation subunit (not shown in the figure), configured to generate a Uniform Resource Locator URL based on the domain name and port information of the target server; A subunit (not shown in the figure) is configured to send the URL as test information to the target server.
在本实施例的一些可选的实现方式中,反馈单元504可以进一步配置用于:若目标服务器的反馈信息为URL对应的页面内容,将页面内容作为测试结果,并返回至用户终端。In some optional implementations of this embodiment, the feedback unit 504 may be further configured to: if the feedback information of the target server is the page content corresponding to the URL, take the page content as the test result and return it to the user terminal.
在本实施例的一些可选的实现方式中,反馈单元504可以进一步配置用于:若目标服务器的反馈信息为URL对应的页面内容,将目标服务器的域名和端口信息作为测试结果,并返回至用户终端。In some optional implementations of this embodiment, the feedback unit 504 may be further configured to: if the feedback information of the target server is the page content corresponding to the URL, use the domain name and port information of the target server as the test result, and return to user terminal.
在本实施例的一些可选的实现方式中,生成单元503可以进一步配置用于:确定目标服务器的端口信息所指示的端口的数量是否大于第一预设值;若是,从目标服务器的端口信息所指示的端口中选取出预定数目个端口,基于目标服务器的域名和所选取出的端口的端口信息生成预定数目个测试信息。In some optional implementations of this embodiment, the generating unit 503 may be further configured to: determine whether the number of ports indicated by the port information of the target server is greater than the first preset value; A predetermined number of ports are selected from the indicated ports, and a predetermined number of test information is generated based on the domain name of the target server and port information of the selected ports.
下面参考图6,其示出了适于用来实现本申请实施例的服务器的计算机系统600的结构示意图。图6示出的服务器仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Referring now to FIG. 6 , it shows a schematic structural diagram of a computer system 600 suitable for implementing the server of the embodiment of the present application. The server shown in FIG. 6 is only an example, and should not limit the functions and scope of use of this embodiment of the present application.
如图6所示,计算机系统600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储部分608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统600操作所需的各种程序和数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6 , a computer system 600 includes a central processing unit (CPU) 601 that can be programmed according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage section 608 into a random-access memory (RAM) 603 Instead, various appropriate actions and processes are performed. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601 , ROM 602 , and RAM 603 are connected to each other via a bus 604 . An input/output (I/O) interface 605 is also connected to the bus 604 .
以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入存储部分608。The following components are connected to the I/O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 608 including a hard disk, etc. and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc. is mounted on the drive 610 as necessary so that a computer program read therefrom is installed into the storage section 608 as necessary.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被中央处理单元(CPU)601执行时,执行本申请的方法中限定的上述功能。需要说明的是,本申请上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication portion 609 and/or installed from removable media 611 . When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the method of the present application are performed. It should be noted that the computer-readable medium mentioned above in this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括接收单元、获取单元、生成单元和反馈单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,接收单元还可以被描述为“接收用户终端发送的互联网协议IP地址,并将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配的单元”。The units involved in the embodiments described in the present application may be implemented by means of software or by means of hardware. The described units may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, an acquiring unit, a generating unit, and a feedback unit. Wherein, the names of these units do not constitute a limitation of the unit itself under certain circumstances. For example, the receiving unit can also be described as "receiving the Internet Protocol IP address sent by the user terminal, and combining the IP address with the server cluster to be tested. The domain name of each server to be tested in the matching unit".
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的服务器中所包含的;也可以是单独存在,而未装配入该服务器中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该服务器执行时,使得该服务器:接收用户终端发送的互联网协议IP地址,并将IP地址与待测试服务器集群中的各待测试服务器的域名进行匹配;将与IP地址匹配的域名所指示的待测试服务器作为目标服务器,获取目标服务器的端口信息;基于目标服务器的域名和端口信息生成测试信息,并将测试信息发送至目标服务器;基于目标服务器的反馈信息生成测试结果,向用户终端返回测试结果,其中,反馈信息为与测试信息相关的信息。As another aspect, the present application also provides a computer-readable medium. The computer-readable medium may be included in the server described in the above embodiments, or may exist independently without being assembled into the server. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the server, the server: receives the Internet Protocol IP address sent by the user terminal, and compares the IP address with the IP address in the server cluster to be tested. The domain name of each server to be tested is matched; the server to be tested indicated by the domain name matching the IP address is used as the target server, and the port information of the target server is obtained; test information is generated based on the domain name and port information of the target server, and the test information Sending to the target server; generating a test result based on the feedback information of the target server, and returning the test result to the user terminal, wherein the feedback information is information related to the test information.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an illustration of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, and should also cover the technical solutions formed by the above-mentioned technical features or without departing from the above-mentioned inventive concept. Other technical solutions formed by any combination of equivalent features. For example, a technical solution formed by replacing the above-mentioned features with technical features with similar functions disclosed in this application (but not limited to).
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710130628.7A CN108574604B (en) | 2017-03-07 | 2017-03-07 | Test method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710130628.7A CN108574604B (en) | 2017-03-07 | 2017-03-07 | Test method and apparatus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108574604A true CN108574604A (en) | 2018-09-25 |
| CN108574604B CN108574604B (en) | 2020-09-29 |
Family
ID=63577078
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710130628.7A Active CN108574604B (en) | 2017-03-07 | 2017-03-07 | Test method and apparatus |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108574604B (en) |
Cited By (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109324914A (en) * | 2018-09-26 | 2019-02-12 | 多点生活(成都)科技有限公司 | Service calling method, service call device and central server |
| CN109542756A (en) * | 2018-09-29 | 2019-03-29 | 中国平安人寿保险股份有限公司 | Method, apparatus, electronic equipment and the storage medium of automatic configuration script |
| CN110457197A (en) * | 2019-08-19 | 2019-11-15 | 中国工商银行股份有限公司 | Service test method, device, computer equipment and storage medium |
| CN110475268A (en) * | 2019-07-05 | 2019-11-19 | 深圳壹账通智能科技有限公司 | Short chain test method, system, equipment and storage medium |
| CN110795343A (en) * | 2019-10-12 | 2020-02-14 | 车智互联(北京)科技有限公司 | Test system, test method and computing equipment |
| CN111049912A (en) * | 2019-12-17 | 2020-04-21 | 用友网络科技股份有限公司 | Debugging method, test development device, and computer-readable storage medium |
| CN112306858A (en) * | 2020-05-21 | 2021-02-02 | 北京字节跳动网络技术有限公司 | Test method and device and electronic equipment |
| CN112363879A (en) * | 2020-11-20 | 2021-02-12 | 上海连尚网络科技有限公司 | Cache server performance test method, device, equipment and medium |
| CN113630802A (en) * | 2020-05-07 | 2021-11-09 | 大唐联仪科技有限公司 | NR user plane service test method and device |
| CN113641575A (en) * | 2021-08-06 | 2021-11-12 | 上海浦东发展银行股份有限公司 | Test method, device, equipment and storage medium |
| CN113760697A (en) * | 2020-07-15 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Interface testing method and device, electronic equipment and storage medium |
| CN114006847A (en) * | 2020-07-14 | 2022-02-01 | 成都鼎桥通信技术有限公司 | Automatic testing method for private network terminal |
| CN114071119A (en) * | 2020-07-31 | 2022-02-18 | 北京达佳互联信息技术有限公司 | Resource testing method and device, electronic equipment and storage medium |
| CN114629888A (en) * | 2022-03-18 | 2022-06-14 | 中国农业银行股份有限公司 | Server load testing method and device |
| CN115509888A (en) * | 2021-06-23 | 2022-12-23 | 神讯电脑(昆山)有限公司 | A test method, device, storage medium and electronic equipment |
Citations (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1435783A (en) * | 2002-10-22 | 2003-08-13 | 交大铭泰(北京)软件有限公司 | Reverse domain name analysis method |
| KR100694248B1 (en) * | 2006-04-25 | 2007-03-27 | 충남대학교산학협력단 | Apparatus and method for testing security policy of network security system |
| CN101447898A (en) * | 2008-11-19 | 2009-06-03 | 中国人民解放军信息安全测评认证中心 | Test system used for network safety product and test method thereof |
| CN101841436A (en) * | 2010-03-02 | 2010-09-22 | 北京星网锐捷网络技术有限公司 | Method for testing performance of IPFIX (Internet Protocol Flow Information Export) server, device and system thereof |
| CN102571466A (en) * | 2010-12-16 | 2012-07-11 | 中国移动通信集团安徽有限公司 | Method, device and system for testing service |
| CN102916958A (en) * | 2012-10-15 | 2013-02-06 | 福建榕基软件股份有限公司 | Method and system for realizing access encryption of mobile terminal browser |
| CN103220372A (en) * | 2012-01-19 | 2013-07-24 | 中国移动通信集团公司 | Data service access method and system |
| CN103685590A (en) * | 2012-09-14 | 2014-03-26 | 阿里巴巴集团控股有限公司 | Method and system for obtaining IP (internet protocol) address |
| CN103746885A (en) * | 2014-01-28 | 2014-04-23 | 中国人民解放军信息安全测评认证中心 | Test system and test method oriented to next-generation firewall |
| CN104090931A (en) * | 2014-06-25 | 2014-10-08 | 华南理工大学 | Information prediction and acquisition method based on webpage link parameter analysis |
| CN104125308A (en) * | 2013-04-25 | 2014-10-29 | 阿里巴巴集团控股有限公司 | Domain name resolution method for multi-users and domain name resolution system |
| CN104915288A (en) * | 2014-03-13 | 2015-09-16 | 阿里巴巴集团控股有限公司 | Testing method and device |
| CN105099811A (en) * | 2015-06-03 | 2015-11-25 | 北京金山安全软件有限公司 | Interface testing method and device |
| CN105430108A (en) * | 2014-08-25 | 2016-03-23 | 腾讯科技(深圳)有限公司 | Test environment accessing method and proxy server |
| CN105868058A (en) * | 2015-12-14 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Cross-machine room test method and apparatus |
| CN106131016A (en) * | 2016-07-13 | 2016-11-16 | 北京知道创宇信息技术有限公司 | Maliciously URL detection interference method, system and device |
| WO2016195644A1 (en) * | 2015-05-29 | 2016-12-08 | Hewlett Packard Enterprise Development Lp | Potential blocking impacts |
| CN106302002A (en) * | 2016-07-29 | 2017-01-04 | 北京小米移动软件有限公司 | Method of testing and device |
-
2017
- 2017-03-07 CN CN201710130628.7A patent/CN108574604B/en active Active
Patent Citations (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1435783A (en) * | 2002-10-22 | 2003-08-13 | 交大铭泰(北京)软件有限公司 | Reverse domain name analysis method |
| KR100694248B1 (en) * | 2006-04-25 | 2007-03-27 | 충남대학교산학협력단 | Apparatus and method for testing security policy of network security system |
| CN101447898A (en) * | 2008-11-19 | 2009-06-03 | 中国人民解放军信息安全测评认证中心 | Test system used for network safety product and test method thereof |
| CN101841436A (en) * | 2010-03-02 | 2010-09-22 | 北京星网锐捷网络技术有限公司 | Method for testing performance of IPFIX (Internet Protocol Flow Information Export) server, device and system thereof |
| CN102571466A (en) * | 2010-12-16 | 2012-07-11 | 中国移动通信集团安徽有限公司 | Method, device and system for testing service |
| CN103220372A (en) * | 2012-01-19 | 2013-07-24 | 中国移动通信集团公司 | Data service access method and system |
| CN103685590A (en) * | 2012-09-14 | 2014-03-26 | 阿里巴巴集团控股有限公司 | Method and system for obtaining IP (internet protocol) address |
| CN102916958A (en) * | 2012-10-15 | 2013-02-06 | 福建榕基软件股份有限公司 | Method and system for realizing access encryption of mobile terminal browser |
| CN104125308A (en) * | 2013-04-25 | 2014-10-29 | 阿里巴巴集团控股有限公司 | Domain name resolution method for multi-users and domain name resolution system |
| CN103746885A (en) * | 2014-01-28 | 2014-04-23 | 中国人民解放军信息安全测评认证中心 | Test system and test method oriented to next-generation firewall |
| CN104915288A (en) * | 2014-03-13 | 2015-09-16 | 阿里巴巴集团控股有限公司 | Testing method and device |
| CN104090931A (en) * | 2014-06-25 | 2014-10-08 | 华南理工大学 | Information prediction and acquisition method based on webpage link parameter analysis |
| CN105430108A (en) * | 2014-08-25 | 2016-03-23 | 腾讯科技(深圳)有限公司 | Test environment accessing method and proxy server |
| WO2016195644A1 (en) * | 2015-05-29 | 2016-12-08 | Hewlett Packard Enterprise Development Lp | Potential blocking impacts |
| CN105099811A (en) * | 2015-06-03 | 2015-11-25 | 北京金山安全软件有限公司 | Interface testing method and device |
| CN105868058A (en) * | 2015-12-14 | 2016-08-17 | 乐视网信息技术(北京)股份有限公司 | Cross-machine room test method and apparatus |
| CN106131016A (en) * | 2016-07-13 | 2016-11-16 | 北京知道创宇信息技术有限公司 | Maliciously URL detection interference method, system and device |
| CN106302002A (en) * | 2016-07-29 | 2017-01-04 | 北京小米移动软件有限公司 | Method of testing and device |
Cited By (26)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109324914A (en) * | 2018-09-26 | 2019-02-12 | 多点生活(成都)科技有限公司 | Service calling method, service call device and central server |
| CN109324914B (en) * | 2018-09-26 | 2021-06-22 | 多点生活(成都)科技有限公司 | Service calling method, service calling device and central server |
| CN109542756A (en) * | 2018-09-29 | 2019-03-29 | 中国平安人寿保险股份有限公司 | Method, apparatus, electronic equipment and the storage medium of automatic configuration script |
| CN109542756B (en) * | 2018-09-29 | 2023-04-11 | 中国平安人寿保险股份有限公司 | Method and device for automatically configuring script, electronic equipment and storage medium |
| CN110475268A (en) * | 2019-07-05 | 2019-11-19 | 深圳壹账通智能科技有限公司 | Short chain test method, system, equipment and storage medium |
| CN110457197B (en) * | 2019-08-19 | 2023-05-09 | 中国工商银行股份有限公司 | Service testing method, device, computer equipment and storage medium |
| CN110457197A (en) * | 2019-08-19 | 2019-11-15 | 中国工商银行股份有限公司 | Service test method, device, computer equipment and storage medium |
| CN110795343A (en) * | 2019-10-12 | 2020-02-14 | 车智互联(北京)科技有限公司 | Test system, test method and computing equipment |
| CN110795343B (en) * | 2019-10-12 | 2024-03-15 | 车智互联(北京)科技有限公司 | Test systems, test methods and computing equipment |
| CN111049912A (en) * | 2019-12-17 | 2020-04-21 | 用友网络科技股份有限公司 | Debugging method, test development device, and computer-readable storage medium |
| CN113630802A (en) * | 2020-05-07 | 2021-11-09 | 大唐联仪科技有限公司 | NR user plane service test method and device |
| CN113630802B (en) * | 2020-05-07 | 2024-02-20 | 大唐联仪科技有限公司 | NR user plane service testing method and device |
| CN112306858A (en) * | 2020-05-21 | 2021-02-02 | 北京字节跳动网络技术有限公司 | Test method and device and electronic equipment |
| CN114006847A (en) * | 2020-07-14 | 2022-02-01 | 成都鼎桥通信技术有限公司 | Automatic testing method for private network terminal |
| CN114006847B (en) * | 2020-07-14 | 2023-07-07 | 成都鼎桥通信技术有限公司 | Automatic test method for private network terminal |
| CN113760697A (en) * | 2020-07-15 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Interface testing method and device, electronic equipment and storage medium |
| CN113760697B (en) * | 2020-07-15 | 2024-09-20 | 北京沃东天骏信息技术有限公司 | Interface testing method, device, electronic device and storage medium |
| CN114071119A (en) * | 2020-07-31 | 2022-02-18 | 北京达佳互联信息技术有限公司 | Resource testing method and device, electronic equipment and storage medium |
| CN114071119B (en) * | 2020-07-31 | 2024-03-19 | 北京达佳互联信息技术有限公司 | Resource testing method and device, electronic equipment and storage medium |
| CN112363879A (en) * | 2020-11-20 | 2021-02-12 | 上海连尚网络科技有限公司 | Cache server performance test method, device, equipment and medium |
| CN112363879B (en) * | 2020-11-20 | 2024-11-01 | 上海连尚网络科技有限公司 | Cache server performance test method, device, equipment and medium |
| CN115509888A (en) * | 2021-06-23 | 2022-12-23 | 神讯电脑(昆山)有限公司 | A test method, device, storage medium and electronic equipment |
| CN113641575A (en) * | 2021-08-06 | 2021-11-12 | 上海浦东发展银行股份有限公司 | Test method, device, equipment and storage medium |
| CN113641575B (en) * | 2021-08-06 | 2024-04-09 | 上海浦东发展银行股份有限公司 | Test method, device, equipment and storage medium |
| CN114629888A (en) * | 2022-03-18 | 2022-06-14 | 中国农业银行股份有限公司 | Server load testing method and device |
| CN114629888B (en) * | 2022-03-18 | 2024-09-17 | 中国农业银行股份有限公司 | Method and device for testing server load |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108574604B (en) | 2020-09-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108574604B (en) | Test method and apparatus | |
| CN110442524B (en) | Method and device for testing web service interface with authentication authorization | |
| CN107277153B (en) | Method, apparatus and server for providing voice service | |
| CN109815107B (en) | Method and device for automatic testing | |
| CN105099811A (en) | Interface testing method and device | |
| EP3614643A1 (en) | Oauth2 saml token service | |
| CN110704200B (en) | Method and device for converting calling interface | |
| CN107797911A (en) | Method and apparatus for testing HTTP interface | |
| CN108416021B (en) | Browser webpage content processing method and device, electronic equipment and readable medium | |
| US9971636B2 (en) | Methods for implementing web services and devices thereof | |
| WO2021023149A1 (en) | Method and apparatus for dynamically returning message | |
| CN112131095B (en) | Pressure testing method and device | |
| CN112084102A (en) | Interface pressure testing method and device | |
| CN113326060B (en) | Service request processing method, device and system, and service configuration method and device | |
| CN112015383B (en) | A login method and device | |
| CN109522202A (en) | A kind of method and apparatus of software test | |
| CN112929453B (en) | Method and device for sharing session data | |
| CN118337783B (en) | Functional verification methods, apparatus, equipment, storage media, and program products for distributed systems | |
| US20140032726A1 (en) | Method and apparatus for configuring social networking site sharing functions | |
| CN116561013B (en) | Test methods, devices, electronic equipment and media based on the target service framework | |
| CN109981546A (en) | The method and apparatus for obtaining the far call relationship between application module | |
| AU2018390863B2 (en) | Computer system and method for extracting dynamic content from websites | |
| CN107247661B (en) | Method and system for supporting automatic verification of installation package of application | |
| CN113760727B (en) | Interface regression testing method and device | |
| CN113704080B (en) | Automated testing method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |