The content of the invention
The machine that test request is sent during for being tested in correlation technique web page quality is shielded, and leads to not survey
The problem of examination, effective solution is not yet proposed at present, therefore, it is a primary object of the present invention to provide a kind of transmission webpage
The method and apparatus of access request, to solve the above problems.
To achieve these goals, according to an aspect of the invention, there is provided a kind of side for sending web access requests
Method, this method include:The test request of test website is received, wherein, testing time is carried in the test request, circulation is held
Row following step, until the number of the access request of generation is equal to the testing time;Generation accesses the first visit of the first webpage
Ask request;After preset time is spaced, generation accesses the second access request of the second webpage;Wherein, the access request bag
First access request and second access request are included, it is described pre- in each circulation when circulation performs above-mentioned steps
If the value of time is incomplete same, first webpage and second webpage belong to the website.
Further, after the first access request that generation accesses the first webpage, methods described also includes:Use function
The preset time of maker generation;Or the preset time is read from tables of data according to cycle-index, the tables of data
The middle corresponding relation for preserving multiple preset times and the cycle-index, the value of the multiple preset time are each not
Together.
Further, the preset time generated using function generator is included:Calculated according to equation below described pre-
If time R, wherein, the formula is:R=(1+s) * b, the b are the default period, and s ∈ [0,1], the s are the letter
The decimal of number maker generation.
Further, the access request is to download the request of the webpage on the website.
Further, after first access request or second access request is generated, described first is accessed
Request or second access request are sent to the Website server of the website.
To achieve these goals, according to another aspect of the present invention, there is provided a kind of dress for sending web access requests
Put, the device includes:Processing module, for receiving the test request of test website, wherein, survey is carried in the test request
Number is tried, circulation performs following step, until the number of the access request of generation is equal to the testing time;First generation mould
Block, the first access request of the first webpage is accessed for generating;Second generation module, for after preset time is spaced, giving birth to
Into the second access request for accessing the second webpage;Wherein, the access request includes first access request and described second
Access request, when circulation performs above-mentioned steps, the value of the preset time in each circulation is incomplete same, and described first
Webpage and second webpage belong to the website.
Further, described device also includes:3rd generation module, accessed for accessing the first of the first webpage in generation
After request, the preset time of function generator generation is used;Or the 4th generation module, for accessing the first net in generation
After first access request of page, the preset time is read from tables of data according to cycle-index, is preserved in the tables of data
The corresponding relation of multiple preset times and the cycle-index, the value of the multiple preset time are variant.
Further, the 3rd generation module includes:Submodule is generated, it is described default for being calculated according to equation below
Time R, wherein, the formula is:R=(1+s) * b, the b are the default period, and s ∈ [0,1], the s are the function
The decimal of maker generation.
Further, the access request is to download the request of the webpage on the website.
Further, described device also includes sending module, for generating first access request or described second
After access request, first access request or second access request are sent to the Website server of the website.
Using the present invention, during testing website, after the first access request sent by terminal,
Certain interval of time (preset time i.e. in above-described embodiment), then regenerates the second access request, also, generates every time
After one access request, the preset time at interval is incomplete same, so that between the access request that terminal is sent to webpage
With time interval, and the interval of same terminal transmission access request is incomplete same, namely the access request sent is in the time
On use different frequencies, Website server without differentiate interval different time access request ability.Pass through the present invention
Embodiment, solve and the machine of test request is frequently sent when testing web page quality shielded, lead to not test
Problem, realize the effect that can send multiple access requests using same terminal to be tested webpage.
Embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention
Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people
The every other embodiment that member is obtained under the premise of creative work is not made, it should all belong to the model that the present invention protects
Enclose.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, "
Two " etc. be for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so use
Data can exchange in the appropriate case, so as to embodiments of the invention described herein can with except illustrating herein or
Order beyond those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment
Those steps or unit clearly listed, but may include not list clearly or for these processes, method, product
Or the intrinsic other steps of equipment or unit.
Fig. 1 is the flow chart of the method for transmission web access requests according to embodiments of the present invention, this method as shown in Figure 1
Comprise the following steps:
Step S102, receive the test request of test website.
Wherein, testing time is carried in test request.After test request is received, circulation performs following step,
Until the number of the access request of generation is equal to testing time.
Step S104, generation access the first access request of the first webpage.
Step S106, after preset time is spaced, generation accesses the second access request of the second webpage.
Wherein, access request includes the first access request and the second access request, each when circulation performs above-mentioned steps
The value of preset time in circulation is incomplete same, and the first webpage and the second webpage belong to website.
Specifically, the value of the preset time in all circulate operations is incomplete same.
Using the embodiment of the present invention, during testing website, being accessed in first sent by terminal please
After asking, certain interval of time (preset time i.e. in above-described embodiment), the second access request is then regenerated, also, often
After the first access request of secondary generation, the preset time at interval is incomplete same, so that the access that terminal is sent to webpage
There is time interval between request, and the interval of same terminal transmission access request is incomplete same, namely the access sent please
Ask and use different frequencies in time, ability of the Website server without the access request for differentiating interval different time.It is logical
The embodiment of the present invention is crossed, solves and the machine of test request is frequently sent when testing web page quality is shielded, cause nothing
The problem of method is tested, realizes the effect that can send multiple access requests using same terminal to be tested webpage.
In the above-described embodiments, the URL of tested webpage, the survey to tested webpage can be included in test request
Number is tried, e.g., test request is:The test of 10,000 times is sent to Baidu (www.***.com).Terminal then please according to the test
Seek survival into 10,000 access requests.
For example, the access request can be the request for downloading webpage, the access request generated in test process can be to visit
The request of different webpages is asked, but different webpages belongs to same website.
During two webpages of download site, there is a pause mechanism (i.e. above-mentioned interval preset time), profit
It can be suspended to send to server with this mechanism and asked, that is, after suspending the regular hour, then it is next to Website server transmission
Individual request.
As shown in Fig. 2 above-described embodiment may include steps of:
Step S202:Download the first webpage.
Specifically, access request (first access request i.e. in above-described embodiment) first is sent to server, before download
One webpage (i.e. the first webpage).
Step S204:Pause is downloaded.
Specifically, after previous webpage has been downloaded, system will be suspended next to the transmission of same Website server
Access request, the time out of this part is above-mentioned preset time.
Step S206:Download the second webpage.
Through pause after a while and then rising to Website server and send next access request (i.e. above-mentioned reality
Apply the second access request in example), download the latter webpage.
According to the above embodiment of the present invention, after the first access request that generation accesses the first webpage, method can be with
Including:The preset time generated using function generator;Or preset time, tables of data are read from tables of data according to cycle-index
The middle corresponding relation for preserving multiple preset times and cycle-index, the value of multiple preset times are variant.
Tables of data can be the time and cycle-index preset.Table 1 shows a kind of form of tables of data:
Table 1
Cycle-index |
Preset time (unit:ms) |
1 |
50 |
2 |
55 |
3 |
60 |
4 |
70 |
5 |
75 |
6 |
65 |
7 |
60 |
As shown in table 1, preset time can be read according to cycle-index, such as when circulating first time, preset time is
50ms, when circulating for the second time, preset time 55ms ... ..., the like.
In an optional embodiment of the present invention, the preset time generated using function generator can include:According to
Equation below calculates preset time R, wherein, formula is:R=(1+s) * b, b are the default period, and s ∈ [0,1], s are function
The decimal of maker generation.
In this embodiment, default time interval (preset time i.e. in above-described embodiment) is caused by dynamic.No
The time interval of same pause may be different.First, the time out parameter for pre-setting a benchmark is obtained, is designated as base
(as above-mentioned b, default period), and obtain a default random function generator (letter i.e. in above-described embodiment
Number maker), the function generator is randomly generated the decimal random () between 0 to 1 (being the s in above-described embodiment).
Then suspend every time time interval interval (the preset time R i.e. in above-described embodiment) generation formula be:
Interval=(1+random ()) * base.
Time interval (preset time i.e. in above-described embodiment) is obtained by above-mentioned formula, size is at base and 2 times
Between base.Then suspend the time of interval sizes again, treat the EOT end of timeout and then sent to Website server next
Request.
It should be further stated that in above-described embodiment, after the first access request or the second access request is generated,
First access request or the second access request are sent to the Website server of website.
By the above embodiment of the present invention, asked relative to not sent at time intervals to Website server frequently,
It can be better protected from identifying that this is that program is sending request to it by Website server using dynamic interval, by
IP situation is closed by screen.Existing Website server None- identified dynamic interval, so as to which dynamic interval can be preferably
Circumvent the detection of Website server.
It should be noted that can be in such as one group of computer executable instructions the flow of accompanying drawing illustrates the step of
Performed in computer system, although also, show logical order in flow charts, in some cases, can be with not
The order being same as herein performs shown or described step.
Fig. 3 is the schematic diagram of the device of transmission web access requests according to embodiments of the present invention.As shown in figure 3, the dress
Putting to include:Processing module 10, the first generation module 30 and the second generation module 50.
Wherein, processing module 10 is used for the test request for receiving test website, wherein, test time is carried in test request
Number, circulation perform following step, until the number of the access request of generation is equal to testing time;First generation module 30 is used to give birth to
Into the first access request for accessing the first webpage;Second generation module 50 is used for after preset time be spaced, generation access the
Second access request of two webpages;Wherein, access request includes the first access request and the second access request, on circulation performs
When stating step, the value of the preset time in each circulation is incomplete same, and the first webpage and the second webpage belong to website.
Specifically, the value of the preset time in all circulate operations is incomplete same.
Using the present invention, during testing website, after the first access request sent by terminal,
Certain interval of time (preset time i.e. in above-described embodiment), then regenerates the second access request, also, generates every time
After one access request, the preset time at interval is incomplete same, so that between the access request that terminal is sent to webpage
With time interval, and the interval of same terminal transmission access request is incomplete same, namely the access request sent is in the time
On use different frequencies, Website server without differentiate interval different time access request ability.Pass through the present invention
Embodiment, solve and the machine of test request is frequently sent when testing in the prior art web page quality shielded, cause
The problem of can not testing, realize the effect that can send multiple access requests using same terminal to be tested webpage.
In the above-described embodiments, the URL of tested webpage, the survey to tested webpage can be included in test request
Number is tried, e.g., test request is:The test of 10,000 times is sent to Baidu (www.***.com).Terminal then please according to the test
Seek survival into 10,000 access requests.
For example, the access request can be the request for downloading webpage, the access request generated in test process can be to visit
The request of different webpages is asked, but different webpages belongs to same website.
During two webpages of download site, there is a pause mechanism (i.e. above-mentioned interval preset time), profit
It can be suspended to send to server with this mechanism and asked, that is, after suspending the regular hour, then it is next to Website server transmission
Individual request.
In the above embodiment of the present invention, device also includes:3rd generation module, for accessing the first webpage in generation
The first access request after, use function generator generate preset time;Or the 4th generation module, for being accessed in generation
After first access request of the first webpage, preset time is read from tables of data according to cycle-index, is preserved in tables of data more
The corresponding relation of individual preset time and cycle-index, the value of multiple preset times are variant.
Wherein, tables of data can be the time and cycle-index preset.
In an optional embodiment of the present invention, the 3rd generation module can include:Submodule is generated, for according to such as
Lower formula calculates preset time R, wherein, formula is:R=(1+s) * b, b are the default period, and s ∈ [0,1], s give birth to for function
Grow up to be a useful person the decimal of generation.
In this embodiment, default time interval (preset time i.e. in above-described embodiment) is caused by dynamic.No
The time interval of same pause may be different.First, the time out parameter for pre-setting a benchmark is obtained, is designated as base
(as above-mentioned b, default period), and obtain a default random function generator (letter i.e. in above-described embodiment
Number maker), the function generator is randomly generated the decimal random () between 0 to 1 (being the s in above-described embodiment).
Then suspend every time time interval interval (the preset time R i.e. in above-described embodiment) generation formula be:
Interval=(1+random ()) * base.
Time interval (preset time i.e. in above-described embodiment) is obtained by above-mentioned formula, size is at base and 2 times
Between base.Then suspend the time of interval sizes again, treat the EOT end of timeout and then sent to Website server next
Request.
Access request in the above embodiment of the present invention can be the request of the webpage in download site.
Need to be that device can also include sending module with further illustrating, in the first access request of generation or the
After two access requests, the first access request or the second access request are sent to the Website server of website.
Modules provided in the present embodiment are identical with the application method that the corresponding step of embodiment of the method is provided, should
Can also be identical with scene.It is noted, of course, that the scheme that above-mentioned module is related to can be not limited in above-described embodiment one
Content and scene, and above-mentioned module may operate in terminal or mobile terminal, can pass through software or hardware is realized.
As can be seen from the above description, the present invention realizes following technique effect:
Using the present invention, during testing website, after the first access request sent by terminal,
Certain interval of time (preset time i.e. in above-described embodiment), then regenerates the second access request, also, generates every time
After one access request, the preset time at interval is incomplete same, so that between the access request that terminal is sent to webpage
With time interval, and the interval of same terminal transmission access request is incomplete same, namely the access request sent is in the time
On use different frequencies, Website server without differentiate interval different time access request ability.Pass through the present invention
Embodiment, solve and the machine of test request is frequently sent when testing in the prior art web page quality shielded, cause
The problem of can not testing, realize the effect that can send multiple access requests using same terminal to be tested webpage.
Obviously, those skilled in the art should be understood that above-mentioned each module of the invention or each step can be with general
Computing device realize that they can be concentrated on single computing device, or be distributed in multiple computing devices and formed
Network on, alternatively, they can be realized with the program code that computing device can perform, it is thus possible to they are stored
Performed in the storage device by computing device, either they are fabricated to respectively each integrated circuit modules or by they
In multiple modules or step be fabricated to single integrated circuit module to realize.So, the present invention is not restricted to any specific
Hardware and software combines.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.