CN109040209A - Intercept method, apparatus, computer equipment and the storage medium of repetitive requests - Google Patents

Intercept method, apparatus, computer equipment and the storage medium of repetitive requests Download PDF

Info

Publication number
CN109040209A
CN109040209A CN201810812954.0A CN201810812954A CN109040209A CN 109040209 A CN109040209 A CN 109040209A CN 201810812954 A CN201810812954 A CN 201810812954A CN 109040209 A CN109040209 A CN 109040209A
Authority
CN
China
Prior art keywords
request
processed
comparison
requests
historical requests
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.)
Withdrawn
Application number
CN201810812954.0A
Other languages
Chinese (zh)
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.)
Shenzhen Dingfeng Cattle Technology Co Ltd
Original Assignee
Shenzhen Dingfeng Cattle 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 Shenzhen Dingfeng Cattle Technology Co Ltd filed Critical Shenzhen Dingfeng Cattle Technology Co Ltd
Priority to CN201810812954.0A priority Critical patent/CN109040209A/en
Publication of CN109040209A publication Critical patent/CN109040209A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/62Establishing a time schedule for servicing the requests

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a kind of method, apparatus, computer equipment and storage mediums for intercepting repetitive requests.Wherein, if the method for intercepting repetitive requests includes: to receive the request to be processed of client transmission, judge whether to receive with request to be processed identical historical requests;If judging result is to receive the identical historical requests with request to be processed, identical historical requests will be requested as a comparison with request to be processed, and judge whether the time interval between request and comparison request to be processed is less than preset time threshold;If judging result is that the time interval between request and comparison request to be processed is less than preset time threshold, refuse the request to be processed, so as to effectively intercept the repetitive requests of client in a short time, the burden of Website server is alleviated, it is ensured that server can operate normally.Implementation of the present invention is simple simultaneously, realizes that difficulty is low, at low cost.

Description

Intercept method, apparatus, computer equipment and the storage medium of repetitive requests
Technical field
The present invention relates to technical field of network security more particularly to a kind of method, apparatus for intercepting repetitive requests, computer Equipment and storage medium.
Background technique
Web server refers to that Website server, Web server can provide document to Web clients such as browsers, can also To place site file, global user is allowed to browse;And data file can be placed, allow global user to download.Visitor When family end issues request to Web server, the request at Web server meeting customer in response end.
However web server end may will receive the attack of the malicious requests of client, in several milliseconds or a few tens of milliseconds Identical request is repeated, the burden of server is greatly increased, server crash is resulted even in when serious.
Summary of the invention
The embodiment of the invention provides a kind of method, apparatus, computer equipment and storage mediums for intercepting repetitive requests, use Identical request is repeated in a short time to intercept client, to mitigate server burden, it is ensured that server can operate normally.
In a first aspect, the embodiment of the invention provides a kind of method for intercepting repetitive requests, the method is applied to website In server, which comprises
If receiving the request to be processed of client transmission, judge whether to receive go through identical with the request to be processed History request;
If judging result be received with the identical historical requests of the request to be processed, will be with the request phase to be processed Same historical requests are requested as a comparison, and whether judge the time interval between the request to be processed and the comparison request Less than preset time threshold;
If judging result is that the time interval between the request to be processed and the comparison request is less than the preset time Threshold value refuses the request to be processed.
Its further technical solution is, described to judge whether to receive the identical history with the request to be processed and ask It asks, comprising:
Obtain the identification information of the request to be processed, the identification information be the request to be processed User ID and The address URL or the identification information are token and the address URL of the request to be processed;
Judge whether there is the historical requests that there is same identification information with the request to be processed;
If judging result is in the presence of the historical requests with the request to be processed with same identification information, judgement was received With the identical historical requests of the request to be processed, and there will be the historical requests of same identification information with the request to be processed It requests as a comparison;
If judging result is there is no the historical requests with the request to be processed with same identification information, judgement is not connect It received and the identical historical requests of the request to be processed.
Its further technical solution is that historical requests are stored in cache server by the Website server, described Judge whether the time interval between the request to be processed and the comparison request is less than preset time threshold, comprising:
Inquiry message is sent to cache server, the inquiry message includes the identification information of the comparison request, described Inquiry message is for comparing the access time of request described in request;
The response message that the cache server returns is received, when the response message includes the access of the comparison request Between;
It is determined according to the access time of the access time of the request to be processed and the comparison request described to be processed Time interval between request and the comparison request, and judge the time between the request to be processed and the comparison request Whether interval is less than preset time threshold.
Its further technical solution is, the method also includes:
If judging result be do not received with the identical historical requests of the request to be processed, respond described to be processed ask It asks.
Its further technical solution is, the method also includes:
If judging result is that the time interval between the request to be processed and the comparison request is not less than preset Between threshold value, respond the request to be processed.
Second aspect, the embodiment of the invention also provides a kind of interception repetitive requests devices comprising:
First judging unit, if the request to be processed for receiving client transmission, judge whether to receive with it is described It is to be processed to request identical historical requests;
Second judgment unit, if the judging result for the first judging unit is identical as the request to be processed to receive Historical requests, will be requested as a comparison with the identical historical requests of the request to be processed, and judge the request to be processed Whether the time interval between the comparison request is less than preset time threshold;
Refuse unit, if the judging result for second judgment unit is the request to be processed and the comparison request Between time interval be less than preset time threshold, refuse the request to be processed.
Its further technical solution is that first judging unit includes:
Acquiring unit, for obtaining the identification information of the request to be processed, the identification information is described to be processed asks The User ID and the address URL asked or the identification information are token and the address URL of the request to be processed;
Third judging unit with the request to be processed there is the history of same identification information to ask for judging whether there is It asks;
First judging unit, if the judging result for third judging unit is to exist to have phase with the request to be processed With the historical requests of identification information, judgement received the identical historical requests with the request to be processed, and will be with described wait locate There are the historical requests of same identification information to request as a comparison for reason request;
Second judging unit, if the judging result for third judging unit is that there is no have with the request to be processed The historical requests of same identification information, judgement did not received and the identical historical requests of the request to be processed.
Its further technical solution is that historical requests are stored in cache server by the Website server, described Second judgment unit includes:
Transmission unit, for sending inquiry message to cache server, the inquiry message includes the comparison request Identification information, the inquiry message is for comparing the access time of request described in request;
Receiving unit, the response message returned for receiving the cache server, the response message include described right Than the access time of request;
Determination unit, for true according to the access time of the request to be processed and the access time of the comparison request Time interval between the fixed request to be processed and the comparison request, and judge that the request to be processed is asked with the comparison Whether the time interval between asking is less than preset time threshold.
Its further technical solution is the interception repetitive requests device further include:
Response unit, if the judging result for the first judging unit is identical with the request to be processed not receive If the judging result of historical requests or second judgment unit is the time between the request to be processed and the comparison request Interval is not less than preset time threshold, responds the request to be processed.
The third aspect, the embodiment of the invention also provides a kind of computer equipments comprising memory and processor, it is described Computer program is stored on memory, the processor realizes the above method when executing the computer program.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage medium, the storage medium storage There is computer program, the computer program can realize the above method when being executed by a processor.
Pass through the technical solution of the application embodiment of the present invention, when receiving the request to be processed of client transmission, judgement Whether received and the identical historical requests of request to be processed;If it is judged that identical as the request to be processed to receive Historical requests, then will be requested as a comparison with the identical historical requests of request to be processed, and judge request and comparison to be processed Whether the time interval between request is less than preset time threshold;If it is judged that for request to be processed and comparison request Between time interval be less than preset time threshold, then refuse the request to be processed, so as to effectively intercept client Repetitive requests in a short time alleviate the burden of Website server, it is ensured that server can operate normally.This hair simultaneously Bright implementation is simple, realizes that difficulty is low, at low cost.
Detailed description of the invention
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of application scenarios schematic diagram of method for intercepting repetitive requests provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram of method for intercepting repetitive requests provided in an embodiment of the present invention;
Fig. 3 is a kind of sub-process schematic diagram of method for intercepting repetitive requests provided in an embodiment of the present invention;
Fig. 4 is a kind of another sub-process schematic diagram of method for intercepting repetitive requests provided in an embodiment of the present invention;
Fig. 5 be another embodiment of the present invention provides a kind of interception repetitive requests method flow diagram;
Fig. 6 is a kind of schematic block diagram for intercepting repetitive requests device provided in an embodiment of the present invention;
Fig. 7 is a kind of schematic frame of the first judging unit for intercepting repetitive requests device provided in an embodiment of the present invention Figure;
Fig. 8 is a kind of schematic frame of second judgment unit for intercepting repetitive requests device provided in an embodiment of the present invention Figure;
Fig. 9 be another embodiment of the present invention provides a kind of interception repetitive requests device schematic block diagram;And
Figure 10 is the schematic block diagram of computer equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
Fig. 1 and Fig. 2 are please referred to, Fig. 1 is a kind of applied field of method for intercepting repetitive requests provided in an embodiment of the present invention Scape schematic diagram.Fig. 2 is a kind of schematic flow chart of method for intercepting repetitive requests provided in an embodiment of the present invention.
A kind of method for interception repetitive requests that the embodiment of the present invention proposes is applied to Website server 1 (Web server) In.When Website server 1 receives the request to be processed that client 2 is sent, judge that about 2 client sends this twice and to be processed asks Whether the time interval asked is less than preset time threshold, if so, Website server 1 refuses the request to be processed.Website service The historical requests received are stored in cache server 3 by device 1.
Fig. 2 is a kind of flow diagram of method for intercepting repetitive requests provided in an embodiment of the present invention.As shown, should Method includes the following steps S1-S3.
If S1, the request to be processed for receiving client transmission, judge whether to receive go through identical with request to be processed History request.
In specific implementation, when receiving the request to be processed of client transmission, judges whether to receive and be asked with to be processed Seek identical historical requests.Specifically, all historical requests are traversed, have checked whether go through identical with the request to be processed History request.
In some embodiments, as shown in figure 3, the step S1 may include following steps S11-S14.
S11 obtains the identification information of request to be processed.
Wherein, identification information is the User ID of request to be processed and the address URL or identification information are request to be processed Token and the address URL.
In specific implementation, parsing obtains the identification information of request to be processed.In one embodiment, identification information is to be processed The User ID of request and the address URL.Or in further embodiments, identification information is the token of request to be processed (Token) and the address URL.
URL (Uniform/Universal Resource Locator, uniform resource locator) is to can be from interconnection The position of the resource obtained on the net and a kind of succinct expression of access method, are the addresses of standard resource on internet.
S12 judges whether there is the historical requests for having same identification information with request to be processed.
In specific implementation, after the identification information for getting request to be processed, judges whether there is and have with request to be processed There are the historical requests of same identification information.
S13, if judging result is to determine to receive in the presence of the historical requests with request to be processed with same identification information Cross with the identical historical requests of request to be processed, and using with request to be processed have the historical requests of same identification information as pair Than request.
In specific implementation, if it is judged that there are the historical requests that there is same identification information with request to be processed, Then determine to receive with request to be processed identical historical requests.
And with request to be processed will there are the historical requests of same identification information to request as a comparison.Specifically, if The identification information of only one historical requests is identical as the identification information of request to be processed, then asks the historical requests as a comparison It asks;If there is the identification information of multiple historical requests is identical as the identification information of request to be processed, then by multiple historical requests In the historical requests that finally receive request as a comparison.
S14, if judging result is to determine not there is no the historical requests with request to be processed with same identification information Received the identical historical requests with request to be processed.
In specific implementation, if it is judged that for there is no with request to be processed there is the history of same identification information to ask It asks, then determines not receive with request to be processed identical historical requests.
If S2, judging result are to receive the identical historical requests with request to be processed, will be identical with request to be processed Historical requests are requested as a comparison, and judge it is to be processed request comparison request between time interval whether be less than preset when Between threshold value.
In specific implementation, if it is judged that for receive with the identical historical requests of request to be processed, then will with wait locate Reason requests identical historical requests to be requested as a comparison.Specifically, if the mark of only one historical requests and request to be processed It is identical to know information, then requests the historical requests as a comparison;If there is multiple historical requests and the mark of request to be processed are believed Manner of breathing is same, then requests the historical requests finally received in multiple historical requests as a comparison.
Further, judge whether the time interval between request and comparison request to be processed is less than preset time threshold Value.Specifically, the access time for obtaining request to be processed with comparison request respectively asks according to request and comparison to be processed is obtained The access time asked determines that (time interval is equal to the visit of request to be processed to the time interval between request and comparison request to be processed Ask that the time subtracts the access time of comparison request), then judge whether time interval is less than preset time threshold.
Need to illustrate that time threshold can be set by those skilled in the art according to specifically interception request, the present invention is real Example is applied to be not specifically limited in this embodiment.For example, in one embodiment, time threshold is set as 100ms.
In some embodiments, historical requests are stored in cache server by Website server, as shown in figure 4, described Step S2 may include following steps S21-S23.
S21 sends inquiry message to cache server, and inquiry message includes the identification information of comparison request, inquiry message Access time for request comparison request.
In the present embodiment, historical requests are stored in cache server by Website server.Meanwhile in order to avoid caching Server storing excess data, settable caching expired time, such as caching expired time are set as 10 seconds, deposit in historical requests Time be more than caching expired time when, historical requests are deleted.
In specific implementation, inquiry message is sent to cache server, inquiry message includes the identification information of comparison request, is ask Ask access time of the information for request comparison request.Cache server receives the inquiry message of Website server transmission When, the identification information for the comparison request for including according to inquiry message searches comparison request, and obtains the access time of comparison request, And the access time of comparison request is sent to Website server.
S22, receives the response message that cache server returns, and response message includes the access time of comparison request.
In specific implementation, the response message that cache server returns is received, and parses and obtains the comparison that response message includes The access time of request.
S23 determines request and comparison to be processed according to the access time of request to be processed and the access time of comparison request Time interval between request, and judge whether the time interval between request and comparison request to be processed is less than the preset time Threshold value.
In specific implementation, check the access time of request to be processed, then according to the access time of request to be processed and The access time of the comparison request determined by step S22 determines the time interval between request and comparison request to be processed, (when Between interval be equal to request to be processed access time subtract comparison request access time), then judge whether time interval small In preset time threshold.
If S3, judging result are that the time interval between request and comparison request to be processed is less than preset time threshold, Then refuse the request to be processed.
In specific implementation, if it is judged that the time interval between request to be processed and comparison request is less than preset Time threshold then illustrates that the client repeats to issue same request in a short time, therefore refuses the request to be processed, to ensure Website server can operate normally.
Pass through the technical solution of the application embodiment of the present invention, when receiving the request to be processed of client transmission, judgement Whether received and the identical historical requests of request to be processed;If it is judged that identical as the request to be processed to receive Historical requests, then will be requested as a comparison with the identical historical requests of request to be processed, and judge request and comparison to be processed Whether the time interval between request is less than preset time threshold;If it is judged that for request to be processed and comparison request Between time interval be less than preset time threshold, then refuse the request to be processed, so as to effectively intercept client Repetitive requests in a short time alleviate the burden of Website server.Implementation of the present invention is simple simultaneously, realizes difficulty It is low, at low cost.
Fig. 5 be another embodiment of the present invention provides a kind of interception repetitive requests method flow diagram.Such as Fig. 5 institute Show, the method for the interception repetitive requests of the present embodiment includes step S510-S550.
If S510, the request to be processed for receiving client transmission, judge whether to receive identical with request to be processed Otherwise historical requests go to S540 if going to S520.
In specific implementation, when receiving the request to be processed of client transmission, judges whether to receive and be asked with to be processed Seek identical historical requests.Specifically, all historical requests are traversed, have checked whether go through identical with the request to be processed History request.
S520, it identical historical requests will be requested as a comparison with request to be processed, and judge request and comparison to be processed Whether the time interval between request is less than preset time threshold, if going to S530, otherwise goes to S540.
In specific implementation, if it is judged that for receive with the identical historical requests of request to be processed, then will with wait locate Reason requests identical historical requests to be requested as a comparison.Specifically, if the mark of only one historical requests and request to be processed It is identical to know information, then requests the historical requests as a comparison;If there is multiple historical requests and the mark of request to be processed are believed Manner of breathing is same, then requests the historical requests finally received in multiple historical requests as a comparison.
Further, judge whether the time interval between request and comparison request to be processed is less than preset time threshold Value.Specifically, the access time for obtaining request to be processed with comparison request respectively asks according to request and comparison to be processed is obtained The access time asked determines that (time interval is equal to the visit of request to be processed to the time interval between request and comparison request to be processed Ask that the time subtracts the access time of comparison request), then judge whether time interval is less than preset time threshold.
Need to illustrate that time threshold can be set by those skilled in the art according to specifically interception request, the present invention is real Example is applied to be not specifically limited in this embodiment.For example, in one embodiment, time threshold is set as 100ms.
S530, refuse the request to be processed.
In specific implementation, if it is judged that the time interval between request to be processed and comparison request is less than preset Time threshold then illustrates that the client repeats to issue same request in a short time, therefore refuses the request to be processed, to ensure Website server can operate normally.
S540 responds the request to be processed.
In specific implementation, if it is judged that then response should not receive the identical historical requests with request to be processed Request to be processed is handled the request to be processed.
Fig. 6 is a kind of schematic block diagram for intercepting repetitive requests device 60 provided in an embodiment of the present invention.As shown in fig. 6, Corresponding to the above method for intercepting repetitive requests, the present invention also provides a kind of interception repetitive requests devices 60.The interception repeats to ask Seeking device 60 includes the unit for executing the method for above-mentioned interception repetitive requests, which can be configured in server. Specifically, referring to Fig. 6, the interception repetitive requests device 60 includes the first judging unit 61, second judgment unit 62 and refuses Exhausted unit 63.
First judging unit 61, if the request to be processed for receiving client transmission, judges whether to receive and institute State the identical historical requests of request to be processed;
Second judgment unit 62, if the judging result for the first judging unit 61 is to receive and the request to be processed Identical historical requests will request as a comparison with the identical historical requests of the request to be processed, and judge described to be processed Whether the time interval between request and the comparison request is less than preset time threshold;
Refuse unit 63, if the judging result for second judgment unit 62 is that the request to be processed is asked with the comparison Time interval between asking is less than preset time threshold, then refuses the request to be processed.
In one embodiment, as shown in fig. 7, first judging unit 61 includes acquiring unit 611, third judging unit 612, the first judging unit 613 and the second judging unit 614.
Acquiring unit 611, for obtaining the identification information of the request to be processed, the identification information is described to be processed The User ID of request and the address URL or the identification information are token and the address URL of the request to be processed;
Third judging unit 612 has going through for same identification information with the request to be processed for judging whether there is History request;
First judging unit 613, if the judging result for third judging unit 612 is to exist and the request to be processed Historical requests with same identification information, then determine to receive the identical historical requests with the request to be processed, and will be with There are the historical requests of same identification information to request as a comparison for the request to be processed;
Second judging unit 614, if the judging result for third judging unit 612 is that there is no to be processed ask with described The historical requests with same identification information are sought, then determine not receive the identical historical requests with the request to be processed.
In one embodiment, as shown in figure 8, the second judgment unit 62 includes transmission unit 621, receiving unit 622 And determination unit 623.
Transmission unit 621, for sending inquiry message to cache server, the inquiry message is requested comprising the comparison Identification information, the inquiry message is for comparing the access time of request described in request;
Receiving unit 622, the response message returned for receiving the cache server, the response message include described Compare the access time of request;
Determination unit 623, when for according to the access of access time of the request to be processed and the comparison request Between determine it is described it is to be processed request it is described comparison request between time interval, and judge it is described it is to be processed request with it is described right Whether it is less than preset time threshold than the time interval between request.
Fig. 9 be another embodiment of the present invention provides a kind of interception repetitive requests device 60 schematic block diagram.Such as Fig. 7 institute Show, the interception repetitive requests device 60 of the present embodiment is to increase response unit 64 on the basis of above-described embodiment.
Response unit 64, if the judging result for the first judging unit 61 is not receive and the request phase to be processed If the judging result of same historical requests or second judgment unit 62 is between the request to be processed and comparison request Time interval be not less than preset time threshold, respond the request to be processed.
It should be noted that it is apparent to those skilled in the art that, above-mentioned interception repetitive requests device 60 and each unit specific implementation process, can with reference to the corresponding description in preceding method embodiment, for convenience of description and Succinctly, details are not described herein.
Above-mentioned interception repetitive requests device 60 can be implemented as a kind of form of computer program, which can be with It is run in computer equipment as shown in Figure 10.
Referring to Fig. 10, Figure 10 is a kind of schematic block diagram of computer equipment provided by the embodiments of the present application.The calculating Machine equipment 500 can be server, wherein server can be independent server, be also possible to multiple server compositions Server cluster.
Refering to fig. 10, which includes processor 502, memory and the net connected by system bus 501 Network interface 505, wherein memory may include non-volatile memory medium 503 and built-in storage 504.
The non-volatile memory medium 503 can storage program area 5031 and computer program 5032.The computer program 5032 are performed, and processor 502 may make to execute a kind of method for intercepting repetitive requests.
The processor 502 is for providing calculating and control ability, to support the operation of entire computer equipment 500.
The built-in storage 504 provides environment for the operation of the computer program 5032 in non-volatile memory medium 503, should When computer program 5032 is executed by processor 502, processor 502 may make to execute a kind of method for intercepting repetitive requests.
The network interface 505 is used to carry out network communication with other equipment.It will be understood by those skilled in the art that in Figure 10 The structure shown, only the block diagram of part-structure relevant to application scheme, does not constitute and is applied to application scheme The restriction of computer equipment 500 thereon, specific computer equipment 500 may include more more or fewer than as shown in the figure Component perhaps combines certain components or with different component layouts.
Wherein, the processor 502 is for running computer program 5032 stored in memory, to realize following step It is rapid:
If receiving the request to be processed of client transmission, judge whether to receive go through identical with the request to be processed History request;
If judging result be received with the identical historical requests of the request to be processed, will be with the request phase to be processed Same historical requests are requested as a comparison, and whether judge the time interval between the request to be processed and the comparison request Less than preset time threshold;
If judging result is that the time interval between the request to be processed and the comparison request is less than the preset time Threshold value then refuses the request to be processed.
In one embodiment, processor 502 judges whether described in the realization to receive identical with the request to be processed When historical requests step, it is implemented as follows step:
Obtain the identification information of the request to be processed, the identification information be the request to be processed User ID and The address URL or the identification information are token and the address URL of the request to be processed;
Judge whether there is the historical requests that there is same identification information with the request to be processed;
If judging result is to determine to receive in the presence of the historical requests with the request to be processed with same identification information Cross with the identical historical requests of the request to be processed, and will have the history of same identification information ask with the request to be processed It asks and requests as a comparison;
If judging result is to determine not there is no the historical requests with the request to be processed with same identification information It received and the identical historical requests of the request to be processed.
In one embodiment, historical requests are stored in cache server by Website server, and processor 502 is realizing institute State judge it is described it is to be processed request it is described comparison request between time interval whether be less than preset time threshold step when, It is implemented as follows step:
Inquiry message is sent to cache server, the inquiry message includes the identification information of the comparison request, described Inquiry message is for comparing the access time of request described in request;
The response message that the cache server returns is received, when the response message includes the access of the comparison request Between;
It is determined according to the access time of the access time of the request to be processed and the comparison request described to be processed Time interval between request and the comparison request, and judge the time between the request to be processed and the comparison request Whether interval is less than preset time threshold.
In one embodiment, processor 502 also realizes following steps:
If judging result be do not received with the identical historical requests of the request to be processed, respond described to be processed ask It asks.
In one embodiment, processor 502 also realizes following steps:
If judging result is that the time interval between the request to be processed and the comparison request is not less than preset Between threshold value, then respond the request to be processed.
It should be appreciated that in the embodiment of the present application, processor 502 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable GateArray, FPGA) or other programmable logic devices Part, discrete gate or transistor logic, discrete hardware components etc..Wherein, general processor can be microprocessor or The processor is also possible to any conventional processor etc..
Those of ordinary skill in the art will appreciate that be realize above-described embodiment method in all or part of the process, It is that relevant hardware can be instructed to complete by computer program.The computer program can be stored in a storage medium, The storage medium is computer readable storage medium.The computer program is held by least one processor in the computer system Row, to realize the process step of the embodiment of the above method.
Therefore, the present invention also provides a kind of storage mediums.The storage medium can be computer readable storage medium.This is deposited Storage media is stored with computer program.The computer program makes processor execute following steps when being executed by processor:
If receiving the request to be processed of client transmission, judge whether to receive go through identical with the request to be processed History request;
If judging result be received with the identical historical requests of the request to be processed, will be with the request phase to be processed Same historical requests are requested as a comparison, and whether judge the time interval between the request to be processed and the comparison request Less than preset time threshold;
If judging result is that the time interval between the request to be processed and the comparison request is less than the preset time Threshold value then refuses the request to be processed.
In one embodiment, the processor execute the computer program and realize it is described judge whether to receive with When the identical historical requests step of the request to be processed, it is implemented as follows step:
Obtain the identification information of the request to be processed, the identification information be the request to be processed User ID and The address URL or the identification information are token and the address URL of the request to be processed;
Judge whether there is the historical requests that there is same identification information with the request to be processed;
If judging result is to determine to receive in the presence of the historical requests with the request to be processed with same identification information Cross with the identical historical requests of the request to be processed, and will have the history of same identification information ask with the request to be processed It asks and requests as a comparison;
If judging result is to determine not there is no the historical requests with the request to be processed with same identification information It received and the identical historical requests of the request to be processed.
In one embodiment, historical requests are stored in cache server by Website server, and the processor is executing The computer program and realize it is described judge it is described it is to be processed request it is described comparison request between time interval it is whether small When preset time threshold step, it is implemented as follows step:
Inquiry message is sent to cache server, the inquiry message includes the identification information of the comparison request, described Inquiry message is for comparing the access time of request described in request;
The response message that the cache server returns is received, when the response message includes the access of the comparison request Between;
It is determined according to the access time of the access time of the request to be processed and the comparison request described to be processed Time interval between request and the comparison request, and judge the time between the request to be processed and the comparison request Whether interval is less than preset time threshold.
In one embodiment, the processor also realizes following steps in the execution computer program:
If judging result be do not received with the identical historical requests of the request to be processed, respond described to be processed ask It asks.
In one embodiment, the processor also realizes following steps in the execution computer program:
If judging result is that the time interval between the request to be processed and the comparison request is not less than preset Between threshold value, then respond the request to be processed.
The storage medium can be USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), magnetic disk Or the various computer readable storage mediums that can store program code such as CD.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not It is considered as beyond the scope of this invention.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary.For example, the division of each unit, only Only a kind of logical function partition, there may be another division manner in actual implementation.Such as multiple units or components can be tied Another system is closed or is desirably integrated into, or some features can be ignored or not executed.
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.This hair Unit in bright embodiment device can be combined, divided and deleted according to actual needs.In addition, in each implementation of the present invention Each functional unit in example can integrate in one processing unit, is also possible to each unit and physically exists alone, can also be with It is that two or more units are integrated in one unit.
If the integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product, It can store in one storage medium.Based on this understanding, technical solution of the present invention is substantially in other words to existing skill The all or part of part or the technical solution that art contributes can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, terminal or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in some embodiment Part, reference can be made to the related descriptions of other embodiments.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, the even these modifications and changes of the present invention range that belongs to the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right It is required that protection scope subject to.

Claims (10)

1. a kind of method for intercepting repetitive requests, which is characterized in that the method is applied in Website server, the method packet It includes:
If receiving the request to be processed of client transmission, judges whether to receive the identical history with the request to be processed and ask It asks;
If judging result be received with the identical historical requests of the request to be processed, will be identical with the request to be processed Historical requests are requested as a comparison, and judge whether the time interval between the request to be processed and the comparison request is less than Preset time threshold;And
If judging result is that the time interval between the request to be processed and the comparison request is less than preset time threshold, Refuse the request to be processed.
2. the method according to claim 1, wherein described judge whether to receive and the request phase to be processed Same historical requests, comprising:
The identification information of the request to be processed is obtained, the identification information is the User ID and URL of the request to be processed Address or the identification information are token and the address URL of the request to be processed;
Judge whether there is the historical requests that there is same identification information with the request to be processed;
If judging result is in the presence of the historical requests with the request to be processed with same identification information, judgement was received and institute State the identical historical requests of request to be processed, and using with the request to be processed have the historical requests of same identification information as Comparison request.
3. the method according to claim 1, wherein historical requests are stored in caching clothes by the Website server It is engaged in device, it is described to judge whether the time interval between the request to be processed and the comparison request is less than preset time threshold Value, comprising:
Inquiry message is sent to cache server, the inquiry message includes the identification information of the comparison request, the inquiry Information is for comparing the access time of request described in request;
The response message that the cache server returns is received, the response message includes the access time of the comparison request;
The request to be processed is determined according to the access time of the access time of the request to be processed and the comparison request The time interval between requesting is compared with described, and judges the time interval between the request to be processed and the comparison request Whether preset time threshold is less than.
4. the method according to claim 1, wherein the method also includes:
If judging result be do not received with the identical historical requests of the request to be processed, respond the request to be processed.
5. the method according to claim 1, wherein the method also includes:
If judging result is that the time interval between the request to be processed and the comparison request is not less than preset time threshold Value responds the request to be processed.
6. a kind of interception repetitive requests device characterized by comprising
First judging unit, if the request to be processed for receiving client transmission, judges whether to receive with described wait locate Reason requests identical historical requests;
Second judgment unit, if the judging result for the first judging unit is to receive go through identical with the request to be processed History request will request as a comparison with the identical historical requests of the request to be processed, and judge the request to be processed and institute Whether the time interval stated between comparison request is less than preset time threshold;
Refuse unit, if the judging result for second judgment unit is between the request to be processed and comparison request Time interval is less than preset time threshold, refuses the request to be processed.
7. interception repetitive requests device according to claim 6, which is characterized in that first judging unit includes:
Acquiring unit, for obtaining the identification information of the request to be processed, the identification information is the request to be processed User ID and the address URL or the identification information are token and the address URL of the request to be processed;
Third judging unit, for judging whether there is the historical requests that there is same identification information with the request to be processed;
First judging unit, if the judging result for third judging unit is to exist to have identical mark with the request to be processed Know the historical requests of information, judgement received with the identical historical requests of the request to be processed, and to be processed will be asked with described The historical requests with same identification information are asked to request as a comparison;
Second judging unit, if the judging result for third judging unit is identical there is no having with the request to be processed The historical requests of identification information, judgement did not received and the identical historical requests of the request to be processed.
8. interception repetitive requests device according to claim 6, which is characterized in that the Website server is by historical requests It is stored in cache server, the second judgment unit includes:
Transmission unit, for sending inquiry message to cache server, the inquiry message includes the mark of the comparison request Information, the inquiry message is for comparing the access time of request described in request;
Receiving unit, the response message returned for receiving the cache server, the response message include that the comparison is asked The access time asked;
Determination unit, for determining institute according to the access time of the request to be processed and the access time of the comparison request The time interval between request to be processed and the comparison request is stated, and judges the request to be processed and the comparison request Between time interval whether be less than preset time threshold.
9. a kind of computer equipment, which is characterized in that the computer equipment includes memory and processor, on the memory It is stored with computer program, the processor is realized as described in any one of claim 1-5 when executing the computer program Method.
10. a kind of storage medium, which is characterized in that the storage medium is stored with computer program, and the computer program is worked as Method according to any one of claims 1 to 5 can be realized when being executed by processor.
CN201810812954.0A 2018-07-23 2018-07-23 Intercept method, apparatus, computer equipment and the storage medium of repetitive requests Withdrawn CN109040209A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810812954.0A CN109040209A (en) 2018-07-23 2018-07-23 Intercept method, apparatus, computer equipment and the storage medium of repetitive requests

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810812954.0A CN109040209A (en) 2018-07-23 2018-07-23 Intercept method, apparatus, computer equipment and the storage medium of repetitive requests

Publications (1)

Publication Number Publication Date
CN109040209A true CN109040209A (en) 2018-12-18

Family

ID=64644368

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810812954.0A Withdrawn CN109040209A (en) 2018-07-23 2018-07-23 Intercept method, apparatus, computer equipment and the storage medium of repetitive requests

Country Status (1)

Country Link
CN (1) CN109040209A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109976896A (en) * 2019-04-09 2019-07-05 中国联合网络通信集团有限公司 Business re-scheduling treating method and apparatus
CN110311986A (en) * 2019-07-10 2019-10-08 中国民航信息网络股份有限公司 The treating method and apparatus of mobile terminal request
CN110442466A (en) * 2019-06-14 2019-11-12 平安科技(深圳)有限公司 Prevent request repeated accesses method, apparatus, computer equipment and storage medium
CN110543348A (en) * 2019-09-06 2019-12-06 北京奇艺世纪科技有限公司 instruction processing method, system, electronic equipment and storage medium
CN110597573A (en) * 2019-08-23 2019-12-20 贝壳技术有限公司 Warehouse entry request data processing method and device
CN110955563A (en) * 2019-11-26 2020-04-03 上海易点时空网络有限公司 Data backup method and device
CN111061938A (en) * 2019-12-17 2020-04-24 深圳前海环融联易信息科技服务有限公司 Anti-jitter function method, device, computer equipment and storage medium for solving multi-time triggering network request
CN111190709A (en) * 2019-11-19 2020-05-22 泰康保险集团股份有限公司 Method and device for processing request, electronic equipment and readable storage medium
CN111224939A (en) * 2019-11-15 2020-06-02 上海钧正网络科技有限公司 Task request intercepting method and device, computer equipment and storage medium
CN111711642A (en) * 2020-07-15 2020-09-25 网易(杭州)网络有限公司 Protocol request processing method and device, electronic equipment and storage medium
CN112527826A (en) * 2019-09-19 2021-03-19 北京京东振世信息技术有限公司 Method and device for processing request
CN113076201A (en) * 2020-01-03 2021-07-06 中国移动通信集团广东有限公司 Mutual exclusion checking method for task instruction and electronic equipment
CN113434293A (en) * 2021-06-29 2021-09-24 青岛海尔科技有限公司 Method and apparatus for processing repeat request, storage medium, and electronic apparatus
CN113438227A (en) * 2021-06-23 2021-09-24 平安普惠企业管理有限公司 Method, device and equipment for limiting current of repeated requests and storage medium
CN113660201A (en) * 2021-07-08 2021-11-16 上海二三四五网络科技有限公司 Control method and control device for high-concurrency main key conflict
CN114268662A (en) * 2021-12-21 2022-04-01 北京京东振世信息技术有限公司 Position information acquisition method, device, equipment and medium
CN114666319A (en) * 2022-03-02 2022-06-24 北京百度网讯科技有限公司 Data downloading method and device, electronic equipment and readable storage medium

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109976896A (en) * 2019-04-09 2019-07-05 中国联合网络通信集团有限公司 Business re-scheduling treating method and apparatus
CN110442466A (en) * 2019-06-14 2019-11-12 平安科技(深圳)有限公司 Prevent request repeated accesses method, apparatus, computer equipment and storage medium
CN110442466B (en) * 2019-06-14 2024-05-07 平安科技(深圳)有限公司 Method, device, computer equipment and storage medium for preventing repeated access request
CN110311986A (en) * 2019-07-10 2019-10-08 中国民航信息网络股份有限公司 The treating method and apparatus of mobile terminal request
CN110597573A (en) * 2019-08-23 2019-12-20 贝壳技术有限公司 Warehouse entry request data processing method and device
CN110543348B (en) * 2019-09-06 2023-03-24 北京奇艺世纪科技有限公司 Instruction processing method, system, electronic equipment and storage medium
CN110543348A (en) * 2019-09-06 2019-12-06 北京奇艺世纪科技有限公司 instruction processing method, system, electronic equipment and storage medium
CN112527826A (en) * 2019-09-19 2021-03-19 北京京东振世信息技术有限公司 Method and device for processing request
CN111224939A (en) * 2019-11-15 2020-06-02 上海钧正网络科技有限公司 Task request intercepting method and device, computer equipment and storage medium
CN111190709A (en) * 2019-11-19 2020-05-22 泰康保险集团股份有限公司 Method and device for processing request, electronic equipment and readable storage medium
CN111190709B (en) * 2019-11-19 2024-04-12 泰康保险集团股份有限公司 Method and device for processing request, electronic equipment and readable storage medium
CN110955563A (en) * 2019-11-26 2020-04-03 上海易点时空网络有限公司 Data backup method and device
CN111061938A (en) * 2019-12-17 2020-04-24 深圳前海环融联易信息科技服务有限公司 Anti-jitter function method, device, computer equipment and storage medium for solving multi-time triggering network request
CN113076201A (en) * 2020-01-03 2021-07-06 中国移动通信集团广东有限公司 Mutual exclusion checking method for task instruction and electronic equipment
CN113076201B (en) * 2020-01-03 2023-04-11 中国移动通信集团广东有限公司 Mutual exclusion checking method for task instruction and electronic equipment
CN111711642A (en) * 2020-07-15 2020-09-25 网易(杭州)网络有限公司 Protocol request processing method and device, electronic equipment and storage medium
CN113438227A (en) * 2021-06-23 2021-09-24 平安普惠企业管理有限公司 Method, device and equipment for limiting current of repeated requests and storage medium
CN113438227B (en) * 2021-06-23 2024-02-27 平安普惠企业管理有限公司 Method, device, equipment and storage medium for limiting repeated request
CN113434293A (en) * 2021-06-29 2021-09-24 青岛海尔科技有限公司 Method and apparatus for processing repeat request, storage medium, and electronic apparatus
CN113660201A (en) * 2021-07-08 2021-11-16 上海二三四五网络科技有限公司 Control method and control device for high-concurrency main key conflict
CN114268662A (en) * 2021-12-21 2022-04-01 北京京东振世信息技术有限公司 Position information acquisition method, device, equipment and medium
CN114666319A (en) * 2022-03-02 2022-06-24 北京百度网讯科技有限公司 Data downloading method and device, electronic equipment and readable storage medium
CN114666319B (en) * 2022-03-02 2024-03-22 北京百度网讯科技有限公司 Data downloading method, device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN109040209A (en) Intercept method, apparatus, computer equipment and the storage medium of repetitive requests
CN107222426B (en) Flow control method, device and system
CN109104483B (en) Micro-service dynamic load balancing method and device based on event notification
CN110069941A (en) A kind of interface access authentication method, apparatus and computer-readable medium
CN107832329B (en) Page resource obtaining method and terminal equipment
CN109586969A (en) Content distributing network disaster recovery method, device, computer equipment and storage medium
WO2007061824A1 (en) System, method, and computer program product for throttling client traffic
CN107360122B (en) Method and device for preventing malicious request
CN108200132B (en) Resource acquisition method, device, equipment and computer readable storage medium
CN108737582A (en) The method and device of domain name mapping
US11709900B2 (en) Automated web page accessing
CN115190047A (en) Server health monitoring method and system and computing equipment
CN109981779B (en) Service providing method, server and computer storage medium
WO2018080967A1 (en) Security mechanism for multi-tiered server­implemented applications
CN102769625A (en) Client-side Cookie information acquisition method and device
CN108055299B (en) Portal page pushing method, network access server and Portal authentication system
CN113938464A (en) Access request method and terminal
CN113553557A (en) Application secret-free login method and device, electronic equipment and storage medium
CN109327468A (en) A kind of offline reminding method, device, equipment and storage medium
CN110233843B (en) User request processing method and device
CN109344349B (en) Data caching method and device and electronic equipment
CN108282495B (en) DNS hijacking defense method and device
CN111767481A (en) Access processing method, device, equipment and storage medium
CN107203915B (en) Data storage method and device
US20040215739A1 (en) Cookies or liberty enabler for processing all connections between user/agent and origin server in a wireless network for enabling cookies or liberty support services for users/agents

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20181218