A method and device for obtaining target subject data information

By introducing NLP natural language and relevance clustering algorithms into web crawlers to process and filter form data, the problems of low data acquisition accuracy and large amounts of useless data in the existing technology are solved, and efficient and accurate data processing is achieved.

CN114707046BActive Publication Date: 2024-10-22ZHIYI TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210336663.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2024-10-22
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

Existing web crawlers lack text semantic recognition capabilities, resulting in low data acquisition accuracy and a large amount of useless information in the data, resulting in a waste of computer storage resources and a heavy workload of data cleaning.

Method used

A deep web crawler based on NLP natural language and correlation clustering algorithm is used to process and standardize the feature tags of the form data, establish a form corpus, and use Transformer-based GPT pre-training model screening and clustering calculation to achieve the target Accurate identification of subject data.

Benefits of technology

It improves the quantity and quality of data acquisition, realizes the deep networking and artificial intelligence of web crawlers, ensures the integrity and accuracy of data, reduces the cleaning of useless data, and builds efficient, accurate and intelligent data processing method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114707046B_ABST
    Figure CN114707046B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of network information technology, and specifically discloses a method for obtaining target subject data information, extracting URL links from a URL queue, entering the target subject's web page to capture original network data, and judging whether the web page contains AJAX references. If so, a deep web crawler is used based on NLP natural language and relevance clustering algorithms to directionally obtain target subject-related data information from web pages containing form URLs; if not, a surface web crawler is used based on NLP natural language and relevance clustering algorithms to directionally obtain target subject-related data information from web pages that do not contain form URLs. The present invention is based on NLP natural language and relevance clustering algorithms, which not only makes the quantity and quality of data obtained far higher than that of traditional web crawlers, but also realizes the deep networking and artificial intelligence of web crawlers, and constructs an efficient, accurate and intelligent data processing method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network information technology, and in particular to a method and device for acquiring target subject data information. Background Art

[0002] In the era of big data, information data is growing explosively, and more and more data is transferred from the surface network to the deep network. According to the technical white paper "The Deep Web-Surfacing the Hidden Value" by Bright Planet, the amount of accessible public information in the deep network is 400 to 500 times that of the surface network and contains more valuable information resources. In the face of such a huge amount of data, the use of deep network crawlers will obtain data with a much higher quantity and quality than traditional web crawlers. However, since the existing web crawlers do not have the ability to recognize text semantics, some relevant data will be omitted from the acquired data, resulting in low accuracy of acquired data, and a large amount of useless data will be mixed in the acquired data, resulting in a huge waste of computer storage resources and a significant increase in the workload of data cleaning. Therefore, how to build an efficient, accurate and intelligent data acquisition and processing method has become the primary issue in the field of big data research. NLP natural language is an important development direction in the field of artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Judging from the current theoretical and technical status, a general, high-quality NLP system is still a long-term goal, but for certain applications, practical systems with certain NLP capabilities have already appeared, such as: natural language interfaces for multilingual databases and expert systems, various machine translation systems, full-text information retrieval systems, automatic abstract systems, etc. Many examples show the possibility of combining NLP with web crawler technology. In view of this, how to realize the deep networking and artificial intelligence of web crawlers and realize intelligent recognition of data has become an urgent problem to be solved by those skilled in the art. Summary of the invention

[0003] The embodiment of the present invention provides a method and device for acquiring target subject data information, so as to solve the problem of intelligent identification of data by network crawlers in the prior art.

[0004] In a first aspect, the present invention provides a method for obtaining target subject data information, comprising:

[0005] Obtain a pre-built URL queue, wherein the URL queue stores URL links of target subject data to be obtained;

[0006] Extracting URL links from the URL queue, entering the web page of the target subject to crawl original network data, the original network data including subject data, web page URL and form URL;

[0007] Determine whether the web page contains AJAX references. If so, use a deep web crawler based on NLP natural language and relevance clustering algorithms to perform the following steps on the web page containing the form URL:

[0008] Acquire form data based on the collected original network data; extract, classify and standardize the feature labels of the form data to obtain data labels of the form data; establish a form corpus based on NLP natural language using the form data and its data labels as corpus sources, and obtain a form GPT pre-training model after model training on the form corpus according to the GPT pre-training model based on the Transformer compiler; obtain preliminary screening form data from the form data according to the form GPT pre-training model; and obtain data information related to the target topic after performing relevance clustering calculation on the preliminary screening form data using a relevance clustering algorithm.

[0009] A second aspect of the present invention provides a device for acquiring target subject data information, comprising:

[0010] A deep web crawler module, the deep web crawler module comprising a web page information data parser;

[0011] A form data NLP processing module and a data topic relevance clustering calculation module, wherein the form data NLP processing module includes a form data label extractor, a form data label NLP corpus module, an unsupervised form GPT pre-training module and a form data extractor;

[0012] The deep web crawler module obtains the pre-built URL queue, wherein the URL queue stores URL links of target subject data to be obtained;

[0013] The web page information data parser extracts URL links from the URL queue, enters the web page of the target subject to capture original network data, and the original network data includes subject data, web page URL and form URL; determines whether the web page contains AJAX references, and if so, uses a deep web crawler based on NLP natural language and relevance clustering algorithm to obtain form data from the web page containing the form URL through the deep web crawler module according to the collected original network data; the form data label extractor extracts, classifies and standardizes the feature labels of the form data to obtain the data labels of the form data; the form data label NLP corpus module uses the form data and its data labels as corpus sources based on NLP natural language to establish a form corpus, and uses the unsupervised form GPT pre-training module to train the form corpus according to the GPT pre-training model based on the Transformer compiler to obtain a form GPT pre-training model; the form data extractor extracts, classifies and standardizes the feature labels of the form data to obtain the data labels of the form data; The pre-trained model filters the form data to obtain preliminary screening form data; the data subject relevance clustering calculation module uses a relevance clustering algorithm to perform relevance clustering calculation on the preliminary screening form data to obtain data information related to the target subject.

[0014] The beneficial effects of the embodiments of the present invention are:

[0015] The present invention is based on NLP natural language and relevance clustering algorithm. According to different network data, deep network crawlers or surface network crawlers are used to directionally obtain data information related to the target topic from the target web page. Not only the quantity and quality of the acquired data are much higher than that of the traditional network crawlers, but also the deep networking and artificial intelligence of the network crawlers are realized, so that the network crawlers have the ability to recognize text semantics, ensuring the integrity and accuracy of the acquired data. At the same time, a large amount of useless data mixed in the data is cleaned and discarded, thereby constructing an efficient, accurate and intelligent data processing method.

[0016] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0018] Figure 1 A flowchart of a method for obtaining target subject data information provided by the first embodiment of the present invention;

[0019] Figure 2 A schematic flow chart of a method for a deep web crawler to obtain target subject data information provided by the first embodiment of the present invention;

[0020] Figure 3 for Figure 2 Specific implementation flow chart of step S201;

[0021] Figure 4 A schematic flow chart of a method for obtaining target subject data information by a surface network crawler provided in the first embodiment of the present invention;

[0022] Figure 5 for Figure 4 Specific implementation flow chart of step S302;

[0023] Figure 6 A schematic diagram of a flow chart of a correlation clustering algorithm provided in the first embodiment of the present invention;

[0024] Figure 7 A schematic diagram of the structure of a device for acquiring target subject data information provided by an embodiment of the present invention;

[0025] Figure 8 is a flow chart of a method for obtaining target subject data information provided by an exemplary embodiment of the present invention;

[0026] Fig. 9 A tree diagram of data link mapping relationships for obtaining women's clothing data provided by an exemplary embodiment of the present invention.

[0027] In the figure: 1-preprocessing module, 2-deep web crawler module, 3-page data topic NLP processing module, 4-form data NLP processing module, 5-data topic relevance clustering calculation module, 6-data storage module. DETAILED DESCRIPTION

[0028] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0029] In the first embodiment of the present invention, see Figure 1-6 , provides a method for obtaining target subject data information, comprising the following steps:

[0030] Step S101: Get a pre-built URL queue, which stores the URL links of the target subject data to be obtained. Before obtaining, the URL queue needs to be initialized, and the URLs need to be sorted, deduplicated, etc. Step S102: Extract the URL link from the URL queue, enter the web page of the target subject to crawl the original network data, and the original network data includes the subject data, web page URL and form URL. Step S103: Determine whether the web page contains AJAX references. If so, use a deep web crawler based on NLP natural language and relevance clustering algorithm to obtain data information related to the target subject from the web page containing the form URL; if not, use a surface web crawler based on NLP natural language and relevance clustering algorithm to obtain data information related to the target subject from the web page that does not contain the form URL.

[0031] In step S103, a deep web crawler is used based on NLP natural language and relevance clustering algorithm to directionally obtain data information related to the target topic from the web page containing the form URL, including: step S201: obtaining form data based on the collected original network data; step S202: extracting, classifying and standardizing the feature labels of the form data to obtain the data labels of the form data; step S203: establishing a form corpus based on NLP natural language using the form data and its data labels as the corpus source, and obtaining a form GPT pre-training model after model training on the form corpus according to the GPT pre-training model based on the Transformer-based compiler; step S204: obtaining preliminary screening form data from the form data according to the form GPT pre-training model; step S205: obtaining data information related to the target topic after performing relevance clustering calculation on the preliminary screening form data using the relevance clustering algorithm.

[0032] In step S101, when obtaining the pre-built URL queue, the data-link dictionary is also obtained. The data-link dictionary is a dictionary set composed of key-value pairs formed by data as keys and links as values. Then step S201 obtains form data according to the collected original network data, including: step S2011: establishing key-value pairs of subject data and web page URLs, subject data and form URLs according to the collected original network data, and the key-value pairs are used to reflect the tree-like relationship mapping structure between subject data and hyperlink text; step S2012: performing searchability verification on the form URL, retaining the key-value pairs of subject data and form URLs that can be searched; step S2013: performing structural decomposition and standardization on the form URL that has passed the searchability verification; step S2014: combining the subject data and the key-value pairs that have passed the searchability verification The key-value pairs of the form URL after the structure splitting and standardization processing operations are filled and stored in the data-link dictionary to generate a queryable form URL queue in the form of a data link; step S2015: according to the splitting results obtained by the structure splitting and standardization processing, the core feature words of the form URL are extracted, the form controls are identified, and the feature words are filled into each part of the form URL to generate a searchable form URL; step S2016: extract the URLs in the form URL queue one by one to obtain the form data, or extract the form data returned after submitting the searchable form URL to the server one by one.

[0033] The step S2013 of performing structural decomposition and standardization processing on the form URL that has passed the searchability verification includes: decomposing each component of the form URL by feature words according to the standard link format, the standard link format is scheme: / / netloc / path; params?query#fragment, wherein scheme is the transmission protocol, netloc is the domain name, path is the access path, params is the parameter, query is the query condition, and fragment is the page location anchor.

[0034] Secondly, when the pre-built URL queue is obtained in step S101, a data keyword list is also obtained. The data keyword list is a noun list created according to the field to which the data information to be obtained belongs or known keywords, and is used to adjust the accuracy of the form GPT pre-training model.

[0035] In step S103, determine whether the web page contains AJAX references. If not, use a surface web crawler based on NLP natural language and relevance clustering algorithm to execute the following steps from the web page that does not contain the form URL: Step S301: parse the page data of the web page that does not contain the form URL to obtain the subject data and the web page URL; Step S302: Filter the subject data and the web page URL based on NLP natural language to obtain the preliminary screened web page data; Step S303: Use the relevance clustering algorithm to perform relevance clustering calculation on the preliminary screened web page data to obtain data information related to the target subject.

[0036] In step S302, the topic data and web page URL are filtered based on NLP natural language to obtain preliminary screened web page data, including: step S3021: constructing a topic pre-trained corpus through existing open source corpus or text data in a specific field to which the topic data belongs as the corpus source; step S3022: performing data cleaning on the topic pre-trained corpus according to preset corpus preprocessing rules to obtain cleaned text data; step S302: constructing a word band model based on the text data, and training the word band model according to the BERT pre-trained model based on the Transformer-based compiler to obtain a data topic pre-trained model; step S302: the data topic pre-trained model performs semantic recognition on the topic data and web page URL according to the data topic word list and extracts preliminary screened web page data that meets the current search target.

[0037] Specifically, constructing a word band model according to text data in step S302 includes: constructing each word or symbol into a set, and constructing a word vector to convert a character or word into a calculation model of a vector matrix:

[0038] V=V t +V s +V p

[0039] Where V t Represents word vector, V s represents a block vector, V p represents the position vector; the size of the three vectors is N×e, N represents the maximum length of the sequence, and e represents the word vector dimension; the word vector V t Expressed as: V t =e t ·W t , where W t ∈R / V / ·e represents a trainable word vector matrix; |V| represents the vocabulary size, e represents the block vector dimension; the block vector V s Represented as V s =e s ·W s, where W S ∈R / s / ·e Represents the trainable block vector matrix, W S represents the number of blocks, e represents the block vector dimension; the position variable V p Represented as V s =e p ·W p , where W p ∈R N·e represents the trainable position vector matrix, N represents the maximum position length, and e represents the position vector latitude.

[0040] Specifically, in step 205, the data information related to the target topic is obtained after the relevance clustering calculation is performed on the primary screening form data using the relevance clustering algorithm, or in step 303, the data information related to the target topic is obtained after the relevance clustering calculation is performed on the primary screening web page data using the relevance clustering algorithm, including:

[0041] Step 401: Perform cluster calculation preprocessing on the initial screening form data or the initial screening web page data and randomly select K cluster centers, where K is a positive integer. The cluster calculation preprocessing includes data cluster center point marking, text punctuation removal, grading, classification, and deduplication.

[0042] Step 402: after calculating the distance between each other form data or web page data in the preliminary screening form data or preliminary screening web page data and the selected cluster center according to the selected cluster center by using the Euclidean distance method, each cluster center is moved to the center position of the cluster to which it belongs to recalculate the cluster center of each cluster, and the center position is the position of the updated cluster center; after updating the cluster center, the distance between each form data or web page data and the cluster center is calculated again until a relevance threshold that satisfies the clustering termination condition is obtained, so as to perform a deletion operation on the data that does not meet the relevance threshold in the preliminary screening form data or preliminary screening web page data that has undergone clustering calculation, so as to make the acquired data more accurate and free of impurities;

[0043] Step 403: The form data or web page data that has completed clustering calculation is graded in the order of data subject, sub-data subject, data value, and data link. After classifying and counting the graded form data or web page data and removing duplicate items in the data, the form data or web page data associated with the target subject is reconstructed by relationship mapping to generate a mapping relationship tree diagram.

[0044] Therefore, the embodiment of the present invention is based on NLP natural language and relevance clustering algorithm, and uses deep web crawlers or surface web crawlers to directionally obtain data information related to the target topic from the target web page for different network data. Not only does the quantity and quality of the acquired data far exceed that of the traditional web crawler, but also the deep networking and artificial intelligence of the web crawler are realized, so that the web crawler has the ability to recognize text semantics, ensuring the integrity and accuracy of the acquired data, and at the same time cleaning and discarding a large amount of useless data mixed in the data, thereby constructing an efficient, accurate and intelligent data processing method.

[0045] See also Figure 7 The second embodiment of the present invention provides a device for obtaining target subject data information, including:

[0046] Deep web crawler module 2, preprocessing module 1, deep web crawler module 2 includes a web page information data parser. Deep web crawler module 2 obtains a pre-built URL queue, the URL queue stores the URL link of the target subject data to be obtained, and preprocessing module 1 is used to initialize the URL queue. The web page information data parser of the deep web crawler module 2 extracts the URL link from the URL queue, enters the web page of the target subject to capture the original network data, the original network data includes the subject data, web page URL and form URL; judges whether the web page contains AJAX references, if so, uses the deep web crawler based on NLP natural language and relevance clustering algorithm to obtain data information related to the target subject from the web page containing the form URL; if not, uses the surface web crawler based on NLP natural language and relevance clustering algorithm to obtain data information related to the target subject from the web page that does not contain the form URL.

[0047] Furthermore, when the deep web crawler module 2 obtains the pre-built URL queue, it also obtains a data keyword list, which is a noun list created according to the field to which the data information to be obtained belongs or known keywords, and is used to adjust the accuracy of the form GPT pre-training model.

[0048] The device provided by the present invention also includes a target data subject preprocessing module 1. Before using the deep network crawler module 2 to obtain data information related to the target subject, the target data subject preprocessing module 1 must first be used to perform the following operations: S11: Initialize the data subject word list, create a list of related nouns for the data to be obtained according to the field to which the data to be obtained belongs or the known related keywords, and use it to match the subject content with the page data subject NLP natural language processing module 3 to determine the subject of this data crawling, and to serve as the associated parameter for the data subject relevance clustering calculation module 5 to calculate the relevance. S12: Initialize the URL queue, the URL queue is used to store the URLs obtained by the crawler program, and sort and remove duplicates from the URLs. S13: Initialize the subject data-form URL dictionary, which is used to create a tree-like relationship mapping structure between the subject and the hyperlink text, forming a dictionary set corresponding to the data (key)-form URL (value), which is a queryable dictionary, and the data subject relevance clustering calculation module 5 classifies, grades, and categorizes the subject-related data of this dictionary, and then generates a complete data chain of the tree-like relationship mapping of the subject data-form URL through the associated data cleaning of the data storage module 6.

[0049] The device provided by the embodiment of the present invention also includes a form data NLP processing module 4 and a data subject relevance clustering calculation module 5. The form data NLP processing module 4 includes a form data label extractor, a form data label NLP corpus module, an unsupervised form GPT pre-training module and a form data extractor. A deep web crawler is used based on NLP natural language and relevance clustering algorithms to obtain data information related to the target subject from a web page containing a form URL, including:

[0050] The deep web crawler module 2 obtains form data based on the collected original web data; the form data label extractor extracts, classifies and standardizes the feature labels of the form data to obtain the data labels of the form data; the form data label NLP corpus module establishes a form corpus based on the NLP natural language with the form data and its data labels as the corpus source, and the unsupervised form GPT pre-training module trains the form corpus according to the GPT pre-training model based on the Transformer as the basic compiler to obtain the form GPT pre-training model. Specifically, the unsupervised form GPT pre-training module has an unsupervised pre-training objective function of the GPT pre-training model based on the 12 Transformers as the basic compiler.

[0051]

[0052] Where k is the size of the context window in the corpus, P is the conditional probability, θ is the parameter of the conditional probability, and the parameter update will adopt the stochastic gradient descent method of the Adam optimizer with annealing strategy.

[0053] The output distribution is h 0 =UW e +W P

[0054] W e represents the embedding matrix of the tag, W P is the embedding matrix of positional encoding. voc represents the vocabulary size, pos represents the longest sentence length, and dim represents the Embedding dimension. Then W P is a pos×dim matrix, W e is a voc×dim matrix. 0 represents the input layer, and h 0 Pass it into all the Transformer decoders of the model in sequence and finally get h n , n is the number of layers of the neural network and the expression is as follows:

[0055]

[0056]

[0057] Perform supervised fine-tuning on the pre-trained model based on the completed pre-trained model and the data keyword list.

[0058] The form data extractor obtains the preliminary screening form data from the form data according to the form GPT pre-training model. The form GPT pre-training model performs feature label and form field standardization on the form data extracted by the form data extractor, and extracts the form data for topic relevance clustering calculation. The data topic relevance clustering calculation module 5 uses the relevance clustering algorithm to perform relevance clustering calculation on the preliminary screening form data to obtain data information related to the target topic.

[0059] When the deep web crawler module 2 obtains the URL queue, it also obtains the initialized data-link dictionary, which is a dictionary set composed of key-value pairs formed by using data as keys and links as values. The deep web crawler module 2 also includes a web form URL validator, a form URL structure classifier, a web form URL queue generator, a form URL filler and a form data extractor. The deep web crawler module 2 obtains form data based on the collected original network data, including: the web information data parser establishes key-value pairs of subject data and web page URL, subject data and form URL based on the collected original network data, and the key-value pairs are used to reflect the tree relationship mapping structure between subject data and hyperlink text. The web form URL validator verifies the searchability of the form URL and retains the key-value pairs of subject data and form URL that can be searched. The form URL structure classifier performs structural decomposition and standardization on the form URL that has been verified for searchability. The web form URL queue generator fills the key-value pairs consisting of the subject data and the form URL after structure splitting and standardization and stores them in the data-link dictionary to generate a queryable form URL queue in the form of a data link. The form URL filler extracts the core feature words of the form URL and identifies the form controls based on the split results obtained by the form URL structure classifier after structure splitting and standardization, and fills the feature words into each part of the form URL to generate a searchable form URL. The form data extractor extracts the URLs in the form URL queue one by one to obtain the form data, or extracts the form data returned after submitting the searchable form URL to the server one by one.

[0060] The device provided by the embodiment of the present invention also includes a page data subject NLP processing module 3. The web page information data parser determines whether the web page contains an AJAX reference. If not, the surface network crawler is used based on NLP natural language and relevance clustering algorithm to parse the page data of the web page that does not contain the form URL, and then obtain the subject data and web page URL, and pass the subject data and web page URL to the page data subject NLP processing module 3. The page data subject NLP processing module 3 performs subject data filtering on the subject data and web page URL based on NLP natural language to obtain the preliminary screening web page data. The data subject relevance clustering calculation module 5 uses the relevance clustering algorithm to perform relevance clustering calculation on the preliminary screening web page data to obtain data information related to the target subject.

[0061] Optionally, the page data subject NLP processing module 3 includes a page data subject corpus construction module, a corpus preprocessing module, a feature model construction module, a page data subject NLP model pretraining module and a data subject classifier. The page data subject NLP processing module 3 obtains the initial screening web page data after subject data filtering on the subject data and web page URL based on NLP natural language, including:

[0062] The page data subject corpus construction module constructs a subject pre-trained corpus using existing open source corpora or text data in a specific field to which the subject data belongs as the corpus source. The corpus preprocessing module cleans the subject pre-trained corpus according to the preset corpus preprocessing rules to obtain cleaned text data. After the feature model construction module constructs a word band model based on the text data, the page data subject NLP model pre-training module trains the word band model based on the BERT pre-training model based on the Transformer-based compiler to obtain a data subject pre-training model. Specifically, the page data topic NLP model pre-training module is composed of 12 Transformer basic compilers stacked to form a BERT pre-training model. Each encoder constructs the vector according to S33 and its output word vector is used as the input word vector of the next encoder. After the word vector sequence enters the encoder, it passes through the self-attention layer so that the encoder can recognize other words in the word vector sequence; the output of the self-attention layer enters the feedforward neural network, each feedforward neural network corresponds to the input position of the word, and each feedforward neural network is independent of each other and does not interfere with each other; the self-attention layer uses a multi-head mechanism, so that different attention heads focus on different parts, each attention layer performs residual connection, and performs layer normalization operation, input representation layer:

[0063]

[0064] v = InputRepresentation(X)

[0065] [CLS] indicates a special marker at the beginning of a text sequence; [SEP] indicates a separator between text sequences. The input layer v passes through L layers of Transformer with the help of self-attention mechanism:

[0066]

[0067] Where h [L] ∈R N·d Represents the hidden layer output of the L-th layer Transformer, and specifies h [0] =v, in order to maintain the completeness of the above formula. For the convenience of description, the markings between layers are omitted and simplified as follows:

[0068] H = Transformer(v)

[0069] Where h represents the output of the last layer Transformer, that is, h [L] The above method finally obtains the contextual semantic representation of the text h∈R N·d , where d represents the hidden layer dimension of BERT. The output layer predicts the classification probability P∈R of the input text through a fully connected layer 2 .

[0070]

[0071] b 0 ∈R |V| represents the bias of the fully connected layer. Represents the weight of the fully connected layer. Finally, the word vector with enhanced semantics of each word is output and passed to the next encoder until the encoding is completed.

[0072] The data subject classifier uses the data subject pre-training model to semantically identify the subject data and web page URLs according to the data subject word list and extracts the preliminary screened web page data that meets the current search target. That is, the pre-training model is fine-tuned in a supervised manner based on the completed data subject pre-training model and the data subject word list to achieve intelligent semantic understanding of the page data and definition of the target data boundary, and complete the confirmation and classification of the target data subject.

[0073] The device also includes a data theme relevance clustering calculation module 5, which uses a relevance clustering algorithm to perform relevance clustering calculation on the initial screening form data to obtain data information related to the target theme, or uses a relevance clustering algorithm to perform relevance clustering calculation on the initial screening web page data to obtain data information related to the target theme, specifically including the following steps:

[0074] 1. Use the data subject relevance clustering calculation module 5 to perform the associated clustering data cleaning step on the preliminary screening form data or the preliminary screening web page data: including data cluster center point marking, text punctuation removal, etc.;

[0075] 2. During clustering calculation, the obtained form data, form URL and web page information data are clustered with the target data subject. The data object x i (x i1 ,x i2 ,…,x ip ) T 、x j (x j1 ,x j2 ,…,x jp ) T

[0076] The distance between them is expressed as the Euclidean distance d(x i ·x j ) is expressed as follows:

[0077]

[0078] The updated calculation of cluster centers is expressed as follows:

[0079]

[0080] The calculation formula for the termination iteration is as follows:

[0081]

[0082] The results serve as the basis for data classification and data selection;

[0083] 3. Clean the associated data. According to the calculation results, the form data and web page information data that have been calculated for association in step 2 are classified in the order of data subject, sub-data subject, data value, and data link. The classified data are classified and counted, and duplicate items in the data are removed.

[0084] 4. Filter irrelevant data and delete the data that does not meet the relevance threshold in the form data and web page information data calculated by the relevance in step 1.

[0085] 5. Data relationship mapping: Reconstruct the relationship mapping of the target data subject’s associated form data and form URL, web page information data and web page URL according to the results of the associated data cleaning, and generate a data subject-sub-data subject-data value, data link mapping relationship tree diagram, such as Fig. 9 The data link mapping relationship for obtaining women's clothing information is shown in a tree diagram.

[0086] 6. Finally, the acquired data is stored in the data storage module 6: S61. Data classification storage, classifying and storing different types of related data under the same target data theme. S62. Data hierarchical storage, establishing master-slave hierarchical storage for target data theme, theme-related form data, and theme-related URL from high to low. S63. Data classification storage, statistical classification of data at the same level.

[0087] The embodiment of the present invention is based on NLP natural language and relevance clustering algorithm. For different network data, deep network crawlers or surface network crawlers are used to directionally obtain data information related to the target topic from the target web page. Not only the quantity and quality of the acquired data are much higher than that of the traditional network crawlers, but also the deep networking and artificial intelligence of the network crawlers are realized, so that the network crawlers have the ability to recognize text semantics, ensuring the integrity and accuracy of the acquired data. At the same time, a large amount of useless data mixed in the data is cleaned and discarded, thereby constructing an efficient, accurate and intelligent data processing method.

[0088] To make the present invention more clear, the fourth embodiment of the present invention respectively provides specific implementation cases of using a deep web crawler and a surface web crawler based on NLP natural language and relevance clustering algorithm to directionally obtain data information related to a target topic from different web pages.

[0089] Implementation Case 1: Using surface web crawlers based on NLP natural language and relevance clustering algorithms, we can obtain data information related to the target topic from web pages that do not contain form URLs. This is used to crawl web page information without form data and obtain web page links with form data. The steps are as follows:

[0090] First, the preprocessing module 1 initializes the data keyword list, URL queue and subject data-link dictionary respectively, and passes the initialized URL to the S21 web page information data parser for page acquisition. The S21 web page information data parser parses the acquired page and performs AJAX reference judgment, performs page data analysis on web pages that do not contain AJAX references, and passes the acquired data and URL links to the page data subject NLP processing module 3 for subject data filtering.

[0091] Before starting the search operation, the page data subject NLP processing module 3 will first use the open source corpus or the text data in the field where the target data is located as the corpus source, remove the special symbols, emoticons, and redundant blanks in the acquired web page text data through corpus preprocessing, unify the text font into simplified Chinese, segment the corpus through the Chinese word segmentation method combining the forward maximum matching and CRF method, remove the stop words for the modal particles, auxiliary words, conjunctions, prepositions, etc. that frequently appear in the text, and perform data cleaning operations such as labeling. The cleaned text data is constructed into a word band model in the form of a matrix of characters or words through the feature model, and the model training is realized through multi-layer normalization operations with the help of the self-attention mechanism. The page data subject NLP processing module 3 that completes the model pre-training performs semantic recognition on the parsed page data according to the data subject word list to extract the data that meets the current search target, and then the data subject relevance clustering calculation module 5 classifies, aggregates, removes duplicates, and grades the acquired data.

[0092] The data topic relevance clustering calculation module 5 first executes the associated clustering data cleaning process to remove punctuation from the web page data that has been initially screened by the page data topic NLP processing module 3, randomly selects K cluster centers and sets the minimum error m. During the clustering calculation, the Euclidean distance method is first used to calculate the distance between each other web page data and the cluster center based on the selected cluster center.

[0093]

[0094] Then recalculate the cluster center of each cluster (ie move each cluster center to the center of its cluster), and this position is the position of the updated cluster center. After updating the cluster center, calculate the distance between each web page data and the cluster center again until the clustering termination condition is met:

[0095]

[0096] The web page data that has completed clustering calculations is cleaned with associated data, and is graded in the order of data subject, sub-data subject, data value, and data link. The graded data is classified and counted, and duplicate items in the data are removed. Irrelevant data filtering discards web page data below the threshold, and then the web page information data and web page URLs that have completed clustering are reconstructed through relationship mapping according to the results of associated data cleaning. Fig. 9 The data storage module 6 then classifies and hierarchically stores the acquired data.

[0097] The data storage module 6 stores each updated data in a hierarchical and classified manner according to the results of the correlation clustering calculation and the historical data, stores the newly added data-link dictionary data in the data-link evidence chain database for use as data tracing evidence, extracts the newly added links into the URL priority queue for use in the next web page acquisition, extracts and cleans the newly added web page data and stores it in the subject information database for use in data analysis.

[0098] Furthermore, it is determined whether the URL priority queue is empty. If it is empty, the current data search is terminated. If it is not empty, the next link is popped up to execute the next round of data search.

[0099] Implementation Case 2: Using deep web crawlers based on NLP natural language and relevance clustering algorithms, we can obtain data information related to the target topic from web pages containing form URLs. This is used for form data crawling and web page link acquisition with form data. Please refer to Figure 7-9 , the steps are as follows:

[0100] First, the preprocessing module 1 is used to initialize the data keyword list, URL queue and subject data-link dictionary, and the initialized URL is passed to the web page information data parser of the deep web crawler module 2 for page acquisition. The web page information data parser parses the acquired page and performs AJAX reference judgment. Figure 8 , parse the script of the web page containing AJAX references, extract potential links from them, and use the page form URL validator of the deep web crawler module 2 to verify the links in the web page script one by one, and discard unavailable links. Then, the form URL structure classifier splits the available form links according to the standard link format, and performs standard processing to generate links that conform to the scheme: / / netloc / path; params? query#fragment format. For example, the Taobao women's clothing link https: / / huodong.taobao.com / wow / a / act / tao / dailyact / 4634 / wupr? spm=a21bo.jianhua.201867-main.1.5af911d9GpFZgT&wh_pid= dailyAct-257518 is split into, scheme=https, netloc=huodong.taobao.com, path=wow / a / act / tao / dailyact / 4634 / wupr, params=”, query=′spm=a21bo.jianhua.201 867-main.1.5af911d9GpFZgT&wh_pid=dailyAct-257518′, ragment=”. The form link with completed structural classification is passed to the form URL filler to generate a standard form link.

[0101] Furthermore, the form URL filler will extract core feature words of the form URL according to the splitting results of the form URL structure classifier, identify form controls, and fill corresponding text feature words into each part of the URL to generate a searchable form URL, which will be submitted to the web form URL queue generator to generate a form URL queue without duplicate links.

[0102] The web form URL queue generator fills the key-value pairs of subject-related data and form URLs and stores them in the subject data-form URL dictionary, generating a queryable form URL queue in the form of a data chain. The URL links are popped up to the form data extractor in sequence.

[0103] The form data extractor submits the form application to the server according to the URL filled in the completed form link, parses the returned data and passes it to the form data NLP processing module for data extraction.

[0104] Furthermore, the form data label extractor extracts, classifies, and standardizes the feature labels of the multi-attribute form. The processed form data labels and data will be passed to the form data label NLP corpus module as the corpus for the form data NLP processing of the next data search. The unsupervised form GPT pre-training model fine-tunes the newly added corpus to improve the recognition ability of form data and label features. The form data extractor will selectively extract the data in the form data extractor according to the unsupervised form GPT pre-training model. The obtained data is passed to the data topic relevance clustering calculation module 5.

[0105] The data topic relevance clustering calculation module 5 removes punctuation from the form data that has been initially screened by the form data NLP processing module 4, randomly selects K cluster centers and sets the minimum error m. During cluster calculation, the Euclidean distance method is used to calculate the distance between each other form data and the cluster center based on the selected cluster center.

[0106]

[0107] Then recalculate the cluster center of each cluster (ie move each cluster center to the center of its cluster), and this position is the position of the updated cluster center. After updating the cluster center, calculate the distance between each web page data and the cluster center again until the clustering termination condition is met:

[0108]

[0109] The associated data of the form data that has completed the clustering calculation is cleaned, and the data is classified in the order of data subject, sub-data subject, data value, and data link. The classified data is classified and counted, and duplicate items in the data are removed. The irrelevant data filtering discards the form data below the threshold, and the web page information data and web page URL that have completed the clustering are reconstructed by relationship mapping according to the results of the associated data cleaning. Fig. 9 As shown ( Fig. 9 The ellipsis "..." in the figure is used to omit redundant content, and the omitted content does not affect the clarity and integrity of the embodiment of the present invention. The data storage module 6 then classifies and hierarchically stores the acquired data.

[0110] The data storage module 6 stores each updated data in a hierarchical and classified manner according to the results of the correlation clustering calculation and the historical data, stores the newly added data-link dictionary data in the data-link evidence chain database as data tracing evidence, extracts the newly added links to the URL priority queue for the next web page acquisition, extracts and cleans the newly added form data and stores it in the subject information database for data analysis. Further, it determines whether the URL priority queue is empty. If it is empty, the current data search is terminated. If it is not empty, the next link is popped up and the next round of data search is performed.

[0111] In conclusion, the present invention provides a method for controlling the autonomous search behavior of an intelligent deep web crawler based on NLP natural language learning. By training the relevant target data fields, web page source code, and web page form corpus, the crawler program has a certain semantic recognition ability. According to a certain search topic, the data in the form and web page is directionally identified and the classification, grading, and classification relationship mapping structure of the generated subject content, target data, and web page links are automatically downloaded and generated. Then, the web crawler can obtain data in the deep network for a specific topic. Compared with the prior art, the advanced feature of the present invention is that the deep web crawler is intelligentized through NLP natural language technology and relevance matching algorithm, the target data is directed to be obtained, and associative data storage is established, which provides an effective method for retrieving information and data analysis.

[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of finger controls to enable a terminal (which can be a mobile phone, computer, server, air conditioner, or network equipment, etc.) to execute the methods described in each embodiment of the present invention.

[0113] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A method for obtaining target subject data information, characterized in that: include: Obtain a pre-built URL queue, wherein the URL queue stores URL links of target subject data to be obtained; Extracting URL links from the URL queue, entering the web page of the target subject to crawl original network data, the original network data including subject data, web page URL and form URL; Determine whether the web page contains AJAX references. If so, use a deep web crawler based on NLP natural language and relevance clustering algorithms to perform the following steps on the web page containing the form URL: Acquire form data according to the collected original network data; Extracting, classifying and standardizing the feature labels of the form data to obtain data labels of the form data; Based on NLP natural language, the form data and its data labels are used as corpus sources to establish a form corpus, and the form corpus is trained according to the GPT pre-trained model based on the Transformer compiler to obtain a form GPT pre-trained model; Filtering the form data to obtain preliminary screening form data according to the form GPT pre-training model; The data information related to the target topic is obtained by performing relevance clustering calculation on the preliminary screening form data using a relevance clustering algorithm.

2. The method for obtaining target subject data information according to claim 1, characterized in that: When obtaining the pre-built URL queue, a data-link dictionary is also obtained, wherein the data-link dictionary is a dictionary set consisting of key-value pairs formed by using data as keys and links as values; Then the step of obtaining the form data according to the collected original network data includes: Establish key-value pairs of subject data and webpage URL, subject data and form URL according to the collected original network data, the key-value pairs are used to reflect the tree relationship mapping structure between subject data and hyperlink text; Performing searchability verification on the form URL, and retaining key-value pairs of searchable subject data and the form URL; Structuring and normalizing form URLs that have been verified for searchability; Filling the key-value pairs consisting of the subject data and the form URL after structure splitting and standardization processing operations and storing them in the data-link dictionary to generate a queryable form URL queue in the form of a data link; Extract core feature words and identify form controls from the form URL based on the split results obtained through structural splitting and standardization, and fill the feature words into each part of the form URL to generate a searchable form URL; The URLs in the form URL queue are extracted one by one to obtain form data, or the form data returned after the searchable form URL is submitted to the server is extracted one by one.

3. The method for obtaining target subject data information according to claim 2, characterized in that: When obtaining the pre-built URL queue, a data keyword list is also obtained. The data keyword list is a noun list created according to the field to which the data information to be obtained belongs or known keywords, and is used to adjust the accuracy of the form GPT pre-training model.

4. The method for obtaining target subject data information according to claim 3, characterized in that: The determination of whether the web page contains an AJAX reference, if not, uses a surface web crawler based on NLP natural language and relevance clustering algorithm to perform the following steps from the web page that does not contain the form URL: Parse the page data of the web page that does not contain the form URL and obtain the subject data and web page URL; Based on NLP natural language, the subject data and web page URL are filtered to obtain preliminary screened web page data; The data information related to the target topic is obtained by performing relevance clustering calculation on the initially screened web page data using a relevance clustering algorithm.

5. The method for obtaining target subject data information according to claim 4, characterized in that: The subject data and webpage URL are filtered based on NLP natural language to obtain the preliminary screened webpage data, including: Build a topic pre-training corpus using existing open source corpora or text data in a specific field to which the topic data belongs as the corpus source; Performing data cleaning on the subject pre-training corpus according to preset corpus preprocessing rules to obtain cleaned text data; Constructing a word band model according to the text data, and performing model training on the word band model according to a BERT pre-trained model based on a Transformer-based compiler to obtain a data topic pre-trained model; The data subject pre-training model performs semantic recognition on the subject data and web page URL according to the data subject word list and extracts preliminary screened web page data that meets the current search target.

6. The method for obtaining target subject data information according to claim 5, characterized in that: The method of using a relevance clustering algorithm to perform relevance clustering calculation on the preliminary screening form data to obtain data information related to the target subject, or using a relevance clustering algorithm to perform relevance clustering calculation on the preliminary screening web page data to obtain data information related to the target subject, includes: Perform clustering calculation preprocessing on the preliminary screening form data or the preliminary screening web page data and randomly select K cluster centers, where K is a positive integer. The processing content of the clustering calculation preprocessing includes data cluster center point marking, text punctuation removal, grading, classification and deduplication; After calculating the distance between the selected cluster center and each other form data or web page data in the preliminary screening form data or the preliminary screening web page data using the Euclidean distance method, each cluster center is moved to the center position of the cluster to which it belongs to recalculate the cluster center of each cluster, and the center position is the position of the updated cluster center; after updating the cluster center, the distance between each form data or web page data and the cluster center is calculated again until a relevance threshold that satisfies the clustering termination condition is obtained, so as to perform a deletion operation on the data that does not meet the relevance threshold in the preliminary screening form data or preliminary screening web page data that has been subjected to clustering calculation; The form data or web page data that has completed clustering calculation is graded in the order of data subject, sub-data subject, data value, and data link. After the graded form data or web page data is classified and counted and duplicate items in the data are removed, the form data or web page data associated with the target subject is reconstructed through relationship mapping to generate a mapping relationship tree chart.

7. A device for obtaining target subject data information, characterized in that: include: A deep web crawler module, the deep web crawler module comprising a web page information data parser; A form data NLP processing module and a data topic relevance clustering calculation module, wherein the form data NLP processing module includes a form data label extractor, a form data label NLP corpus module, an unsupervised form GPT pre-training module and a form data extractor; The deep web crawler module obtains a pre-built URL queue, wherein the URL queue stores URL links of target subject data to be obtained; The web page information data parser extracts the URL link from the URL queue, enters the web page of the target subject to capture the original network data, and the original network data includes the subject data, the web page URL and the form URL; determines whether the web page contains AJAX references, and if so, uses the deep web crawler based on the NLP natural language and relevance clustering algorithm to obtain the form data from the web page containing the form URL through the deep web crawler module according to the collected original network data; the form data label extractor extracts, classifies and standardizes the feature labels of the form data to obtain the data labels of the form data; the form data The label NLP corpus module establishes a form corpus based on the NLP natural language using the form data and its data labels as the corpus source, and obtains a form GPT pre-training model after model training is performed on the form corpus according to the GPT pre-training model based on the Transformer compiler through the unsupervised form GPT pre-training module; the form data extractor obtains preliminary screening form data from the form data according to the form GPT pre-training model; the data topic relevance clustering calculation module obtains data information related to the target topic after performing relevance clustering calculation on the preliminary screening form data using a relevance clustering algorithm.

8. The device for obtaining target subject data information according to claim 7, characterized in that: When the deep web crawler module obtains the URL queue, it also obtains a data-link dictionary, where the data-link dictionary is a dictionary set consisting of key-value pairs formed by using data as keys and links as values; The deep web crawler module further includes a web form URL validator, a form URL structure classifier, a web form URL queue generator, a form URL filler and a form data extractor. The deep web crawler module acquires form data according to the collected original web data, including: The web page information data parser establishes key-value pairs of subject data and web page URL, subject data and form URL according to the collected original network data, and the key-value pairs are used to reflect the tree relationship mapping structure between subject data and hyperlink text; The webpage form URL validator verifies the searchability of the form URL and retains the key-value pairs of the subject data and the form URL that can be searched; The form URL structure classifier performs structure splitting and standardization processing on the form URL that has been verified for searchability; The webpage form URL queue generator fills the key-value pairs consisting of the subject data and the form URL after structure splitting and standardization processing operations and stores them in the data-link dictionary to generate a queryable form URL queue in the form of a data link; The form URL filler extracts core feature words from the form URL and identifies form controls based on the split results obtained by the form URL structure classifier after performing structure splitting and standardization processing on the form URL, and fills the feature words into each part of the form URL to generate a searchable form URL; The form data extractor extracts the URLs in the form URL queue one by one to obtain form data, or extracts the form data returned after submitting the searchable form URL to the server one by one.

9. The device for obtaining target subject data information according to claim 8, characterized in that: When the deep web crawler module obtains the pre-built URL queue, it also obtains a data keyword list, which is a noun list created according to the field to which the data information to be obtained belongs or known keywords, and is used to adjust the accuracy of the form GPT pre-training model.

10. The device for obtaining target subject data information according to claim 9, characterized in that: It also includes a page data subject NLP processing module, the web page information data parser determines whether the web page contains AJAX references, if not, uses a surface network crawler based on NLP natural language and relevance clustering algorithm to parse the page data of the web page that does not contain the form URL, and then obtains the subject data and the web page URL, and transmits the subject data and the web page URL to the page data subject NLP processing module; The page data subject NLP processing module obtains the preliminary screened web page data after subject data filtering on the subject data and web page URL based on NLP natural language; the data subject relevance clustering calculation module obtains the data information related to the target subject after relevance clustering calculation on the preliminary screened web page data using the relevance clustering algorithm.