CN109873732B - Test method and device for proxy server - Google Patents

Test method and device for proxy server Download PDF

Info

Publication number
CN109873732B
CN109873732B CN201711269651.0A CN201711269651A CN109873732B CN 109873732 B CN109873732 B CN 109873732B CN 201711269651 A CN201711269651 A CN 201711269651A CN 109873732 B CN109873732 B CN 109873732B
Authority
CN
China
Prior art keywords
test
server
test server
target
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711269651.0A
Other languages
Chinese (zh)
Other versions
CN109873732A (en
Inventor
李一伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711269651.0A priority Critical patent/CN109873732B/en
Publication of CN109873732A publication Critical patent/CN109873732A/en
Application granted granted Critical
Publication of CN109873732B publication Critical patent/CN109873732B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the application discloses a test method and a test device of a proxy server. One embodiment of the method comprises: in response to receiving a test request from a client, selecting a test server with a connection number from at least one test server according to the connection number preset in the test request to obtain a candidate test server set; selecting a candidate test server with the degree of income greater than zero from the candidate test server set as a target test server according to the degree of income of the candidate test server, wherein the degree of income of the candidate test server is the number of test servers from which the received connection requests originate; and selecting the target test server with the largest weight value from the selected target test servers to execute the test. This embodiment improves the testing efficiency.

Description

Test method and device for proxy server
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to the technical field of internet, and particularly relates to a test method and a test device for a proxy server.
Background
Testing is a necessary procedure to ensure that the web site can be used properly. Automated testing is a process that translates human-driven test behavior into machine execution. Generally, after a test case is designed and evaluated, a test is performed according to the procedures described in the test case, resulting in a comparison of the actual results with the expected results.
The existing automatic test generally comprises three stages of preparing a test environment, executing a test script and collecting a test result. Preparing a test environment comprises installing and deploying an object to be tested, installing and deploying a test running environment, and developing, compiling and debugging a test script; the test script execution comprises the steps of preparing a test environment and a test frame, downloading the test script and triggering and executing the test script; collecting test results includes collecting and collating log information.
Disclosure of Invention
The embodiment of the application provides a test method and a test device for a proxy server.
In a first aspect, an embodiment of the present application provides a test method for a proxy server, where the proxy server is in communication connection with at least one test server, and the test method includes: in response to receiving a test request from a client, selecting a test server with a connection number from at least one test server according to the connection number preset in the test request to obtain a candidate test server set; selecting a candidate test server with the degree of income greater than zero from the candidate test server set as a target test server according to the degree of income of the candidate test server, wherein the degree of income of the candidate test server is the number of test servers from which the received connection requests originate; and selecting the target test server with the largest weight value from the selected target test servers to execute the test.
In some embodiments, selecting a candidate test server with an in-degree greater than zero from the set of candidate test servers as the target test server comprises: and selecting the candidate test server with the in-degree greater than zero and the out-degree as a target test server from the candidate test server set, wherein the out-degree is the number of the test servers to which the issued connection requests aim.
In some embodiments, the method further comprises: for each target test server in each target test server, detecting whether a test environment configuration file is configured in the target test server; and in response to determining that no test environment configuration file is configured in the target test server, outputting information characterizing the no test environment configuration file in the target test server.
In some embodiments, the method further comprises: for each target test server in each target test server, in response to detecting that a test environment configuration file exists in the target test server, determining whether a network protocol address and a port address recorded in the test environment configuration file are the same as a network protocol address and a port address recorded in a configuration file of a proxy server; and outputting information for representing the configuration error of the test environment configuration file in response to the two being different.
In some embodiments, selecting the target testing server with the largest weight value from the selected target testing servers to perform the test includes: and selecting the target test server with the largest weight value from all the target test servers to execute the test by using a weighted polling method.
In some embodiments, after selecting the target testing server with the largest weight value from the selected target testing servers to perform the test, the method further includes: and responding to the connection failure of the target test server with the maximum weight value in a preset time period, selecting the target test server with the second weight value to execute the test, and reducing the preset weight value of the target test server with the connection failure.
In a second aspect, an embodiment of the present application provides a testing apparatus for a proxy server, where the apparatus includes: the first generation unit is configured to respond to a test request received from a client, and select a test server with a connection number from at least one test server according to the connection number preset in the test request to obtain a candidate test server set; the second generation unit is configured to select a candidate test server with the degree greater than zero from the candidate test server set as a target test server according to the degree of the candidate test server, wherein the degree of the candidate test server is the number of test servers from which the received connection request originates; and the first selection unit is configured to select the target test server with the largest weight value from the selected target test servers to execute the test.
In some embodiments, the second generating unit is further configured to: and selecting the candidate test server with the in-degree greater than zero and the out-degree as a target test server from the candidate test server set, wherein the out-degree is the number of the test servers to which the issued connection requests aim.
In some embodiments, the testing device is further configured to: for each target test server in each target test server, detecting whether a test environment configuration file is configured in the target test server; and in response to determining that no test environment configuration file is configured in the target test server, outputting information characterizing the no test environment configuration file in the target test server.
In some embodiments, the testing device is further configured to: for each target test server in each target test server, in response to detecting that a test environment configuration file exists in the target test server, determining whether a network protocol address and a port address recorded in the test environment configuration file are the same as a network protocol address and a port address recorded in a configuration file of a proxy server; and outputting information for representing the configuration error of the test environment configuration file in response to the two being different.
In some embodiments, the first selection unit is further configured to: and selecting the target test server with the largest weight value from all the target test servers to execute the test by using a weighted polling method.
In some embodiments, the testing apparatus further includes a second selecting unit configured to select, in response to a connection failure with the target testing server having the largest weight value within a preset time period, the target testing server having the second weight value to perform the test, and reduce the preset weight value of the target testing server having the connection failure.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the test method and the test device for the proxy server, a candidate test server set is obtained by selecting a test server with a connection number from at least one test server in response to the connection number preset in a test request received from a client; and selecting the candidate test server from the candidate test server set as a target test server according to the in-degree and out-degree of the candidate test server, and selecting the target test server with the largest weight value from the selected target test servers to execute the test, so that the test efficiency is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a testing method for a proxy server according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a test method for a proxy server according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a testing method for a proxy server according to the present application;
FIG. 5 is a schematic block diagram of one embodiment of a test apparatus for a proxy server according to the present application;
fig. 6 is a schematic structural diagram of a computer system suitable for implementing the terminal device or the server according to the embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the testing method for a proxy server or the testing apparatus for a proxy server of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, networks 104, 106, and servers 105, 107, 108, 109. Networks 104, 106 are the medium used to provide communication links between terminal devices 101, 102, 103 and server 105, and between server 105 and servers 107, 108, 109. The networks 104, 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The server 105 may interact with the servers 107, 108, 109 over the network 107 to establish connections, etc. Various client applications, such as an application for sending a test request, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, sending information, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like.
The server 105 may be a proxy server that receives test requests sent by the terminal devices 101, 102, 103 and provides the requests to the servers 107, 108, 109. The proxy server may analyze and/or otherwise process the received data, such as the test request, and establish a connection with the servers 107, 108, and 109 based on the processing result to select the servers 107, 108, and 109 to perform the test.
The servers 107, 108, 109 may be test servers that receive test requests transmitted by the server 105. And the test server executes the test request sent by the terminal equipment based on the connection with the proxy server.
It should be noted that the test method for testing the server provided by the embodiment of the present application is generally performed by the server 105, and accordingly, the device for the proxy server is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of end devices, networks, and servers, and the servers may be replaced with a distributed server cluster, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a proxy server testing method according to the present application is shown. The test method comprises the following steps:
step 201, in response to receiving a test request from a client, selecting a test server with a connection number from at least one test server according to a connection number preset in the test request, and obtaining a candidate test server set.
In this embodiment, the proxy server may receive the test request through a wired connection manner or a wireless connection manner. Specifically, the test request includes the number of connections requested to be established, and the number of connections is preset. The proxy server can select the same test server as the number of the connections to establish the connection with the client. After the test server is connected with the client through the proxy server, the test request of the client can be executed. The proxy server may select the number of test servers from the at least one test server to connect to the proxy server, and obtain a candidate test server set based on the selected test server.
The test request may be an HTTP (Hyper Text Transfer Protocol) request sent by a user through a browser installed in the terminal, or may be an HTTPs (Hyper Text Transfer Protocol over Secure Socket Layer) request sent by a user through a browser installed in the terminal.
As an example, the specific process of the electronic device receiving the test request from the client is as follows: the number of connections with the test server preset in the test request received by the proxy server is 5, 5 test servers are selected from at least one test server, namely a test server A, a test server B, a test server C, a test server D and a test server E, and the 5 test servers A, B, C, D and E form a candidate test server set.
Step 202, according to the degree of entrance of the candidate test server, selecting a candidate test server with the degree of entrance larger than zero from the candidate test server set as a target test server.
In this embodiment, the in-degree of the candidate test server refers to the number of test servers from which the received connection request originates, and the out-degree of the candidate test server refers to the number of test servers to which the issued connection request is directed. Specifically, each test server may be regarded as a node, and the connection between the test servers may be regarded as a connection between a plurality of nodes. For the same node, the node can send requests to other nodes and can receive the requests sent by other nodes. The number of nodes sending requests to other nodes by the node is out-degree, and the number of nodes receiving the requests sent by other nodes by the node is in-degree. Generally, when the node receives a request sent by another node, the node is an executing node, that is, an executing test server, and meanwhile, a test environment configuration file is installed on the executing test server. A test environment refers to the computer hardware, software, network equipment, etc. necessary to complete the test. The test environment configuration file may be data configured on the execution server, or the like, in order to implement the building of the test environment. Based on the set of candidate test servers determined in step 201, the proxy server may select a candidate test server from the set of candidate test servers as the target test server according to the degree of entry of the candidate test server.
In this embodiment, a candidate test server with an incoming degree greater than zero is selected as the target test server from the candidate test server set. Here, the entry and the exit may be divided into four combinations according to whether the entry and the exit of the candidate test server are greater than 0, where the entry is 0 and the exit is 0, the entry is greater than 0 and the exit is 0, the entry is 0 and the exit is greater than 0, and the entry is greater than 0 and the exit is greater than 0. Here, the in-degree greater than 0 indicates that at least one server connected thereto sends a request to the server, and thus, the test server is a server performing a test. Also, a test environment configuration file is installed in the test server. The out degree is more than 0, which indicates that the test server at least sends a request to one server. The test server with the in-degree of 0 and the out-degree of more than 0 is a root test server, and the test server may not be provided with the test environment configuration file, and is configured to receive the test request transmitted by the test request terminal connected to the test server, and send the test request to the execution test server connected to the test server and provided with the test environment configuration file. In this implementation manner, a candidate test server with an in-degree greater than zero is selected as a target test server, that is, a test server with an in-degree value greater than 0 and an out-degree value of 0 or a test server with an in-degree value greater than 0 and an out-degree value of 0 is selected as a target test server.
As an example, the in-degree of candidate test server a is 3 and the out-degree is 0; the in-degree of the candidate test server B is 0, and the out-degree is 0; the in-degree of the candidate test server C is 0, and the out-degree is 4; the in-degree of the candidate test server D is 2, and the out-degree is 0; the candidate test server E has an in-degree of 3 and an out-degree of 0. Therefore, the electronic device may select the candidate test server a, the candidate test server D, and the candidate test server E as the target test server.
In some optional implementation manners of this embodiment, for each target test server in each target test server, in response to detecting that a test environment configuration file exists in the target test server, determining whether a network protocol address and a port address recorded in the test environment configuration file are the same as a network protocol address and a port address recorded in the configuration file of the proxy server; and in response to the two being different, outputting information representing a configuration error of the test environment configuration file. In this optional implementation manner, the proxy server determines whether the network protocol address and the port address recorded in the configuration file in the proxy server are the same as the network protocol address and the port address recorded in the test environment configuration file of the target test server, so as to determine whether the test environment configuration file in the target test server is configured incorrectly, which is beneficial to quickly detecting whether the test environment in the target test server is set up correctly, and improves the accuracy of the test.
And step 203, selecting the target test server with the largest weight value from the selected target test servers to execute the test.
In this embodiment, the proxy server stores in advance a weight value of each target test server, the weight value indicating the number of times the target test server is requested to be executed within a preset time period, and the weight value is preset according to the processing capacity of each test server. The more times of execution is requested within the preset time period, the greater the weight value of the target test server is, which indicates that the execution capacity of the target test server is stronger. After the target test servers are initialized, the proxy server may select the target test server with the largest weight value to execute the test.
As an example, the weight value of the target test server "a" is 4, the weight value of the target test server "B" is 2, the weight value of the target test server "C" is 1, and the weight value of the target test server "a" is the largest among the three target test servers, so the proxy server may select the target test server "a" having the weight value of 4 to execute the test request transmitted by the client.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the test method for the proxy server according to the present embodiment.
In the application scenario of fig. 3, first, the proxy server 301 receives a test request sent by the client 302, where the number of connections in the test request is 5. The proxy server 301 selects 5 test servers, namely a test server a, a test server B, a test server C, a test server D, and a test service E, from at least one test server according to a preset connection number 5 in the test request, and generates a candidate test server set based on the 5 test servers, where the entry of the test server a is 0, the entry of the test server B is 2, the entry of the test server C is 3, the entry of the test server D is 0, and the entry of the test server E is 2. Next, the proxy server 301 selects a candidate test server with an incoming degree greater than zero from the candidate test server set as a target test server according to the incoming degrees of the candidate test servers, that is, the candidate test server B, the candidate test server C, and the candidate test server E as the target test server. Here, the weight value of candidate test server B is 2, the weight value of candidate test server C is 4, and the weight value of candidate test server E is 1. Finally, the target test server with the largest weight value (namely the target test server C) is selected from the selected target test servers to execute the test request.
In the testing method and the testing device for the proxy server provided by the embodiment, a candidate testing server set is obtained by selecting a testing server with a connection number from at least one testing server in response to the connection number preset in a testing request received from a client; and selecting the candidate test server from the candidate test server set as a target test server according to the in-degree and out-degree of the candidate test server, and selecting the target test server with the largest weight value from the selected target test servers to execute the test, so that the test efficiency is improved.
Referring now to fig. 4, fig. 4 illustrates a flow 400 of another embodiment of a testing method for a proxy server according to the present application.
As shown in fig. 4, the data processing method of the present embodiment includes the following steps:
and responding to the test request received from the client, and selecting a test server with the connection number from at least one test server according to the connection number preset in the test request to obtain a candidate test server set.
In this embodiment, the proxy server may receive the test request in a wired connection manner or a wireless connection manner, and select a test server with the same number as the number of connections according to the number of connections preset in the test request to establish a connection with the client. The proxy server may select the number of test servers from the at least one test server to connect to the proxy server, and obtain a candidate test server set based on the selected test server.
Step 402, according to the degree of entrance of the candidate test server, selecting the candidate test server with the degree of entrance larger than zero and the degree of exit of zero from the candidate test server set as the target test server.
In this embodiment, based on the candidate test server set determined in step 401, the proxy server may select, as the target test server, a candidate test server from the candidate test server set, where the in-degree is greater than zero and the out-degree is zero, according to the in-degree and the out-degree of the candidate test server. Here, the in-degree refers to the number of test servers from which the received connection request originates, and the out-degree refers to the number of test servers to which the issued connection request is directed.
In some optional implementation manners of this embodiment, for each target testing server in the target testing servers, the proxy server may detect whether a testing environment configuration file is configured in the target testing server. And in response to determining that no test environment configuration file is configured in the target test server, outputting information characterizing the no test environment configuration file in the target test server. Here, the test environment refers to computer hardware, software, network equipment, data, and the like necessary for completing a test job, and the test environment configuration file may refer to data configured on an execution server, and the like, for realizing the construction of the test environment.
And step 403, selecting the target test server with the largest weight value from the target test servers to execute the test by using a weighted polling method.
In this embodiment, according to the target test servers determined in step 402, the proxy server may select a target test server with the highest weight value from the target test servers to perform the test by using a weighted polling method.
In this embodiment, a common weighted polling method or a smooth weighted polling method may be adopted to select a target test server with the largest weight value from among the target test servers and execute the test. The above-described smoothed weighted round robin method may be implemented by a Nginx (engine x) algorithm developed by the second rambler. ru site in the russian visit by igore sexojeff. The Nginx algorithm is a well-known technique in the prior art, and is not described herein again.
As an example, when the proxy server selects 3 test servers "test server a", "test server B", and "test server C" from the candidate test servers to execute the test servers, the initial weight value of "test server a" is 3, the initial weight value of "test server B" is 2, and the initial weight value of "test server C" is 1. The initial weight value is preset. When the proxy server receives six test requests, the proxy server firstly selects a test server 'test server A' with the highest weight value to execute one of tests; then, subtracting the sum 6 of the weight values of the 3 test servers from the weight value of the test server A, wherein the weight value of the test server A is changed to be-3, adding the initial weight value of the test server A to the current weight value of the test server A, wherein the current weight value of the test server A is 0, the weight value of the test server B is 2, the weight value of the test server C is 1, and selecting the test server B with the largest weight value to execute one test; next, the sum of the weight values of the 3 test servers is subtracted from the weight value of the "test server B" by 6, the weight value of the "test server B" is changed to-4, the current weight value of the "test server B" is added to the initial weight value thereof, the current weight value of the "test server B" is-2, the weight value of the "test server a" is 0, the weight value of the "test server C" is 1, and the test server "test server C" with the largest weight value is selected to execute one of the tests. In this way, according to the weight value of each target test server, the test server with the largest weight value is selected in a polling mode to execute the test request.
In response to the connection failure with the target test server with the largest weight value within the preset time period, step 404 selects the target test server with the second weight value to execute the test, and reduces the preset weight value of the target test server with the failed connection.
In this embodiment, when the proxy server is connected to the target test server with the largest weight value based on the network protocol address and the port address, and when the target test server connected to the proxy server is in a busy state and an internal abnormality occurs, the proxy server cannot be connected to the server to be connected within a preset time period, and at this time, the server may select the target test server with the second weight value to execute the test, and reduce the preset weight value of the target test server with the failed connection.
As can be seen from the embodiment shown in fig. 4, different from the embodiment shown in fig. 2, the present embodiment highlights the method that the target test server with the largest weight value is selected from the target test servers by using the weighted polling method to perform the test and the method that is adopted after the connection between the proxy server and the target test server to be connected fails, so that the load of each target test server is balanced, and the test efficiency is further improved.
With further reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of a testing apparatus for a proxy server, where the apparatus embodiment corresponds to the method embodiment shown in fig. 2, and the apparatus may be applied to various electronic devices.
As shown in fig. 5, the test apparatus 500 for a proxy server of the present embodiment includes: a first generating unit 501, a second generating unit 502 and a first selecting unit 503. The first generating unit 501 is configured to, in response to receiving a test request from a client, select a test server with a connection number from at least one test server according to a connection number preset in the test request, and obtain a candidate test server set; the second generating unit 502 is configured to select, as a target test server, a candidate test server with an incoming degree greater than zero from the candidate test server set according to the incoming degrees of the candidate test servers, where the incoming degree of the candidate test server is the number of test servers from which the received connection request originates; and the first selection unit 503 is configured to select a target test server with the largest weight value from the selected respective target test servers to perform the test.
In this embodiment, in the testing apparatus 500 for a proxy server, specific processing of the first generating unit 501, the second generating unit 502, and the first selecting unit 503 and technical effects thereof may refer to the related descriptions of step 201, step 202, and step 203 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the second generating unit 502 is further configured to: and selecting the candidate test server with the in-degree greater than zero and the out-degree as a target test server from the candidate test server set, wherein the out-degree is the number of the test servers to which the issued connection requests aim.
In some optional implementations of the present embodiment, the testing apparatus 500 is further configured to: for each target test server in each target test server, detecting whether a test environment configuration file is configured in the target test server; and in response to determining that no test environment configuration file is configured in the target test server, outputting information characterizing the no test environment configuration file in the target test server.
In some optional implementations of the present embodiment, the testing apparatus 500 is further configured to: for each target test server in each target test server, in response to detecting that a test environment configuration file exists in the target test server, determining whether a network protocol address and a port address recorded in the test environment configuration file are the same as a network protocol address and a port address recorded in a configuration file of a proxy server; and outputting information for representing the configuration error of the test environment configuration file in response to the two being different.
In some optional implementations of this embodiment, the first selecting unit 503 is further configured to: and selecting the target test server with the largest weight value from all the target test servers to execute the test by using a weighted polling method.
In some optional implementations of the embodiment, the testing apparatus 500 further includes a second selecting unit (not shown) configured to, in response to a connection failure with the target testing server with the largest weight value within a preset time period, select the target testing server with the second weight value to perform the test, and reduce the preset weight value of the target testing server with the failed connection.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use in implementing a proxy server of an embodiment of the present application is shown. The proxy server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 606 into a Random Access Memory (RAM) 603. 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 bus 604.
The following components are connected to the I/O interface 605: a storage portion 606 including a hard disk and the like; and a communication section 607 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 607 performs communication processing via a network such as the internet. Drivers 608 are also connected to the I/O interface 605 as needed. A removable medium 609 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 608 as necessary, so that a computer program read out therefrom is mounted into the storage section 606 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 607 and/or installed from the removable medium 609. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection 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, wire, fiber optic 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 the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). 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 the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first generating unit, a second generating unit, and a first selecting unit. For example, the obtaining unit may be further described as "in response to receiving the test request from the client, selecting a number of test servers from at least one test server according to a number of connections preset in the test request, and obtaining a unit of the candidate test server set.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: in response to receiving a test request from a client, selecting a test server with a connection number from at least one test server according to the connection number preset in the test request to obtain a candidate test server set; selecting a candidate test server with the degree of income greater than zero from the candidate test server set as a target test server according to the degree of income of the candidate test server, wherein the degree of income of the candidate test server is the number of test servers from which the received connection requests originate; and selecting the target test server with the largest weight value from the selected target test servers to execute the test.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (14)

1. A testing method for a proxy server, the proxy server being communicatively connected to at least one testing server, the testing method comprising:
in response to receiving a test request from a client, selecting the test servers with the connection number from the at least one test server according to the connection number preset in the test request to obtain a candidate test server set;
selecting a candidate test server with the degree of income greater than zero from the candidate test server set as a target test server according to the degree of income of the candidate test server, wherein the degree of income of the candidate test server is the number of test servers from which the received connection requests originate;
and selecting the target test server with the largest weight value from the selected target test servers to execute the test, wherein the weight value is preset based on the processing capacity of each test server, and the weight value is positively correlated with the number of times of the target test server being requested to execute in a preset time period.
2. The method of claim 1, the selecting a candidate test server from the set of candidate test servers with an in-degree greater than zero as a target test server, comprising:
and selecting a candidate test server with the in-degree greater than zero and the out-degree as a target test server from the candidate test server set, wherein the out-degree is the number of test servers for which the issued connection requests aim at.
3. The method of claim 1 or 2, further comprising:
for each target test server in each target test server, detecting whether a test environment configuration file is configured in the target test server; and in response to determining that no test environment configuration file is configured in the target test server, outputting information characterizing the no test environment configuration file in the target test server.
4. The method of claim 1 or 2, further comprising:
for each target test server in each target test server, in response to detecting that a test environment configuration file exists in the target test server, determining whether a network protocol address and a port address recorded in the test environment configuration file are the same as a network protocol address and a port address recorded in a configuration file of the proxy server; and in response to the two being different, outputting information representing the configuration error of the test environment configuration file.
5. The method of claim 1, wherein selecting the target testing server with the largest weight value from the selected target testing servers to perform the test comprises:
and selecting the target test server with the largest weight value from all the target test servers to execute the test by using a weighted polling method.
6. The method of claim 1, after the selecting the target testing server with the largest weight value from the selected target testing servers to perform the test, the method further comprises:
and responding to the connection failure of the target test server with the maximum weight value in a preset time period, selecting the target test server with the second weight value to execute the test, and reducing the preset weight value of the target test server with the connection failure.
7. A testing apparatus for a proxy server communicatively coupled to at least one test server, the testing apparatus comprising:
the first generating unit is configured to respond to a test request received from a client, select the test servers with the connection number from the at least one test server according to the connection number preset in the test request, and obtain a candidate test server set;
the second generation unit is configured to select a candidate test server with the degree of approach larger than zero from the candidate test server set as a target test server according to the degree of approach of the candidate test server, wherein the degree of approach of the candidate test server is the number of test servers from which the received connection request originates;
the first selection unit is configured to select a target test server with a largest weight value from the selected target test servers to execute the test, wherein the weight value is preset based on the processing capacity of each test server, and the weight value is positively correlated with the number of times of execution of the target test server in a preset time period.
8. The apparatus of claim 7, the second generating unit further configured to:
and selecting a candidate test server with the in-degree greater than zero and the out-degree as a target test server from the candidate test server set, wherein the out-degree is the number of test servers for which the issued connection requests aim at.
9. The apparatus of claim 7 or 8, the testing apparatus further configured to:
for each target test server in each target test server, detecting whether a test environment configuration file is configured in the target test server; and in response to determining that no test environment configuration file is configured in the target test server, outputting information characterizing the no test environment configuration file in the target test server.
10. The apparatus of claim 7 or 8, the testing apparatus further configured to:
for each target test server in each target test server, in response to detecting that a test environment configuration file exists in the target test server, determining whether a network protocol address and a port address recorded in the test environment configuration file are the same as a network protocol address and a port address recorded in a configuration file of the proxy server; and in response to the two being different, outputting information representing the configuration error of the test environment configuration file.
11. The apparatus of claim 7, the first selection unit further configured to:
and selecting the target test server with the largest weight value from all the target test servers to execute the test by using a weighted polling method.
12. The apparatus of claim 7, the testing apparatus further comprising:
and the second selection unit is configured to respond to the connection failure of the target test server with the largest weight value in a preset time period, select the target test server with the second weight value to execute the test, and reduce the preset weight value of the target test server with the connection failure.
13. A server, the server comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN201711269651.0A 2017-12-05 2017-12-05 Test method and device for proxy server Active CN109873732B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711269651.0A CN109873732B (en) 2017-12-05 2017-12-05 Test method and device for proxy server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711269651.0A CN109873732B (en) 2017-12-05 2017-12-05 Test method and device for proxy server

Publications (2)

Publication Number Publication Date
CN109873732A CN109873732A (en) 2019-06-11
CN109873732B true CN109873732B (en) 2021-05-25

Family

ID=66916547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711269651.0A Active CN109873732B (en) 2017-12-05 2017-12-05 Test method and device for proxy server

Country Status (1)

Country Link
CN (1) CN109873732B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112653632A (en) * 2019-10-09 2021-04-13 北京京东振世信息技术有限公司 Flow control realization method and device
CN111930620B (en) * 2020-08-07 2023-08-11 中国工商银行股份有限公司 Application running environment data processing method and device
CN112363879A (en) * 2020-11-20 2021-02-12 上海连尚网络科技有限公司 Cache server performance test method, device, equipment and medium
CN113179334B (en) * 2021-06-30 2021-09-24 神威超算(北京)科技有限公司 Server selection method, device and computer readable medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110119369A1 (en) * 2009-11-13 2011-05-19 International Business Machines,Corporation Monitoring computer system performance
CN102662941A (en) * 2011-12-31 2012-09-12 武汉理工大学 Sequencing method based on random walk
CN103401947A (en) * 2013-08-20 2013-11-20 曙光信息产业(北京)有限公司 Method and device for allocating tasks to multiple servers
SE542674C2 (en) * 2015-02-04 2020-06-23 Lumenradio Ab A method and system for selecting communication parameters in a wireless network
CN107026899A (en) * 2017-02-23 2017-08-08 成都谷辘信息技术有限公司 A kind of load-balanced server of the efficient easy-to-use stabilization based on dynamic link library

Also Published As

Publication number Publication date
CN109873732A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
CN109873732B (en) Test method and device for proxy server
US11194640B2 (en) Validation framework for runtime connected API systems
US9959201B2 (en) Automated test generation for multi-interface enterprise virtualization management environment
US8886795B2 (en) Method and system for determining response time of a server
CN108768730B (en) Method and device for operating intelligent network card
US10592399B2 (en) Testing web applications using clusters
CN110647332A (en) Software deployment method and device based on container cloud
CN109901985B (en) Distributed test apparatus and method, storage medium, and electronic device
US10552306B2 (en) Automated test generation for multi-interface and multi-platform enterprise virtualization management environment
CN107045475B (en) Test method and device
CN105871947A (en) Method and device for cross-domain data request
CN112311620A (en) Method, apparatus, electronic device and readable medium for diagnosing network
CN103581133A (en) Method and system for transmitting responses to access requests of Web server
CN107528854A (en) Connection method, system, client and server based on proof of work
CN107229565B (en) Test method and device
CN107315672B (en) Method and device for monitoring server
CN109218338B (en) Information processing system, method and device
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
CN109120433B (en) Method and apparatus for containerized deployment of hosts
CN109145591B (en) Plug-in loading method of application program
US9384074B1 (en) Redirecting service calls using endpoint overrides
CN109462491B (en) System, method and apparatus for testing server functionality
CN112395194B (en) Method and device for accessing test platform
CN111338928A (en) Chrome-based browser testing method and device
CN110971478A (en) Pressure measurement method and device for cloud platform service performance and computing equipment

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