CN112860969A - Domain name classification matching method and device - Google Patents

Domain name classification matching method and device Download PDF

Info

Publication number
CN112860969A
CN112860969A CN202110211983.3A CN202110211983A CN112860969A CN 112860969 A CN112860969 A CN 112860969A CN 202110211983 A CN202110211983 A CN 202110211983A CN 112860969 A CN112860969 A CN 112860969A
Authority
CN
China
Prior art keywords
domain name
file
classification
matching
predefined
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110211983.3A
Other languages
Chinese (zh)
Inventor
张晓东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Sipuleng Technology Co Ltd
Wuhan Sipuling Technology Co Ltd
Original Assignee
Wuhan Sipuling Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Sipuling Technology Co Ltd filed Critical Wuhan Sipuling Technology Co Ltd
Priority to CN202110211983.3A priority Critical patent/CN112860969A/en
Publication of CN112860969A publication Critical patent/CN112860969A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]

Abstract

The embodiment of the application discloses a domain name classification matching method and a domain name classification matching device, wherein the method comprises the following steps: firstly, acquiring a predefined domain name classification file according to a predefined generation rule; then when a domain name request is received, acquiring a domain name classification file to be matched according to the predefined generation rule; then matching the domain name classification file to be matched with a predefined domain name classification file; and if the matching is successful, acquiring the classification file corresponding to the requested domain name, and allowing the resource website corresponding to the requested domain name to be accessed. By adopting the scheme, when the domain name is matched and classified for searching, only files are used for searching, and searching is not carried out in the memory, namely, the occupation of the memory is converted into the occupation of the hard disk storage, so that the occupation of the memory is greatly reduced, and the fast searching is realized. Furthermore, the method can also realize fast matching of domain name classification, direct resource positioning, avoid complex operation and improve matching efficiency.

Description

Domain name classification matching method and device
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a domain name classification matching method and apparatus.
Background
The domain name, which may also be referred to as a web domain, is a string of name characters on an internet computer and is unique and serves as a location identifier when transmitting data. At present, most network security devices support a domain name classification filtering function. The domain name classification filtering is to filter the domain names according to various domain names in the domain name classification library, and allow the domain names meeting the conditions to pass through. The domain name classification library can contain various characteristics and classification information of news, finance, tourism, streaming media and video, sports, humanity, social networks and the like. The administrator manages resource websites corresponding to various resources in the domain name classification library according to actual requirements, for example, resource websites which only allow access to work related classes during working hours and resource websites which block non-work related classes such as finance, tourism, streaming media, video and sports. In the process of domain name classification filtering, the domain name classification is needed to be realized through domain name matching classification.
The current domain name matching and classifying method is that a predefined domain name is set, the predefined domain name is established in a memory, when the domain name of an access request is received, the HASH value is calculated, then the domain name is shifted to a corresponding HASH position and compared with the domain name under the same HASH, if the comparison is successful, the corresponding domain name is confirmed to be matched with the category, normal access can be carried out, and if the comparison is unsuccessful, the domain name of the access request is intercepted and is not accessed.
However, with the explosion of internet resources, the number of domain names increases exponentially, the number of domain names is large, a large amount of memory is occupied, and the matching efficiency is seriously affected.
Disclosure of Invention
The application provides a domain name classification matching method and device, and aims to solve the problems that the domain name number is exponentially increased along with the great explosion of internet resources, the domain name number is large, a large amount of memory is occupied, and the matching efficiency is seriously influenced.
In a first aspect, an embodiment of the present application provides a domain name classification matching method, where the method includes:
acquiring a predefined domain name classification file according to a predefined generation rule;
when a domain name request is received, acquiring a domain name classification file to be matched according to the predefined generation rule;
matching the domain name classification file to be matched with a predefined domain name classification file;
and if the matching is successful, acquiring the classification file corresponding to the requested domain name, and allowing the resource website corresponding to the requested domain name to be accessed.
With reference to the first aspect, in one implementation manner, the method further includes: and if the matching fails, intercepting the domain name of the request to access the corresponding resource website.
With reference to the first aspect, in one implementation manner, the predefined generation rule includes:
dividing the domain name by taking points in the domain name as a dividing unit;
creating a directory step by step for the divided domain names;
and creating a classification file in a directory part at the tail end, wherein the classification file comprises specific information of domain name classification.
With reference to the first aspect, in an implementation manner, before obtaining a domain name classification file to be matched, the method further includes:
and generating a resource path for the requested domain name, and generating the classification of the domain name to be matched according to the resource path.
With reference to the first aspect, in an implementation manner, matching the domain name classification file to be matched with a predefined domain name classification file includes:
and searching the domain name classification file to be matched corresponding to the resource path according to the resource path generated by the domain name request.
In a second aspect, an embodiment of the present application provides, in part, a domain name classification matching apparatus, where the apparatus includes:
the predefined domain name classification file acquisition module is used for acquiring a predefined domain name classification file according to a predefined generation rule;
the domain name classified file to be matched acquiring module is used for acquiring the domain name classified file to be matched according to the predefined generating rule when a domain name request is received;
the matching module is used for matching the domain name classification file to be matched with a predefined domain name classification file;
and the classified file acquisition module is used for acquiring the classified file corresponding to the requested domain name and allowing the resource website corresponding to the requested domain name to be accessed when the matching is successful.
With reference to the second aspect, in one implementation manner, the apparatus further includes:
and the intercepting module is used for intercepting the domain name of the request to access the corresponding resource website when the matching fails.
With reference to the second aspect, in an implementation manner, the predefined domain name class file obtaining module includes:
the division unit is used for dividing the domain name by taking points in the domain name as division units;
the directory creating unit is used for creating directories step by step on the divided domain names;
and the classified file creating unit is used for creating a classified file in a directory part at the tail end, wherein the classified file comprises specific information of domain name classification.
With reference to the second aspect, in an implementation manner, the domain name classification file to be matched obtaining module is further configured to:
and generating a resource path for the requested domain name, and generating the classification of the domain name to be matched according to the resource path.
With reference to the second aspect, in one implementation manner, the matching module includes:
and the searching unit is used for searching the domain name classification file to be matched corresponding to the resource path according to the resource path generated by the domain name request.
The embodiment of the application discloses a domain name classification matching method and a domain name classification matching device, wherein the method comprises the following steps: firstly, acquiring a predefined domain name classification file according to a predefined generation rule; then when a domain name request is received, acquiring a domain name classification file to be matched according to the predefined generation rule; then matching the domain name classification file to be matched with a predefined domain name classification file; and if the matching is successful, acquiring the classification file corresponding to the requested domain name, and allowing the resource website corresponding to the requested domain name to be accessed. By adopting the scheme, when the domain name is matched and classified, only files are used for searching, and the files are not searched in the memory, namely, the occupation of the memory is converted into the occupation of the hard disk storage, so that the occupation of the memory is greatly reduced, and the fast matching is realized. Furthermore, the method can also realize fast matching of domain name classification, direct resource positioning, avoid complex operation and improve matching efficiency.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a domain name classification matching method provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart of a domain name classification matching method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a domain name classification matching apparatus provided in an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
It can be known from the description of the background art that in the existing domain name matching classification, matching classification is realized by calculating HASH values, but the number of domain names is huge at present, and a large amount of memory is occupied, so that the running speed is influenced, and further the matching efficiency is influenced.
Therefore, to solve the above problem, an embodiment of the present application provides a domain name classification matching method, and with reference to fig. 1, the method includes:
and S11, acquiring the predefined domain name classification file according to the predefined generation rule.
In this step, firstly, according to predefined generation rules, the domain names corresponding to various resource websites are classified to obtain predefined domain name classification files corresponding to the resource websites which are allowed to access the relevant classes of work, that is, all the domain names which are allowed to access are stored in the predefined domain name classification files for subsequent matching and searching.
And S12, when receiving the domain name request, acquiring the domain name classification file to be matched according to the predefined generation rule.
In this step, after receiving the domain name requested to be accessed by the user, the domain name requested to be accessed is classified according to the predefined generation rule in step S11, so as to obtain a domain name classification file to be matched.
And S13, matching the domain name classification file to be matched with a predefined domain name classification file, and judging whether the domain name classification file to be matched is matched with the predefined classification file.
In this step, the domain name classification file to be matched obtained in step S12 is matched and searched with the predefined domain name classification file in step S11, and it is determined whether the domain name classification file to be matched can be found in the predefined classification file, that is, whether the classification corresponding to the domain name requested to be accessed by the user is in the domain name classification file allowed to be accessed.
And S14, if the matching is successful, acquiring the classification file corresponding to the requested domain name, and allowing the resource website corresponding to the requested domain name to be accessed.
And S15, if the matching fails, intercepting the domain name of the request to access the corresponding resource website.
After the matching in step S13, two results are generated, that is, the matching is successful and the matching is unsuccessful, if the matching is successful, that is, the domain name classification file to be matched can be found in the predefined classification file, it indicates that the resource website corresponding to the requested domain name is allowed to access, and if the matching is unsuccessful, the resource website corresponding to the requested domain name is intercepted, and the access cannot be allowed.
The domain name classification matching method disclosed in the embodiment of the application realizes rapid resource positioning matching directly through the rule conversion of the domain name, avoids the influence of complex operation rules on matching efficiency, meanwhile, when the domain name is subjected to domain name matching classification, the searching matching is only searched in a file, and the searching is not performed in a memory, so that the occupation of the memory is reduced, and the classification and the domain name in the file are stored in a one-to-one manner, so that the conflicting domain name does not exist, and further the matching efficiency is not influenced.
From the above, the embodiment of the present application discloses a domain name classification matching method, which includes obtaining a predefined domain name classification file according to a predefined generation rule; then when a domain name request is received, acquiring a domain name classification file to be matched according to the predefined generation rule; then matching the domain name classification file to be matched with a predefined domain name classification file; if the matching is successful, the classification file corresponding to the requested domain name is obtained, the resource website corresponding to the requested domain name is allowed to be accessed, and if the matching is failed, the access is intercepted. The method for searching only uses file searching, does not search in the memory, namely the memory occupation is converted into the hard disk storage occupation, so that the memory occupation is greatly reduced.
Optionally, the predefined generation rule may be obtained by specifically adopting the following method:
dividing the domain name by taking points in the domain name as a dividing unit;
creating a directory step by step for the divided domain names;
and creating a classification file in a directory part at the tail end, wherein the classification file comprises specific information of domain name classification.
In S11, the finally created classification file is a predefined domain name classification file, and the classification file includes each classification information corresponding to the domain name permitted to be accessed; in S12, the finally created classified file is a domain name classified file to be matched, and the classified file includes category information corresponding to the domain name to be matched.
For example: the domain name is www.baidu.com, and the division unit is' in the domain name, and the domain name is divided into: www, baidu and com, then creating directories step by step for the divided domain names, wherein the created directories are www- > baidu- > com, and finally creating a classification file index.
For another example: the domain name is www.news.baidu.com, and the domain name is divided into the following parts by taking the point as a division unit: www, news, baidu and com, creating a directory www- > news- > baidu- > com after division, and finally creating a classification file index.
Optionally, before obtaining the domain name classification file to be matched, the method further includes:
and generating a resource path for the requested domain name, and generating the classification of the domain name to be matched according to the resource path.
In this step, the resource path can further represent the location and type of the requested domain name, for example, the resource path corresponding to the domain name www.baidu.com is www/baidu/com/index.
Optionally, matching the domain name classification file to be matched with a predefined domain name classification file includes:
and searching the domain name classification file to be matched corresponding to the resource path according to the resource path generated by the domain name request.
Examples
Referring to fig. 2, an embodiment of a domain name class matching method is shown, where a domain name requested by the embodiment is, for example, sport, sina, com, a predefined domain name class file (not shown in the figure) is first established, after receiving a domain name request, the domain name is divided into sport, sina, com, and then sport/sina/com/index.txt is generated, then a predefined domain name class file is searched, a file sport/sina/com/index.txt corresponding to a resource path is opened, the file is read, if the file reading is successful, the corresponding class can be read from the index.txt, and the file can be accessed, and if the file reading fails, the corresponding class is not matched, and the requested domain name cannot be accessed.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
Referring to fig. 3, a domain name classification matching apparatus disclosed in an embodiment of the present application includes:
a predefined domain name classification file obtaining module 10, configured to obtain a predefined domain name classification file according to a predefined generation rule;
a domain name classification file to be matched obtaining module 20, configured to obtain a domain name classification file to be matched according to the predefined generation rule when a domain name request is received;
the matching module 30 is configured to match the domain name classification file to be matched with a predefined domain name classification file;
and the classified file obtaining module 40 is configured to obtain a classified file corresponding to the requested domain name and allow access to the resource website corresponding to the requested domain name when matching is successful.
And the intercepting module 50 is configured to intercept the domain name of the request to access the corresponding resource website when the matching fails.
Optionally, the predefined domain name classification file obtaining module includes:
the division unit is used for dividing the domain name by taking points in the domain name as division units;
the directory creating unit is used for creating directories step by step on the divided domain names;
and the classified file creating unit is used for creating a classified file in a directory part at the tail end, wherein the classified file comprises specific information of domain name classification.
Optionally, the domain name classification file to be matched obtaining module is further configured to:
and generating a resource path for the requested domain name, and generating the classification of the domain name to be matched according to the resource path.
Optionally, the matching module comprises:
and the searching unit is used for searching the domain name classification file to be matched corresponding to the resource path according to the resource path generated by the domain name request.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the description in the method embodiment.
The present application has been described in detail with reference to specific embodiments and illustrative examples, but the description is not intended to limit the application. Those skilled in the art will appreciate that various equivalent substitutions, modifications or improvements may be made to the presently disclosed embodiments and implementations thereof without departing from the spirit and scope of the present disclosure, and these fall within the scope of the present disclosure. The protection scope of this application is subject to the appended claims.

Claims (10)

1. A domain name classification matching method is characterized by comprising the following steps:
acquiring a predefined domain name classification file according to a predefined generation rule;
when a domain name request is received, acquiring a domain name classification file to be matched according to the predefined generation rule;
matching the domain name classification file to be matched with a predefined domain name classification file;
and if the matching is successful, acquiring the classification file corresponding to the requested domain name, and allowing the resource website corresponding to the requested domain name to be accessed.
2. The domain name classification matching method according to claim 1, further comprising: and if the matching fails, intercepting the domain name of the request to access the corresponding resource website.
3. The domain name classification matching method according to claim 1, wherein the predefined generation rule comprises:
dividing the domain name by taking points in the domain name as a dividing unit;
creating a directory step by step for the divided domain names;
and creating a classification file in a directory part at the tail end, wherein the classification file comprises specific information of domain name classification.
4. The domain name classification matching method according to claim 1, wherein before obtaining the domain name classification file to be matched, the method further comprises:
and generating a resource path for the requested domain name, and generating the classification of the domain name to be matched according to the resource path.
5. The domain name classification matching method according to claim 4, wherein matching the domain name classification file to be matched with a predefined domain name classification file comprises:
and searching the domain name classification file to be matched corresponding to the resource path according to the resource path generated by the domain name request.
6. A domain name classification matching apparatus, comprising:
the predefined domain name classification file acquisition module is used for acquiring a predefined domain name classification file according to a predefined generation rule;
the domain name classified file to be matched acquiring module is used for acquiring the domain name classified file to be matched according to the predefined generating rule when a domain name request is received;
the matching module is used for matching the domain name classification file to be matched with a predefined domain name classification file;
and the classified file acquisition module is used for acquiring the classified file corresponding to the requested domain name and allowing the resource website corresponding to the requested domain name to be accessed when the matching is successful.
7. The apparatus according to claim 6, wherein the apparatus further comprises:
and the intercepting module is used for intercepting the domain name of the request to access the corresponding resource website when the matching fails.
8. The domain name classification matching device according to claim 6, wherein the predefined domain name classification file obtaining module comprises:
the division unit is used for dividing the domain name by taking points in the domain name as division units;
the directory creating unit is used for creating directories step by step on the divided domain names;
and the classified file creating unit is used for creating a classified file in a directory part at the tail end, wherein the classified file comprises specific information of domain name classification.
9. The domain name classification matching device according to claim 6, wherein the to-be-matched domain name classification file obtaining module is further configured to:
and generating a resource path for the requested domain name, and generating the classification of the domain name to be matched according to the resource path.
10. The domain name classification matching apparatus according to claim 9, wherein the matching module includes:
and the searching unit is used for searching the domain name classification file to be matched corresponding to the resource path according to the resource path generated by the domain name request.
CN202110211983.3A 2021-02-25 2021-02-25 Domain name classification matching method and device Pending CN112860969A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110211983.3A CN112860969A (en) 2021-02-25 2021-02-25 Domain name classification matching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110211983.3A CN112860969A (en) 2021-02-25 2021-02-25 Domain name classification matching method and device

Publications (1)

Publication Number Publication Date
CN112860969A true CN112860969A (en) 2021-05-28

Family

ID=75989945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110211983.3A Pending CN112860969A (en) 2021-02-25 2021-02-25 Domain name classification matching method and device

Country Status (1)

Country Link
CN (1) CN112860969A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120303808A1 (en) * 2011-05-24 2012-11-29 Palo Alto Networks, Inc. Using dns communications to filter domain names
CN102882987A (en) * 2011-07-12 2013-01-16 阿里巴巴集团控股有限公司 Domain filter list storing and matching method and device
CN104750704A (en) * 2013-12-26 2015-07-01 中国移动通信集团河南有限公司 Webpage uniform resource locator (URL) classification and identification method and device
CN106559420A (en) * 2016-11-07 2017-04-05 杭州迪普科技股份有限公司 A kind of filter method and device of message
US20180300475A1 (en) * 2017-04-14 2018-10-18 Alibaba Group Holding Limited Method, means, system, processor, and memory for intercepting malicious websites
CN109710860A (en) * 2018-12-21 2019-05-03 武汉思普崚技术有限公司 A kind of matched method and device of URL classification
CN109951469A (en) * 2019-03-12 2019-06-28 中国平安人寿保险股份有限公司 A kind of method, apparatus, storage medium and server creating domain name black and white lists
CN110430188A (en) * 2019-08-02 2019-11-08 武汉思普崚技术有限公司 A kind of quick url filtering method and device
CN111782914A (en) * 2020-06-22 2020-10-16 杭州迪普科技股份有限公司 Web server protection method and device and network equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120303808A1 (en) * 2011-05-24 2012-11-29 Palo Alto Networks, Inc. Using dns communications to filter domain names
CN102882987A (en) * 2011-07-12 2013-01-16 阿里巴巴集团控股有限公司 Domain filter list storing and matching method and device
CN104750704A (en) * 2013-12-26 2015-07-01 中国移动通信集团河南有限公司 Webpage uniform resource locator (URL) classification and identification method and device
CN106559420A (en) * 2016-11-07 2017-04-05 杭州迪普科技股份有限公司 A kind of filter method and device of message
US20180300475A1 (en) * 2017-04-14 2018-10-18 Alibaba Group Holding Limited Method, means, system, processor, and memory for intercepting malicious websites
CN109710860A (en) * 2018-12-21 2019-05-03 武汉思普崚技术有限公司 A kind of matched method and device of URL classification
CN109951469A (en) * 2019-03-12 2019-06-28 中国平安人寿保险股份有限公司 A kind of method, apparatus, storage medium and server creating domain name black and white lists
CN110430188A (en) * 2019-08-02 2019-11-08 武汉思普崚技术有限公司 A kind of quick url filtering method and device
CN111782914A (en) * 2020-06-22 2020-10-16 杭州迪普科技股份有限公司 Web server protection method and device and network equipment

Similar Documents

Publication Publication Date Title
US9928292B2 (en) Classifying uniform resource locators
JP5661104B2 (en) Method and system for search using search engine indexing and index
US10250526B2 (en) Method and apparatus for increasing subresource loading speed
US20080071727A1 (en) Environment classification
US9367569B1 (en) Recovery of directory information
US11537751B2 (en) Using machine learning algorithm to ascertain network devices used with anonymous identifiers
US7801883B2 (en) Method and apparatus for improving data processing speed through storage of record information of identity module
US20080133460A1 (en) Searching descendant pages of a root page for keywords
CN112003857A (en) Network asset collecting method, device, equipment and storage medium
US20090083266A1 (en) Techniques for tokenizing urls
WO2013106595A2 (en) Processing store visiting data
CN111368227B (en) URL processing method and device
US20160275199A1 (en) Data processing device, data processing method, and non-transitory computer readable medium
WO2012062107A1 (en) Method and apparatus for data processing based on surfing behavior of mobile telephone user
KR20050013961A (en) Method and apparatus for late-binding/dynamic pathname resolution
CN105354195A (en) Information search method and apparatus
CN112860969A (en) Domain name classification matching method and device
CN103258052A (en) Method for discovering related resources on eMule network
CN106878252A (en) Foundation is exempted from the method for close login relation, removes the method and its device of account
US11704099B1 (en) Discovering matching code segments according to index and comparative similarity
US20230138113A1 (en) System for retrieval of large datasets in cloud environments
US20170270127A1 (en) Category-based full-text searching
CN104378453A (en) Method and device for redirection of URL
US20140372361A1 (en) Apparatus and method for providing subscriber big data information in cloud computing environment
CN111865976A (en) Access control method, device and gateway

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210528