Method and device for distinguishing links inside and outside target website, electronic equipment and storage medium
By obtaining the ICP filing information of the target website to distinguish URL links, this method solves the problem of misjudging internal and external links in existing URL recognition methods in cloud-deployed and centralized website construction, achieving higher accuracy and simplicity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies that use URL recognition to distinguish between internal and external links of a target website have low accuracy and are prone to misjudgment. This is especially true for websites deployed in the cloud and built in a centralized manner. External links with the same IP address and the same main domain are judged as internal links, while internal links with different IP addresses and not completely the same main domain are judged as external links.
By obtaining the ICP filing information of the target website, the ICP filing information can be used to distinguish whether the URL link to be distinguished is an internal link or an external link of the target website, avoiding misjudgment caused by considering the relationship between the main domain name and IP address.
It improves the accuracy of distinguishing between internal and external links of a target website, especially in non-commercial websites, and completes the distinction between internal and external links in a simple and efficient manner, avoiding misjudgments caused by the relationship between the main domain name and IP address.
Smart Images

Figure CN114385950B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of internal and external link differentiation, for example to a method and device for differentiating internal and external links of a target website, an electronic device and a storage medium. BACKGROUND
[0002] The links of a website are divided into internal links and external links, the internal links are the links of the internal pages of the website, and the external links are the links of the pages of other websites. In some web-related applications, after collecting the links under the website, it may be necessary to identify whether the link is an internal link or an external link in order to make different treatments. However, the cloud deployment of business and applications has become the main direction of current website construction, which is conducive to rapid deployment, cost reduction and distributed operation, especially for non-operational websites such as governments and large enterprises, in order to strengthen management and improve data sharing capabilities, they have launched intensive construction of websites, and constructed unified data centers and business platforms, and various types of websites are deployed in the cloud. The intensive construction of such websites blurs the boundaries between internal and external links of the website, and also changes the connotation of internal and external links of the website.
[0003] In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art: In the prior art, the URL identification method is used to compare the main domain name or IP address of the target website with the main domain name or IP address of the URL link, and the accuracy of determining whether the URL link is an internal link or an external link of the target website by this method is low, and the following mistakes are likely to occur: the external link with the same IP address and the same main domain name is judged as an internal link, and the internal link with different IP addresses and not completely the same main domain name is judged as an external link. SUMMARY
[0004] To provide a basic understanding of some aspects of the disclosed embodiments, the following summary is given. The summary is not an overall description of the application, nor is it intended to determine the key / important elements or delineate the scope of the embodiments. It is only a prelude to the detailed description below.
[0005] The embodiments of the present disclosure provide a method and device for differentiating internal and external links of a target website, an electronic device and a storage medium, to improve the accuracy of differentiating internal and external links of the target website.
[0006] In some embodiments, the method for differentiating internal and external links of a target website comprises: obtaining first ICP filing information of the target website; obtaining a URL link to be differentiated of the target website; and differentiating whether the URL link to be differentiated is an internal link or an external link of the target website according to the first ICP filing information.
[0007] In some embodiments, the apparatus for distinguishing internal and external links of a target website comprises: a first obtaining module configured to obtain first ICP filing information of a target website; a second obtaining module configured to obtain a URL link to be distinguished of the target website; and a distinguishing module configured to distinguish, according to the first ICP filing information, whether the URL link to be distinguished is an internal link or an external link of the target website.
[0008] In some embodiments, the apparatus for distinguishing internal and external links of a target website comprises: a processor and a memory storing program instructions, the processor being configured to execute the method for distinguishing internal and external links of a target website described above when running the program instructions.
[0009] In some embodiments, the electronic device comprises the apparatus for distinguishing internal and external links of a target website described above.
[0010] In some embodiments, the storage medium stores program instructions, which, when executed, perform the method for distinguishing internal and external links of a target website described above.
[0011] The method and apparatus for distinguishing internal and external links of a target website, the electronic device, and the storage medium provided by the embodiments of the present disclosure can achieve the following technical effects: by obtaining first ICP filing information of a target website, obtaining a URL link to be distinguished of the target website, and then distinguishing, according to the first ICP filing information, whether the URL link to be distinguished is an internal link or an external link of the target website. In this way, the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished, and the IP address of the URL link to be distinguished does not need to be considered to cause misjudgment, and the first ICP filing information of the target website is used to distinguish whether the URL link to be distinguished is an internal link or an external link of the target website, thereby improving the accuracy of distinguishing internal and external links of the target website.
[0012] The foregoing general description and the following description are merely exemplary and explanatory, and are not intended to limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0013] One or more embodiments are exemplarily illustrated by corresponding drawings, which do not constitute a limitation on the embodiments, elements with the same reference numerals in the drawings are shown as similar elements, the drawings do not constitute a proportional limitation, and wherein:
[0014] Figure 1 is a schematic diagram of a method for distinguishing internal and external links of a target website provided by the embodiments of the present disclosure;
[0015] Figure 2 is a schematic diagram of another method for distinguishing internal and external links of a target website provided by the embodiments of the present disclosure;
[0016] Figure 3 is a schematic diagram of another method for distinguishing between internal and external links of a target website provided by an embodiment of the present disclosure;
[0017] Figure 4 is a schematic diagram of another method for distinguishing between internal and external links of a target website provided by an embodiment of the present disclosure;
[0018] Figure 5 is a schematic diagram of an apparatus for distinguishing between internal and external links of a target website provided by an embodiment of the present disclosure;
[0019] Figure 6 is a schematic diagram of another apparatus for distinguishing between internal and external links of a target website provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] In order to enable persons skilled in the art to more fully understand the features and technical contents of the embodiments of the present disclosure, the implementation of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings, which are used only for reference and are not intended to limit the embodiments of the present disclosure. In the following technical description, in order to facilitate explanation, a plurality of details are provided to provide a full understanding of the disclosed embodiments. However, one or more embodiments can still be implemented without these details. In other cases, well-known structures and devices can be simplified to facilitate the drawings.
[0021] The terms "first", "second", and the like in the specification and claims of the embodiments of the present disclosure and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion.
[0022] Unless otherwise specified, the term "a plurality of" means two or more.
[0023] In the embodiments of the present disclosure, the character " / " represents an "or" relationship between the objects before and after it. For example, A / B represents: A or B.
[0024] The term "and / or" is a description of the association relationship between objects, which means that there can be three relationships. For example, A and / or B means: A or B, or, A and B, the three relationships.
[0025] The term "corresponding" can refer to an association relationship or a binding relationship. A and B correspond to each other means that there is an association relationship or a binding relationship between A and B.
[0026] The technical solutions of the embodiments of the present disclosure can be applied to a smart terminal or a server. In some embodiments, the smart terminal includes a smart phone, a tablet computer, or a computer, etc. capable of accessing a website.
[0027] In the embodiments of the present disclosure, the URL link of the target website is distinguished by using the smart terminal or the server, so that the smart terminal or the server can determine whether the URL link to be distinguished of the target website is an internal link or an external link of the target website according to the ICP (Internet Content Provider) filing information of the target website when accessing the target website, thereby facilitating processing of the link.
[0028] In combination with Figure 1 The embodiments of the present disclosure provide a method for distinguishing internal and external links of a target website, including:
[0029] In step S101, an electronic device acquires first ICP (Internet Content Provider) filing information of a target website.
[0030] In step S102, the electronic device acquires a URL link to be distinguished of the target website.
[0031] In step S103, the electronic device distinguishes whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information.
[0032] The method for distinguishing internal and external links of a target website provided by the embodiments of the present disclosure acquires first ICP filing information of the target website, acquires a URL link to be distinguished of the target website, and then distinguishes whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information. In this way, without considering the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished, and the IP address of the URL link to be distinguished, which leads to misjudgment, the first ICP filing information of the target website is used to distinguish whether the URL link to be distinguished is an internal link or an external link of the target website, thereby improving the accuracy of distinguishing internal and external links of the target website.
[0033] Optionally, the target website is a non-commercial website.
[0034] Optionally, the electronic device obtains the first ICP filing information of the target website, including: the electronic device accesses a first website homepage of the target website; the electronic device extracts content of the first website homepage; and the electronic device obtains the first ICP filing information of the target website from the content of the first website homepage. In this way, the first website homepage of the target website is accessed by the electronic device, and the first ICP filing information of the target website is obtained from the content of the first website homepage, so as to distinguish whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information, without considering the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished, and the IP address of the URL link to be distinguished, which causes misjudgment, and the first ICP filing information of the target website is used to distinguish whether the URL link to be distinguished is an internal link or an external link of the target website, thereby improving the accuracy of distinguishing internal and external links of the target website.
[0035] Optionally, the electronic device accesses the first website homepage of the target website, including: the electronic device obtains the URL link of the target website; the electronic device obtains a homepage address of the URL link of the target website; and the electronic device accesses the first website homepage corresponding to the homepage address. Optionally, the homepage address of the URL link of the target website is a website address corresponding to a host field of the URL link of the target website.
[0036] In some embodiments, the electronic device accesses the first website homepage of the target website, and then the electronic device extracts the content of the first website homepage by a crawler, and the electronic device obtains the first ICP filing information of the target website from the content of the first website homepage.
[0037] Optionally, the first ICP filing information of the target website is an ICP filing number of the first website homepage of the target website.
[0038] In some embodiments, according to relevant policies, a non-operational Internet information service provider should file the website information of the website before opening the website and obtain the ICP filing information, i.e. the ICP filing number. Then the ICP filing number is placed at the bottom of the homepage of the website for public query and verification, so as to confirm that the ICP filing information is the public and private attribute field of the page on the homepage of the website in terms of content. In this way, the ICP filing number is especially suitable for distinguishing the internal and external links of the non-operational website, and does not need to consider the misjudgment caused by the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished, and the IP address of the URL link to be distinguished. By using the first ICP filing information of the target website, the URL link to be distinguished is distinguished as the internal link or the external link of the non-operational website, the accuracy of distinguishing the internal and external links of the non-operational website is improved. At the same time, by using the unique attribute of the non-operational website, the internal and external links of the website can be distinguished only by analyzing one general attribute of the ICP filing information in the page content, and the simplicity, efficiency and accuracy of distinguishing the internal and external links of the target website are improved.
[0039] Optionally, the electronic device obtains the first ICP filing information of the target website from the content of the homepage of the first website, including: the electronic device performs format matching on the content of the homepage of the first website, and the electronic device determines the field as the first ICP filing information of the target website in the case of matching the field with the same preset format.
[0040] Optionally, the preset format is the format of the ICP filing number.
[0041] In some embodiments, the format of the ICP filing number is: “provincial abbreviation + ICP preparation” + “main ICP filing number” + “website serial number”; or, the format of the ICP filing number is: “ICP preparation” + “main ICP filing number” + “website serial number”.
[0042] Optionally, in the case that the electronic device does not obtain the first ICP filing information of the target website, the electronic device extracts the URL link to be distinguished of the target website from the homepage of the first website; and the electronic device distinguishes whether the URL link to be distinguished is the internal link or the external link of the target website by using the URL identification method.
[0043] Optionally, the electronic device obtaining the URL link to be distinguished of the target website comprises: in a case that the first ICP filing information of the target website is obtained, the electronic device extracts the URL link to be distinguished of the target website in the first website homepage. In this way, by extracting the URL link to be distinguished of the target website in the first website homepage in a case that the first ICP filing information of the target website is obtained, the URL link to be distinguished is distinguished as the internal link or the external link of the target website according to the first ICP filing information, without considering the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished, which causes misjudgment, and the accuracy of distinguishing the internal and external links of the target website is improved by distinguishing the URL link to be distinguished as the internal link or the external link of the target website by using the first ICP filing information of the target website.
[0044] Optionally, the electronic device extracts the URL link to be distinguished of the target website in the first website homepage comprises: the electronic device performs format matching on the content of the first website homepage; and in a case that a field same as the preset URL format is matched, the electronic device determines the field as the URL link to be distinguished of the target website.
[0045] Optionally, the URL link to be distinguished comprises a second-level link of the target website and a third-level link of the target website.
[0046] Optionally, the electronic device distinguishes the URL link to be distinguished as the internal link or the external link of the target website according to the first ICP filing information comprises: the electronic device obtains a first host field of the first website homepage; the electronic device obtains a second host field of the URL link to be distinguished; in a case that the first host field is same as the second host field, the electronic device determines the URL link to be distinguished as the internal link of the target website; and in a case that the first host field is not same as the second host field, the electronic device distinguishes the URL link to be distinguished as the internal link or the external link of the target website according to the first ICP filing information. In this way, by determining the URL link to be distinguished as the internal link of the target website in a case that the first host field is same as the second host field, and distinguishing the URL link to be distinguished as the internal link or the external link of the target website according to the first ICP filing information in a case that the first host field is not same as the second host field, without considering the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished, which causes misjudgment, the accuracy of distinguishing the internal and external links of the target website is improved.
[0047] In some embodiments, the URL link comprises a host field, a path field and a file field. For example: www.aaa.com / a / b / files / 202111 / index.html; wherein www.aaa.com is the host field; a / b / files / 202111 is the path field; index.html is the file field; and aaa.com is the domain name field.
[0048] In combination Figure 2 As shown in the drawings, the embodiments of the present disclosure provide another method for distinguishing internal and external links of a target website, comprising:
[0049] In step S201, the electronic device accesses a first website homepage of a target website.
[0050] In step S202, the electronic device extracts the content of the first website homepage.
[0051] In step S203, the electronic device obtains first ICP filing information of the target website in the content of the first website homepage.
[0052] In step S204, the electronic device obtains a URL link to be distinguished of the target website.
[0053] In step S205, the electronic device obtains a first host field of the first website homepage.
[0054] In step S206, the electronic device obtains a second host field of the URL link to be distinguished.
[0055] In step S207, the electronic device determines the URL link to be distinguished as an internal link of the target website when the first host field is the same as the second host field.
[0056] In step S208, the electronic device distinguishes whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information when the first host field is not the same as the second host field.
[0057] The method for distinguishing the internal and external links of a target website provided by the embodiment of the present disclosure comprises the following steps: obtaining the first ICP filing information of the target website through the first website homepage of the target website; obtaining the URL link to be distinguished of the target website through the first website homepage; and then distinguishing whether the URL link to be distinguished is the internal link or the external link of the target website according to the first host field, the second host field and the first ICP filing information. In this way, the misjudgment caused by the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished is not needed to be considered, and the first host field, the second host field and the first ICP filing information of the target website are used to distinguish whether the URL link to be distinguished is the internal link or the external link of the target website, so that the accuracy of distinguishing the internal and external links of the target website is improved.
[0058] In combination with Figure 3 The embodiment of the present disclosure provides another method for distinguishing the internal and external links of a target website, which comprises the following steps:
[0059] In step S301, the electronic device accesses the first website homepage of the target website.
[0060] In step S302, the electronic device extracts the content of the first website homepage.
[0061] In step S303, the electronic device obtains the first ICP filing information of the target website in the content of the first website homepage.
[0062] In step S304, the electronic device extracts the URL link to be distinguished of the target website in the first website homepage when the first ICP filing information of the target website is obtained.
[0063] In step S305, the electronic device obtains the first host field of the first website homepage.
[0064] In step S306, the electronic device obtains the second host field of the URL link to be distinguished.
[0065] In step S307, the electronic device determines that the URL link to be distinguished is the internal link of the target website when the first host field is the same as the second host field.
[0066] In step S308, the electronic device distinguishes whether the URL link to be distinguished is the internal link or the external link of the target website according to the first ICP filing information when the first host field is not the same as the second host field.
[0067] The method for distinguishing the internal and external links of the target website provided by the embodiment of the present disclosure can obtain the first ICP filing information of the target website through the first website homepage of the target website, extract the URL link to be distinguished of the target website in the first website homepage in the case that the first ICP filing information of the target website is obtained, and then distinguish whether the URL link to be distinguished is the internal link or the external link of the target website according to the first host field, the second host field and the first ICP filing information. In this way, the misjudgment caused by the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished is not needed to be considered, and in the case that the first ICP filing information of the target website is obtained, the URL link to be distinguished is distinguished to be the internal link or the external link of the target website by using the first host field, the second host field and the first ICP filing information of the target website, so that the accuracy of distinguishing the internal and external links of the target website is improved.
[0068] Optionally, in the case that the first host field is different from the second host field, the electronic device distinguishes whether the URL link to be distinguished is the internal link or the external link of the target website according to the first ICP filing information, including: in the case that the first host field is different from the second host field, the electronic device accesses the second website homepage of the URL link to be distinguished according to the second host field; the electronic device extracts the content of the second website homepage; the electronic device obtains the second ICP filing information of the URL link to be distinguished in the content of the second website homepage; and the electronic device distinguishes whether the URL link to be distinguished is the internal link or the external link of the target website according to the first ICP filing information and the second ICP filing information. In this way, in the case that the first host field is different from the second host field, the second ICP filing information of the URL link to be distinguished is obtained according to the second host field, and the URL link to be distinguished is distinguished to be the internal link or the external link of the target website by using the first ICP filing information and the second ICP filing information, so that the misjudgment caused by the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished is not needed to be considered, and the accuracy of distinguishing the internal and external links of the target website is improved.
[0069] Optionally, the electronic device accesses the second website homepage of the URL link to be distinguished according to the second host field, including: the electronic device accesses the second website homepage of the URL link to be distinguished corresponding to the second host field.
[0070] Optionally, the electronic device obtains the second ICP filing information of the URL link to be distinguished in the content of the second website homepage, including: the electronic device performs format matching on the content of the second website homepage; and the electronic device determines the field matching the preset format as the second ICP filing information of the URL link to be distinguished in the case that the field matching the preset format is matched.
[0071] In some embodiments, the electronic device accesses a second website homepage of the to-be-distinguished URL link corresponding to the second host field when the first host field is different from the second host field, and then extracts the content of the second website homepage by using a crawler, and distinguishes the second ICP filing information of the to-be-distinguished URL link in the content of the second website homepage by format matching.
[0072] Optionally, the electronic device distinguishes whether the to-be-distinguished URL link is an internal link or an external link of the target website according to the first ICP filing information and the second ICP filing information, including: determining that the to-be-distinguished URL link is an internal link of the target website when the first ICP filing information is same as the second ICP filing information; and / or determining that the to-be-distinguished URL link is an external link of the target website when the first ICP filing information is different from the second ICP filing information. In this way, by determining that the to-be-distinguished URL link is an internal link of the target website when the first ICP filing information is same as the second ICP filing information, and determining that the to-be-distinguished URL link is an external link of the target website when the first ICP filing information is different from the second ICP filing information, the accuracy of distinguishing internal and external links of the target website is improved without considering the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the to-be-distinguished URL link, and the IP address of the to-be-distinguished URL link, which leads to misjudgment.
[0073] In some embodiments, the first ICP filing information is determined to be same as the second ICP filing information when the "provincial abbreviation" field, the "main ICP filing number" field, and the "website serial number" field of the first ICP filing information and the second ICP filing information are all same.
[0074] In some embodiments, the first ICP filing information is determined to be different from the second ICP filing information when any one of the "provincial abbreviation" field, the "main ICP filing number" field, and the "website serial number" field of the first ICP filing information and the second ICP filing information is different.
[0075] Optionally, the electronic device stores the first filing information and the second filing information after obtaining the first filing information and the second filing information.
[0076] In combination with Figure 4 As shown in the figure, the embodiments of the present disclosure provide another method for distinguishing internal and external links of a target website, including:
[0077] In step S401, the electronic device accesses a first website homepage of a target website.
[0078] In step S402, the electronic device extracts the content of the first website homepage.
[0079] In step S403, the electronic device acquires the first ICP filing information of the target website from the content of the first website homepage.
[0080] In step S404, the electronic device extracts the URL link to be distinguished of the target website from the first website homepage, in a case where the first ICP filing information of the target website is acquired.
[0081] In step S405, the electronic device acquires the first host field of the first website homepage.
[0082] In step S406, the electronic device acquires the second host field of the URL link to be distinguished.
[0083] In step S407, the electronic device determines whether the first host field and the second host field are the same; if the first host field and the second host field are the same, step S412 is executed; if the first host field and the second host field are not the same, step S408 is executed.
[0084] In step S408, the electronic device accesses the second website homepage of the URL link to be distinguished according to the second host field.
[0085] In step S409, the electronic device extracts the content of the second website homepage.
[0086] In step S410, the electronic device acquires the second ICP filing information of the URL link to be distinguished from the content of the second website homepage.
[0087] In step S411, the electronic device determines whether the first ICP filing information and the second ICP filing information are the same; if the first ICP filing information and the second ICP filing information are the same, step S412 is executed; if the first ICP filing information and the second ICP filing information are not the same, step S413 is executed.
[0088] In step S412, the electronic device determines that the URL link to be distinguished is an internal link of the target website.
[0089] In step S413, the electronic device determines that the URL link to be distinguished is an external link of the target website.
[0090] The method for distinguishing the internal and external links of a target website provided by the embodiments of the present disclosure comprises the following steps: obtaining the first ICP filing information of the target website through the first homepage of the target website; in the case that the first ICP filing information of the target website is obtained, extracting the URL link to be distinguished of the target website in the first homepage; in the case that the first host field is the same as the second host field, determining that the URL link is the internal link of the target website; in the case that the first host field is not the same as the second host field, obtaining the second ICP filing information of the URL link through the second homepage of the URL link; and distinguishing whether the URL link to be distinguished is the internal link or the external link of the target website according to the first ICP filing information and the second ICP filing information. In this way, the misjudgment caused by the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished is not needed to be considered, and in the case that the first ICP filing information of the target website is obtained, the first host field, the second host field, the first ICP filing information and the second ICP filing information are used to distinguish whether the URL link to be distinguished is the internal link or the external link of the target website, thereby improving the accuracy of distinguishing the internal and external links of the target website.
[0091] In some embodiments, in the case of judging the internal and external links of the target website www.xxx1.gov.cn, the obtained URL links to be distinguished of the target website include URL1: "www.xxx1.gov.cn / hudong / hdjl / ..." and URL2: "jw.xxx1.gov.cn / xxgk / zfxxgkml / ...". According to the URL identification method, URL1 and URL2 are distinguished, the main domain name of the target website is xxx1.gov.cn, the main domain name of URL1 is xxx1.gov.cn, the main domain name of URL2 is xxx1.gov.cn, the main domain names of the three are the same, and the two have a common IP address: 111.13.x.x through domain name resolution, it is determined according to the URL identification method that URL1 and URL2 are both internal links of the website. However, the obtained ICP filing information of the target website and the URL link URL1 to be distinguished is the same, and the ICP filing information of the target website and the URL link URL2 to be distinguished is not the same, therefore, the method for distinguishing the internal and external links of the target website according to the present solution is used to distinguish the internal and external links of the URL links to be distinguished, it is determined that URL1 is an internal link of the target website, and URL2 is an external link of the target website. By determining the sponsor or undertaker of the target website, URL1 and URL2, it is obtained that the sponsor of the target website and URL1 is xx1 Municipal xx2 Government, and the sponsor of URL2 is xx1 Municipal xx3 Committee, that is, URL2 is an external link of the target website. It can be seen that the present solution can use the ICP filing information of the target website to judge the external link with the same IP address and the same main domain name as the internal link, thereby improving the accuracy of distinguishing the internal and external links of the target website.
[0092] In some embodiments, in the case of judging the internal and external links of the target website www.xxx2.gov.cn, the obtained URL links to be distinguished of the target website include URL3 "www.xxx2.gov.cn / col / col80524 / index.html" and URL4 "www.xxx2.cn / col / col80524 / index.html", according to the URL identification method, URL3 and URL4 are distinguished, the main domain name of the target website is xxx2.gov.cn, the main domain name of URL3 is xxx2.gov.cn, and the main domain name of URL4 is xxx2.cn. The main domain name of the target website is the same as that of URL3, and they also have the same IP address 119.188.x.x through domain name resolution, so URL3 is an internal link of the target website. The main domain name of the target website is not the same as that of URL4, and the IP address of URL4 is 202.110.x.x through domain name resolution, which is different from the IP address of the target website, so URL4 is an external link of the target website. However, the ICP filing information of the obtained target website and the URL links to be distinguished URL3 and URL4 are the same, therefore, the method for distinguishing the internal and external links of the target website according to the present solution distinguishes the internal and external links of the URL links to be distinguished, and determines that URL3 and URL4 are both internal links of the target website. By determining the sponsor or undertaker of the target website, URL3 and URL4, it is obtained that the sponsor of the target website, URL3 and URL4 is xx3 municipal xx4 government, that is, URL3 and URL4 are both internal links of the target website. It can be seen that the present solution can avoid judging the internal link with different IP addresses and not completely the same main domain name as the external link, and improves the accuracy of distinguishing the internal and external links of the target website.
[0093] In some embodiments, in the case of business cloud and website intensive station building scenarios, the URL identification method cannot accurately distinguish internal and external links. The present disclosure provides introducing ICP filing information to distinguish the URL links to be distinguished, which can distinguish from the management domain angle that the URL links to be distinguished are internal or external links of the target website, and improves the accuracy of distinguishing the URL links to be distinguished.
[0094] In combination Figure 5 As shown in the figure, the present disclosure provides a device for distinguishing internal and external links of a target website, comprising a first acquisition module 1, a second acquisition module 2 and a distinguishing module 3. The first acquisition module 1 is configured to acquire first ICP filing information of a target website; the second acquisition module 2 is configured to acquire URL links to be distinguished of the target website; and the distinguishing module 3 is configured to distinguish according to the first ICP filing information that the URL links to be distinguished are internal or external links of the target website.
[0095] The device for distinguishing internal and external links of a target website provided by the embodiment of the present disclosure is used to obtain the first ICP filing information of the target website, obtain the URL link to be distinguished of the target website, and then distinguish whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information. In this way, the misjudgment caused by the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished is not needed to be considered, and the accuracy of distinguishing the internal and external links of the target website is improved by using the first ICP filing information of the target website to distinguish whether the URL link to be distinguished is an internal link or an external link of the target website.
[0096] Optionally, the first obtaining module is configured to obtain the first ICP filing information of the target website by the following method: accessing the first website homepage of the target website; extracting the content of the first website homepage; and obtaining the first ICP filing information of the target website in the content of the first website homepage.
[0097] Optionally, the second obtaining module is configured to obtain the URL link to be distinguished of the target website by the following method: in the case that the first ICP filing information of the target website is obtained, extracting the URL link to be distinguished of the target website in the first website homepage.
[0098] Optionally, the distinguishing module is configured to distinguish whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information by the following method: obtaining the first host field of the first website homepage; obtaining the second host field of the URL link to be distinguished; in the case that the first host field is the same as the second host field, determining the URL link to be distinguished as an internal link of the target website; and in the case that the first host field is not the same as the second host field, distinguishing whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information.
[0099] Optionally, the distinguishing module is configured to distinguish whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information in the case that the first host field is not the same as the second host field by the following method: in the case that the first host field is not the same as the second host field, accessing the second website homepage of the URL link to be distinguished according to the second host field; extracting the content of the second website homepage; obtaining the second ICP filing information of the URL link to be distinguished in the content of the second website homepage; and distinguishing whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information and the second ICP filing information.
[0100] Optionally, the distinguishing module is configured to distinguish, according to the first ICP filing information and the second ICP filing information, whether the URL link to be distinguished is an internal link or an external link of the target website by: determining that the URL link to be distinguished is an internal link of the target website in a case where the first ICP filing information and the second ICP filing information are the same; and / or determining that the URL link to be distinguished is an external link of the target website in a case where the first ICP filing information and the second ICP filing information are different.
[0101] In combination Figure 6 As shown in the accompanying drawings, the embodiment of the present disclosure provides a device for distinguishing internal and external links of a target website, which comprises a processor 100 and a memory 101. Optionally, the device can further comprise a communication interface 102 and a bus 103. The processor 100, the communication interface 102 and the memory 101 can communicate with each other through the bus 103. The communication interface 102 can be used for information transmission. The processor 100 can invoke the logical instructions in the memory 101 to execute the method for distinguishing internal and external links of a target website in the above-mentioned embodiments.
[0102] In addition, the logical instructions in the memory 101 described above can be implemented in the form of a software functional unit and sold or used as an independent product, which can be stored in a computer readable storage medium.
[0103] The memory 101 as a computer readable storage medium can be used to store software programs, computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 100 executes the program instructions / modules stored in the memory 101, thereby performing functional applications and data processing, i.e. implementing the method for distinguishing internal and external links of a target website in the above-mentioned embodiments.
[0104] The memory 101 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 101 can include a high-speed random access memory, and can also include a non-volatile memory.
[0105] The device for distinguishing internal and external links of a target website provided by the embodiment of the present disclosure can acquire the first ICP filing information of the target website, acquire the URL link to be distinguished of the target website, and then distinguish whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information. In this way, the misjudgment caused by the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished is not needed to be considered, the URL link to be distinguished is distinguished to be an internal link or an external link of the target website by using the first ICP filing information of the target website, and the accuracy of distinguishing the internal and external links of the target website is improved.
[0106] The embodiment of the present disclosure provides an electronic device comprising the device for distinguishing internal and external links of a target website.
[0107] The electronic device provided by the embodiment of the present disclosure can acquire the first ICP filing information of the target website, acquire the URL link to be distinguished of the target website, and then distinguish whether the URL link to be distinguished is an internal link or an external link of the target website according to the first ICP filing information. In this way, the misjudgment caused by the relationship between the main domain name of the target website, the IP address of the target website, the main domain name of the URL link to be distinguished and the IP address of the URL link to be distinguished is not needed to be considered, the URL link to be distinguished is distinguished to be an internal link or an external link of the target website by using the first ICP filing information of the target website, and the accuracy of distinguishing the internal and external links of the target website is improved.
[0108] Optionally, the electronic device comprises a smart terminal or a server. Optionally, the smart terminal comprises a smartphone, a tablet computer or a computer, and the like, which can access a website.
[0109] The embodiment of the present disclosure provides a storage medium, which stores computer executable instructions, and the computer executable instructions are configured to execute the method for distinguishing internal and external links of a target website.
[0110] The embodiment of the present disclosure provides a computer program product, which comprises a computer program stored on a computer readable storage medium, and the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes the method for distinguishing internal and external links of a target website.
[0111] The computer readable storage medium described above can be a transitory computer readable storage medium or a non-transitory computer readable storage medium.
[0112] The technical solutions of the embodiments of the present disclosure can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes one or more instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method disclosed in the embodiments of the present disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes, and can also be a transitory storage medium.
[0113] The above description and drawings sufficiently illustrate the embodiments of the present disclosure to enable one skilled in the art to practice them. Other embodiments can include structural, logical, electrical, process, and other changes. The embodiments represent only a few of the possible variations. Individual components and functions are optional unless explicitly required, and the order of operations can be changed. Parts and features of some embodiments can be included in or replace parts and features of other embodiments. Also, the words used in this application are used only to describe the embodiments and not to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly requires otherwise, the singular forms "a," "an," and "the" are intended to include the plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listed items. In addition, when used in this application, the term "comprise" and its variations "comprises" and / or comprises" and the like mean the presence of the stated features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, or device including the stated element. In this document, each embodiment focuses on the differences from other embodiments, and the same or similar parts between embodiments can be referred to each other. For the method, product, etc. disclosed in the embodiments, if it corresponds to the method part disclosed in the embodiments, the relevant part can be referred to the description of the method part.
[0114] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods for each specific application to realize the described functions, but such implementation should not be considered beyond the scope of the embodiments of the present disclosure. The skilled person can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0115] In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the units can only be a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms. The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to implement the embodiments. In addition, each functional unit in the embodiments of the present disclosure can be integrated in one processing unit, or each unit can be a physically independent unit, or two or more units can be integrated in one unit.
[0116] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
Claims
1. A method for distinguishing links inside and outside a target website, characterized in that, The method comprises: acquiring first ICP filing information of a target website; acquiring URL links to be distinguished of the target website; acquiring a first host field of a first website homepage of the target website; acquiring a second host field of the URL links to be distinguished; in a case where the first host field is identical to the second host field, determining the URL links to be distinguished as internal links of the target website; in a case where the first host field is not identical to the second host field, accessing a second website homepage of the URL links to be distinguished according to the second host field; extracting content of the second website homepage; acquiring second ICP filing information of the URL links to be distinguished in the content of the second website homepage; in a case where the first ICP filing information and the second ICP filing information are identical, determining that the URL links to be distinguished are internal links of the target website; and / or in a case where the first ICP filing information and the second ICP filing information are not identical, determining that the URL links to be distinguished are external links of the target website. The method for acquiring first ICP filing information of a target website comprises:
2. The method of claim 1, wherein, accessing a first website homepage of the target website; extracting content of the first website homepage; acquiring first ICP filing information of the target website in the content of the first website homepage. The method for acquiring URL links to be distinguished of the target website comprises:
3. The method of claim 2, wherein, in a case where the first ICP filing information of the target website is acquired, extracting the URL links to be distinguished of the target website in the first website homepage. The method for accessing a first website homepage of a target website comprises:
4. The method of claim 2, wherein, acquiring URL links of the target website; acquiring a homepage address of the URL links of the target website; accessing a first website homepage corresponding to the homepage address. The method comprises:
5. A device for distinguishing internal and external links of a target website, characterized in that, a first acquiring module configured to acquire first ICP filing information of a target website; a second acquiring module configured to acquire URL links to be distinguished of the target website; a distinguishing module configured to acquire a first host field of a first website homepage of the target website; acquire a second host field of the URL links to be distinguished; in a case where the first host field is identical to the second host field, determine the URL links to be distinguished as internal links of the target website; in a case where the first host field is not identical to the second host field, access a second website homepage of the URL links to be distinguished according to the second host field; extract content of the second website homepage; acquire second ICP filing information of the URL links to be distinguished in the content of the second website homepage; in a case where the first ICP filing information and the second ICP filing information are identical, determine that the URL links to be distinguished are internal links of the target website; and / or in a case where the first ICP filing information and the second ICP filing information are not identical, determine that the URL links to be distinguished are external links of the target website. The processor is configured to execute the program instructions to perform the method for distinguishing internal and external links of a target website according to any one of claims 1 to 4 when the program instructions are run.
6. An apparatus for distinguishing links inside and outside a target website, comprising a processor and a memory having stored program instructions, characterized in that, 7. An electronic device, comprising: The apparatus for distinguishing between in-target and out-target links as claimed in claim 5 or 6.
8. A storage medium storing program instructions, characterized in that, The program instructions, when executed, perform the method for distinguishing between in-target and out-target links as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and system for preventing phishing attacks
CN102902917A
Method and device for detecting phishing website
CN108270754A