Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to
During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification.On the contrary, they are only and such as institute
The example of the consistent apparatus and method of some aspects be described in detail in attached claims, this specification.
It is only merely for the purpose of description specific embodiment in the term that this specification uses, and is not intended to be limiting this explanation
Book." one kind " of used singulative, " described " and "the" are also intended to bag in this specification and in the appended claims
Most forms are included, unless context clearly shows that other implications.It is also understood that term "and/or" used herein is
Refer to and any or all may be combined comprising the associated list items purpose of one or more.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but
These information should not necessarily be limited by these terms.These terms are only used for same type of information being distinguished from each other out.For example, do not taking off
In the case of this specification scope, the first information can also be referred to as the second information, and similarly, the second information can also be claimed
For the first information.Depending on linguistic context, word as used in this " if " can be construed to " ... when " or
" when ... " or " in response to determining ".
As it was previously stated, determine that proxy server can use agent way and direct-connected mode with the presence or absence of problem by comparing
It is lower to send whether the response results that are returned after same request unanimously judge, that is to say, that to send 2 identicals to same website
Request, is once sent in a manner of direct-connected, is sent with agent way.
The direct-connected mode can refer to, without proxy server, client directly communicates with Website server, directly
Send a request to Website server.
The agent way can refer to that client is communicated by proxy server with Website server, it can be understood as
Client sends the request to proxy server, and Website server is forwarded the request to by proxy server.
But in practice, the information of change can be included in many response results, such as be able to can include in response results
Random number jsonp (JSON with Padding) request, with randomness recommendation information (such as Taobao's recommendation information, every time
User opens Taobao's homepage, can all show some Recommendations information, and these merchandise newss are all often random, therefore every time
The Recommendations information of display may be different from).Accordingly even when it is that different response results also occur in same request.
Fig. 1 is the system architecture diagram of the realization detection provided in this specification embodiment.In the present embodiment, the system can be with
Including client 11, proxy server 12, Website server 13.
The client 11 can be provided with the terminal of test software.
The proxy server 12 can be that Website server 13 improves agency service.
The Website server 13 can provide service to access the user of website.
In general, user can access the various websites in network by client 11, if website is deployed with agency's clothes
Business device, then access path is as shown in Fig. 1 101;
If proxy server is not disposed in website, or client disabling proxy server, then in access path such as Fig. 1
Shown in 102.
A kind of embodiment for the method for realizing detection of this specification is introduced incorporated by reference to the example shown in Fig. 2 below, such as Fig. 2 institutes
Show, this method may comprise steps of:
Step 210:Obtain the solicited message set of target web.
In the present embodiment, the request solicited messages on target web can be obtained by simulation browser environment, it is more
Individual solicited message can form a request solicited message set.
The target web can be the webpage using proxy server.
It is noted that in order to improve the accuracy of detection, the solicited message set includes the target web
All solicited messages.
Step 220:The request of at least 3 times is sent according to the solicited message set;Wherein, in the transmission request method
At least 2 times are direct-connected modes, and at least 1 time is agent way.
The solicited message set is sent at least 3 times requests per a solicited message.
It is noted that in order to improve detection accuracy, at least 3 times requests of the transmission can be sent simultaneously.
Exemplified by sending 3 requests, it is assumed that the solicited message of targeted website has:Request 1, request 2, request 3;Then get
Solicited message set request 1, request 2, request 3;
In a manner of direct-connected request 1, request 2, request 3 are sent to target website server;
In a manner of direct-connected request 1, request 2, request 3 are sent to target website server;
Request 1, request 2, request 3 are sent to the proxy server of targeted website with agent way;
As it was previously stated, in order to improve the accuracy of detection, above-mentioned 3 transmissions can be carried out simultaneously.
Step 230:Receive at least three response message set returned.
In general, client, which often sends out a solicited message, correspondingly to receive a response response message.
Therefore, client can receive at least three response message set of return.
The example in previous step, in general are continued to use, a request can be corresponding with a response;
Client can receive 3 response message set of return, i.e.,:
The response message set { response 1, response 2, response 3 } returned under direct-connected mode;
The response message set { response 1, response 2, response 3 } returned under another direct-connected mode;
The response message set { response 1, response 2, response 3 } returned under agent way;
Here response 1 is asks 1 response message, and response 2 is the response messages of request 2, and response 3 is the sound of request 3
Answer information.
Step 240:Calculate the first similarity between response message set under direct-connected mode.
The first similarity of response message set under direct-connected mode is calculated, first similarity may be considered same request
The degree of randomness of change information in lower response results.
Specifically, the step 240, may include steps of:
Response message set under the direct-connected mode of at least two is converted into character string;
Calculate the first similarity of the character string of any 2 direct-connected modes.
Assuming that length is 100 character string, identical then similarity is 100%;Have that certain 1 character is different, and its
Its 99 character is all identical, then similarity is 99%.
For example,
Assuming that response message collection is combined into { 10101,01010 } under direct-connected mode;It is then character string 1 to be converted to character string:
1010101010;
Response message collection is combined into { 11100,11010 } under another direct-connected mode;It is then character string 2 to be converted to character string:
1110011010 (employing binary number in the example for the ease of description, can be any character in practical application);
As shown in figure 3,2 character strings of traversal, the 1st character is identical, and the 2nd character difference, the 3rd character is identical, the 4th
Position character is identical, and the 5th character difference, the 6th character difference, the 7th character is identical, and the 8th character is identical, the 9th character
Identical, the 10th character is identical.Because the quantity of identical characters position is 7, divided by string length 10, it is possible to draw similar
Spend for 70%.
In the embodiment, the Similarity Measure can pass through Levenshtein Distance algorithms or Simhash
Algorithm is realized.The Levenshtein Distance algorithms or Simhash algorithms can be used for two character strings of calculating
Similarity, and computational efficiency is higher.
Step 250:Calculate the second similarity between response message set under direct-connected mode and agent way.
The second similarity of response message set under direct-connected mode and agent way is calculated, second similarity can consider
It is diversity factor between direct-connected mode and agent way under same request.
Specifically, the step 250, may include steps of:
Response message set under the direct-connected mode of at least one and at least one agent way is converted into character string;
Calculate the second similarity of the character string of any 1 agent way and any 1 direct-connected mode.
It is similar with previous step 240, the second Similarity Measure can also by Levenshtein Distance algorithms or
Person Simhash algorithms are realized.Detailed description content may be referred to above-mentioned steps 230, and this is repeated no more.
Step 260:According to first similarity and the second similarity, testing result is determined.
Based on the degree of randomness, it is possible to exclude to be produced by change information in response results under direct-connected mode and agent way
Difference, and then judge whether direct-connected mode consistent with the response results of agent way.
Specifically, the step 260, may include steps of:
Calculate the difference of first similarity and the second similarity;
Judge whether the absolute value of the difference exceedes threshold value;
In the case where the absolute value of the difference exceedes threshold value, determine that testing result has problem for proxy server.
In the case where the absolute value of the difference is no more than threshold value, determines that testing result is not present for proxy server and ask
Topic.
In the embodiment, the difference of first similarity and the second similarity is calculated, it is believed that be to exclude direct-connected side
Difference caused by the change information of part in response results under formula and agent way;That is, the absolute value of the difference is exactly
The difference of itself under direct-connected mode and agent way.
If direct-connected mode is identical with the response message that agent way returns, the absolute value of the difference must be
0.Therefore, the threshold value can also be 0;
In actual applications, some data without semanteme are there is likely to be in response message, even if response message can be caused
Have that semantic component is identical, and still had differences without semantic component;But this request is allowed, be not to say that direct-connected mode and
Response message is different under agent way;Therefore, it is necessary to allow a range of difference, i.e., described threshold value may be greater than 0.
It is more than 0 situation for the threshold value:
The threshold value can be artificial set in advance;
With the progress of the continuous development of computer technology, particularly artificial intelligence, the threshold value, which can also be, passes through machine
Device study is calculated.For example, threshold value when being detected based on history, by machine learning algorithm can calculate one it is optimal
Threshold value.
Have again, the threshold value can also be what is be calculated based on big data technology.For example, pass through mass data, hair
When now most of detection proxy server whether there is problem, the threshold value of setting is 5%, then can determine in this detection process
Threshold value can also be set as 5%.
The threshold value is smaller, illustrates that examination criteria is stricter;
When the absolute value of the difference is no more than threshold value, it is believed that response results one under direct-connected mode and agent way
Cause, then illustrate that there is no problem for proxy server;
When the absolute value of the difference exceedes threshold value, it is believed that response results differ under direct-connected mode and agent way
Cause, then illustrate that proxy server has problem.
By this specification embodiment, the first similarity of response message set under direct-connected mode is calculated, this is first similar
Degree may be considered the degree of randomness of change information in response results under same request;And calculate and rung under direct-connected mode and agent way
The second similarity of information aggregate is answered, second similarity may be considered under same request between direct-connected mode and agent way
Diversity factor;Based on the degree of randomness, it is possible to exclude to be produced by change information in response results under direct-connected mode and agent way
Difference, and then judge whether direct-connected mode consistent with the response results of agent way.
Corresponding with the detection method embodiment described in earlier figures 2, this specification additionally provides a kind of reality of detection means
Apply example.Described device embodiment can be realized by software, can also be realized by way of hardware or software and hardware combining.With
It is by non-volatile memories by the processor of equipment where it as the device on a logical meaning exemplified by software is realized
Corresponding computer program instructions read what operation in internal memory was formed in device.For hardware view, this specification detection dress
A kind of hardware configuration of equipment where putting can include outside processor, network interface, internal memory and nonvolatile memory, real
The equipment in example where device is applied generally according to the detection actual functional capability, other hardware can also be included, this is repeated no more.
Referring to Fig. 4, the module map of the detection means provided for the embodiment of this specification one, described device includes:
Acquiring unit 310, obtain the solicited message set of target web;
Transmitting element 320, at least 3 times requests are sent according to the solicited message set;Wherein, the transmission request method
In at least 2 times be direct-connected mode, at least 1 time is agent way;
Receiving unit 330, receive at least three response message set of return;
First computing unit 340, calculate the first similarity between response message set under direct-connected mode;
Second computing unit 350, calculate the second similarity between response message set under direct-connected mode and agent way;
Determining unit 360, according to first similarity and the second similarity, determine testing result.
In an optional embodiment:
First computing unit 340, is specifically included:
Conversion subunit, response message set under the direct-connected mode of at least two is converted into character string;
Computation subunit, calculate the first similarity of the character string of any 2 direct-connected modes.
In an optional embodiment:
Second computing unit 350, is specifically included:
Conversion subunit, response message set under the direct-connected mode of at least one and at least one agent way is converted into character
String;
Computation subunit, calculate the second similarity of the character string of any 1 agent way and any 1 direct-connected mode.
In an optional embodiment:
The determining unit 360, is specifically included:
Computation subunit, calculate the difference of first similarity and the second similarity;
Judgment sub-unit, judges whether the difference exceedes threshold value;
Determination subelement, in the case where the difference exceedes threshold value, determine that testing result exists for proxy server and ask
Topic.
In an optional embodiment:
The solicited message set includes all solicited messages of the target web.
In an optional embodiment:
It is described to send at least 3 times requests to send simultaneously.
In an optional embodiment:
The Similarity Measure is realized by Levenshtein Distance algorithms or Simhash algorithms.
System, device, module or the unit that above-described embodiment illustrates, it can specifically be realized by computer chip or entity,
Or realized by the product with certain function.One kind typically realizes that equipment is computer, and the concrete form of computer can
To be personal computer, laptop computer, cell phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet PC, wearable device or these equipment
The combination of any several equipment.
The function of unit and the implementation process of effect specifically refer to and step are corresponded in the above method in said apparatus
Implementation process, it will not be repeated here.
For device embodiment, because it corresponds essentially to embodiment of the method, so related part is real referring to method
Apply the part explanation of example.Device embodiment described above is only schematical, wherein described be used as separating component
The unit of explanation can be or may not be physically separate, can be as the part that unit is shown or can also
It is not physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality
Need to select some or all of module therein to realize the purpose of this specification scheme.Those of ordinary skill in the art are not
In the case of paying creative work, you can to understand and implement.
Figure 4 above describes inner function module and the structural representation of detection means, and its substantial executive agent can be with
For a kind of electronic equipment, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Obtain the solicited message set of target web;
At least 3 times requests are sent according to the solicited message set;Wherein, it is at least 2 times in the transmission request method
Direct-connected mode, at least 1 time is agent way;
Receive at least three response message set returned;
Calculate the first similarity between response message set under direct-connected mode;
Calculate the second similarity between response message set under direct-connected mode and agent way;
According to first similarity and the second similarity, testing result is determined.
In the embodiment of above-mentioned electronic equipment, it should be appreciated that the processor can be CPU (English:
Central Processing Unit, referred to as:CPU), it can also be other general processors, digital signal processor (English:
Digital Signal Processor, referred to as:DSP), application specific integrated circuit (English:Application Specific
Integrated Circuit, referred to as:ASIC) etc..General processor can be microprocessor or the processor can also be
Any conventional processor etc., and foregoing memory can be read-only storage (English:Read-only memory, abbreviation:
ROM), random access memory (English:Random access memory, referred to as:RAM), flash memory, hard disk or solid
State hard disk.The step of method with reference to disclosed in the embodiment of the present invention, can be embodied directly in hardware processor and perform completion, or
Hardware and software module combination in person's processor perform completion.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.Set especially for electronics
For standby embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is real referring to method
Apply the part explanation of example.
Those skilled in the art will readily occur to this specification after considering specification and putting into practice invention disclosed herein
Other embodiments.This specification is intended to any modification, purposes or adaptations of this specification, these modifications,
Purposes or adaptations follow the general principle of this specification and undocumented in the art including this specification
Common knowledge or conventional techniques.Description and embodiments be considered only as it is exemplary, the true scope of this specification and
Spirit is pointed out by following claim.
It should be appreciated that the precision architecture that this specification is not limited to be described above and is shown in the drawings,
And various modifications and changes can be being carried out without departing from the scope.The scope of this specification is only limited by appended claim
System.