Domain name classification method and system based on depth model

Through the combination of deep models and asynchronous detection queues, the problem of low domain name classification accuracy and efficiency in the existing technology is solved, high-accuracy and efficient domain name classification is achieved, and the risk of false negatives is reduced.

CN118760764APending Publication Date: 2024-10-11CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Application Number
CN202410802163.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-12-12
Filing Date
2024-06-20
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing domain name classification methods that rely on manual labeling have high costs and low accuracy. Machine learning methods based on URL features have low accuracy and cannot effectively classify domain names. Moreover, URLs and web page content change frequently, making classification more difficult.

Method used

Adopt a deep model-based domain name classification method, use distributed crawlers to capture secondary page content, use BERT and ResNet models for text and image recognition, combine Triton Server container deployment and operator optimization, and use asynchronous detection queues to achieve data pull Merge the results and store them in Elasticsearch and MySQL for aggregation and management of classification results.

Benefits of technology

Significantly improves the generalization of traditional machine learning based on URL features, reduces model recognition errors, improves response speed, enhances the strictness of classifying illegal websites, reduces the risk of false negatives, and achieves domain name classification accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760764A_ABST
    Figure CN118760764A_ABST
Patent Text Reader

Abstract

The invention relates to the field of natural language processing of artificial intelligence, in particular to a domain name classification method and system based on a depth model, and the method comprises the steps: based on a distributed crawler function, carrying out the periodic grabbing of a second-level page under a specific domain name, and storing the second-level page in Elasticsearch; identifying the text content and the picture content of the second-level page by using the depth model, and performing operator optimization processing on the depth model; performing text detection on the second-level page under each domain name, aggregating text detection results of the domain names, and storing aggregated classification results; based on an asynchronous detection queue function, the functions of data pulling, model calling, merging result detection and storage result detection on different domain names are realized at the same time. In Local DNS domain name resolution, visitors are limited according to the classification of the domain names, and the categories of massive domain names are accurately marked, so that the manual marking cost is greatly reduced, and the marking speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing of artificial intelligence, and specifically to a domain name classification method and system based on a deep model. Background Art

[0002] A domain name classification system is a program that analyzes a given domain name to determine its business category (news, entertainment, prohibited, etc.).

[0003] Its primary value lies in: LocalDNS domain name resolution allows for restricting visitors based on domain name classification. It can also block prohibited domains or recommend similar domains of interest to users. Using a recognition method based on deep NLP models, it can accurately identify the categories of massive domains, significantly reducing manual labeling costs and increasing labeling speed.

[0004] Currently, domain name classification is still mainly done through manual labeling or by using URL features. There are two methods: rule-based and machine learning-based.

[0005] Existing methods suffer from the following problems: manual annotation is slow and costly; methods based on URL rules have low accuracy, prone to missed detections and misclassifications; and machine learning methods based on URL features, relying solely on URL data, still have low accuracy and are unable to fundamentally and accurately classify domain names. URLs themselves are often unrelated to webpage content, and content can fluctuate, making classification even more difficult.

[0006] Based on this, the present invention proposes a domain name classification method based on a deep model to solve the above problems. Summary of the Invention

[0007] To achieve the above-mentioned objectives, the present invention provides the following technical solutions: based on the distributed crawler function, the secondary pages under a specific domain name are periodically crawled and stored in Elasticsearch; the text content and image content of the secondary pages are identified by using a deep model, the text deep model and the image deep model are deployed in a containerized manner using Triton Server, and the operator optimization processing is performed on the deep model; Triton Server and the keyword detection service are called to perform text detection on the secondary pages under each domain name; the deep model is called to aggregate the text detection results of the domain name, and the classification results are written to the MySql database after determining the classification results of the domain name; based on the asynchronous detection queue function, the functions of data pulling, model calling, merging result detection and storing result detection are realized for different domain names at the same time.

[0008] Preferably, the periodic crawling includes: periodic crawling to avoid invalidation of previous crawling results due to changes in website content, and to achieve real-time crawling of web page content according to a set crawling cycle.

[0009] Preferably, the Elasticsearch includes, for the secondary page content under each captured domain name, the secondary page content includes text and image content; the secondary page content is stored in Elasticsearch to achieve rapid retrieval of large-scale data, and the results of each web page model analysis are written back to Elasticsearch to provide data for subsequent model update iterations; at the same time, the results of domain name classification are saved and managed.

[0010] Preferably, the text depth model includes a bert model, and the image depth model includes a ResNet model;

[0011] The operator optimization processing includes using a model acceleration method based on TensorRT to perform operator optimization processing on the BERT model and the ResNet model, while performing model pruning and model lightweighting.

[0012] Preferably, the classification result includes performing text detection on the secondary pages under each domain name,

[0013] Each page generates a classification result, and the domain classification result is aggregated from the results of the second-level pages;

[0014] Domain name classification methods include category division, category calculation, category proportion ranking, and retention of valid categories;

[0015] The classification includes classifying domain names into illegal categories and regular categories;

[0016] The classification calculation includes calculating the proportion of each classification:

[0017] CR(A)=count(A) / count(all_pages)

[0018] CR(A) represents the proportion of category A, count(A) represents the number of secondary URLs of category A, and count(all_pages) represents the number of all secondary URLs under the current domain name.

[0019] The classification proportion ranking includes the classification proportion ranking based on the premise that illegal domain names are ranked first and regular domain names are ranked last, and the ranking is arranged from largest to smallest according to the proportion;

[0020] The retaining of valid classifications includes retaining the category if there are subcategories under the illegal category in the category, and the order is still sorted by proportion; the subcategories under the regular category are arranged after the illegal category in order of proportion, and at the same time, the categories whose proportion is lower than the set threshold are eliminated.

[0021] Preferably, a domain name classification system based on a deep model includes a data acquisition module, a model service module, a detection business logic module, and a storage module;

[0022] The data collection module, based on the distributed crawler function, periodically crawls the secondary pages under a specific domain name and stores them in Elasticsearch;

[0023] The model service module uses a deep model to identify the text content and image content of the secondary page, uses Triton Server containerized deployment of the text deep model and the image deep model, and performs operator optimization processing on the deep model;

[0024] The detection business logic module extracts the corresponding domain name data from Elasticsearch, calls the deep model to aggregate the text detection results of the domain name, and writes the results to the MySql database of the storage module;

[0025] The storage module includes an Elasticsearch unit and a MySQL unit, which are used to store data.

[0026] The text depth model includes a bert model, and the image depth model includes a ResNet model.

[0027] Preferably, the Elasticsearch unit is used to store the secondary page content of a specific domain name captured by the crawler function; and the MySQL unit is used to store the classification results of the captured domain name.

[0028] An electronic device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein when the processor executes the program, the steps in the domain name classification method based on a deep model are implemented.

[0029] A readable storage medium, characterized in that the readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the domain name classification method based on a deep model.

[0030] Beneficial effects of the present invention: The present invention completes the detection task in web page content classification based on a deep model. In terms of effect, it greatly improves the generalization of traditional URL feature-based machine learning. At the same time, it uses periodic task configuration to regularly capture data from previously crawled web pages, achieves a certain degree of update, and avoids deviations in domain name classification.

[0031] The present invention reduces the final result errors caused by model recognition errors by calculating different weights for different tables, and can also classify illegal websites more strictly to reduce the risk of missed reports.

[0032] This invention uses model lightweighting and operator acceleration to accelerate the performance of the model, greatly improving the response speed and the detection speed;

[0033] The present invention designs a public cache queue to implement distributed architecture deployment, thereby improving performance and availability. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A flowchart of the domain name classification method based on the deep model provided by the present invention;

[0035] Figure 2 A topological diagram of the domain name classification method based on the deep model provided by the present invention;

[0036] Figure 3 A structural diagram of the domain name classification system based on the deep model provided by the present invention;

[0037] Figure 4 A system flow chart of the domain name classification system based on the deep model provided by the present invention;

[0038] Figure 5 It is a schematic structural diagram of the electronic device provided by the present invention;

[0039] Figure 6 It is a schematic diagram of the structure of the computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0040] For a better understanding of the present application, various aspects of the present application will be described in more detail with reference to the accompanying drawings. It should be understood that these detailed descriptions are merely descriptions of exemplary embodiments of the present application and are not intended to limit the scope of the present application in any way. Throughout the specification, the same reference numerals refer to the same elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items.

[0041] In the accompanying drawings, the size, dimensions, and shapes of the elements have been slightly adjusted for ease of illustration. The accompanying drawings are for illustration only and are not drawn strictly to scale. As used herein, the terms "substantially," "approximately," and similar terms are used to indicate approximations, not degrees, and are intended to illustrate inherent deviations in measurements or calculations that would be recognized by a person of ordinary skill in the art. In addition, in this application, the order in which the steps are described does not necessarily represent the order in which these steps would occur in actual operation, unless otherwise specified or inferred from the context.

[0042] It should also be understood that expressions such as "comprises," "including," "having," "includes," and / or "comprising" are open rather than closed expressions in this specification, indicating the presence of the stated features, elements, and / or components, but do not exclude the presence of one or more other features, elements, components, and / or combinations thereof. In addition, when expressions such as "at least one of..." appear after a list of listed features, they modify the entire list of features rather than just the individual elements in the list. In addition, when describing embodiments of the present application, "may" is used to mean "one or more embodiments of the present application." And, the term "exemplary" is intended to refer to an example or illustration.

[0043] Unless otherwise defined, all words used herein (including engineering terms and scientific and technological terms) have the same meaning as commonly understood by those skilled in the art to which this application belongs. It should also be understood that, unless otherwise specified in this application, words defined in commonly used dictionaries should be interpreted as having the same meaning as they do in the context of the relevant technology, and should not be interpreted in an idealized or overly formal sense.

[0044] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0045] Example 1

[0046] Reference Figure 1 and Figure 2 The first embodiment of this application provides a domain name classification method based on a deep model.

[0047] S1: Domain name data crawling.

[0048] Specifically, a distributed crawler system is used to periodically crawl secondary pages under a specific domain name to avoid invalidation of previous detection and classification results due to changes in website content, ensuring real-time crawling of web page content.

[0049] Furthermore, the captured secondary page content under each domain name, including text and image content, is stored in Elasticsearch to facilitate rapid retrieval of large-scale data.

[0050] The results of each web page model analysis are written back to Elasticsearch to provide data for subsequent model updates and iterations; at the same time, the results of domain name classification for relational data are saved and managed.

[0051] S2: Page content detection.

[0052] Specifically, the text depth model includes a BERT model, and the image depth model includes a ResNet model.

[0053] The BERT model training process is as follows: extract text data from secondary pages stored in Elasticsearch; segment the extracted text data into words using the BERT model's tokenizer tool; load the BERT model using the Hugging FaceTransformers library; input the text processed by the tokenization tool into the BERT model to obtain the text representation; based on the obtained text representation, add a classification layer to map the text to specific categories; use a loss function to measure the difference between the model's output and the true label; and deploy the function that meets the performance requirements in a real environment for text classification tasks.

[0054] The ResNet model training process is as follows: extract image data from secondary pages stored in Elasticsearch; preprocess and standardize the images; deploy the ResNet model through the timm library; import the preprocessed images into the ResNet model and build a classification model by adding a global average pooling layer and a fully connected layer to create an image classifier; establish a loss function to measure the image classification effect; verify the performance of the ResNet model, and deploy the ResNet model that meets the performance requirements in the actual environment.

[0055] Furthermore, a model acceleration method based on TensorRT is used to optimize operators of BERT and ResNet, and model pruning and lightweighting are performed at the same time. Finally, the model is deployed using Triton Server, which greatly improves the model's reasoning performance and accelerates the speed and efficiency of domain name classification detection.

[0056] S3: Domain name classification.

[0057] Specifically, the remote Triton Server model and keyword detection service are called to perform text detection on the secondary pages under each domain name, and a classification result is generated for each page.

[0058] Aggregating the text detection results of domain names. The final domain name classification results are aggregated from the results of secondary pages, which can greatly reduce abnormal classification results caused by model misjudgment.

[0059] Furthermore, the classification result includes performing text detection on the secondary pages under each domain name, generating a classification result for each page, and the domain name classification result is aggregated by the results of the secondary pages.

[0060] Domain name classification methods include category division, category calculation, category proportion ranking, and retention of valid categories.

[0061] The classification includes classifying domain names into illegal categories and regular categories;

[0062] The classification calculation includes calculating the proportion of each classification:

[0063] CR(A)=count(A) / count(all_pages)

[0064] CR(A) represents the proportion of category A, count(A) represents the number of secondary URLs of category A, and count(all_pages) represents the number of all secondary URLs under the current domain name.

[0065] The classification proportion ranking includes, based on the premise that the illegal domain names are in front and the regular domain names are in the back, the classification proportion ranking is arranged from large to small according to the proportion.

[0066] The retaining of valid classifications includes retaining the category if there are subcategories under the illegal category in the category, and the order is still sorted by proportion; the subcategories under the regular category are arranged after the illegal category in order of proportion, and at the same time, the categories whose proportion is lower than the set threshold are eliminated.

[0067] S5: Based on the asynchronous detection queue function, it can simultaneously realize the functions of data pulling, model calling, merging result detection, and storing result detection for different domain names.

[0068] The asynchronous task queue is an independent task queue service used to perform background detection tasks, including data pulling, calling algorithm services, merging detection results, and storing detection results, while completing the classification operation steps of multiple different domain names.

[0069] Example 2

[0070] like Figure 3 and Figure 4As shown, an embodiment of the present application provides a domain name classification system based on a deep model.

[0071] The system includes a data acquisition module, a model service module, a detection business logic module and a storage module.

[0072] The data collection module, based on the distributed crawler function, periodically crawls the secondary pages under a specific domain name and stores them in Elasticsearch.

[0073] The model service module uses a deep model to identify the text content and image content of the secondary page, uses Triton Server containerization to deploy the text deep model and the image deep model, and performs operator optimization processing on the deep model.

[0074] The detection business logic module extracts the corresponding domain name data from Elasticsearch, calls the deep model to aggregate the text detection results of the domain name, and writes the results to the MySql database of the storage module.

[0075] The storage module includes an Elasticsearch unit and a MySQL unit, which are used to store data.

[0076] The text depth model includes that the text depth model is a BERT model, and the image depth model includes that the image depth model is a ResNet model.

[0077] The Elasticsearch unit is used to store the secondary page content of a specific domain name captured by the crawler function; the MySQL unit is used to store the classification results of the captured domain name.

[0078] Example 3

[0079] Figure 5 This is a schematic diagram of the electronic device structure provided by an embodiment of the present application. Figure 5 According to another aspect of the present application, an electronic device 500 is provided. The electronic device 500 may include one or more processors and one or more memories. The memories may store computer-readable code that, when executed by the one or more processors, may execute the above-described domain name classification method based on a deep model.

[0080] The method or system according to the embodiment of the present application can also be used by Figure 5 The electronic device architecture shown in FIG. Figure 5As shown, electronic device 500 may include a bus 501, one or more CPUs 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, a communication port 505 connected to a network, an input / output component 506, a hard disk 507, etc. The storage device in electronic device 500, such as ROM 503 or hard disk 507, may store a domain name classification method based on a deep model provided in this application. A domain name classification method based on a deep model may, for example, include:

[0081] Based on the distributed crawler function, the secondary pages under a specific domain name are periodically crawled and stored in Elasticsearch; the text content and image content of the secondary page are identified using a deep model, and the text deep model and image deep model are deployed in a containerized manner using TritonServer, and the operator optimization processing is performed on the deep model; Triton Server and keyword detection services are called to perform text detection on the secondary pages under each domain name, and the text detection results of the domain name are aggregated, and the classification results are written to the MySql database after the classification results of the domain name are determined; based on the asynchronous detection queue function, data pulling, model calling, merging result detection and storage result detection functions are realized for different domain names at the same time. Furthermore, the electronic device 500 may also include a user interface 508. Of course, Figure 5 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 5 One or more components of an electronic device are shown.

[0082] Example 4

[0083] Figure 6 This is a schematic diagram of the computer-readable storage medium structure provided by an embodiment of the present application. Figure 6 , a computer-readable storage medium 600 according to one embodiment of the present application is shown. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by a processor, a domain name classification method based on a deep model according to an embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory. Non-volatile memory may include, for example, read-only memory (ROM), a hard disk, flash memory, etc.

[0084] In addition, according to the implementation mode of the present application, the process described in the above reference flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, which stores machine-readable instructions, and the machine-readable instructions can be run by a processor to execute instructions corresponding to the method steps provided by the present application, such as: based on the distributed crawler function, periodically crawling the secondary pages under a specific domain name and storing them in Elasticsearch; using a deep model to identify the text content and image content of the secondary page, using Triton Server containerized deployment of the text deep model and the image deep model, and performing operator optimization processing on the deep model; calling Triton Server and keyword detection service, performing text detection on the secondary pages under each domain name, aggregating the text detection results of the domain name, and writing the classification results to the MySql database after determining the classification results of the domain name; based on the asynchronous detection queue function, simultaneously realizing the functions of data pulling, model calling, merging result detection and storing result detection for different domain names. The method, apparatus and equipment of the present application may be implemented in many ways. For example, the methods, apparatus, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media that store programs for executing the method according to the present application.

[0085] In addition, the parts of the above technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.

[0086] The above-described specific embodiments further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is merely a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A domain name classification method based on a deep model, characterized by: include, Based on the distributed crawler function, the secondary pages under a specific domain name are periodically crawled and stored in Elasticsearch; Use deep models to identify text and image content on secondary pages, use Triton Server to deploy text deep models and image deep models in a containerized manner, and perform operator optimization on the deep models. Call Triton Server and keyword detection service to perform text detection on the secondary pages under each domain name, aggregate the text detection results of the domain name, and write the classification results into the MySql database after determining the classification results of the domain name; Based on the asynchronous detection queue function, it can simultaneously realize the functions of data pulling, model calling, merging result detection and storing result detection for different domain names.

2. According to claim 1, a domain name classification method based on a deep model is characterized in that: The periodic crawling includes: periodic crawling to avoid the invalidation of previous crawling results due to changes in website content, and to achieve real-time crawling of web page content according to a set crawling cycle.

3. According to claim 2, a domain name classification method based on a deep model is characterized in that: The Elasticsearch includes, for the secondary page content under each domain name captured, the secondary page content includes text and image content; The secondary page content is stored in Elasticsearch to achieve fast retrieval of large-scale data, and the results of each web page model analysis are written back to Elasticsearch to provide data for subsequent model update iterations; at the same time, the results of domain name classification are saved and managed.

4. According to claim 3, a domain name classification method based on a deep model is characterized in that: The text depth model includes: the text depth model is a bert model; the image depth model includes: the image depth model is a ResNet model; The operator optimization processing includes using a model acceleration method based on TensorRT to perform operator optimization processing on the BERT model and the ResNet model, and simultaneously performing model pruning and model lightweighting.

5. According to claim 4, a domain name classification method based on a deep model is characterized in that: The classification results include text detection on the secondary pages under each domain name. Each page generates a classification result, and the domain classification result is aggregated from the results of the secondary pages; Domain name classification methods include category division, category calculation, category proportion ranking, and retention of valid categories; The classification includes classifying the domain name categories into illegal categories and regular categories; The classification calculation includes calculating the proportion of each classification: CR(A)=count(A) / count(all_pages) CR(A) indicates the proportion of category A, count(A) indicates the number of secondary URLs of category A, and count(all_pages) indicates the number of all secondary URLs under the current domain name; The classification proportion sorting includes, based on the premise that the illegal domain names are in the front and the regular domain names are in the back, the classification proportion sorting is arranged from large to small according to the proportion; The retaining of valid classifications includes: if there are subcategories under the illegal class in the category, the category is retained, and the order is still sorted according to the proportion; the subcategories under the regular class are arranged after the illegal class in order of proportion, and the categories with a proportion lower than the set threshold are eliminated.

6. A domain name classification method based on a deep model according to claim 5, characterized in that: The asynchronous detection queue includes an asynchronous task queue which is an independent task queue service for executing background detection tasks, including data pulling, calling algorithm services, merging result detection and storing result detection, and completing classification operation steps for multiple different domain names at the same time.

7. A domain name classification system based on a deep model, which is implemented based on a domain name classification method based on a deep model according to any one of claims 1 to 6, characterized in that: It includes data collection module, model service module, detection business logic module and storage module; The data collection module periodically crawls secondary pages under a specific domain name based on a distributed crawler function and stores them in Elasticsearch; The model service module uses a deep model to identify the text content and image content of the secondary page, uses Triton Server containerized deployment of the text deep model and the image deep model, and performs operator optimization processing on the deep model; The detection business logic module extracts the corresponding domain name data from Elasticsearch, calls the deep model to aggregate the text detection results of the domain name, and writes the results to the MySql database of the storage module; The storage module includes an Elasticsearch unit and a MySQL unit, which are used to store data.

8. A domain name classification system based on a deep model according to claim 7, characterized in that: The text depth model includes: the text depth model is a bert model; the image depth model includes: the image depth model is a ResNet model; The Elasticsearch unit is used to store the secondary page content of the specific domain name captured by the crawler function; the MySQL unit is used to store the classification results of the captured domain name.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of a domain name classification method based on a deep model as described in any one of claims 1 to 6 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps of a domain name classification method based on a deep model as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method, system and equipment for inspecting website through IP (Internet Protocol) and judging website category, and medium

    CN113157998A

  • Text and image-based multi-modal pornography and gambling domain name automatic detection method

    CN115277211A

  • Classification model construction method and classification system for domain name classification

    CN116502153A

  • Classification of Malware Generated Domain Names

    US20160255107A1

  • Classification of top-level domain (TLD) websites based on a known website classification

    US20180007090A1

Cited By

  • System and method for extracting and categorizing information from online sources

    WO2026109928A1