Behavior recognition method and device
By analyzing the reference information and keywords in the access log, the source of crawler behavior is accurately identified, and the problem of poor identification effect in the existing technology is solved, and the accurate identification and traceability of crawler behavior is achieved, and legal crackdowns are supported.
Patent Information
- Application Number
- CN202011063117.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-09-30
AI Technical Summary
The prior art is not accurate enough when identifying crawler behavior, which is easy to misjudgment normal users as crawlers or misjudgment crawler behavior, resulting in poor recognition effect.
By obtaining reference information in the access log, extracting access behavior characteristics, analyzing the HTTP_Referer field and preset crawler behavior association keywords, determining the access source of crawler behavior, and then performing anti-crawler operations.
It improves the accuracy of identification of crawler behavior, reduces misjudgment and misjudgment, realizes accurate identification and traceability of crawler behavior, and supports legal crackdowns.
Smart Images

Figure CN114330466B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a behavior recognition method and device. Background Art
[0002] In related technologies, crawler attacks usually use IP proxy pools for multi-level proxying, and change IPs within minutes or seconds, making it difficult to trace the source of crawler attacks to which individuals or companies. The traditional method of identifying crawler behavior is to count the total number of Uniform Resource Locator (URL) generated by a certain IP visiting the target website within a period of time. If the value exceeds the set threshold, the IP source is considered to be a crawler.
[0003] However, when multiple normal users share the same IP, it is easy to mistake these normal users for crawlers, or when users frequently change IP addresses to access, crawlers cannot be identified, resulting in missed detection. It can be seen that the existing crawler behavior identification method is not accurate enough and the identification effect is poor. Summary of the invention
[0004] The present disclosure provides a behavior recognition method and device to at least solve the problem that the crawler behavior recognition method in the related art is not accurate enough and the recognition effect is poor. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a behavior recognition method is provided, including:
[0006] Obtaining an access log, wherein the access log is obtained by collecting reference information returned by the accessing party when accessing the target website;
[0007] Extracting access behavior features from the access log;
[0008] Based on the extracted access behavior features, it is determined that there is an access source with crawler behavior targeting the target website.
[0009] According to a second aspect of an embodiment of the present disclosure, there is provided a behavior recognition device, including:
[0010] An acquisition module is configured to execute acquisition of access logs, wherein the access logs are obtained by collecting reference information returned by the accessing party when accessing the target website;
[0011] An extraction module is configured to extract access behavior features from the access log;
[0012] The determination module is configured to determine the access source of the crawler behavior targeting the target website based on the extracted access behavior characteristics.
[0013] According to a third aspect of an embodiment of the present disclosure, there is provided a behavior recognition device, including:
[0014] processor;
[0015] a memory for storing instructions executable by the processor;
[0016] The processor is configured to execute the instructions to implement the behavior recognition method as described in the first aspect above.
[0017] According to a fourth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising executable instructions, which, when executed on a computer, enable the computer to execute the behavior recognition method as described in the first aspect above.
[0018] According to a fifth aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a behavior recognition device, the behavior recognition device can perform the behavior recognition method described in the first aspect above.
[0019] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0020] Obtain access logs, which are obtained by collecting reference information returned by the visitor when visiting the target website; extract access behavior features from the access logs; and determine the access source that has crawler behavior against the target website based on the extracted access behavior features. In this way, by collecting reference information returned by the visitor when visiting the target website, it is possible to accurately identify whether the visitor has crawler behavior against the target website based on the reference information, thereby improving the identification effect.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0023] Figure 1 The figure is a flow chart of a behavior recognition method according to an exemplary embodiment.
[0024] Figure 2 is a schematic diagram showing that a website corresponding to a reference source segment includes data of a target website according to an exemplary embodiment;
[0025] Figure 3 The figure is a block diagram of a behavior recognition device according to an exemplary embodiment.
[0026] Figure 4 is a block diagram of another behavior recognition device according to an exemplary embodiment. DETAILED DESCRIPTION
[0027] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0029] Figure 1 is a flow chart of a behavior recognition method according to an exemplary embodiment, the method is used in a behavior recognition device, such as Figure 1 As shown, the following steps are included.
[0030] In step S11, an access log is obtained, wherein the access log is obtained by collecting reference information returned by the visitor when visiting the target website.
[0031] The access log obtained above may be an access log stored in an access log database. Specifically, since the visitor will return reference information, i.e., the reference source Referer, to the URL address of the visited party when visiting the target website, an access log may be generated by recording the Referer returned by each visitor, and the generated access log may be stored in the access log database. Moreover, access logs may be generated for different visitors respectively and stored in the access log database. That is to say, the access log database may store access logs of multiple visitors.
[0032] The access log may record the reference information of the visitor, such as the reference website source HTTP_Referer, domain name, IP address, Uniform Resource Identifier (URI), etc. Thus, by analyzing the access log of each visitor, it is possible to identify whether the corresponding visitor has crawled the target website data.
[0033] The target website mentioned above may be a website that needs to be identified whether there is any crawler behavior targeting it. The purpose of this solution is to identify whether the target website has been crawled, or even to identify which specific platforms or corporate websites have crawled the data.
[0034] In an embodiment of the present application, when preparing to identify crawler behavior, you can first obtain the access log of each visitor from the access log database, and then analyze the reference information in the access log to identify in turn whether the corresponding visitor has crawler behavior against the target website.
[0035] In step S12, access behavior features are extracted from the access log.
[0036] When identifying the crawler behavior of the visitor based on the access log, the visitor's access behavior features can be extracted from the access log, such as extracting the reference information returned by the visitor during the visit recorded in the access log, and the reference information usually includes the reference website source HTTP_Referer. The reference website source usually hides the visitor's crawler behavior features, such as the reference URL in the reference website source will display the data crawled from the target website, or the reference URL in the reference website source will contain some keywords indicating the purpose of the crawler. Therefore, by extracting such access behavior features from the access log, it can be ensured that based on the extracted access behavior features, it is possible to more accurately identify which visitor has crawler behavior against the target website.
[0037] In step S13, based on the extracted access behavior features, it is determined whether there is an access source with crawler behavior targeting the target website.
[0038] After extracting the access behavior features, it is possible to identify whether each visitor has any crawler behavior against the target website based on the extracted access behavior features, and then determine the visitor information that has crawler behavior against the target website, that is, the source of the visit, such as the visitor's website, domain name, affiliated company, access IP, etc.
[0039] Specifically, based on the reference website source HTTP_Referer extracted from the access log, the URL address stored in the reference website source can be obtained, that is, the reference website address of the visitor when visiting the target website, and some of these URL addresses can be accessed directly, and some URL addresses will contain some crawler-related hint words, so by accessing these URL addresses, it is possible to check whether the URL displays the data of the target website, or by searching for some crawler-related keywords in these URL addresses, to identify whether the visitor corresponding to the reference website source has crawler behavior against the target website. For example, if a URL address stored in a reference website source is accessed and it is found that the URL displays the data of the target website, or it is found that some crawler-related keywords are present in the URL address stored in the reference website source, it can be determined that the visitor corresponding to the reference website source has crawled the data of the target website, that is, the visitor corresponding to the reference website source has crawler behavior against the target website.
[0040] In this way, by analyzing the reference information recorded in the access log, it is possible to more accurately identify whether each visitor has any crawler behavior against the target website without making it easy to make a misjudgment or missed judgment.
[0041] Optionally, the step S12 includes:
[0042] Extracting a reference source field in the reference information from the access log;
[0043] The step S13 comprises:
[0044] Accessing a first website corresponding to the reference source field to determine whether the first website contains data of the target website;
[0045] In the case that the first website contains data of the target website, it is determined that a visitor corresponding to the first website has a crawler behavior targeting the target website.
[0046] In one embodiment, the access behavior feature extracted from the access log may be extracted from the access log a reference source field in the reference information returned by the accessing party, namely, an HTTP_Referer field. Then, the website corresponding to the HTTP_Referer field may be directly accessed to query whether the website contains the data of the target website. If the website corresponding to any HTTP_Referer field recorded in the access log is successfully accessed and it is found that the website contains the data of the target website, it can be determined that the accessing party corresponding to the website has crawled the data of the target website. If the website corresponding to any HTTP_Referer field recorded in the access log is successfully accessed and it is found that the website does not contain the data of the target website, it can be determined that the accessing party corresponding to the website has not crawled the data of the target website. In addition, if the website corresponding to any HTTP_Referer field recorded in the access log cannot be accessed, it cannot be determined whether the accessing party corresponding to the website has crawled the data of the target website. The behavior of the website can be identified through other means.
[0047] For example, Figure 2 As shown, you can access the website "https: / / ks.ca****.com / ** / ** / ***28" corresponding to an HTTP_Referer field and find that the website contains data of the target website "live.ku***.com". It can be determined that the access party corresponding to the HTTP_Referer field has crawled the data of the target website, and there is a crawler behavior targeting the target website.
[0048] More specifically, in this implementation, after obtaining the access logs of each visitor, the access logs of each visitor can be arranged in order, such as placing HTTP_Referer fields with the same domain name adjacent to each other. For example, the sorted access logs can be shown in Table 1 below.
[0049] Table 1 Access log sorting
[0050]
[0051] Then, the URLs in the HTTP_Referer fields with the same domain name can be checked one by one to determine whether the website contains the data of the target website live.ku**.com. For example, first visit the URLs https: / / ks.ca**.com / ***6304, https: / / ks.ca**.com / ***1328, etc. in the HTTP_Referer field with the domain name ks.ca***.com to see whether these websites contain the data of the website live.ku**.com, and then visit the URL https: / / ks.fe**.cn / *** in the HTTP_Referer field with the domain name ks.fe**.cn to determine whether the website contains the data of the website live.ku**.com. When it is confirmed that the URL in a certain HTTP_Referer field contains the data of the target website, it can be confirmed that the URL type in the HTTP_Referer field is a crawler service platform.
[0052] Thus, in this implementation, by accessing the website corresponding to the reference source field recorded in the access log set and determining whether the website contains data of the target website, the visitor with crawler behavior targeting the target website can be more accurately identified.
[0053] Optionally, the step S12 includes:
[0054] Extracting a target reference source field from the access log, wherein the target reference source field is a reference source field including a preset crawler behavior-related keyword in the reference information;
[0055] The step S13 comprises:
[0056] Determine a second website corresponding to the target reference source field;
[0057] It is determined that a visitor corresponding to the second website has crawler behavior directed to the target website.
[0058] In another embodiment, the extracting of access behavior features from the access log may be to extract a target reference source field including a preset crawler behavior-related keyword from the reference information of the access log, that is, the preset crawler behavior-related keyword may be used as a search term to retrieve whether each reference source field recorded in the access log, i.e., the HTTP_Referer field, contains the preset crawler behavior-related keyword. If the target HTTP_Referer field is retrieved to contain the preset crawler behavior-related keyword, the target HTTP_Referer field may be extracted, and the visitor website corresponding to the target HTTP_Referer field may be determined, such as by determining the corresponding visitor website through the URL address in the target HTTP_Referer field, and it may be determined that the visitor corresponding to the visitor website is a crawler service platform, which has crawled the data of the target website. For the HTTP_Referer field for which the preset crawler behavior-related keyword is not retrieved, it may be temporarily impossible to determine whether the visitor corresponding to the HTTP_Referer field has a crawler behavior against the target website, and further identification may be performed through other means, such as visiting the website corresponding to the HTTP_Referer field to see whether it contains the data of the target website.
[0059] Among them, the preset crawler behavior-associated keywords can be preset keywords that can characterize crawler behavior, such as spider, crawl and other keywords. For example, as shown in Table 2 below, some of the HTTP_Referer fields recorded in the access log contain the crawl keyword, and some contain the spider keyword, so it can be determined that the access party corresponding to these HTTP_Referer fields is the crawler service platform.
[0060] In this way, by checking whether each reference source field recorded in the access log contains a preset crawler behavior-related keyword, the visitor who has crawler behavior against the target website can be identified more accurately.
[0061] Table 2 Access log
[0062] Remote_addr Http_Referer Host URI 1**.**.**.2** https: / / 1**.1**** / wxacrawler / ***appservice live.ku**.com / ***phql 8*.**.***.1** https: / / 1**.1**** / wxacrawler / ***appservice live.ku**.com / ***phql 2**.**.**.9* https: / / to**.byted*** / spider-deadlink***content live.ku**.com / u / ***4394 1**.**.***.1** https: / / 1**.1**** / crawler-distinct / ***Get live.ku**.com / u / ***6429
[0063] Optionally, after step S13, the method further includes:
[0064] An anti-crawler operation is performed on the access source, wherein the anti-crawler operation includes at least one of registering information of the access source, reporting access request records of the access source, and intercepting access requests of the access source.
[0065] That is, after determining that there are access sources that have crawled the target website, certain anti-crawler operations can be performed on these access sources to prevent them from crawling the target website's data again, or the crawling records of these access sources can be saved to provide evidence support for combating crawler behavior.
[0066] Specifically, the information of the access source can be registered, such as recording the website, domain name, IP address or company name of the access source, or the access request record of the access source can be reported so that the technicians can timely check the crawler behavior based on the report record, or the access request of the access source can be intercepted to timely prevent the data crawling behavior of the access source. Of course, these three anti-crawler operations can also be used in combination, such as using any two of the three anti-crawler operations at the same time, or using the three anti-crawler operations at the same time.
[0067] Optionally, the performing an anti-crawler operation on the access source includes:
[0068] Obtain the name of the enterprise to which the domain name of the visiting party's website in the access source belongs;
[0069] The enterprise name is entered into the crawler database.
[0070] In this implementation, after identifying the access source of the crawler behavior against the target website, the access party information corresponding to the access party website in the access source can be further obtained, such as determining the detailed enterprise information to which the access party website belongs. Specifically, the domain name in the access party website can be investigated by filing to obtain the enterprise to which the domain name belongs. In this way, it can be confirmed that the enterprise illegally collected or crawled the data of the target website, thereby providing evidence and technical support for the legal affairs of the company to which the target website belongs, and then effectively combating the crawler attack behavior through legal means. And after obtaining the enterprise name to which the domain name of the access party website belongs, the enterprise name can be further entered into the crawler database, and the access request from the enterprise website can be prohibited or blocked later.
[0071] Optionally, the performing an anti-crawler operation on the access source includes:
[0072] Report the access request records sent by the access party website in the access source.
[0073] That is, an automated reporting mechanism can be established for the access sources identified to have crawler behavior, and the access request records issued by the accessing websites in the access sources can be reported. For example, when a request to access a target website is received from a certain website, if it is confirmed that the website is an identified accessing website that has crawled the data of the target website, an alarm email can be sent to the technical staff of the target website to prompt the visited party that it is currently receiving a crawler attack behavior, and then the access behavior can be intercepted to deny access to the crawler service.
[0074] In this way, by reporting the access request records issued by the access party website in the access source, it is helpful for the access party to timely learn about the crawler behavior and effectively intercept the crawler service access request based on the reported records.
[0075] Optionally, the access log records the IP address corresponding to each access party;
[0076] The performing the anti-crawler operation on the access source includes:
[0077] Add the IP address corresponding to the visitor in the access source to the IP blacklist;
[0078] The access request originating from the IP address in the IP blacklist is intercepted.
[0079] In this implementation, the access log may record the IP address of each visitor's remote access, that is, the IP address through which each visitor accesses. As shown in Tables 1 and 2 above, the access log of each visitor includes an IP address field.
[0080] In this way, after identifying the access source of the crawler behavior against the target website, it can be confirmed that the IP address corresponding to the access party in the access source is the IP address of the crawler service platform or the crawler IP address, and the IP address corresponding to the access party in the access source can be further added to the IP blacklist, and the access request from the IP address in the IP blacklist is intercepted, that is, the target website can determine whether the IP address of the access party is an IP address in the IP blacklist based on the IP address of the access party. If so, the access request of the access party is intercepted, and the access to the crawler service is denied. For example, the IP addresses in each Remote_addr field in Table 2 can be entered into the blacklist database, and the access requests initiated by these IP addresses are subsequently intercepted.
[0081] In this way, by adding the IP address corresponding to the visitor in the access source to the IP blacklist, the access request originating from the IP address in the IP blacklist is intercepted, thereby effectively intercepting, shielding or monitoring crawler attack behavior.
[0082] It should be noted that the URL address in the HTTP_Referer field returned by the visitor with crawler behavior during the visit can also be entered into the HTTP_Referer database. The target website can set a Referer blacklist for the URL addresses in the HTTP_Referer database, intercept access requests containing this type of Referer, and deny access.
[0083] Optionally, the method further includes:
[0084] Obtaining reference information returned by the accessing party when accessing the target website, and generating an access log;
[0085] If the access log contains preset information, deleting the access log, wherein the preset information is information that has no association with the crawler behavior;
[0086] In the case that the access log does not contain the preset information, the preset fields in the access log are retained, and the processed access log is stored in an access log database, wherein the preset fields at least include a reference source field.
[0087] In this implementation, the reference information returned by the visitor when visiting the target website, that is, the Referer, can be recorded one by one, that is, the Referer returned by each visitor when visiting the target website is collected to generate a Referer log, that is, an access log. And for each access log obtained, the log can be cleaned and stored, specifically removing the access log containing the preset information, retaining the preset fields in the access log that does not contain the preset information, obtaining the processed access log, and storing the processed access log in the access log database, such as automatically writing the processed access log into the access log database on a daily or hourly basis.
[0088] The preset information may be information in the access log that is not related to the crawler investigation, such as the domain name, IP address, etc. of the target website being the visitor, that is, the target website's own access log may be deleted, and the access log with empty content, the access log containing the search engine service domain name or other unconcerned domain names, etc. may also be deleted. The other unconcerned domain names may be obtained by statistics after the access. By removing these access logs containing the preset information, it may be helpful to narrow the scope of the access log investigation when identifying crawler behavior based on the access log.
[0089] The preset fields may be fields in the Referer returned by the visitor that are closely related to crawler screening. Through the preset fields, it is possible to quickly and effectively screen out which crawler behaviors are, such as the reference source HTTP_Referer field. Of course, the preset fields may also include fields where the visited party is the domain name of the target website, fields where the visited party is the URI of the target website, IP address fields, etc. Through the HTTP_Referer field, the URL address and domain name information of the visitor can be obtained, and through the IP address field, the access address information of the visitor can be obtained. Through the field where the visited party is the domain name of the target website and the field where the visited party is the URI of the target website, it is possible to know which data of the target website the visitor has crawled. Therefore, the information of these fields can be retained in the access log, which is helpful to accurately and quickly screen out which access records are crawler attack behaviors and the crawled data.
[0090] In this way, by removing the access logs containing preset information and retaining the access logs that do not contain the preset information and include preset fields, it can be ensured that the access log database stores the access logs of the visitor who is very likely to have crawler behavior, and the stored access logs have fewer but key fields, which helps to save database space, and can also ensure that based on the processed access logs, crawler behavior can be quickly and effectively checked.
[0091] This solution can be applied to the scenarios of crawler attack tracing and accurate identification of crawler attack behavior. By recording the Http_Referer returned by the crawler, and then visiting the website corresponding to the Http_Referer to check whether it contains the data of the target website, or retrieving whether the Http_Referer contains preset crawler behavior-related keywords, it is possible to identify whether the visiting party corresponding to the Http_Referer has crawler behavior against the target website, and the specific crawler service platform information can be determined through the domain name in the Http_Referer, thereby achieving crawler attack tracing and accurate identification of crawler attack behavior, and then providing evidence and technical support for the legal affairs of the target website company, effectively combating crawler attack behavior through legal means, and effectively intercepting, blocking or monitoring abnormal crawler attack behavior.
[0092] The behavior identification method provided by the embodiment of the present disclosure obtains an access log, which is obtained by collecting reference information returned by the accessing party when accessing the target website; extracts access behavior features from the access log; and determines the access source of the crawler behavior against the target website based on the extracted access behavior features. In this way, by collecting the reference information returned by the accessing party when accessing the target website, it is possible to accurately identify whether the accessing party has crawler behavior against the target website based on the reference information, thereby improving the identification effect.
[0093] Figure 3 is a block diagram of a behavior recognition device according to an exemplary embodiment. Figure 3 The behavior recognition device 300 includes an acquisition module 301, an extraction module 302 and a determination module 303.
[0094] The acquisition module 301 is configured to execute acquisition of access logs, wherein the access logs are obtained by collecting reference information returned by the accessing party when accessing the target website;
[0095] The extraction module 302 is configured to extract access behavior features from the access log;
[0096] The determination module 303 is configured to determine the access source having crawler behavior directed to the target website based on the extracted access behavior features.
[0097] Optionally, the extraction module 302 is configured to extract a reference source field in the reference information from the access log;
[0098] The determination module 303 includes:
[0099] A judging unit is configured to access a first website corresponding to the reference source field to judge whether the first website contains data of the target website;
[0100] The first determining unit is configured to determine, when the first website contains data of the target website, that a visitor corresponding to the first website has a crawler behavior targeting the target website.
[0101] Optionally, the extraction module 302 is configured to extract a target reference source field from the access log, wherein the target reference source field is a reference source field including a preset crawler behavior-related keyword in the reference information;
[0102] The determination module 303 includes:
[0103] A second determining unit is configured to determine a second website corresponding to the target reference source field;
[0104] The third determining unit is configured to determine whether a visitor corresponding to the second website has a crawler behavior targeting the target website.
[0105] Optionally, the behavior recognition device 300 further includes:
[0106] The processing module is configured to perform an anti-crawler operation on the access source, wherein the anti-crawler operation includes at least one of registering information on the access source, reporting the access request record of the access source, and intercepting the access request of the access source.
[0107] Optionally, the processing module includes:
[0108] An acquisition unit is configured to acquire the name of the enterprise to which the domain name of the visiting party website in the access source belongs;
[0109] The entry module is configured to enter the enterprise name into the crawler database.
[0110] Optionally, the processing module is configured to report access request records issued by the accessing website in the access source.
[0111] Optionally, the access log records the IP address corresponding to each access party;
[0112] The processing module comprises:
[0113] An adding unit is configured to add the IP address corresponding to the visitor in the access source into an IP blacklist;
[0114] The interception unit is configured to intercept access requests originating from the IP addresses in the IP blacklist.
[0115] Optionally, the behavior recognition device 300 further includes:
[0116] A generating module configured to obtain reference information returned by the accessing party when accessing the target website and generate an access log;
[0117] a deletion module, configured to delete the access log if the access log contains preset information, wherein the preset information is information that has no association with the crawler behavior;
[0118] The storage module is configured to retain the preset fields in the access log and store the processed access log in the access log database when the access log does not contain the preset information, wherein the preset fields at least include a reference source field.
[0119] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0120] Figure 4 is a block diagram of a behavior recognition device 400 according to an exemplary embodiment. Figure 4 The behavior recognition device 400 includes: a processor 401, a memory 402 and a bus interface 403.
[0121] The processor 401 is used to read the program in the memory 402 and execute the following process:
[0122] Obtaining an access log, wherein the access log is obtained by collecting reference information returned by the accessing party when accessing the target website;
[0123] Extracting access behavior features from the access log;
[0124] Based on the extracted access behavior features, it is determined that there is an access source with crawler behavior targeting the target website.
[0125] exist Figure 4 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 401 and memory represented by memory 402. The bus architecture may also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 403 provides an interface.
[0126] The processor 401 is responsible for managing the bus architecture and general processing, and the memory 402 can store data used by the processor 401 when performing operations.
[0127] Optionally, the processor 401 is further configured to:
[0128] Extracting a reference source field in the reference information from the access log;
[0129] Accessing a first website corresponding to the reference source field to determine whether the first website contains data of the target website;
[0130] In the case that the first website contains data of the target website, it is determined that a visitor corresponding to the first website has a crawler behavior targeting the target website.
[0131] Optionally, the processor 401 is further configured to:
[0132] Extracting a target reference source field from the access log, wherein the target reference source field is a reference source field including a preset crawler behavior-related keyword in the reference information;
[0133] Determine a second website corresponding to the target reference source field;
[0134] It is determined that a visitor corresponding to the second website has crawler behavior directed to the target website.
[0135] Optionally, the processor 401 is further configured to:
[0136] An anti-crawler operation is performed on the access source, wherein the anti-crawler operation includes at least one of registering information of the access source, reporting access request records of the access source, and intercepting access requests of the access source.
[0137] Optionally, the processor 401 is further configured to:
[0138] Obtain the name of the enterprise to which the domain name of the visiting party's website in the access source belongs;
[0139] The enterprise name is entered into the crawler database.
[0140] Optionally, the processor 401 is further configured to:
[0141] Report the access request records sent by the visiting website in the access source.
[0142] Optionally, the access log records the IP address corresponding to each access party;
[0143] The processor 401 is further configured to:
[0144] Add the IP address corresponding to the visitor in the access source to the IP blacklist;
[0145] The access request originating from the IP address in the IP blacklist is intercepted.
[0146] Optionally, the processor 401 is further configured to:
[0147] Obtaining reference information returned by the accessing party when accessing the target website, and generating an access log;
[0148] If the access log contains preset information, deleting the access log, wherein the preset information is information that has no association with the crawler behavior;
[0149] In the case that the access log does not contain the preset information, the preset fields in the access log are retained, and the processed access log is stored in an access log database, wherein the preset fields at least include a reference source field.
[0150] The behavior recognition device 400 can implement each process in the aforementioned embodiments, and will not be described again here to avoid repetition.
[0151] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 402 including instructions, and the instructions can be executed by a processor 401 of the behavior recognition device 400 to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0152] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0153] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A behavior recognition method, characterized in that: include: Obtaining an access log, wherein the access log is obtained by collecting reference information returned by the visitor when accessing the target website; Extracting access behavior features from the access log; Based on the extracted access behavior features, determining the access source where there is crawler behavior targeting the target website; The step of extracting access behavior features from the access log includes: Extracting a reference source field in the reference information from the access log; The step of determining the access source of the crawler behavior targeting the target website based on the extracted access behavior features includes: Accessing a first website corresponding to the reference source field to determine whether the first website contains data of the target website; In the case where the first website contains data of the target website, determining that a visitor corresponding to the first website has a crawler behavior targeting the target website; or, The extracting access behavior features from the access log includes: Extracting a target reference source field from the access log, wherein the target reference source field is a reference source field including a preset crawler behavior-related keyword in the reference information; The step of determining the access source of the crawler behavior targeting the target website based on the extracted access behavior features includes: Determine a second website corresponding to the target reference source field; It is determined that a visitor corresponding to the second website has crawler behavior directed to the target website.
2. The method according to claim 1, characterized in that After determining that there is an access source of crawler behavior targeting the target website, the method further includes: An anti-crawler operation is performed on the access source, wherein the anti-crawler operation includes at least one of registering information of the access source, reporting access request records of the access source, and intercepting access requests of the access source.
3. The method according to claim 2, characterized in that The performing the anti-crawler operation on the access source includes: Obtain the name of the enterprise to which the domain name of the visiting party's website in the access source belongs; The enterprise name is entered into the crawler database.
4. The method according to claim 2, characterized in that: The performing the anti-crawler operation on the access source includes: Report the access request records sent by the access party website in the access source.
5. The method according to claim 2, characterized in that: The access log records the IP address corresponding to each access party; The performing the anti-crawler operation on the access source includes: Add the IP address corresponding to the visitor in the access source to the IP blacklist; Intercept access requests originating from IP addresses in the IP blacklist.
6. The method according to claim 1, characterized in that The method further comprises: Obtaining reference information returned by the accessing party when accessing the target website, and generating an access log; If the access log contains preset information, deleting the access log, wherein the preset information is information that has no association with the crawler behavior; In the case that the access log does not contain the preset information, the preset fields in the access log are retained, and the processed access log is stored in an access log database, wherein the preset fields at least include a reference source field.
7. A behavior recognition device, characterized in that: include: An acquisition module is configured to execute acquisition of access logs, wherein the access logs are obtained by collecting reference information returned by the accessing party when accessing the target website; An extraction module is configured to extract access behavior features from the access log; A determination module is configured to determine the access source of the crawler behavior targeting the target website based on the extracted access behavior features; Wherein, the extraction module is configured to extract the reference source field in the reference information from the access log; The determination module comprises: A judging unit is configured to access a first website corresponding to the reference source field to judge whether the first website contains data of the target website; A first determining unit is configured to determine, when the first website contains data of the target website, whether a visitor corresponding to the first website has a crawler behavior targeting the target website; or, The extraction module is configured to extract a target reference source field from the access log, wherein the target reference source field is a reference source field including a preset crawler behavior-related keyword in the reference information; The determination module comprises: A second determining unit is configured to determine a second website corresponding to the target reference source field; The third determining unit is configured to determine whether a visitor corresponding to the second website has a crawler behavior targeting the target website.
8. The behavior recognition device according to claim 7, characterized in that: The behavior recognition device also includes: The processing module is configured to perform an anti-crawler operation on the access source, wherein the anti-crawler operation includes at least one of registering information on the access source, reporting the access request record of the access source, and intercepting the access request of the access source.
9. The behavior recognition device according to claim 8, characterized in that: The processing module comprises: An acquisition unit is configured to acquire the name of the enterprise to which the domain name of the visiting party website in the access source belongs; The entry module is configured to enter the enterprise name into the crawler database.
10. The behavior recognition device according to claim 8, characterized in that: The processing module is configured to report the access request records sent by the access party website in the access source.
11. The behavior recognition device according to claim 8, characterized in that: The access log records the IP address corresponding to each access party; The processing module comprises: An adding unit is configured to add the IP address corresponding to the visitor in the access source into an IP blacklist; The interception unit is configured to intercept access requests originating from the IP addresses in the IP blacklist.
12. The behavior recognition device according to claim 7, characterized in that: The behavior recognition device also includes: A generating module configured to obtain reference information returned by the accessing party when accessing the target website and generate an access log; a deletion module, configured to delete the access log if the access log contains preset information, wherein the preset information is information that has no association with the crawler behavior; The storage module is configured to retain the preset fields in the access log and store the processed access log in the access log database when the access log does not contain the preset information, wherein the preset fields at least include a reference source field.
13. A behavior recognition device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the behavior recognition method as described in any one of claims 1 to 6.
14. A storage medium, when instructions in the storage medium are executed by a processor of a behavior recognition device, the behavior recognition device is enabled to execute the behavior recognition method as described in any one of claims 1 to 6.
