Data crawling method and device, equipment and storage medium

Through the big model-based data crawling method, the problem that traditional crawlers cannot understand dynamic loading content and frequent blocking is solved, and efficient and accurate data crawling is achieved, reducing maintenance costs and complexity.

CN118964708APending Publication Date: 2024-11-15SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411181730.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Traditional crawlers cannot correctly understand the dynamic loading content of the website. Frequent access to the same website may trigger IP blockade, which cannot meet the data analysis and crawling of complex website structures, increasing maintenance costs and complexity.

Method used

Using a large model-based data crawling method, link standardization, scoring, prioritization and deduplication are performed through preset network link processing rules, and text, media and multimodality are used for preset network crawler architecture and pre-trained large models. Data analysis, combining data fusion strategies for data preprocessing, mapping and storage.

Benefits of technology

It effectively reduces the cost of crawler business development and maintenance and improves the quality, efficiency, accuracy and availability of data crawling results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964708A_ABST
    Figure CN118964708A_ABST
Patent Text Reader

Abstract

The invention discloses a data crawling method and device, equipment and a storage medium, and relates to the field of artificial intelligence, and the method comprises the steps: carrying out the link standardization, link scoring, priority ranking and duplicate removal filtering of each current to-be-processed network link based on a preset network link processing rule; performing text analysis, media data analysis and multi-modal data analysis on a corresponding target webpage based on a pre-trained target large model in the process of performing webpage data crawling on each target to-be-processed network link in the obtained target network link queue by using a preset downloader in a preset web crawler architecture; and performing corresponding data preprocessing, data mapping and data fusion on each obtained data crawling result based on a preset data fusion strategy, and storing the obtained fused data in a preset database according to a preset data type. And webpage data crawling is performed by using the target large model and the preset web crawler architecture, so that the quality and efficiency of a data crawling result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, and in particular to a data crawling method, device, equipment and storage medium. Background Art

[0002] In the current web crawling solutions, traditional crawlers may not be able to correctly understand the dynamically loaded content of the website, and crawlers that frequently visit the same website may trigger its security system, resulting in the temporary or permanent blocking of the IP (Internet Protocol) address. With the development of the Internet, web crawlers can no longer meet the increasingly complex website structure, and parsing and crawling data has become more and more difficult. Therefore, web crawlers need to be updated regularly to adapt to changes in website structure, which undoubtedly increases the cost and complexity of long-term maintenance.

[0003] From the above, it can be seen that how to dynamically realize data crawling based on large models is an urgent problem that needs to be solved. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a data crawling method, device, equipment and medium, which can dynamically realize data crawling based on a large model, effectively reduce the cost of crawler business development and subsequent maintenance costs, and greatly improve the quality, efficiency, accuracy and availability of data crawling results. The specific scheme is as follows:

[0005] In a first aspect, the present application provides a data crawling method, comprising:

[0006] Based on the preset network link processing rules, link standardization, link scoring, priority sorting, and deduplication filtering are performed on the current network links to be processed to obtain the corresponding target network link queue;

[0007] In the process of crawling web page data of each target to-be-processed network link in the target network link queue by using a preset downloader in a preset network crawler architecture, text analysis, media data analysis and multimodal data analysis are performed on the corresponding target web page based on a pre-trained target large model to obtain data crawling results corresponding to each target to-be-processed network link;

[0008] Based on the preset data fusion strategy, corresponding data preprocessing, data mapping and data fusion are performed on each of the data crawling results, and the obtained fused data is stored in the corresponding preset database according to the preset data type.

[0009] Optionally, before performing text analysis, media data analysis and multimodal data analysis on the corresponding target web page based on the pre-trained target large model to obtain data crawling results respectively corresponding to each of the target to-be-processed network links, the method further includes:

[0010] Performing data cleaning on the acquired pre-training data based on a preset data cleaning method to obtain corresponding cleaned data;

[0011] Using a preset data annotation strategy to annotate the cleaned data to obtain corresponding annotated data;

[0012] After the annotated data is segmented based on the data features to obtain the processed data, initial large models corresponding to the model training tasks are constructed according to a plurality of model training tasks and pre-loaded pre-trained models, and hyperparameters corresponding to the initial large models are configured; wherein the model training tasks include text analysis tasks, media data analysis tasks, multimodal data analysis tasks, and link scoring tasks;

[0013] The processed data is used to train, verify and test each of the initial large models to obtain a corresponding target large model.

[0014] Optionally, after using the processed data to train, verify and test each of the initial large models to obtain a corresponding target large model, the method further includes:

[0015] Each of the target large models is encapsulated using a preset encapsulation method, and the encapsulated target large models are deployed to the server in the preset web crawler architecture, so that when crawling data, each of the target large models is called based on a preset interface, so that each of the target large models can be used to perform text analysis, media data analysis, and multimodal data analysis on the corresponding target web pages.

[0016] Optionally, also include:

[0017] During the data crawling process, the current crawler operation status is monitored using the preset monitoring tool in the preset web crawler architecture to obtain corresponding monitoring results;

[0018] The monitoring results are log-generated and saved based on a preset log recording tool, so as to perform debugging and / or auditing based on the saved log information.

[0019] Optionally, the text analysis, media data analysis and multimodal data analysis are performed on the corresponding target web page based on the pre-trained target large model to obtain data crawling results corresponding to each of the target to-be-processed network links, including:

[0020] Using the pre-trained first target large model, second target large model and third target large model, respectively, the target web pages corresponding to the target to-be-processed network links are subjected to corresponding semantic analysis, entity recognition and relationship extraction to complete corresponding text analysis operations and obtain text analysis results;

[0021] Using the pre-trained fourth target large model and fifth target large model, respectively, the target web pages corresponding to the target network links to be processed are subjected to corresponding image recognition and video analysis to complete corresponding media data analysis operations and obtain media data analysis results;

[0022] Based on the pre-trained sixth target large model, corresponding correlation analysis and context understanding are performed on the text analysis results and the media data analysis results to complete the corresponding multimodal data analysis operations and obtain data crawling results corresponding to each of the target network links to be processed.

[0023] Optionally, performing corresponding data preprocessing, data mapping and data fusion on each of the data crawling results based on a preset data fusion strategy includes:

[0024] Based on the data preprocessing strategy, the data crawling results are subjected to data deduplication operation, data correction operation, data filling operation and abnormal data removal operation to obtain corresponding preprocessed data;

[0025] Using a preset data standardization tool to perform a standardization operation on the preprocessed data to obtain corresponding standardized data;

[0026] After mapping the target fields in the standardized data that meet the preset similarity condition, triggering a corresponding data alignment operation based on the obtained new standardized data to obtain corresponding aligned data;

[0027] The aligned data are subjected to statistical fusion, rule fusion and machine learning fusion using preset data fusion rules to obtain corresponding fused data.

[0028] Optionally, the link standardization, link scoring, priority sorting, and deduplication filtering of each current to-be-processed network link based on a preset network link processing rule to obtain a corresponding target network link queue includes:

[0029] After performing absolute path conversion and link normalization on each current network link to be processed based on a preset link normalization rule, classifying and scoring each obtained standardized link using a pre-trained target link scoring model to obtain a scoring result corresponding to each of the standardized links;

[0030] Determine the target priority corresponding to each of the standardized links based on each of the scoring results, and sort according to each of the target priorities to obtain a corresponding initial network link queue;

[0031] Based on a hash table or a Bloom filter, determining whether each of the standardized links in the initial network link queue has been crawled, and using the obtained determination result to perform link deduplication to obtain a corresponding deduplication queue;

[0032] The standardized links in the deduplicated queue are filtered using a preset filtering rule to obtain a corresponding target network link queue.

[0033] In a second aspect, the present application provides a data crawling device, comprising:

[0034] A link queue acquisition module is used to perform link standardization, link scoring, priority sorting, and deduplication filtering on each current to-be-processed network link based on a preset network link processing rule to obtain a corresponding target network link queue;

[0035] A data crawling module, used for performing text analysis, media data analysis and multimodal data analysis on the corresponding target web pages based on a pre-trained target large model in the process of crawling web page data for each target to-be-processed network link in the target network link queue using a preset downloader in a preset network crawler architecture, so as to obtain data crawling results corresponding to each target to-be-processed network link;

[0036] The data storage module is used to perform corresponding data preprocessing, data mapping and data fusion on each of the data crawling results based on a preset data fusion strategy, and store the obtained fused data into a corresponding preset database according to a preset data type.

[0037] In a third aspect, the present application provides an electronic device, including:

[0038] Memory, used to store computer programs;

[0039] The processor is used to execute the computer program to implement the aforementioned data crawling method.

[0040] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned data crawling method when executed by a processor.

[0041] The present application performs link standardization, link scoring, priority sorting, and deduplication filtering on each current pending network link based on a preset network link processing rule to obtain a corresponding target network link queue; in the process of crawling web page data for each target pending network link in the target network link queue using a preset downloader in a preset network crawler architecture, text analysis, media data analysis, and multimodal data analysis are performed on the corresponding target web page based on a pre-trained target large model to obtain data crawling results corresponding to each target pending network link; based on a preset data fusion strategy, data preprocessing, data mapping, and data fusion are performed on each of the data crawling results, and the fused data obtained is stored in a corresponding preset database according to a preset data type. As can be seen from the above, in the process of crawling web page data, the present application first prioritizes the pending network links, and then uses the preset downloader and the target large model in the preset network crawler architecture to perform text analysis, media data analysis, and multimodal data analysis on the corresponding target web page to obtain the corresponding data crawling results. Afterwards, the data crawling results are fused, and the data is saved based on the data type after the fusion is completed. In this way, the cost of crawler business development and subsequent maintenance costs can be effectively reduced, and the quality, efficiency, accuracy and availability of data crawling results can be greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0043] Figure 1 A flow chart of a data crawling method disclosed in this application;

[0044] Figure 2 A flow chart of a specific data crawling method disclosed in this application;

[0045] Figure 3 A schematic diagram of a preset web crawler architecture provided for this application;

[0046] Figure 4 This is a schematic diagram of the structure of a data crawling device disclosed in this application;

[0047] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] At present, traditional crawlers may not be able to correctly understand the dynamically loaded content of the website, and crawlers that frequently visit the same website may trigger its security system, resulting in temporary or permanent blocking of the IP address. Traditional crawlers can no longer meet the increasingly complex website structure. To this end, the present application provides a data crawling method that uses a target large model and a preset web crawler architecture to crawl web page data, effectively reducing the cost of crawler business development and subsequent maintenance costs, and greatly improving the quality, efficiency, accuracy and availability of data crawling results.

[0050] See also Figure 1 As shown, an embodiment of the present invention discloses a data crawling method, including:

[0051] Step S11: Based on the preset network link processing rules, link standardization, link scoring, priority sorting, and deduplication filtering are performed on the current network links to be processed to obtain a corresponding target network link queue.

[0052] In this embodiment, before link standardization, link scoring, priority sorting, and deduplication filtering are performed on the current network links to be processed based on the preset network link processing rules, the target web page is first parsed, and the target web page is parsed using a preset parser in a preset web crawler architecture. Specifically, BeautifulSoup (a Python library for parsing HTML (Hyper Text Markup Language) and XML (Extensible Markup Language) documents) or lxml (a parsing library for Python) can be used to parse the web page HTML and extract all Tags, namely, the current network links to be processed.

[0053] It can be understood that the current network links to be processed are subjected to link screening and priority sorting to obtain a target network link queue. Specifically, the current network links to be processed are subjected to link standardization, link scoring, priority sorting, and deduplication filtering based on the preset network link processing rules to obtain the corresponding target network link queue, including: after the current network links to be processed are subjected to absolute path conversion and link normalization based on the preset link standardization rules, the obtained standardized links are classified and scored using the pre-trained target link scoring model to obtain the scoring results corresponding to each standardized link; the target priorities corresponding to each standardized link are determined based on each scoring result, and the links are sorted according to each target priority to obtain the corresponding initial network link queue; based on the hash table or Bloom filter, it is judged whether each standardized link in the initial network link queue has been crawled, and the obtained judgment result is used to deduplicate the links to obtain the corresponding deduplication queue; each standardized link in the deduplication queue is filtered using the preset filtering rules to obtain the corresponding target network link queue.

[0054] Furthermore, after obtaining the network links to be processed, regular expression matching rules can be used to filter out links that meet actual needs, for example, only links beginning with HTTP (Hypertext Transfer Protocol) or HTTPS (Hypertext Transfer Protocol Secure) are retained. After obtaining the filtered links, the relative paths of the links are converted to absolute paths to ensure the integrity of each link, and then the slash at the end of the link is removed to uniformly process WWW (World Wide Web) links. Web (i.e. World Wide Web) and non-WWW versions, to avoid repeated crawling, after obtaining the corresponding standardized links, the target link scoring model is used to classify the standardized links to distinguish different types of links (such as news, advertisements, navigation links, etc.), and the target link scoring model is used to predict the relevance and importance of the standardized links to score the standardized links to obtain scoring results corresponding to the standardized links, if the scoring results meet the preset target high priority condition, then the standardized links meeting the preset target high priority condition are saved in the initial network link queue in order from high to low priority, if the scoring results meet the preset target low priority condition, then the standardized links meeting the preset target high priority condition are saved in the initial network link queue in order from high to low priority, and then the hash table or Bloom filter can be used to filter the standardized links that have been crawled and are not of interest to the user end, such as social media sharing links, login links, etc., and the filtered links are saved in the target network link queue in the request scheduler in the preset network crawler architecture.

[0055] It should be pointed out that the target link scoring model can be a random forest, XGBoost (an optimized distributed gradient boosting library) or a neural network. The training process is to first collect the data required for the training model, perform corresponding data cleaning operations and data preprocessing operations on the collected raw data, and then convert the raw data, such as standardization and normalization. Then, NLP (Neuro Linguistic Programming) technology can be used to extract features from the text around the standardized link, such as the link text, the topic of the paragraph where the link is located, etc., and then use historical data to train and verify the initial link scoring model to ensure the prediction ability of the model, and optimize the model based on the obtained verification results to obtain the corresponding target link scoring model.

[0056] Step S12: In the process of crawling web page data for each target to-be-processed network link in the target network link queue using a preset downloader in a preset network crawler architecture, text analysis, media data analysis, and multimodal data analysis are performed on the corresponding target web page based on a pre-trained target large model to obtain data crawling results corresponding to each of the target to-be-processed network links.

[0057] In this embodiment, before the text analysis, media data analysis and multimodal data analysis of the corresponding target web page based on the pre-trained target big model are performed to obtain the data crawling results corresponding to each of the target to-be-processed network links, it also includes: data cleaning the acquired pre-trained data based on a preset data cleaning method to obtain the corresponding cleaned data; data labeling the cleaned data using a preset data labeling strategy to obtain the corresponding labeled data; after word segmentation processing is performed on the labeled data based on data features to obtain processed data, initial big models corresponding to each of the model training tasks are constructed according to multiple model training tasks and pre-loaded pre-trained models, and hyperparameters corresponding to each of the initial big models are configured; wherein the model training tasks include text analysis tasks, media data analysis tasks, multimodal data analysis tasks, and link scoring tasks; each of the initial big models is trained, verified and tested using the processed data to obtain the corresponding target big model.

[0058] It can be understood that the construction process of the target large model is as follows: first, prepare the data for model training. You can start with the actual crawler business and obtain pre-trained data from public web pages, news, forums, social media and other related websites. After obtaining the data, you need to clean the data, remove irrelevant HTML tags, advertisements, script codes, etc., and retain the plain text content. In order to ensure the accuracy and high availability of the early model training, supervised learning is introduced. At this time, it is necessary to annotate the cleaned data obtained, including the title, content, entity name, time, etc. of the text. The annotated data obtained is segmented according to the language features, and the text is decomposed into words or words to prepare for understanding the text structure. Then, you can use word vectors such as Word2Vec (Word to Vector, a related model for generating word vectors), GloVe (Global Vectors for Word Representation, i.e. global word vectors) or BERT (BidirectionalEncoder Representation from Transformers, i.e. a pre-trained model for language representation) to represent this article. Then determine the model training tasks of the micro model, such as text classification, named entity recognition, summary generation, etc. Use BERT, GPT (Generative Pre-Training, a language model pre-training method), RoBERTa (Robustly optimized BERT approach, a strongly optimized BERT method), DistilBERT (Distilled Bidirectional Encoder Representations from Transformers, a pre-trained language model) and other model architectures suitable for text understanding tasks for model training. Based on the pre-loaded pre-trained model, corresponding initial large models are constructed according to the multiple model training tasks and the pre-trained model, and corresponding hyper parameters are configured based on each of the initial large models, such as defining hyper parameters such as learning rate, batch size, and number of iterations. Then, the initial large model is trained based on the processed data obtained, and the model weights can be adjusted through back propagation to minimize the loss function.

[0059] Furthermore, the obtained trained model is verified and tested, and the model performance can be evaluated on the verification set. The trained model can be evaluated and optimized from three aspects: performance measurement, error analysis, and model optimization. First, the model performance can be evaluated using indicators such as accuracy, F1 score, AUC-ROC curve, and then the reasons for the prediction errors of the trained model are analyzed, which may be data deviation, too high or too low model complexity, etc. Then, the architecture or training parameters of the trained model are adjusted according to the results of the error analysis until the target large model is adjusted to satisfactory performance indicators.

[0060] In this embodiment, after the evaluation and optimization of the model, when the target large model meets the business requirements, the target large model needs to be packaged and then deployed on the server, providing service capabilities to the outside in the form of an API (Application Programming Interface) interface, and providing intelligent capabilities for the web crawler. Specifically, after the processed data is used to train, verify and test each of the initial large models to obtain the corresponding target large model, it also includes: using a preset packaging method to package each of the target large models, and deploying the obtained packaged target large model to the server in the preset web crawler architecture, so that when crawling data, each of the target large models is called based on the preset interface, so as to use each of the target large models to perform text analysis, media data analysis and multimodal data analysis on the corresponding target web page.

[0061] Step S13: performing corresponding data preprocessing, data mapping and data fusion on each of the data crawling results based on a preset data fusion strategy, and storing the obtained fused data into a corresponding preset database according to a preset data type.

[0062] In this embodiment, after the crawling operation of each link is completed, it is necessary to perform multi-source data fusion based on the obtained data crawling results, wherein multi-source data fusion is the process of integrating data obtained from different sources into a consistent, complete and high-quality data set. That is, data cleaning, conversion and integration are performed on each of the data crawling results to eliminate errors, duplications and inconsistent data, ensure the quality and accuracy of the data, and then perform data mapping and data fusion on the pre-processed data. The obtained fused data is more accurate crawled data, ensuring the accuracy, consistency and availability of the data.

[0063] It is understandable that the fused data is saved based on the preset data type. In a specific implementation, if the fused data is structured data, it can be stored in databases such as MySQL (a relational database management system) and PostgreSql (a relational database management system). If the fused data is unstructured or semi-structured data, it can be stored in databases such as MongoDB (a database based on distributed file storage) and Cassandra (an open source distributed database system) to improve the performance of the crawler system. In addition, in order to ensure data security, the fused data can be desensitized and encrypted, and a reasonable backup strategy can be formulated to prevent data loss.

[0064] It is understandable that during the data crawling process, the current crawler status needs to be monitored in order to understand the crawler's work progress, speed, and whether it encounters problems in real time. Specifically, during the data crawling process, the current crawler running status is monitored using the preset monitoring tool in the preset web crawler architecture to obtain corresponding monitoring results; logs are generated and saved for the monitoring results based on the preset log recording tool, so as to debug and / or audit based on the saved log information.

[0065] Furthermore, based on the intelligent recognition and processing capabilities of the target big model, the structure and attributes of the page form elements of the target website are analyzed, the fields that need to be filled in and their corresponding HTML tags and attributes are determined, the form submission method (POST / GET) and the submitted link are analyzed, form processing and page interaction are realized, and the page data after interaction is processed and parsed. If an error occurs, the big model will decide to perform strategies such as form interaction retry or exception storage.

[0066] As can be seen from the above, in the process of crawling web data, the present application first prioritizes the network links to be processed, and then uses the preset downloader in the preset web crawler architecture and the target large model to perform text analysis, media data analysis, and multimodal data analysis on the corresponding target web page to obtain the corresponding data crawling results. Afterwards, the data crawling results are fused, and the data is saved based on the data type after the fusion is completed. In this way, the cost of crawler business development and the subsequent maintenance cost can be effectively reduced, and the quality, efficiency, accuracy and availability of data crawling results can be greatly improved.

[0067] It can be seen from the above embodiments that the present application performs data crawling operations and data fusion operations based on a pre-trained target large model to improve the quality and accuracy of the data crawling results. Therefore, the process of performing data crawling operations and data fusion operations based on a pre-trained target large model is described.

[0068] See also Figure 2 As shown, the embodiment of the present invention discloses a specific data crawling method, including:

[0069] Step S21: Based on the preset network link processing rules, link standardization, link scoring, priority sorting, and deduplication filtering are performed on the current network links to be processed to obtain a corresponding target network link queue.

[0070] Step S22: In the process of crawling web page data for each target to-be-processed network link in the target network link queue using a preset downloader in a preset network crawler architecture, the pre-trained first target large model, second target large model and third target large model are used to perform corresponding semantic analysis, entity recognition and relationship extraction on each target web page corresponding to each target to-be-processed network link, so as to complete the corresponding text analysis operation and obtain the text analysis result.

[0071] In this embodiment, the webpage structure of the target webpage corresponding to each of the target to-be-processed network links can be parsed using libraries such as BeautifulSoup or lxml to extract media content such as text, pictures, and videos. The main content area of ​​the webpage can be identified using layout analysis or machine learning methods to filter out non-main content such as navigation bars and advertisements. Then, the first target large model is used to perform semantic analysis on each of the target webpages. Specifically, a pre-trained NLP model (such as BERT, GPT series) can be used for semantic understanding to extract the theme, emotion, keywords, etc. of the text; the second target large model is used to perform entity recognition on each of the target webpages. Specifically, a NER (Named Entity Recognition) model can be used to recognize entities in the text, such as names, place names, organizations, etc.; then, the third target large model is used to perform relationship extraction on the target webpage to identify the relationship between entities, such as belonging to, located in, etc., so as to enhance the structural degree of information. By performing corresponding semantic analysis, entity recognition, and relationship extraction on each of the target webpages, the corresponding text analysis operation is completed and the text analysis result is obtained.

[0072] Step S23, using the pre-trained fourth target large model and the fifth target large model to perform corresponding image recognition and video analysis on each of the target web pages corresponding to each of the target network links to be processed, so as to complete the corresponding media data analysis operation and obtain the media data analysis results.

[0073] In this embodiment, the fourth target large model is used to perform image recognition on each target web page corresponding to each target network link to be processed. Specifically, computer vision models such as ResNet (Residual Network) and Inception (a deep learning model) can be used to identify objects and scenes in the image; then the fifth target large model is used to perform video analysis on each target web page corresponding to each target network link to be processed, extract video frames, perform corresponding image analysis, or use a preset video understanding model to identify video content. By performing corresponding image recognition and video analysis on each target web page, the corresponding media data analysis operation is completed and the media data analysis result is obtained.

[0074] Step S24: Based on the pre-trained sixth target large model, corresponding correlation analysis and context understanding are performed on the text analysis results and the media data analysis results to complete the corresponding multimodal data analysis operation and obtain data crawling results corresponding to each of the target network links to be processed.

[0075] In this embodiment, the sixth target big model can be used to perform corresponding association analysis on the text analysis results and the media data analysis results to obtain the associated results, that is, combining the text and multimedia information to identify the association between the text and the multimedia information, such as the consistency between the image description and the surrounding text; based on the sixth target big model, the associated results are subjected to corresponding contextual understanding, that is, integrating multiple information sources to understand the context of the content to improve the accuracy of understanding, and the text analysis results and the media data analysis results are subjected to corresponding association analysis and contextual understanding to complete the multimodal data analysis operation, and obtain the data crawling results corresponding to each of the target network links to be processed.

[0076] It can be understood that after each corresponding data crawling using the target big model, the quality of the data crawling results can be evaluated based on factors such as the richness, originality, timeliness, etc. of the data crawling results, and then the target big model can be used to determine the relevance of the data crawling results to the crawler targets, and irrelevant or low-quality data crawling results can be deleted based on the obtained relevance results. Then, the big model can be updated regularly or on demand based on the data crawling results to adapt to new language phenomena and changes in network content, and can also be fed back to the model based on user-side operations or manual review results to continuously optimize the accuracy and effectiveness of content recognition.

[0077] Step S25: Based on the data preprocessing strategy, the data crawling results are subjected to data deduplication operations, data correction operations, data filling operations, and abnormal data removal operations to obtain corresponding preprocessed data.

[0078] In this embodiment, corresponding data deduplication operations are performed on the data in the data crawling results. In a specific implementation, a hash-based deduplication strategy can be used to perform hash processing on the data crawling results, divide the data with the same hash value into the same group, and then compare each group of data to remove duplicate data; in another specific implementation, a sorting-based deduplication strategy can be used to sort the data based on the data crawling results, retain only one adjacent identical data, and complete the data deduplication operation.

[0079] It can be understood that the method of the data correction operation includes deleting rows / columns with missing values, filling missing values ​​with statistical data (such as mean, median) or prediction methods (such as regression), estimating missing values ​​using interpolation, and predicting missing values ​​based on trends using extrapolation; a data filling function can be used to perform data filling operations on the data in the data crawling results, and different types of missing value problems can be filled based on the data filling function; OpenRefine (a data cleaning tool) can be used to remove abnormal data in the data crawling results, and the strategy for performing the data preset operation can be determined based on actual conditions and is not specifically limited here.

[0080] Step S26: using a preset data standardization tool to perform a standardization operation on the preprocessed data to obtain corresponding standardized data.

[0081] In this embodiment, the pre-processed data can be converted into a unified data format, such as date, time, currency unit, etc., according to business needs to ensure data consistency. Tools to ensure data consistency include transaction management, version control, distributed consistency algorithm, change data capture technology, data integrity check, log management, and data consistency verification tools, etc. The corresponding data standardization tools can be determined according to actual needs, and no specific limitation is made here.

[0082] Step S27: After mapping the target fields in the standardized data that meet the preset similarity condition, trigger a corresponding data alignment operation based on the obtained new standardized data to obtain corresponding aligned data.

[0083] In this embodiment, DSL (domain-specific languages) can be introduced to map similar fields in different data sources. Even if the field names are different, it is necessary to ensure that they represent the same information. After mapping the target field, the mapped field can be saved in the standardized data to obtain new standardized data. After that, the new standardized data can be aligned separately, and then the standardized data can be aligned as a whole to resolve the differences in identifiers such as timestamps and IDs (Identity documents) between data sources, and ensure the correct correspondence between data. It should be pointed out that the mapping operation and the data alignment operation can be adjusted accordingly according to actual conditions, and no specific limitation is made here.

[0084] Step S28: Use preset data fusion rules to perform statistical fusion, rule fusion and machine learning fusion on the aligned data to obtain corresponding fused data, and store the obtained fused data in a corresponding preset database according to the preset data type.

[0085] In this embodiment, the numerical data in the aligned data can be fused using statistical methods such as average, weighted average, and median. It can be based on predefined rules or logic, such as giving priority to information from authoritative data sources, using a training model to predict the most accurate data source, or using an integrated learning method to integrate the outputs of multiple data sources. The aligned data is subjected to statistical fusion, rule fusion, and machine learning fusion to obtain fused data. Afterwards, the fused data can be checked for data conflicts to detect inconsistencies or contradictions between the data, such as different descriptions of the same event by two data sources. For conflicts that cannot be resolved automatically, an expert system or manual review can be introduced to make decisions. Then, the retained data or external standards can be used to verify the correctness of the fused data to obtain corresponding verification results, which are fed back to the preset data fusion rules for continuous optimization.

[0086] It is understandable that in order to ensure that the combination of web crawlers and target large models can adapt to environmental changes and continuously improve performance, the target large model can be continuously learned and optimized. Incremental learning, online learning and periodic training can be used to ensure that the model keeps up with the direction of technological development from multiple angles such as fine-tuning the model, timely updating model parameters, and retraining the model to adapt to changes in long-term trends.

[0087] For the specific implementation process of step S21, reference may be made to the corresponding contents in the aforementioned embodiments, which will not be described in detail here.

[0088] As can be seen from the above, based on the first target big model, the second target big model and the third target big model, corresponding semantic analysis, entity recognition and relationship extraction are performed on each target web page corresponding to each target network link to be processed, and the fourth target big model and the fifth target big model are used to perform corresponding image recognition and video analysis on each target web page corresponding to each target network link to be processed, and based on the sixth target big model, corresponding association analysis and context understanding are performed on the text analysis results and the media data analysis results to complete the data crawling process, and obtain data crawling results corresponding to each target network link to be processed, and data crawling is performed based on the target big model and the preset network crawler architecture, thereby improving the quality and accuracy of the data crawling results.

[0089] Combine the following Figure 3 The schematic diagram disclosed in the embodiment of the present application is used to specifically illustrate the technical solution.

[0090] In this embodiment, the preset web crawler architecture mainly includes four parts: distributed management, crawler core, intelligent components, monitoring and logging. The distributed management mainly includes: using Scrapy Cluster (a distributed crawler framework), Apache Airflow (a workflow management platform) or a custom distributed framework, supporting multi-node parallel crawling, and improving crawler efficiency. It has the functions of handling network errors, server failures, etc., ensuring the stability of the crawler, designing a retry mechanism, and using health checks and automatic recovery strategies. Among them, monitoring and logging are used to provide crawler system monitoring and daily management capabilities by monitoring the crawler running status and logging.

[0091] Regarding the crawler core, as the core function of the preset web crawler architecture, it includes six main functional components: 1) Request scheduler: Use priority queues or message queues to manage the current queues of network links to be crawled, and schedule requests according to priority or strategy. 2) Downloader: Use requests (synchronous), aiohttp (asynchronous) or Selenium (dynamic pages) to send HTTP requests, obtain web page content, configure proxy pools to avoid IP blocking, and set retry logic to handle network instability. 3) Parser: Use BeautifulSoup, lxml or PyQuery (a web parsing library) to parse HTML, parse web page content, extract required data, and use regular expressions or XPath to extract links in pages. 4) Data storage: Use databases (such as MySQL, MongoDB), file systems or cloud storage services. Store crawled data, which can be temporary storage or persistent storage. 5) Robots (crawler protocol) strategy: Parse the robots.txt file and follow its rules. Respect the website's crawler policy and avoid illegal crawling. 6) Privacy and copyright: Crawled content is anonymized to protect personal and corporate privacy.

[0092] Regarding the intelligent component, it is used to access the trained big model and provide intelligent processing capabilities for the core functions of the crawler: 1) Big model integration: local reasoning is performed through API calls or direct loading of the target big model. The big model can be used to analyze web page content and identify important information. 2) URL (Uniform Resource Locator, that is, the network link to be processed) intelligent screening: use machine learning models to predict the relevance and importance of the network link to be processed. According to the model analysis results, valuable URLs are intelligently screened for further crawling. Eliminate hard coding caused by manual code writing and the inability to automatically identify and process valuable web pages. 3) Multi-source data fusion: Use ETL (Extract-Transform-Load, a data processing process) process to clean, transform and load data, integrate data from different websites, eliminate redundancy, and form a unified data view.

[0093] Accordingly, see Figure 4 As shown, the present application also provides a data crawling device, including:

[0094] The link queue acquisition module 11 is used to perform link standardization, link scoring, priority sorting, and deduplication filtering on each current to-be-processed network link based on a preset network link processing rule to obtain a corresponding target network link queue;

[0095] The data crawling module 12 is used to perform text analysis, media data analysis and multimodal data analysis on the corresponding target web pages based on the pre-trained target big model in the process of crawling web page data for each target to-be-processed network link in the target network link queue using the preset downloader in the preset network crawler architecture, so as to obtain data crawling results corresponding to each target to-be-processed network link;

[0096] The data storage module 13 is used to perform corresponding data preprocessing, data mapping and data fusion on each of the data crawling results based on a preset data fusion strategy, and store the obtained fused data into a corresponding preset database according to a preset data type.

[0097] As can be seen from the above, in the process of crawling web data, the present application first prioritizes the network links to be processed, and then uses the preset downloader in the preset web crawler architecture and the target large model to perform text analysis, media data analysis, and multimodal data analysis on the corresponding target web page to obtain the corresponding data crawling results. Afterwards, the data crawling results are fused, and the data is saved based on the data type after the fusion is completed. In this way, the cost of crawler business development and the subsequent maintenance cost can be effectively reduced, and the quality, efficiency, accuracy and availability of data crawling results can be greatly improved.

[0098] In some specific implementations, the data crawling device may further include:

[0099] A data cleaning unit, used to clean the acquired pre-training data based on a preset data cleaning method to obtain corresponding cleaned data;

[0100] A data labeling unit, used to label the cleaned data using a preset data labeling strategy to obtain corresponding labeled data;

[0101] A model building unit, for building initial large models corresponding to the model training tasks according to a plurality of model training tasks and pre-loaded pre-trained models after word segmentation processing is performed on the annotated data based on data features to obtain processed data, and configuring hyperparameters corresponding to the initial large models; wherein the model training tasks include text analysis tasks, media data analysis tasks, multimodal data analysis tasks, and link scoring tasks;

[0102] The target model determination unit is used to train, verify and test each of the initial large models using the processed data to obtain a corresponding target large model.

[0103] In some specific implementations, the data crawling device may further include:

[0104] A model encapsulation unit is used to encapsulate each of the target large models using a preset encapsulation method, and deploy the obtained encapsulated target large models to the server in the preset web crawler architecture, so that when crawling data, each of the target large models can be called based on a preset interface, so as to use each of the target large models to perform text analysis, media data analysis and multimodal data analysis on the corresponding target web pages.

[0105] In some specific implementations, the data crawling device may further include:

[0106] A status monitoring unit is used to monitor the current crawler operation status using a preset monitoring tool in the preset web crawler architecture during data crawling to obtain corresponding monitoring results;

[0107] The log saving unit is used to generate and save logs for the monitoring results based on a preset log recording tool, so as to perform debugging and / or auditing based on the saved log information.

[0108] In some specific implementations, the data crawling module 12 may specifically include:

[0109] A text analysis unit, used to use the pre-trained first target large model, the second target large model and the third target large model to respectively perform corresponding semantic analysis, entity recognition and relationship extraction on each target web page corresponding to each target to-be-processed network link, so as to complete the corresponding text analysis operation and obtain the text analysis result;

[0110] The media data analysis unit is used to use the pre-trained fourth target large model and the fifth target large model to perform corresponding image recognition and video analysis on each of the target web pages corresponding to each of the target to-be-processed network links, so as to complete the corresponding media data analysis operation and obtain the media data analysis result;

[0111] The multimodal data analysis unit is used to perform corresponding association analysis and context understanding on the text analysis results and the media data analysis results based on the pre-trained sixth target large model, so as to complete the corresponding multimodal data analysis operation and obtain the data crawling results corresponding to each of the target network links to be processed.

[0112] In some specific implementations, the data storage module 13 may specifically include:

[0113] A data preprocessing unit, used to perform data deduplication operations, data correction operations, data filling operations, and abnormal data removal operations on the data crawling results based on the data preprocessing strategy to obtain corresponding preprocessed data;

[0114] A data standardization unit, used to perform a standardization operation on the preprocessed data using a preset data standardization tool to obtain corresponding standardized data;

[0115] A data alignment unit, configured to trigger a corresponding data alignment operation based on the obtained new standardized data after mapping the target fields satisfying the preset similarity condition in the standardized data, so as to obtain corresponding aligned data;

[0116] The data fusion unit is used to perform statistical fusion, rule fusion and machine learning fusion on the aligned data using preset data fusion rules to obtain corresponding fused data.

[0117] In some specific implementations, the link queue acquisition module 11 may specifically include:

[0118] A link scoring unit is used to classify and score each standardized link obtained by using a pre-trained target link scoring model after performing absolute path conversion and link normalization on each current network link to be processed based on a preset link standardization rule, so as to obtain a scoring result corresponding to each of the standardized links;

[0119] A link sorting unit, configured to determine target priorities corresponding to the standardized links based on the scoring results, and sort the target priorities to obtain a corresponding initial network link queue;

[0120] A link deduplication unit, configured to determine whether each of the standardized links in the initial network link queue has been crawled based on a hash table or a Bloom filter, and perform link deduplication using the obtained determination result to obtain a corresponding deduplication queue;

[0121] The link filtering unit is used to filter each of the standardized links in the deduplicated queue using a preset filtering rule to obtain a corresponding target network link queue.

[0122] Furthermore, the present application also discloses an electronic device. Figure 5 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the data crawling method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0123] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0124] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0125] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data crawling method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0126] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed data crawling method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0127] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0128] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0129] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0130] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0131] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data crawling method, It is characterized in that include: Based on the preset network link processing rules, link standardization, link scoring, priority sorting, and deduplication filtering are performed on the current network links to be processed to obtain the corresponding target network link queue; In the process of crawling web page data of each target to-be-processed network link in the target network link queue by using a preset downloader in a preset network crawler architecture, text analysis, media data analysis and multimodal data analysis are performed on the corresponding target web page based on a pre-trained target large model to obtain data crawling results corresponding to each target to-be-processed network link; Based on the preset data fusion strategy, corresponding data preprocessing, data mapping and data fusion are performed on each of the data crawling results, and the obtained fused data is stored in the corresponding preset database according to the preset data type.

2. The data crawling method according to claim 1, It is characterized in that Before performing text analysis, media data analysis and multimodal data analysis on the corresponding target webpage based on the pre-trained target large model to obtain data crawling results corresponding to each of the target to-be-processed network links, the method further includes: Performing data cleaning on the acquired pre-training data based on a preset data cleaning method to obtain corresponding cleaned data; Using a preset data annotation strategy to annotate the cleaned data to obtain corresponding annotated data; After the annotated data is segmented based on the data features to obtain the processed data, initial large models corresponding to the model training tasks are constructed according to a plurality of model training tasks and pre-loaded pre-trained models, and hyperparameters corresponding to the initial large models are configured; wherein the model training tasks include text analysis tasks, media data analysis tasks, multimodal data analysis tasks, and link scoring tasks; The processed data is used to train, verify and test each of the initial large models to obtain a corresponding target large model.

3. The data crawling method according to claim 2, It is characterized in that After the processed data is used to train, verify and test each of the initial large models to obtain the corresponding target large models, the method further includes: Each of the target large models is encapsulated using a preset encapsulation method, and the encapsulated target large models are deployed to the server in the preset web crawler architecture, so that when crawling data, each of the target large models is called based on a preset interface, so that each of the target large models can be used to perform text analysis, media data analysis, and multimodal data analysis on the corresponding target web pages.

4. The data crawling method according to claim 1, It is characterized in that Also includes: During the data crawling process, the preset monitoring tool in the preset web crawler architecture is used to monitor the current crawler operation status to obtain corresponding monitoring results; The monitoring results are log-generated and log-saved based on a preset log recording tool, so as to perform debugging and / or auditing based on the saved log information.

5. The data crawling method according to claim 1, It is characterized in that The text analysis, media data analysis and multimodal data analysis of the corresponding target webpage based on the pre-trained target large model are performed to obtain data crawling results corresponding to each of the target to-be-processed network links, including: Using the pre-trained first target large model, second target large model and third target large model, respectively, the target web pages corresponding to the target to-be-processed network links are subjected to corresponding semantic analysis, entity recognition and relationship extraction to complete the corresponding text analysis operation and obtain the text analysis result; Using the pre-trained fourth target large model and fifth target large model, respectively, the target web pages corresponding to the target network links to be processed are subjected to corresponding image recognition and video analysis to complete corresponding media data analysis operations and obtain media data analysis results; Based on the pre-trained sixth target large model, corresponding correlation analysis and context understanding are performed on the text analysis results and the media data analysis results to complete the corresponding multimodal data analysis operations and obtain data crawling results corresponding to each of the target network links to be processed.

6. The data crawling method according to claim 5, It is characterized in that The data crawling results are subjected to corresponding data preprocessing, data mapping and data fusion based on the preset data fusion strategy, including: Based on the data preprocessing strategy, the data crawling results are subjected to data deduplication operation, data correction operation, data filling operation and abnormal data removal operation to obtain corresponding preprocessed data; Using a preset data standardization tool to perform a standardization operation on the preprocessed data to obtain corresponding standardized data; After mapping the target fields in the standardized data that meet the preset similarity condition, triggering a corresponding data alignment operation based on the obtained new standardized data to obtain corresponding aligned data; The aligned data are subjected to statistical fusion, rule fusion and machine learning fusion using preset data fusion rules to obtain corresponding fused data.

7. The data crawling method according to any one of claims 1 to 6, It is characterized in that The method of performing link standardization, link scoring, priority sorting, and deduplication filtering on each current network link to be processed based on the preset network link processing rules to obtain a corresponding target network link queue includes: After performing absolute path conversion and link normalization on each current network link to be processed based on a preset link normalization rule, classifying and scoring each obtained standardized link using a pre-trained target link scoring model to obtain a scoring result corresponding to each of the standardized links; Determine the target priority corresponding to each of the standardized links based on each of the scoring results, and sort according to each of the target priorities to obtain a corresponding initial network link queue; Based on a hash table or a Bloom filter, determining whether each of the standardized links in the initial network link queue has been crawled, and using the obtained determination result to perform link deduplication to obtain a corresponding deduplication queue; The standardized links in the deduplicated queue are filtered using a preset filtering rule to obtain a corresponding target network link queue.

8. A data crawling device, It is characterized in that include: A link queue acquisition module is used to perform link standardization, link scoring, priority sorting, and deduplication filtering on each current to-be-processed network link based on a preset network link processing rule to obtain a corresponding target network link queue; A data crawling module, used for performing text analysis, media data analysis and multimodal data analysis on the corresponding target web pages based on a pre-trained target large model in the process of crawling web page data for each target to-be-processed network link in the target network link queue using a preset downloader in a preset network crawler architecture, so as to obtain data crawling results corresponding to each target to-be-processed network link; The data storage module is used to perform corresponding data preprocessing, data mapping and data fusion on each of the data crawling results based on a preset data fusion strategy, and store the obtained fused data into a corresponding preset database according to a preset data type.

9. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, used to execute the computer program to implement the data crawling method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that Used to store a computer program, wherein the computer program, when executed by a processor, implements the data crawling method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Website type judgment method and device based on multiple modes

    CN114239689A

  • Method and apparatus for an application crawler

    US20060230011A1

Cited By

  • Automatic network data acquisition method based on ScrapeGraphAI

    CN120910367A

  • Information crawling method and device, equipment, storage medium and computer program product

    CN121030073A

  • High-precision time series data extraction method and system based on modular design

    CN121350330A

  • A high-precision time-series data extraction method and system based on modular design

    CN121350330B