Access request processing method, device, storage medium and computer equipment
By judging the client IP and data type, defending against crawler access, the server pressure problem caused by crawlers' frequent access is solved, and the data of the target website is protected.
Patent Information
- Application Number
- CN202211246977.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-10-12
AI Technical Summary
Frequent access to target websites by crawlers leads to increased pressure on the server side, affecting the client experience and causing valuable data to be crawled, which makes it difficult for existing technology to effectively defend.
By obtaining the IP address of the client, determining whether it is on the blacklist, updating the number of accesses, decrypting and comparing the initial data, determining whether the data types are consistent, and allowing or denying access requests.
It increases the difficulty of crawlers, reduces abnormal access requests, reduces server pressure, and protects valuable data.
Smart Images

Figure CN115618149B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method, apparatus, storage medium, and computer equipment for processing access requests. Background Art
[0002] With the development of the internet, information is becoming increasingly diverse and decentralized. Users from different fields and backgrounds often have different search objectives and needs. Search engine results often contain a large number of web pages that users are not interested in. Consequently, many service providers categorize and integrate massive, dispersed data to gain commercial benefits. However, many others use crawlers to disguise access requests, thereby obtaining pre-categorized and integrated data and providing it to users to generate traffic value.
[0003] After research, it was found that the extensive use of crawler programs will frequently initiate access requests to the target website, increase the pressure on the target website server, seriously affect the client's user experience, and cause a large amount of valuable data to be captured by the crawler. Summary of the Invention
[0004] The embodiments of the present application provide a method, apparatus, storage medium, and computer equipment for processing access requests, which can increase the difficulty of crawling the target website, reduce the number of abnormal access requests, and thus reduce the pressure on the server, while also protecting a large amount of valuable data in the target website.
[0005] In a first aspect, the present application provides a method for processing an access request, which is applied to a server and includes:
[0006] When receiving an access request sent by a client, obtaining the initial data contained in the access request and the IP address of the client;
[0007] Determine whether the IP address exists in a preset blacklist, and if the IP address does not exist in the blacklist, update a first access count, where the first access count is the number of times the client accesses the server;
[0008] If the currently updated first access count does not exceed a first preset threshold, decompressing and decrypting the initial data to obtain target data corresponding to the initial data and a data type of the target data;
[0009] Comparing the target data with data in a preset data pool, and if the comparison is successful, determining whether the client is accessing the server for the first time based on the currently updated first access count;
[0010] If it is not the first time for the client to access the server, determining whether the data type of the target data is the same as the target data type, where the target data type is the data type returned by the server to the client when the client last accessed the server;
[0011] If the data type of the target data is the same as the target data type, the client is allowed to access the server.
[0012] In one embodiment, after allowing the client to access the server, the method further includes:
[0013] The target data is stored in the data pool.
[0014] In one embodiment, the method further comprises:
[0015] If the currently updated first access count exceeds the first preset threshold, the IP address is added to the blacklist.
[0016] In one embodiment, the method further comprises:
[0017] If the IP address exists in the blacklist or the data type of the target data is different from the target data type, the client is denied access to the server.
[0018] In one embodiment, the data type of the target data is the first data type or the second data type;
[0019] When the data type of the target data is the first data type, comparing the target data with data in a preset data pool includes:
[0020] Determine a comparison data list; wherein the comparison data list is a collection of data in the data pool that has the same data type as the target data;
[0021] If the comparison data list is not empty, compare the target data with each item of data in the comparison data list;
[0022] If there is a difference between the target data and each data item in the comparison data list, the comparison is successful;
[0023] If the target data is completely consistent with any data in the comparison data list, the comparison fails and the client is denied access to the server.
[0024] In one embodiment, when the data type of the target data is the second data type, comparing the target data with data in a preset data pool includes:
[0025] Updating a second access count corresponding to the data type; wherein the second access count is the number of times a client carrying data of the data type accesses the server;
[0026] If the currently updated second access count does not exceed the second preset threshold, the comparison is passed;
[0027] If the currently updated second access count exceeds a second preset threshold, the comparison fails and the client is denied access to the server.
[0028] In one embodiment, the method further comprises:
[0029] If the data pool is empty or the comparison data list is empty, the comparison is successful.
[0030] In one embodiment, the method further comprises:
[0031] If the access request is the first time for the client to access the server, the client is allowed to access the server; wherein the data type of the initial data carried in the access request is the first data type by default.
[0032] In a second aspect, the present application provides an access request processing device, comprising:
[0033] A first acquisition module is configured to, upon receiving an access request from a client, acquire the initial data contained in the access request and the IP address of the client;
[0034] a determination module, configured to determine whether the IP address exists in a preset blacklist, and if the IP address does not exist in the blacklist, update a first access count, where the first access count is the number of times the client accesses the server;
[0035] a second acquisition module, configured to decompress and decrypt the initial data to obtain target data corresponding to the initial data and a data type of the target data if the currently updated first access count does not exceed a first preset threshold;
[0036] a comparison module, configured to compare the target data with data in a preset data pool, and if the comparison passes, determine whether the client accesses the server for the first time based on the currently updated first access count;
[0037] a judgment module, configured to judge, if this is not the first time that the client accesses the server, whether the data type of the target data is the same as a target data type, where the target data type is the data type returned by the server to the client when the client last accessed the server;
[0038] The access acceptance module is configured to allow the client to access the server if the data type of the target data is the same as the target data type.
[0039] In a third aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the access request processing method described in any of the above embodiments.
[0040] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;
[0041] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, they perform the steps of the method for processing an access request as described in any one of the above embodiments.
[0042] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0043] The access request processing method, apparatus, storage medium, and computer device provided in the present application, when receiving an access request sent by a client, obtains initial data and the IP address of the client contained in the access request, and determines whether the IP address exists in a preset blacklist. If the IP address does not exist in the blacklist, updates a first access count, which is the number of times the client has accessed the server. If the current updated first access count does not exceed a first preset threshold, decompresses and decrypts the initial data to obtain target data corresponding to the initial data and the data type of the target data. Compares the target data with data in a preset data pool. If the comparison passes, determines whether this is the first time the client has accessed the server based on the current updated first access count. If this is not the first time the client has accessed the server, determines whether the data type of the target data is the same as the target data type, which is the data type returned by the server to the client the last time the client accessed the server. If the data type of the target data is the same as the target data type, allows the client to access the server. By determining the number of IP accesses and judging and comparing data of randomly selected information types, the difficulty of crawling the target website is greatly increased, the number of abnormal access requests is reduced, and the pressure on the server is reduced. At the same time, a large amount of valuable data in the target website is also protected. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0045] Figure 1 is a flowchart of a method for processing an access request in one embodiment;
[0046] Figure 2 A flowchart of the steps of comparing the target data with data in a preset data pool when the data type of the target data is a first data type in one embodiment;
[0047] Figure 3 A flowchart of the steps of comparing the target data with data in a preset data pool when the data type of the target data is a second data type in one embodiment;
[0048] Figure 4 is a structural block diagram of an access request processing device in one embodiment;
[0049] Figure 5 FIG. 1 is a diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0051] like Figure 1 As shown, an embodiment of the present invention provides a method for processing an access request, which is applied to a server. The method includes:
[0052] Step S101: When an access request sent by a client is received, initial data and the IP address of the client included in the access request are obtained.
[0053] It is understandable that each client has one and only one IP address, and one IP address can uniquely identify one client.
[0054] Step S102: Determine whether the IP address exists in a preset blacklist.
[0055] Step S103: If the IP address exists in the blacklist, the client is denied access to the server.
[0056] It can be understood that the blacklist is used to record IP addresses that have accessed the server more than a first preset threshold number of times. Since the same IP address will not frequently access the same server, when an IP address in the blacklist accesses the server, no response will be given to the access request, that is, the client corresponding to the IP address is denied access to the server.
[0057] Step S104: If the IP address does not exist in the blacklist, the first access count is updated.
[0058] The first access count is the number of times the client accesses the server.
[0059] Step S105 , determining whether the currently updated first access count exceeds a first preset threshold.
[0060] Step S106: If the currently updated first access count exceeds the first preset threshold, the IP address is added to the blacklist.
[0061] Step S107 : If the currently updated first access count does not exceed the first preset threshold, decompress and decrypt the initial data to obtain target data corresponding to the initial data and the data type of the target data.
[0062] The initial data is the data carried in the access request when the client sends the access request to the server.
[0063] It is understandable that after the initial data is decompressed and decrypted, target data corresponding to the initial data can be obtained.
[0064] Step S108: comparing the target data with the data in a preset data pool.
[0065] It can be understood that the data pool is a database used by the server to store data.
[0066] Step S109, determining whether the comparison is successful.
[0067] Step S110: If the comparison fails, the client is denied access to the server.
[0068] Step S111: If the comparison passes, based on the currently updated first access count, it is determined whether the client accesses the server for the first time.
[0069] The first access count is the number of times the client accesses the server. When an access request sent by the client is received, the first access count corresponding to the client is incremented by one.
[0070] Step S112: If the client accesses the server for the first time, the client is allowed to access the server.
[0071] It is understandable that when the first access count is 1, it indicates that the client accesses the server for the first time.
[0072] Step S113: If it is not the first time for the client to access the server, it is determined whether the data type of the target data is the same as the target data type.
[0073] The target data type is the data type returned by the server to the client when the client accesses the server last time.
[0074] For example, assuming that the first access times corresponding to client A, client B and client C are 0, 2, 200 respectively, and the first preset threshold is 200, when client A, client B and client C initiate an access request to the server, the first access times corresponding to client A, client B and client C are updated, and the current updated first access times of client A, client B and client C are 1, 3, 201 respectively. Then, the first access time corresponding to client A is 1, which means that client A is accessing the server for the first time. The first access time corresponding to client B is 3, which does not exceed the first preset threshold 200. Then, it is determined whether the data type of the target data is the same as the target data type. The first access time corresponding to client C is 201, which exceeds the first preset threshold 200, and client C is denied access to the server.
[0075] Step S114: If the data type of the target data is the same as the target data type, the client is allowed to access the server.
[0076] Step S115: If the data type of the target data is different from the target data type, denying the client access to the server.
[0077] The access request processing method provided by the present application, when receiving an access request sent by a client, obtains the initial data and the IP address of the client contained in the access request, and determines whether the IP address exists in a preset blacklist; if the IP address does not exist in the blacklist, updates a first access count, which is the number of times the client has accessed the server; if the current updated first access count does not exceed a first preset threshold, decompresses and decrypts the initial data to obtain target data corresponding to the initial data and the data type of the target data; compares the target data with data in a preset data pool; if the comparison passes, determines whether it is the first time for the client to access the server based on the current updated first access count; if it is not the first time for the client to access the server, determines whether the data type of the target data is the same as the target data type, which is the data type returned by the server to the client when the client last accessed the server; if the data type of the target data is the same as the target data type, allows the client to access the server. By determining the number of IP accesses and judging and comparing data of randomly selected information types, the difficulty of crawling the target website is greatly increased, the number of abnormal access requests is reduced, and the pressure on the server is reduced. At the same time, a large amount of valuable data in the target website is also protected.
[0078] In one embodiment, the method further comprises:
[0079] The target data is stored in the data pool.
[0080] like Figure 2 As shown, in one embodiment, the data type of the target data is the first data type or the second data type, including:
[0081] Step S201 : When the data type of the target data is the first data type, the target data is compared with data in a preset data pool.
[0082] Step S202: Determine a comparison data list.
[0083] The comparison data list is a collection of data in the data pool that has the same data type as the target data.
[0084] Step S203: determine whether the comparison data list is empty.
[0085] Step S204: If the comparison data list is empty, the comparison is successful.
[0086] It is understandable that if the comparison data list is empty, that is, there is no data in the data pool that has the same data type as the target data, then the comparison between the target data and the data in the preset data pool is successful.
[0087] Step S205: If the comparison data list is not empty, compare the target data with each item of data in the comparison data list.
[0088] When the comparison data list is not empty, that is, there is data of the same data type as the target data in the data pool, the target data is compared one by one with each item of data in the comparison data list.
[0089] Step S206 , determining whether there is a difference between the target data and each data item in the comparison data list.
[0090] Step S207: If there is a difference between the target data and each item of data in the comparison data list, the comparison is successful.
[0091] Step S208: If the target data is completely consistent with any data in the comparison data list, the comparison fails, and the client is denied access to the server.
[0092] Exemplarily, assuming that the data type of the target data is a cookie type, and there are three items of data in the comparison data list, namely data A, data B and data C, the target data is compared with data A, data B and data C respectively. If there are differences between the target data and data A, data B and data C, the comparison passes; if the target data is completely consistent with at least one of the three items of data in the comparison data list, the comparison fails, and the client is denied access to the server.
[0093] When the target data is of the first data type, by comparing it with the data of the same data type in the data pool, for the first data type, the probability that the data of the data type obtained in different time periods are completely consistent is extremely small. Therefore, this can be used to determine whether the access request is an abnormal access request. If the access request is an abnormal access request, the access request to the server is rejected, which reduces the pressure on the server and also protects a large amount of valuable data in the target website.
[0094] like Figure 3 As shown, in one embodiment, the data type of the target data is the first data type or the second data type, including:
[0095] Step S301 : When the data type of the target data is the second data type, the target data is compared with data in a preset data pool.
[0096] Step S302: Update the second access count corresponding to the data type.
[0097] The second access count is the number of times a client carrying data of the data type accesses the server.
[0098] For example, assume that client A, client B and client C initiate access requests to the server, and the data types carried by client A, client B and client C when initiating the access requests are device fingerprint type, ja3 fingerprint type and device fingerprint type respectively, and for the server, the second access times corresponding to all data types are zero; then, the second access times corresponding to the updated device fingerprint type is 2, and the second access times corresponding to the ja3 fingerprint type is 1.
[0099] Step S303: Determine whether the currently updated second access count does not exceed a second preset threshold.
[0100] Step S304: If the currently updated second access count does not exceed the second preset threshold, the comparison is successful.
[0101] Step S305: If the currently updated second access count exceeds a second preset threshold, the comparison fails and the client is denied access to the server.
[0102] When the target data is of the second data type, by counting the clients carrying data of the same data type and setting a second preset threshold, the difficulty of crawling the target website can be further increased. Once the second preset threshold is exceeded, the client's access to the server is denied, thereby improving the anti-crawler effect.
[0103] In one embodiment, the method further comprises:
[0104] If the data pool is empty or the comparison data list is empty, the comparison is successful.
[0105] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0106] The following describes an access request processing device provided in an embodiment of the present application. The access request processing device described below and the access request processing method described above can refer to each other.
[0107] like Figure 4 As shown, an embodiment of the present application provides an access request processing device 400, which is applied to a server, and the device includes:
[0108] The first acquisition module 401 is configured to, upon receiving an access request from a client, acquire the initial data and the IP address of the client contained in the access request;
[0109] Determining module 402, configured to determine whether the IP address exists in a preset blacklist, and if the IP address does not exist in the blacklist, updating a first access count, where the first access count is the number of times the client accesses the server;
[0110] A second acquisition module 403 is configured to decompress and decrypt the initial data to obtain target data corresponding to the initial data and a data type of the target data if the currently updated first access count does not exceed a first preset threshold;
[0111] A comparison module 404 is configured to compare the target data with data in a preset data pool, and if the comparison passes, determine whether the client is accessing the server for the first time based on the currently updated first access count;
[0112] A determination module 405 is configured to determine, if this is not the first time that the client accesses the server, whether the data type of the target data is the same as a target data type, where the target data type is the data type returned by the server to the client when the client last accessed the server.
[0113] The access acceptance module 406 is configured to allow the client to access the server if the data type of the target data is the same as the target data type.
[0114] In one embodiment, the data type of the target data is the first data type or the second data type; when the data type of the target data is the first data type, the comparison module 404 includes:
[0115] A determination submodule, configured to determine a comparison data list; wherein the comparison data list is a collection of data in the data pool that has the same data type as the target data;
[0116] a comparison submodule, configured to compare the target data with each item of data in the comparison data list if the comparison data list is not empty;
[0117] A first judgment submodule, if there is a difference between the target data and each data item in the comparison data list, the comparison is passed;
[0118] The second judgment submodule is configured to deny the client access to the server if the target data is completely consistent with any data in the comparison data list and the comparison fails.
[0119] In one embodiment, the data type of the target data is the first data type or the second data type; when the data type of the target data is the second data type, the comparison module 404 includes:
[0120] An updating submodule, configured to update a second access count corresponding to the data type; wherein the second access count is the number of times a client carrying data of the data type accesses the server;
[0121] A third judgment submodule, configured to determine that the comparison is successful if the currently updated second access count does not exceed a second preset threshold;
[0122] The fourth judgment submodule is configured to determine that the comparison fails and deny the client access to the server if the currently updated second access count exceeds a second preset threshold.
[0123] In one embodiment, after allowing the client to access the server, the access acceptance module 406 further includes:
[0124] The storage submodule is used to store the target data in the data pool.
[0125] In one embodiment, the access request processing device further includes:
[0126] The fifth judgment submodule is configured to add the IP address to the blacklist if the currently updated first access count exceeds the first preset threshold.
[0127] In one embodiment, the access request processing device further includes:
[0128] The sixth judgment submodule is configured to deny the client access to the server if the IP address exists in the blacklist or the data type of the target data is different from the target data type.
[0129] In one embodiment, the access request processing device further includes:
[0130] The seventh judgment submodule is configured to determine that the comparison is successful if the data pool is empty or the comparison data list is empty.
[0131] In one embodiment, the access request processing device further includes:
[0132] An eighth judgment submodule is configured to allow the client to access the server if the access request is the first access by the client to the server; wherein the data type of the initial data carried in the access request defaults to the first data type.
[0133] The division of the various modules in the access request processing device described above is for illustrative purposes only. In other embodiments, the access request processing device can be divided into different modules as needed to complete all or part of the functions of the access request processing device described above. The various modules in the access request processing device described above can be implemented in whole or in part through software, hardware, or a combination thereof. The modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of the modules.
[0134] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the access request processing method as described in any of the above embodiments.
[0135] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the access request processing method as described in any of the above embodiments.
[0136] Schematically, as Figure 5 As shown, Figure 5 This is an internal structure diagram of a computer device provided in an embodiment of the present application. The computer device 500 can be provided as a server. Figure 5 Computer device 500 includes a processing component 502, which further includes one or more processors, and a memory resource represented by memory 501 for storing instructions executable by processing component 502, such as an application. The application stored in memory 501 may include one or more modules, each corresponding to a set of instructions. In addition, processing component 502 is configured to execute the instructions to perform the access request processing method of any of the above-mentioned embodiments.
[0137] The computer device 500 may further include a power supply component 503 configured to perform power management of the computer device 500, a wired or wireless network interface 504 configured to connect the computer device 500 to a network, and an input / output (I / O) interface 505. The computer device 500 may operate based on an operating system stored in the memory 501, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or the like.
[0138] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0139] Finally, it should be noted that, in this article, relational terms such as first and second are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element. In this article, the singular forms "a," "an," and "said / the" may also include plural forms unless the context clearly indicates otherwise. It should also be understood that the terms "comprise," "comprising," or "having" specify the presence of the stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. Also, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.
[0140] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.
[0141] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing an access request, characterized in that: The method is applied to the server and includes: When receiving an access request sent by a client, obtaining the initial data contained in the access request and the IP address of the client; Determine whether the IP address exists in a preset blacklist, and if the IP address does not exist in the blacklist, update a first access count, where the first access count is the number of times the client accesses the server; If the currently updated first access count does not exceed a first preset threshold, decompressing and decrypting the initial data to obtain target data corresponding to the initial data and a data type of the target data; Comparing the target data with data in a preset data pool, and if the comparison is successful, determining whether the client is accessing the server for the first time based on the currently updated first access count; If it is not the first time for the client to access the server, determining whether the data type of the target data is the same as the target data type, where the target data type is the data type returned by the server to the client when the client last accessed the server; If the data type of the target data is the same as the target data type, the client is allowed to access the server.
2. The method for processing an access request according to claim 1, wherein: After allowing the client to access the server, the method further includes: The target data is stored in the data pool.
3. The method for processing an access request according to claim 1, wherein: The method further comprises: If the currently updated first access count exceeds the first preset threshold, the IP address is added to the blacklist.
4. The method for processing an access request according to claim 3, wherein: The method further comprises: If the IP address exists in the blacklist or the data type of the target data is different from the target data type, the client is denied access to the server.
5. The method for processing an access request according to claim 1, wherein: The data type of the target data is the first data type or the second data type; When the data type of the target data is the first data type, comparing the target data with data in a preset data pool includes: Determine a comparison data list; wherein the comparison data list is a collection of data in the data pool that has the same data type as the target data; If the comparison data list is not empty, compare the target data with each item of data in the comparison data list; If there is a difference between the target data and each data item in the comparison data list, the comparison is successful; If the target data is completely consistent with any data in the comparison data list, the comparison fails and the client is denied access to the server.
6. The method for processing an access request according to claim 5, wherein: When the data type of the target data is the second data type, comparing the target data with data in a preset data pool includes: Updating a second access count corresponding to the data type; wherein the second access count is the number of times a client carrying data of the data type accesses the server; If the currently updated second access count does not exceed the second preset threshold, the comparison is passed; If the currently updated second access count exceeds a second preset threshold, the comparison fails and the client is denied access to the server.
7. The method for processing an access request according to claim 5, wherein: The method further comprises: If the data pool is empty or the comparison data list is empty, the comparison is successful.
8. The method for processing an access request according to claim 5 or 6, characterized in that: The method further comprises: If the access request is the first time for the client to access the server, the client is allowed to access the server; wherein the data type of the initial data carried in the access request is the first data type by default.
9. A device for processing an access request, characterized in that: Applied to the server, the device includes: A first acquisition module is configured to, upon receiving an access request from a client, acquire the initial data contained in the access request and the IP address of the client; a determination module, configured to determine whether the IP address exists in a preset blacklist, and if the IP address does not exist in the blacklist, update a first access count, where the first access count is the number of times the client accesses the server; a second acquisition module, configured to decompress and decrypt the initial data to obtain target data corresponding to the initial data and a data type of the target data if the currently updated first access count does not exceed a first preset threshold; a comparison module, configured to compare the target data with data in a preset data pool, and if the comparison passes, determine whether the client accesses the server for the first time based on the currently updated first access count; a judgment module, configured to judge, if this is not the first time that the client accesses the server, whether the data type of the target data is the same as a target data type, where the target data type is the data type returned by the server to the client when the client last accessed the server; The access acceptance module is configured to allow the client to access the server if the data type of the target data is the same as the target data type.
10. A storage medium, characterized in that: The storage medium stores computer-readable instructions, which, when executed by one or more processors, enable the one or more processors to perform the steps of the method for processing an access request according to any one of claims 1 to 8.
11. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, the steps of the method for processing an access request according to any one of claims 1 to 8 are executed.
Citation Information
Patent Citations
An anti-crawler method and system based on user access behaviors
CN109862018A
IP pool management method, system and device, equipment and storage medium
CN114024938A