CN105721251A - Reconfigurable testing pile service method and system - Google Patents
Reconfigurable testing pile service method and system Download PDFInfo
- Publication number
- CN105721251A CN105721251A CN201610123758.3A CN201610123758A CN105721251A CN 105721251 A CN105721251 A CN 105721251A CN 201610123758 A CN201610123758 A CN 201610123758A CN 105721251 A CN105721251 A CN 105721251A
- Authority
- CN
- China
- Prior art keywords
- server
- invocation
- request
- configuration
- calling
- 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
- 238000012360 testing method Methods 0.000 title claims abstract description 160
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000012546 transfer Methods 0.000 claims abstract description 11
- 230000004044 response Effects 0.000 claims description 14
- 238000012986 modification Methods 0.000 claims description 11
- 230000004048 modification Effects 0.000 claims description 11
- 238000012790 confirmation Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 7
- 238000012545 processing Methods 0.000 description 9
- 238000012423 maintenance Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000012800 visualization Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000002715 modification method Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
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/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
-
- 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
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种可配置测试桩服务的方法及系统。该方法包括:调用服务器获取客户端发送的超文本传输协议的服务请求,并根据所述服务请求生成相应的调用请求;所述调用服务器修改配置文件,并根据修改后的配置文件将所述调用请求发送至测试桩服务器;所述调用服务器接收所述测试桩服务器反馈的与所述调用请求相应的配置结果,并根据所述配置结果生成相应的服务结果并传送至所述客户端。可以解决现有技术中在调用服务器设置拦截器过程复杂,且手动加载、管理复杂的技术问题。
The invention discloses a method and system for configurable test pile service. The method includes: calling the server to obtain the service request of the hypertext transfer protocol sent by the client, and generating a corresponding calling request according to the service request; The request is sent to the test stub server; the call server receives the configuration result fed back by the test stub server corresponding to the call request, and generates a corresponding service result according to the configuration result and sends it to the client. It can solve the technical problems in the prior art that the process of setting the interceptor in the calling server is complicated, and manual loading and management are complicated.
Description
技术领域technical field
本发明涉及计算机技术领域,尤其涉及一种可配置测试桩服务的方法及系统。The present invention relates to the field of computer technology, in particular to a method and system for configurable test stub services.
背景技术Background technique
超文本传输协议(HyperTextTransferProtocol,HTTP)是互联网上应用最为广泛的一种网络协议。所有的WWW文件都必须遵守这个标准。HTTP是一个客户端和服务器端请求和应答的标准。客户端是终端用户,服务器端是网站。通常,由HTTP客户端发起一个请求,建立一个到服务器端指定端口的传输控制协议(TransmissionControlProtocol,TCP)连接。服务器端则在那个指定端口监听客户端发送过来的请求。一旦收到连接请求,服务器端(向客户端)发回一个状态行,比如"HTTP/1.1200OK",和响应的消息,响应的消息可能是请求的文件、错误消息、或者其它一些信息。Hypertext Transfer Protocol (HyperTextTransferProtocol, HTTP) is the most widely used network protocol on the Internet. All WWW documents must comply with this standard. HTTP is a standard for client and server requests and responses. The client side is the end user and the server side is the website. Usually, an HTTP client initiates a request to establish a Transmission Control Protocol (Transmission Control Protocol, TCP) connection to a designated port on the server. The server side listens to the request sent by the client on the specified port. Once the connection request is received, the server (to the client) sends back a status line, such as "HTTP/1.1200 OK", and a response message, which may be the requested file, an error message, or some other information.
现在,客户端对HTTP的测试通常是将客户端发起的请求发送至调用服务器并在调用服务器增加一个拦截器,拦截客户端发送的请求,并根据拦截的请求返回模拟的响应结果,以测试客户端收到响应结果后的处理是否符合预期的需要。增加拦截器就需要对调用服务器系统的代码进行修改,且在修改时,需手动触发配置文件重新加载,无法做到变更实时生效,且管理复杂,容易引起运维事故。Now, the client's test of HTTP is usually to send the request initiated by the client to the calling server and add an interceptor to the calling server, intercept the request sent by the client, and return the simulated response result according to the intercepted request to test the client Whether the processing after the terminal receives the response meets the expected needs. Adding an interceptor requires modifying the code that calls the server system, and when modifying, the configuration file needs to be manually triggered to reload, which cannot take effect in real time, and the management is complicated, which may easily cause operation and maintenance accidents.
发明内容Contents of the invention
有鉴于此,本发明实施例提供一种可配置测试桩服务的方法及系统,以解决现有技术中在调用服务器增加拦截器过程复杂,且手动加载、管理复杂的技术问题。In view of this, the embodiments of the present invention provide a method and system for configurable test stub services to solve the technical problems in the prior art that the process of adding an interceptor to a calling server is complicated, and manual loading and management are complicated.
第一方面,本发明实施例提供了一种可配置测试桩服务的方法,包括:In the first aspect, the embodiment of the present invention provides a method for configurable test stub service, including:
调用服务器获取客户端发送的超文本传输协议的服务请求,并根据所述服务请求生成相应的调用请求;Invoking the server to obtain the service request of the hypertext transfer protocol sent by the client, and generating a corresponding invocation request according to the service request;
所述调用服务器修改配置文件,并根据修改后的配置文件将所述调用请求发送至测试桩服务器;The calling server modifies the configuration file, and sends the calling request to the test stub server according to the modified configuration file;
所述调用服务器接收所述测试桩服务器反馈的与所述调用请求相应的配置结果,并根据所述配置结果生成相应的服务结果并传送至所述客户端。The invocation server receives the configuration result corresponding to the invocation request fed back by the test stub server, generates a corresponding service result according to the configuration result, and transmits it to the client.
第二方面,本发明实施例还提供了一种可配置测试桩服务的系统,包括:In the second aspect, the embodiment of the present invention also provides a system for configurable test stub services, including:
请求获取模块,配置于调用服务器,用于获取客户端发送的超文本传输协议的服务请求,并根据所述服务请求生成相应的调用请求;The request acquisition module is configured in the invocation server, and is used to acquire the service request of the hypertext transfer protocol sent by the client, and generate a corresponding invocation request according to the service request;
修改模块,配置于所述调用服务器,用于修改配置文件,并根据修改后的配置文件将所述调用请求发送至测试桩服务器;A modification module, configured on the calling server, is used to modify the configuration file, and send the calling request to the test stub server according to the modified configuration file;
接收模块,配置于所述调用服务器,用于接收所述测试桩服务器反馈的与所述调用请求相应的配置结果,并根据所述配置结果生成相应的服务结果并传送至所述客户端。The receiving module is configured on the invocation server, and is used for receiving the configuration result corresponding to the invocation request fed back by the test stub server, and generating a corresponding service result according to the configuration result and sending it to the client.
本发明实施例提供的可配置测试桩服务的方法及系统,通过调用服务器获取客户端发送的超文本传输协议的服务请求,生成调用请求并根据修改的配置文件将所述调用请求发送至测试桩服务器,无需在调用服务器中安装拦截器,不仅简单方便,还可以使得配置修改实时生效。调用服务器接收所述测试桩服务器反馈的与调用请求对应的配置结果,并根据配置结果生成请求结果发送至客户端,使得对调用请求的处理全部由测试桩服务器进行,由于测试桩服务器与线上环境无关,因此,可以避免因配置问题产生的运维事故,且调用请求都发送至测试桩服务器,便于管理,发生问题后便于查找问题。只需要对测试桩服务器进行变更,就可以实现调用请求的配置结果变更,也使得变更更加可控。The method and system for configurable test stub service provided by the embodiment of the present invention obtains the service request of the hypertext transfer protocol sent by the client by calling the server, generates a call request and sends the call request to the test stub according to the modified configuration file The server does not need to install an interceptor in the calling server, which is not only simple and convenient, but also makes the configuration modification take effect in real time. The invocation server receives the configuration result corresponding to the invocation request fed back by the test stub server, and generates a request result according to the configuration result and sends it to the client, so that all processing of the invocation request is performed by the test stub server. The environment is irrelevant, therefore, operation and maintenance accidents caused by configuration problems can be avoided, and all call requests are sent to the test stub server, which is easy to manage and easy to find problems after they occur. Only by changing the test stub server, the configuration result of the call request can be changed, which also makes the change more controllable.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本发明的其它特征、目的和优点将会变得更明显:Other characteristics, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1为本发明实施例一提供的一种可配置测试桩服务的方法的流程图;FIG. 1 is a flow chart of a method for configuring a test stub service provided by Embodiment 1 of the present invention;
图2为本发明实施例二提供的一种可配置测试桩服务的方法的流程图;FIG. 2 is a flow chart of a method for configuring a test stub service provided by Embodiment 2 of the present invention;
图3为本发明实施例三提供的一种可配置测试桩服务的方法中的测试桩服务器输出配置结果至调用服务器的流程图;3 is a flow chart of the test stub server outputting the configuration result to the calling server in a method for configuring the test stub service provided by Embodiment 3 of the present invention;
图4为本发明实施例提供的一种可配置测试桩服务的方法中的测试桩服务器解析调用请求的流程图;FIG. 4 is a flow chart of the test stub server parsing and invoking requests in a method for configuring a test stub service provided by an embodiment of the present invention;
图5为本发明实施例四提供的一种可配置测试桩服务的方法的流程图;FIG. 5 is a flow chart of a method for configuring a test stub service provided by Embodiment 4 of the present invention;
图6为本发明实施例提供的一种可配置测试桩服务的方法中的测试桩服务器解析调用请求的流程图;FIG. 6 is a flow chart of the test stub server parsing and invoking requests in a method for configurable test stub services provided by an embodiment of the present invention;
图7为本发明实施例五提供的一种可配置测试桩服务的系统的结构示意图。FIG. 7 is a schematic structural diagram of a system for configuring test stub services provided by Embodiment 5 of the present invention.
具体实施方式detailed description
下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。The present invention 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 the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only parts related to the present invention are shown in the drawings but not all content.
实施例一Embodiment one
图1为本发明实施例一提供的一种可配置测试桩服务的方法的流程图。本实施例适用于对客户端发送的服务请求进行拦截处理的情况。本实施例提供的可配置测试桩服务的方法可由可配置测试桩服务的系统来执行,该系统可以由软件和/或硬件来实现,并集成在对应的终端设备中。如图1所示,该方法包括:FIG. 1 is a flow chart of a method for configuring a test stub service provided by Embodiment 1 of the present invention. This embodiment is applicable to the case of intercepting and processing the service request sent by the client. The method for configurable test stub service provided in this embodiment can be executed by a system for configurable test stub service, and the system can be implemented by software and/or hardware, and integrated into a corresponding terminal device. As shown in Figure 1, the method includes:
S110、调用服务器获取客户端发送的超文本传输协议的服务请求,并根据所述服务请求生成相应的调用请求。S110. Invoke the server to acquire the service request of the hypertext transfer protocol sent by the client, and generate a corresponding invocation request according to the service request.
示例性的,客户端可以为客户持有的终端设备,例如台式电脑、笔记本电脑、平板电脑、手机等。客户端可以通过浏览器等应用程序显示网页服务器或文件系统的超文本标记语言内容,并让用户与这些文件交互。客户端发出的服务请求为用户通过浏览器等应用程序输入的,并经过客户端特定处理生成遵循超文本传输协议的请求,具体特定处理的方式可以根据实际情况进行设定。调用服务器为可以接收客户端发送的服务请求,并通过解析接收的服务请求调用相关的其他服务器的相关服务生成相应的调用请求的设备。每台调用服务器可以接收至少一台客户端发送的服务请求。调用请求可以为调用服务器解析接收到的服务请求后,生成的可以发送至目标网络服务器的请求,可以包括调用目标网络服务器的统一资源定位符和IP地址、调用服务的具体内容等数据。其中,调用服务器解析服务请求生成相应的调用请求的具体方式可以根据实际情况进行设定,这里不作任何的限定。Exemplarily, the client may be a terminal device held by the customer, such as a desktop computer, a notebook computer, a tablet computer, a mobile phone, and the like. Clients can display HTML content of web servers or file systems through applications such as browsers, and allow users to interact with these files. The service request sent by the client is input by the user through an application program such as a browser, and is processed by the client to generate a request following the hypertext transfer protocol. The specific processing method can be set according to the actual situation. The calling server is a device that can receive the service request sent by the client, and generate a corresponding calling request by parsing the received service request and calling related services of other servers. Each invocation server can receive service requests sent by at least one client. The invocation request can be a request that can be sent to the target web server generated after the invocation server parses the received service request, and can include data such as the Uniform Resource Locator and IP address of the invocation target web server, and the specific content of the invocation service. Wherein, the specific manner of invoking the server to resolve the service request and generate the corresponding invocation request can be set according to the actual situation, and is not limited here.
S120、所述调用服务器修改配置文件,并根据修改后的配置文件将所述调用请求发送至测试桩服务器。S120. The calling server modifies the configuration file, and sends the calling request to the test stub server according to the modified configuration file.
示例性的,调用服务器获取调用请求后,读取操作系统中的配置文件,按照配置文件的数据将调用请求发送至目标设备,其中配置文件为存储在调用服务器的操作系统中的、包含特定数据的文件,例如hosts文件,可以包含网络服务器域名和IP地址映射关系等内容。调用服务器对配置文件进行修改,确保根据修改后的配置文件可以将调用请求发送至测试桩服务器。测试桩服务器为可以执行特定测试功能的服务器。优选的,本实施例中的测试桩服务器可以解析调用请求,并在数据库中查找跟调用请求相关的配置生成配置结果。同一调用服务器可以接收不同的服务请求并生成不同的调用请求,但是参考同一配置文件进行调用请求的后续处理,因此需要说明的是,本步骤中调用服务器对配置文件进行修改不局限于在生成某一调用请求之后,也可以在接收到客户端发送的服务请求之前,或者是根据实际需要实时修改配置文件。Exemplarily, after the invocation server obtains the invocation request, it reads the configuration file in the operating system, and sends the invocation request to the target device according to the data in the configuration file, wherein the configuration file is stored in the invocation server's operating system and contains specific data The file, such as the hosts file, can contain content such as the domain name of the network server and the mapping relationship between the IP address. Call the server to modify the configuration file to ensure that the call request can be sent to the test stub server according to the modified configuration file. The test stub server is a server that can perform specific test functions. Preferably, the test stub server in this embodiment can parse the invocation request, and search the database for the configuration related to the invocation request to generate a configuration result. The same invocation server can receive different service requests and generate different invocation requests, but refer to the same configuration file for subsequent processing of the invocation request. Therefore, it should be noted that the modification of the configuration file by the invocation server in this step is not limited to After calling the request, before receiving the service request sent by the client, or modify the configuration file in real time according to actual needs.
S130、所述调用服务器接收所述测试桩服务器反馈的与所述调用请求相应的配置结果,并根据所述配置结果生成相应的服务结果并传送至所述客户端。S130. The invocation server receives the configuration result corresponding to the invocation request fed back by the test stub server, generates a corresponding service result according to the configuration result, and transmits it to the client.
示例性的,所述配置结果为预先设定的针对不同调用请求的模拟响应结果。其中模拟响应结果可以是设定的错误结果,不同的调用请求可能对应不同的模拟响应结果。当调用服务器接收到测试桩服务器反馈的配置结果时,表示测试桩服务器接收到了调用请求并进行响应生成了配置结果。调用服务器接收到配置结果后,对配置结果进行解析生成相应的服务结果。其中,调用服务器可以根据配置结果调用相关的其他服务器的服务生成客户端可以响应的服务结果,调用服务器具体的解析和调用方式可以根据实际情况进行设定,这里不作限定。客户端根据接收到的服务结果进行响应,若服务结果为错误结果时,可以根据客户端对错误结果的响应结果测试出客户端对于错误结果的处理能力。需要说明的是,调用服务器对接收到的配置结果进行分析后认为该配置结果可以不发送至客户端,此时调用服务器可以不将测试桩服务器反馈的结果发送至客户端,而是调用服务器自行分析处理,可以确定调用服务器对于配置结果的处理能力。Exemplarily, the configuration result is a preset simulated response result for different call requests. The simulated response result may be a set error result, and different call requests may correspond to different simulated response results. When the invocation server receives the configuration result fed back by the test stub server, it means that the test stub server has received the invocation request and responded to generate the configuration result. After the calling server receives the configuration result, it parses the configuration result to generate the corresponding service result. Wherein, the calling server can call the services of other related servers according to the configuration result to generate the service result that the client can respond to. The specific parsing and calling methods of the calling server can be set according to the actual situation, which is not limited here. The client responds according to the received service result. If the service result is an error result, the client's ability to handle the error result can be tested according to the client's response to the error result. It should be noted that after analyzing the received configuration results, the invoking server believes that the configuration results may not be sent to the client. At this time, the invoking server may not send the results fed back by the test stub server to the client, but the invoking server itself Analysis processing can determine the processing capability of the calling server for the configuration result.
本发明实施例一提供的可配置测试桩服务的方法,调用服务器可以通过解析获取的服务请求生成相应的调用请求,并根据修改后的配置文件将所述调用请求发送至测试桩服务器,并接收测试桩服务器反馈的相应的配置结果,进行后续的处理。这样,既不需要在调用服务器中安装拦截器,还可以通过修改调用服务器的配置文件使得配置修改实时生效,并可以避免因配置问题产生的运维事故。调用请求都发送至测试桩服务器,便于管理,发生问题后便于查找问题。In the method of configurable test stub service provided by Embodiment 1 of the present invention, the invocation server can generate a corresponding invocation request by parsing the obtained service request, and send the invocation request to the test stub server according to the modified configuration file, and receive The corresponding configuration results fed back by the test stub server are used for subsequent processing. In this way, there is no need to install an interceptor in the calling server, and the configuration modification can take effect in real time by modifying the configuration file of the calling server, and can avoid operation and maintenance accidents caused by configuration problems. Call requests are sent to the test pile server, which is easy to manage and easy to find problems after they occur.
进一步的,本实施例提供的可配置测试桩服务的方法还可以包括:Further, the method for configuring the test stub service provided by this embodiment may also include:
所述测试桩服务器接收所述调用服务器发送的调用请求,根据所述调用请求输出相应的配置结果至所述调用服务器。The test stub server receives the invocation request sent by the invocation server, and outputs a corresponding configuration result to the invocation server according to the invocation request.
示例性的,测试桩服务器接收调用请求后,对调用请求进行解析得到与调用请求相应的配置结果,并将所述配置结果发送至所述调用服务器,模拟目标网络服务器完成了对调用请求的响应。这样仅需要对测试桩服务器进行变更,就可以实现对调用请求的配置结果变更,也使得变更更加可控。Exemplarily, after the test stub server receives the invocation request, it parses the invocation request to obtain a configuration result corresponding to the invocation request, and sends the configuration result to the invocation server, simulating that the target network server completes the response to the invocation request . In this way, only the test stub server needs to be changed to change the configuration result of the call request, which also makes the change more controllable.
实施例二Embodiment two
图2为本发明实施例二提供的一种可配置测试桩服务的方法的流程图。本实施例在实施例一的基础上,对所述调用服务器修改配置文件,并根据修改后的配置文件将所述调用请求发送至测试桩服务器进行了优化。参考图2,该方法包括:FIG. 2 is a flowchart of a method for configuring a test stub service provided by Embodiment 2 of the present invention. Based on the first embodiment, this embodiment modifies the configuration file of the calling server, and optimizes sending the calling request to the test stub server according to the modified configuration file. Referring to Figure 2, the method includes:
S210、调用服务器获取客户端发送的超文本传输协议的服务请求,并根据所述服务请求生成相应的调用请求。S210, invoking the server to acquire the service request of the hypertext transfer protocol sent by the client, and generating a corresponding invocation request according to the service request.
S220、所述调用服务器获取IP地址添加指令。S220. The invoking server acquires an IP address addition instruction.
示例性的,调用服务器获取IP地址添加指令可以是获取本调用服务器发出的IP地址添加指令,也可以是获取与调用服务器进行数据交互的其他设备发出的IP地址添加指令,其他设备优选为配置服务器,其中配置服务器为具备数据和/或文件管理功能的硬件服务器。优选为调用服务器获取配置服务器发出的IP地址添加指令。采用配置服务器向调用服务器发送IP地址添加指令的好处为:当系统中调用服务器的数量过多时,由配置服务器统一管理各调用服务器的配置文件的修改,可以节省修改时间,提升修改的效率。配置服务器可以通过可视化窗口获取IP地址添加指令后将该IP地址添加指令发送至调用服务器,其中,可视化窗口为展示在屏幕上可以观看的窗口。配置服务器也可以按照特定规则生成IP地址添加指令,并将该IP地址添加指令发送至调用服务器。IP地址添加指令中可以包含调用请求发送的目标设备的IP地址和该IP地址的添加方式。目标设备为可以接收并解析调用请求的设备,但不局限于目标网络服务器。优选的,目标设备为测试桩服务器,IP地址为测试桩服务器的IP地址。调用服务器获取IP地址添加指令的时间顺序不作限定,即调用服务器可以实时获取IP地址添加指令。Exemplarily, the call server to obtain the IP address addition instruction may be to obtain the IP address addition instruction issued by the call server, or to obtain the IP address addition instruction issued by other devices that interact with the call server for data. The other devices are preferably configuration servers , where the configuration server is a hardware server with data and/or file management functions. Preferably, an instruction is added for invoking the server to obtain the IP address issued by the configuration server. The advantage of using the configuration server to send IP address addition instructions to the calling server is: when there are too many calling servers in the system, the configuration server will uniformly manage the modification of the configuration files of each calling server, which can save modification time and improve modification efficiency. The configuration server may obtain the IP address addition instruction through the visualization window and then send the IP address addition instruction to the calling server, wherein the visualization window is a window displayed on the screen and viewable. The configuration server may also generate an IP address addition instruction according to specific rules, and send the IP address addition instruction to the calling server. The IP address adding instruction may include the IP address of the target device sent by the calling request and the way of adding the IP address. The target device is a device that can receive and parse the call request, but is not limited to the target network server. Preferably, the target device is a test stub server, and the IP address is the IP address of the test stub server. There is no limitation on the time sequence for invoking the server to obtain the IP address addition instruction, that is, the invocation server can obtain the IP address addition instruction in real time.
S230、所述调用服务器根据所述IP地址添加指令,在所述配置文件中添加测试桩服务器的IP地址。S230. The calling server adds the IP address of the test stub server to the configuration file according to the IP address adding instruction.
示例性的,调用服务器根据IP地址添加指令,在配置文件中添加测试桩服务器的IP地址,优选的,在配置文件的目标网络服务器的域名前或后添加所述IP地址,优选为在目标网络服务器的域名后添加IP地址。若配置文件中已经存在其他目标设备的IP地址,则此时可以根据获取的IP地址添加指令,用新获取的IP地址替换配置文件中的原有的IP地址。进一步的,调用服务器可以将添加IP地址的过程通过可视化窗口进行展示,便于用户观看和手动在添加过程中进行修改。Exemplarily, the calling server adds the IP address of the test stub server in the configuration file according to the IP address addition instruction, preferably, the IP address is added before or after the domain name of the target network server in the configuration file, preferably in the target network Add the IP address after the domain name of the server. If the IP address of other target devices already exists in the configuration file, you can add an instruction according to the obtained IP address at this time, and replace the original IP address in the configuration file with the newly obtained IP address. Further, the calling server can display the process of adding the IP address through a visual window, which is convenient for the user to watch and manually modify during the adding process.
S240、所述调用服务器根据所述IP地址将所述调用请求发送至测试桩服务器。S240. The calling server sends the calling request to a test stub server according to the IP address.
示例性的,若在配置文件中添加测试桩服务器的IP地址,则调用服务器在发送调用请求时,就会根据配置文件中的IP地址将所述调用请求发送至测试桩服务器。其中,测试桩服务器IP地址的具体设定方式可以根据实际情况进行设定。Exemplarily, if the IP address of the test stub server is added in the configuration file, when the invocation server sends the invocation request, it will send the invocation request to the test stub server according to the IP address in the configuration file. Wherein, the specific setting method of the IP address of the test stub server may be set according to the actual situation.
S250、所述调用服务器接收所述测试桩服务器反馈的与所述调用请求相应的配置结果,并根据所述配置结果生成相应的服务结果并传送至所述客户端。S250. The invocation server receives the configuration result fed back by the test stub server corresponding to the invocation request, generates a corresponding service result according to the configuration result, and transmits it to the client.
本发明实施例二提供的可配置测试桩服务的方法,调用服务器在获取调用请求后,根据IP地址添加指令,在所述配置文件中添加测试桩服务器的IP地址,使得调用服务器将所述调用请求发送至测试桩服务器,等接收到测试桩服务器反馈的配置结果时进行响应。这样可以使得调用请求全部被发送到测试桩服务器,由于测试桩服务器与线上环境无关,因此,可以避免因配置问题产生的运维事故,且便于管理,发生问题后便于查找问题。In the method of configurable test stub service provided by Embodiment 2 of the present invention, after the call server obtains the call request, it adds an instruction according to the IP address, and adds the IP address of the test stub server in the configuration file, so that the call server will call the Send the request to the test stub server, and respond when the configuration result fed back by the test stub server is received. In this way, all call requests can be sent to the test stub server. Since the test stub server has nothing to do with the online environment, operation and maintenance accidents caused by configuration problems can be avoided, and it is easy to manage and find problems after they occur.
实施例三Embodiment three
图3为本发明实施例三提供的一种可配置测试桩服务的方法中的测试桩服务器输出配置结果至调用服务器的流程图。本实施例在实施例一的基础上,对所述测试桩服务器接收所述调用服务器发送的调用请求,根据所述调用请求输出相应的配置结果至所述调用服务器的步骤进行优化。如图3所示,该可配置测试桩服务的方法中的测试桩服务器输出配置结果至调用服务器包括:FIG. 3 is a flow chart of the test stub server outputting configuration results to the calling server in a method for configuring a test stub service provided by Embodiment 3 of the present invention. In this embodiment, on the basis of the first embodiment, the test stub server receives the invocation request sent by the invocation server, and outputs a corresponding configuration result to the invocation server according to the invocation request to optimize the steps. As shown in Figure 3, the output configuration result of the test stub server in the method for configuring the test stub service to the calling server includes:
S310、所述测试桩服务器接收所述调用服务器发送的调用请求。S310. The test stub server receives the invocation request sent by the invocation server.
示例性的,所述测试桩服务器可以实时接收至少一台调用服务器发送的全部的调用请求。Exemplarily, the test stub server can receive all invocation requests sent by at least one invocation server in real time.
S320、所述测试桩服务器查看是否存在与所述调用请求相关的配置,若存在,则按照所述配置输出相应的配置结果至所述调用服务器,否则,将所述调用请求发送至目标网络服务器。S320. The test stub server checks whether there is a configuration related to the invocation request, and if so, outputs the corresponding configuration result to the invocation server according to the configuration, otherwise, sends the invocation request to the target network server .
示例性的,在测试桩服务器接收到调用请求后,查看数据库中是否存在与所述调用请求相关的配置,若存在,则输出相应的配置结果至调用服务器。若测试桩服务器中没有与调用请求相关的配置,则将所述调用请求发送至外部接口,通过外部接口发送至目标网络服务器。其中,数据库可以配置在测试桩服务器中,也可以配置在其它服务器中。若数据库配置在测试桩服务器中,则测试桩服务器在查看是否存在与调用请求相关的配置时,直接访问配置在测试桩服务器中的数据库。若数据库配置在其他服务器中,则测试桩服务器需要访问其他服务器,并在其他服务器的数据库中查看是否存在匹配的数据。数据库中数据的写入和/或存储的类型可以通过配置服务器进行控制。优选的,参考图4,该步骤可以包括:Exemplarily, after the test stub server receives the invocation request, it checks whether there is a configuration related to the invocation request in the database, and if so, outputs the corresponding configuration result to the invocation server. If there is no configuration related to the invocation request in the test stub server, the invocation request is sent to the external interface, and then sent to the target network server through the external interface. Wherein, the database can be configured in the test stub server or in other servers. If the database is configured in the test stub server, the test stub server directly accesses the database configured in the test stub server when checking whether there is a configuration related to the call request. If the database is configured in other servers, the test stub server needs to access other servers, and check whether there is matching data in the databases of other servers. The type of writing and/or storage of data in the database can be controlled through the configuration server. Preferably, referring to Fig. 4, this step may include:
S321、所述测试桩服务器解析所述调用请求中的调用域名。S321. The test stub server resolves the calling domain name in the calling request.
示例性的,调用域名可以包括确定目标网络服务器的统一资源定位符和目标网络服务器的IP地址。测试桩服务器接收到调用请求后,解析调用请求中的调用域名,即得到目标网络服务器的统一资源定位符和IP地址。Exemplarily, invoking the domain name may include determining the Uniform Resource Locator of the target web server and the IP address of the target web server. After receiving the invocation request, the test stub server parses the invocation domain name in the invocation request to obtain the uniform resource locator and IP address of the target network server.
S322、所述测试桩服务器查看数据库中是否存在与所述调用域名相应的域名配置。S322. The test stub server checks whether there is a domain name configuration corresponding to the calling domain name in the database.
示例性的,测试桩服务器查看的数据库中预先存储了一定数量的调用域名。当解析调用请求中的调用域名后,测试桩服务器在数据库中查看是否存有相同的调用域名,即查看数据库中是否存在与调用请求的调用域名相应的域名配置。测试桩服务器可以设定查看数据库中是否存在与调用域名中的目标网络服务器的统一资源定位符和IP地址全部匹配的配置,也可以设定查看数据库中只存在与调用域名中的目标网络服务器的统一资源定位符或IP地址中任一项匹配的配置,具体的设定方式可以根据实际情况进行设定。其中,查看结果若是数据库中存在与所述调用域名相应的域名配置,则执行S323,若数据库中不存在与所述调用域名相应的域名配置,则执行S325。Exemplarily, a certain number of invocation domain names are pre-stored in the database viewed by the test stub server. After parsing the invocation domain name in the invocation request, the test stub server checks whether the same invocation domain name exists in the database, that is, checks whether there is a domain name configuration corresponding to the invocation domain name in the invocation request in the database. The test stub server can be set to check whether there is a configuration in the database that matches the uniform resource locator and IP address of the target web server in the calling domain name, or it can be set to check whether there are only configurations in the database that match the target web server in the calling domain name For the configuration matching any one of the uniform resource locator or the IP address, the specific setting method can be set according to the actual situation. Wherein, if there is a domain name configuration corresponding to the called domain name in the database, execute S323, and if there is no domain name configuration corresponding to the called domain name in the database, execute S325.
S323、若存在与所述调用域名相应的域名配置,则所述测试桩服务器解析所述调用请求中的调用服务类型。S323. If there is a domain name configuration corresponding to the invocation domain name, the test stub server analyzes the invocation service type in the invocation request.
示例性的,若查看结果为数据库中存在与所述调用域名相应的域名配置,则测试桩服务器继续解析调用请求中的调用服务类型。其中,调用服务类型为调用目标网络服务器提供服务的类型,例如打开目标网络服务器的首页,或者播放视频等服务。Exemplarily, if the check result shows that there is a domain name configuration corresponding to the invocation domain name in the database, the test stub server continues to analyze the invocation service type in the invocation request. Wherein, the invocation service type is a service type provided by the invocation target network server, such as opening a home page of the target network server, or playing a video and other services.
S324、所述测试桩服务器查看所述数据库中是否存在与所述调用服务类型相应的服务配置,若存在,则按照预设模板,输出与所述调用请求相应的配置结果至所述调用服务器,否则,将所述调用请求发送至所述目标网络服务器。S324. The test stub server checks whether there is a service configuration corresponding to the invocation service type in the database, and if so, outputs a configuration result corresponding to the invocation request to the invocation server according to a preset template, Otherwise, send the calling request to the target network server.
示例性的,测试桩服务器查看的数据库中预先存储了一定数量的调用服务类型,每个调用服务类型都对应特定的预设模板,其中不同的预设模板可以生成不同的配置结果。当测试桩服务器查看的数据库中存在与调用请求中调用域名相应的配置,则继续查看数据库中是否存在与该调用请求相同的调用服务类型,即数据库中是否存在与调用请求中调用服务类型相应的服务配置。若存在相应的服务配置,则测试桩服务器获取该调用服务类型对应的预设模板,按照预设模板生成并输出相应的配置结果至所述调用服务器,其中,所述配置结果为模拟响应结果。若数据库中不存在与调用请求的配置文件中调用服务类型相应的服务配置,则测试桩服务器将所述调用请求发送至外部接口,通过所述外部接口发送至目标网络服务器。其中外部接口为测试桩服务器与其他服务器数据传输的接口,优选为测试桩服务器与网络服务器数据传输的接口。Exemplarily, a certain number of invocation service types are pre-stored in the database viewed by the test stub server, and each invocation service type corresponds to a specific preset template, wherein different preset templates can generate different configuration results. When the database viewed by the test stub server has a configuration corresponding to the calling domain name in the calling request, it will continue to check whether there is the same calling service type as the calling request in the database, that is, whether there is a configuration corresponding to the calling service type in the calling request in the database. Service configuration. If there is a corresponding service configuration, the test stub server obtains a preset template corresponding to the invocation service type, generates and outputs a corresponding configuration result to the invocation server according to the preset template, wherein the configuration result is a simulated response result. If there is no service configuration corresponding to the invocation service type in the configuration file of the invocation request in the database, the test stub server sends the invocation request to an external interface, and then sends the invocation request to the target network server through the external interface. The external interface is an interface for data transmission between the test stub server and other servers, preferably an interface for data transmission between the test stub server and the network server.
S325、若不存在与所述调用域名相应的域名配置,则所述测试桩服务器将所述调用请求发送至所述目标网络服务器。S325. If there is no domain name configuration corresponding to the calling domain name, the test stub server sends the calling request to the target network server.
示例性的,若测试桩服务器查看的数据库中不存在与调用请求中调用域名相应的域名配置,则将所述调用请求发送至外部接口,并由所述外部接口发送至目标网络服务器。目标网络服务器接收到调用请求后,反馈响应结果至外部接口,并通过外部接口发送至调用服务器,由调用服务器解析生成服务结果。也可以由目标网络服务器接收到调用请求后,直接反馈结果至调用服务器,由调用服务器解析生成服务结果。Exemplarily, if the database viewed by the test stub server does not have a domain name configuration corresponding to the calling domain name in the calling request, the calling request is sent to the external interface, and then sent to the target network server by the external interface. After receiving the invocation request, the target network server feeds back the response result to the external interface, and sends it to the invocation server through the external interface, and the invocation server parses and generates a service result. Alternatively, the target network server may directly feed back the result to the invocation server after receiving the invocation request, and the invocation server parses and generates a service result.
本发明实施例三提供的可配置测试桩服务的方法,测试桩服务器解析接收的调用请求并查看数据库中是否有与调用请求相应的配置,若数据库中分别存在与调用请求的调用域名和调用服务类型相应的配置,则测试桩服务器按照预设模板生成并输出对应的配置结果至调用服务器,若数据库中不存在与所述调用请求的配置文件中的调用域名或调用服务类型相应的配置,则测试桩服务器将所述调用请求发送至目标网络服务器。使得对调用请求的处理全部由测试桩服务器进行,由于测试桩服务器与线上环境无关,就避免了因配置问题产生的运维事故,且测试桩服务器对调用请求进行分流处理,便于管理,发生问题后便于查找问题。In the method of configurable test stub service provided by Embodiment 3 of the present invention, the test stub server parses the received call request and checks whether there is a configuration corresponding to the call request in the database. type corresponding to the configuration, the test stub server will generate and output the corresponding configuration results to the invocation server according to the preset template, if there is no configuration corresponding to the invocation domain name or invocation service type in the configuration file of the invocation request in the database, then The test stub server sends the call request to the target network server. All the processing of call requests is carried out by the test stub server. Since the test stub server has nothing to do with the online environment, operation and maintenance accidents caused by configuration problems are avoided, and the test stub server performs shunt processing of call requests, which is convenient for management. It is easy to find the problem after the problem.
实施例四Embodiment Four
图5为本发明实施例四提供的一种可配置测试桩服务的方法的流程图。本实施例为一优选示例。参考图5,该方法包括:FIG. 5 is a flowchart of a method for configuring a test stub service provided by Embodiment 4 of the present invention. This embodiment is a preferred example. Referring to Figure 5, the method includes:
S510、xxxService发起请求调用api.yyy.com/service服务。S510, xxxService initiates a request to call the api.yyy.com/service service.
示例性的,xxxService为客户端,api.yyy.com/service为特定网络服务器端的第三方服务。Exemplarily, xxxService is a client, and api.yyy.com/service is a third-party service on a specific network server.
S520、修改调用服务器的hosts文件。S520. Modify the hosts file of the calling server.
示例性的,hosts文件为调用服务器的操作系统中的配置文件,可以通过可视化窗口修改调用服务器的hosts文件。修改的方式为从配置服务器中获取测试桩服务器IP地址添加指令并在host文件中增加测试桩服务器的IP地址。例如,api.yyy.com192.168.6.66。即在api.yyy.com/service的统一资源定位符(UniformResoureLocator,URL)api.yyy.com后添加192.168.6.66,其中192.168.6.66为测试桩服务器的IP地址,其中,api.yyy.com为预先存储在配置文件中的第三方服务的URL。需要说明的是,该步骤可以放在S510之前。Exemplarily, the hosts file is a configuration file in the operating system of the calling server, and the hosts file of the calling server can be modified through a visualization window. The modification method is to add an instruction to obtain the IP address of the test stub server from the configuration server and add the IP address of the test stub server to the host file. For example, api.yyy.com192.168.6.66. That is, add 192.168.6.66 after the uniform resource locator (UniformResoureLocator, URL) api.yyy.com of api.yyy.com/service, where 192.168.6.66 is the IP address of the test stub server, where api.yyy.com is The URL of the third-party service pre-stored in the configuration file. It should be noted that this step can be placed before S510.
S530、调用服务器接收xxxService发起请求调用api.yyy.com/service服务,并生成相应的调用请求转发到测试桩服务器。S530. The calling server receives a request from xxxService to call the api.yyy.com/service service, generates a corresponding calling request and forwards it to the test stub server.
示例性的,调用服务器接收到xxxService发起的调用api.yyy.com/service服务的请求后,对该服务请求进行解析处理后生成相应的调用请求。由于在配置文件中增加测试桩服务器的IP地址,调用服务器可以根据该IP地址,将所述调用请求发送至测试桩服务器。Exemplarily, after the invocation server receives the request for invoking the api.yyy.com/service service initiated by xxxService, it parses and processes the service request and generates a corresponding invocation request. Since the IP address of the test stub server is added to the configuration file, the invocation server can send the invocation request to the test stub server according to the IP address.
S540、测试桩服务器收到调用请求后,对比数据库中的配置,如在数据库中有相关配置,则将数据库中的配置作为结果返回,否则直接访问外部系统。S540. After receiving the invocation request, the test stub server compares the configuration in the database, and returns the configuration in the database as a result if there is a relevant configuration in the database, otherwise accesses the external system directly.
示例性的,若数据库中没有与调用请求相关的配置,则测试桩服务器将所述调用请求通过外部接口发送至外部系统,外部系统可以为api.yyy.com对应的网络服务器。参考图6,该步骤包括:Exemplarily, if there is no configuration related to the call request in the database, the test stub server sends the call request to an external system through an external interface, and the external system may be a web server corresponding to api.yyy.com. With reference to Fig. 6, this step comprises:
S541、测试桩服务器接收调用请求。S541. The test stub server receives the calling request.
S542、测试桩服务器根据URL、IP地址查询数据库。S542. The test stub server queries the database according to the URL and the IP address.
示例性的,根据调用请求中的URL和IP地址在数据库中查询相应的配置。如果没有相关配置,则执行S543,如果有相关配置,则执行S544。Exemplarily, the corresponding configuration is queried in the database according to the URL and IP address in the call request. If there is no relevant configuration, execute S543, and if there is relevant configuration, execute S544.
S543、如果没有相关配置,测试桩服务器直接调用外部接口。S543. If there is no relevant configuration, the test stub server directly invokes the external interface.
示例性的,若数据库中没有与调用请求的URL和IP地址相应的配置,则将所述调用请求发送至外部接口,通过外部接口发送至外部设备。Exemplarily, if there is no configuration corresponding to the URL and IP address of the invocation request in the database, the invocation request is sent to the external interface, and then sent to the external device through the external interface.
S544、如果有相关配置,测试桩服务器判断是否与调用服务类型匹配。S544. If there is a relevant configuration, the test stub server judges whether it matches the calling service type.
示例性的,如果数据库中存在与调用请求的URL和IP地址相应的配置,则测试桩服务器判断数据库中是否存在与调用请求的调用服务类型相匹配的配置。如果数据库中存在与调用服务类型匹配的配置,则执行S546,否则执行S545。Exemplarily, if there is a configuration corresponding to the URL and IP address of the invocation request in the database, the test stub server determines whether there is a configuration in the database that matches the invocation service type of the invocation request. If there is a configuration matching the calling service type in the database, execute S546, otherwise execute S545.
S545、如果与调用服务类型不匹配,则测试桩服务器直接调用外部接口。S545. If it does not match the calling service type, the test stub server directly calls the external interface.
示例性的,如果不匹配,则测试桩服务器将所述调用请求发送至外部接口,通过外部接口发送至外部设备。Exemplarily, if they do not match, the test stub server sends the call request to the external interface, and sends it to the external device through the external interface.
S546、如果与调用服务类型匹配,则测试桩服务器解析参数用于填充模板。S546. If the parameter matches the invocation service type, the test stub server parses the parameters to fill the template.
示例性的,如果数据库中存在与调用服务类型相应的配置,则测试桩服务器解析配置对应的参数,并将解析的参数填充于模板中。Exemplarily, if there is a configuration corresponding to the calling service type in the database, the test stub server parses the parameters corresponding to the configuration, and fills the parsed parameters in the template.
S547、根据模板生成配置结果。S547. Generate a configuration result according to the template.
示例性的,测试桩服务器根据模板中的参数生成配置结果。Exemplarily, the test stub server generates configuration results according to the parameters in the template.
S548、结果返回调用方,流程结束。S548. The result is returned to the caller, and the process ends.
示例性的,将所述配置结果反馈给发出调用请求的调用方,即调用服务器,流程结束。Exemplarily, the configuration result is fed back to the caller that sends the call request, that is, the call server, and the process ends.
本发明实施例四提供的可配置测试桩服务的方法,通过调用服务器修改配置文件,将所述调用请求发送至测试桩服务器,若测试桩服务器查看的数据库中存在与调用请求相应的配置,则输出配置结果至调用方,如果测试桩服务器查看的数据库中没有与调用请求相应的配置,则将所述调用请求发送至外部设备,使得调用服务器无需设置拦截器,且便于管理,可以避免运维事故。In the method for configurable test stub service provided by Embodiment 4 of the present invention, the call request is sent to the test stub server by invoking the server to modify the configuration file. If there is a configuration corresponding to the call request in the database viewed by the test stub server, then Output the configuration result to the caller. If there is no configuration corresponding to the call request in the database viewed by the test stub server, the call request will be sent to the external device, so that the call server does not need to set an interceptor, and it is easy to manage and can avoid operation and maintenance ACCIDENT.
实施例五Embodiment five
图7为本发明实施例五提供的一种可配置测试桩服务的系统的结构示意图,如图7所示,所述系统包括调用服务器701和测试桩服务器702。FIG. 7 is a schematic structural diagram of a system for configuring test stub services provided by Embodiment 5 of the present invention. As shown in FIG. 7 , the system includes an invocation server 701 and a test stub server 702 .
其中,所述调用服务器701可以包括:请求获取模块,用于获取客户端发送的超文本传输协议的服务请求,并根据所述服务请求生成相应的调用请求;修改模块,用于修改配置文件,并根据修改后的配置文件将所述调用请求发送至测试桩服务器702;接收模块,用于接收所述测试桩服务器702反馈的与所述调用请求相应的配置结果,并根据所述配置结果生成相应的服务结果并传送至所述客户端。Wherein, the invocation server 701 may include: a request acquisition module, configured to acquire a hypertext transfer protocol service request sent by the client, and generate a corresponding invocation request according to the service request; a modification module, configured to modify the configuration file, And according to the modified configuration file, the call request is sent to the test stub server 702; the receiving module is used to receive the configuration result corresponding to the call request fed back by the test stub server 702, and generate a configuration result according to the configuration result The corresponding service result is sent to the client.
进一步的,所述修改模块可以包括:指令获取单元,用于获取IP地址添加指令;地址添加单元,用于根据所述IP地址添加指令,在所述配置文件中添加测试桩服务器702的IP地址;发送单元,用于根据所述IP地址将所述调用请求发送至所述测试桩服务器702。Further, the modification module may include: an instruction acquisition unit, configured to acquire an IP address addition instruction; an address addition unit, configured to add an instruction according to the IP address, and add the IP address of the test stub server 702 in the configuration file a sending unit, configured to send the call request to the test stub server 702 according to the IP address.
优选的,所述测试桩服务器702可以包括:输出模块,用于接收所述调用服务器701发送的调用请求,根据所述调用请求输出相应的配置结果至所述调用服务器701。Preferably, the test stub server 702 may include: an output module, configured to receive an invocation request sent by the invocation server 701 , and output a corresponding configuration result to the invocation server 701 according to the invocation request.
进一步的,所述输出模块可以包括:请求接收单元,用于接收所述调用服务器701发送的调用请求;配置单元,用于查看是否存在与所述调用请求相关的配置,若存在,则按照所述配置输出相应的配置结果至所述调用服务器701,否则,将所述调用请求发送至目标网络服务器。Further, the output module may include: a request receiving unit, configured to receive the invocation request sent by the invocation server 701; a configuration unit, configured to check whether there is a configuration related to the invocation request, and if so, follow the The above configuration outputs the corresponding configuration result to the calling server 701, otherwise, sends the calling request to the target network server.
优选的,所述配置单元可以包括:域名确认子单元,用于解析所述调用请求中的调用域名;域名匹配子单元,用于查看数据库中是否存在与所述调用域名相应的域名配置;服务确认子单元,用于若所述数据库中存在与所述调用域名相应的域名配置,则解析所述调用请求中的调用服务类型;服务匹配子单元,用于查看所述数据库中是否存在与所述调用服务类型相应的服务配置,若存在,则按照预设模板,输出与所述调用请求相应的配置结果至所述调用服务器,否则,将所述调用请求发送至所述目标网络服务器;发送子单元,用于若所述数据库中不存在与所述调用域名相应的域名配置,则将所述调用请求发送至所述目标网络服务器。Preferably, the configuration unit may include: a domain name confirmation subunit, configured to resolve the calling domain name in the calling request; a domain name matching subunit, used to check whether there is a domain name configuration corresponding to the calling domain name in the database; The confirmation subunit is used to analyze the calling service type in the calling request if there is a domain name configuration corresponding to the calling domain name in the database; the service matching subunit is used to check whether there is a configuration corresponding to the calling domain name in the database. The service configuration corresponding to the calling service type, if it exists, output the configuration result corresponding to the calling request to the calling server according to the preset template, otherwise, send the calling request to the target network server; send A subunit, configured to send the calling request to the target network server if there is no domain name configuration corresponding to the calling domain name in the database.
上述实施例的基础上,所述配置结果为预先设定的针对不同调用请求的模拟响应结果。On the basis of the above embodiments, the configuration result is a preset simulation response result for different call requests.
本发明实施例五提供的可配置测试桩服务的系统可用于执行上述任意实施例所提供的可配置测试服务的方法,具备执行方法相应的功能模块和有益效果。The system for configurable test stub service provided by Embodiment 5 of the present invention can be used to execute the method for configurable test service provided by any of the above embodiments, and has corresponding functional modules and beneficial effects for executing the method.
注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610123758.3A CN105721251B (en) | 2016-03-04 | 2016-03-04 | A kind of method and system of configurable test pile service |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610123758.3A CN105721251B (en) | 2016-03-04 | 2016-03-04 | A kind of method and system of configurable test pile service |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105721251A true CN105721251A (en) | 2016-06-29 |
CN105721251B CN105721251B (en) | 2019-03-08 |
Family
ID=56157360
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610123758.3A Active CN105721251B (en) | 2016-03-04 | 2016-03-04 | A kind of method and system of configurable test pile service |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105721251B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108460612A (en) * | 2017-02-20 | 2018-08-28 | 腾讯科技(北京)有限公司 | A kind of test method, device and equipment that advertisement is launched |
CN109768951A (en) * | 2018-08-17 | 2019-05-17 | 付东光 | Remote analog data method and remote dummy server |
CN113821430A (en) * | 2020-09-24 | 2021-12-21 | 北京沃东天骏信息技术有限公司 | Multi-service testing method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1988479A (en) * | 2006-12-31 | 2007-06-27 | 金蝶软件(中国)有限公司 | Method for recording system information and object pile |
CN101141328A (en) * | 2007-10-11 | 2008-03-12 | 中兴通讯股份有限公司 | Method and device for simulating Diameter server terminal |
CN103150238A (en) * | 2011-12-07 | 2013-06-12 | 阿里巴巴集团控股有限公司 | Service request processing method, simulation performance test method and simulation performance test device |
-
2016
- 2016-03-04 CN CN201610123758.3A patent/CN105721251B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1988479A (en) * | 2006-12-31 | 2007-06-27 | 金蝶软件(中国)有限公司 | Method for recording system information and object pile |
CN101141328A (en) * | 2007-10-11 | 2008-03-12 | 中兴通讯股份有限公司 | Method and device for simulating Diameter server terminal |
CN103150238A (en) * | 2011-12-07 | 2013-06-12 | 阿里巴巴集团控股有限公司 | Service request processing method, simulation performance test method and simulation performance test device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108460612A (en) * | 2017-02-20 | 2018-08-28 | 腾讯科技(北京)有限公司 | A kind of test method, device and equipment that advertisement is launched |
CN108460612B (en) * | 2017-02-20 | 2023-01-06 | 腾讯科技(北京)有限公司 | Advertisement delivery test method, device and equipment |
CN109768951A (en) * | 2018-08-17 | 2019-05-17 | 付东光 | Remote analog data method and remote dummy server |
CN113821430A (en) * | 2020-09-24 | 2021-12-21 | 北京沃东天骏信息技术有限公司 | Multi-service testing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN105721251B (en) | 2019-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102647482B (en) | Method and system for accessing website | |
CN108512710B (en) | Test method based on test tool and test tool | |
CN111092877B (en) | Data processing method and device, electronic equipment and storage medium | |
CN112073405A (en) | Webpage data loading method and device, computer equipment and storage medium | |
TWI670611B (en) | Web file sending method, webpage rendering method and device, webpage rendering system | |
US8527862B2 (en) | Methods for making ajax web applications bookmarkable and crawlable and devices thereof | |
EP3614643B1 (en) | Oauth2 saml token service | |
US9143378B2 (en) | Rendering components within different browser environments | |
CN106161521B (en) | The processing method and processing device of hypertext transfer protocol requests | |
TWI526028B (en) | A way to implement network access and a web server | |
CN111079048B (en) | Page loading method and device | |
CN109194742B (en) | A virtual machine console connection method, device and storage medium | |
CN112261111A (en) | Method and system for realizing cross-domain access of browser in application program | |
CN104317570B (en) | The apparatus and method of dynamic analysis Web applications | |
JP2015079486A (en) | System and method for configuring field devices | |
CN111475751A (en) | Page picture processing method and device, server and storage medium | |
CN109344351A (en) | Web page loading method, intermediate server and web page loading system | |
US20140245124A1 (en) | System and method thereof for browser agnostic extension models | |
CN110874278A (en) | Embedding method, workflow system, device and storage medium of external system | |
CN110795650A (en) | Webpage opening method and device and computer readable storage medium | |
CN102662838B (en) | The adjustment method of Flash and system in a kind of browser | |
CN105721251A (en) | Reconfigurable testing pile service method and system | |
CN104932910A (en) | Method and system for application program interface extension | |
CN116561013B (en) | Test methods, devices, electronic equipment and media based on the target service framework | |
WO2018081963A1 (en) | Method and device for dns resolution and network system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |