Website content acquisition method and device, storage medium and program product

Through the website content acquisition method based on the stream computing framework, combined with the Hbase database and scheduled task mechanism, the problem of crawler tools being unable to reach deep-level and non-root domain pages of the website is solved, achieving comprehensive acquisition of website content and accurate sensitive information. Screening reduces content traversal complexity.

CN118551129APending Publication Date: 2024-08-27CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410787082.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing crawler tools cannot reach the deepest vertical level of the website and cannot explore non-website root domain pages, resulting in the inability to fully obtain website content.

Method used

A stream computing framework is used to obtain website user access logs from a distributed message queue, and offline data analysis is performed through the Hbase database to obtain website page links and content. The scheduled task mechanism and regular matching are combined to establish a mapping between objects to be screened and page links. relationship to achieve sensitive information screening.

Benefits of technology

It solves the problem that crawler tools cannot handle the complexity of website levels, reduces the spatio-temporal complexity of website content traversal, and achieves comprehensive acquisition of website content and accurate screening of sensitive information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551129A
    Figure CN118551129A
Patent Text Reader

Abstract

The invention discloses a website content obtaining method and device, a storage medium and a program product, and relates to the technical field of data processing.The website content obtaining method comprises the steps that on the basis of a stream computing framework, website user access logs are obtained from a distributed message queue and stored in an Hbase database; performing offline data analysis on the website user access log to obtain a first website page link; and obtaining first website content based on the first website page link. According to the scheme, the website content is obtained through the user behavior driving mode, the problem that an existing crawler tool cannot process website hierarchy complexity is solved, and the time-space complexity of website content traversal is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a website content acquisition method, device, storage medium and program product. Background Art

[0002] In modern society, digital media information is flooding the Internet space. However, there is no lack of illegal and harmful media information. Therefore, in order to maintain a good network ecology, it is necessary to screen Internet media information for sensitive information.

[0003] The existing screening of sensitive information requires obtaining website content. Currently, similar website content acquisition methods often use crawler tools to traverse the website content. However, during recursive traversal, they can generally only reach the third-level website directory, and there is a risk of an infinite loop. At the same time, the website provides various exclusive pages for other systems. Such pages cannot be reached from the root path of the website, so the crawler cannot crawl them.

[0004] In summary, existing crawler tools have the problem of being unable to reach the deepest vertical level of a website and being unable to explore pages reached by non-website root domain names.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of this application is to provide a website content acquisition method, device, storage medium and program product, aiming to solve the technical problems that existing crawler tools cannot reach the deepest vertical level of the website and cannot explore non-website root domain names to reach pages.

[0007] To achieve the above purpose, the present application proposes a method for obtaining website content, the method comprising:

[0008] Based on the stream computing framework, website user access logs are obtained from the distributed message queue and stored in the Hbase database;

[0009] Performing offline data analysis on the website user access log to obtain a first website page link;

[0010] Based on the first website page link, the first website content is obtained.

[0011] In one embodiment, the step of performing offline data analysis on the website user access log to obtain the first website page link includes:

[0012] Obtaining a first website user access log from the Hbase database;

[0013] Performing data preprocessing on the first website user access log to obtain a second website user access log;

[0014] Performing data analysis on the user access log of the second website to obtain page access links of several related websites;

[0015] The page access links of the several related websites are aggregated to obtain the first website page link.

[0016] In one embodiment, the method further comprises:

[0017] Establish a timed task mechanism according to preset time intervals;

[0018] Based on the timed task mechanism, reacquire the website page link to obtain the second website page link;

[0019] Determining incremental website page links based on the first website page link and the second website page link;

[0020] Based on the incremental website page link, obtaining incremental website content;

[0021] The incremental website content and the first website content are aggregated to obtain the second website content.

[0022] In one embodiment, the step of acquiring the first website content based on the first website page link includes:

[0023] Based on the first website page link, obtaining corresponding page content;

[0024] Convert the page content into HTML and obtain a static resource access link;

[0025] Based on the static resource access link, obtain the corresponding static resource content;

[0026] The page content and the static resource content are aggregated to obtain the first website content.

[0027] In one embodiment, after the step of aggregating the incremental website content and the first website content to obtain the second website content, the step further includes:

[0028] Based on the content of the second website, obtaining the object to be screened by regular matching according to preset matching characters;

[0029] Based on the Hbase database and the MySQL database, a paging table of mapping relationships between the objects to be screened and the website page links is established and stored.

[0030] In one embodiment, the step of establishing and storing a mapping relationship paging table between the objects to be screened and the website page links based on the Hbase database and the MySQL database includes:

[0031] Encrypting and deduplicating the object to be screened to obtain a unique identifier of the object to be screened;

[0032] According to the corresponding relationship between the unique identifier of the object to be screened and the object to be screened, a first relationship table is established and stored in the MySQL database;

[0033] Based on the unique identifier of the object to be screened, and according to the corresponding relationship between the object to be screened and the website page link, a second relationship table is established and stored in the Hbase database;

[0034] Based on the first relationship table and the second relationship table, a mapping relationship paging table between the objects to be screened and the website page links is obtained.

[0035] In one embodiment, after the step of establishing and storing a mapping relationship paging table between the objects to be screened and the website page links based on the Hbase database and the MySQL database, the following step is further included:

[0036] Based on the mapping relationship paging table, sensitive information of the screening object is screened according to the preset information review mechanism to determine suspected sensitive objects.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a website content acquisition device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the website content acquisition method described above.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the website content acquisition method described above are implemented.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the website content acquisition method described above are implemented.

[0040] One or more technical solutions proposed in this application have at least the following technical effects:

[0041] The website content acquisition method, device, storage medium and program product proposed in the embodiments of the present application specifically obtain website user access logs from a distributed message queue based on a stream computing framework and store them in an Hbase database; perform offline data analysis on the website user access logs to obtain a first website page link; and obtain the first website content based on the first website page link.

[0042] By using the stream computing framework and distributed message queues, this application can perform real-time stream computing processing on website user access logs, and then perform offline data analysis based on the Hbase database to obtain website content through a user behavior-driven model. This not only solves the problem that existing crawler tools are unable to handle the complexity of the website level, but also reduces the time and space complexity of traversing the website content. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0044] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1 A flowchart of the first embodiment of the method for obtaining website content of the present application is provided;

[0046] Figure 2 A comparison diagram of the crawler tool and the dimensionality-reduced flattened content traversal involved in the website content acquisition method embodiment of this application;

[0047] Figure 3 A flowchart of the second embodiment of the method for obtaining website content of the present application is provided;

[0048] Figure 4 A flowchart of the third embodiment of the method for obtaining website content of the present application is provided;

[0049] Figure 5 A list of objects to be screened stored in the MySQL+HBase combination involved in the website content acquisition method embodiment of this application;

[0050] Figure 6 A flowchart of the fourth embodiment of the website content acquisition method of the present application is provided;

[0051] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the website content acquisition method in the embodiment of the present application.

[0052] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0054] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0055] The main solution of the embodiment of the present application is: based on the stream computing framework, obtain the website user access log from the distributed message queue and store it in the Hbase database; perform offline data analysis on the website user access log to obtain the first website page link; based on the first website page link, obtain the first website content.

[0056] Technical terms involved in the embodiments of this application:

[0057] HBase: HBase is a highly reliable, high-performance, column-oriented, scalable distributed storage system. HBase is modeled on Google's Bigtable and is part of the Apache Hadoop ecosystem. HBase is designed to provide high-reliability, high-performance read and write capabilities on large-scale data sets, especially for application scenarios that require horizontal expansion.

[0058] The basic architecture of HBase uses Hadoop's HDFS (Hadoop Distributed File System) as the underlying storage. HBase consists of a Master node and multiple RegionServers.

[0059] The core features of Hbase include:

[0060] Column storage: HBase uses column family column storage and supports dynamic column addition and deletion.

[0061] Horizontal scalability: HBase can be seamlessly expanded horizontally on multiple servers to achieve large-scale data storage and processing.

[0062] High-concurrency read and write: High-concurrency read and write operations are achieved through the distributed architecture of HBase and the load balancing mechanism of RegionServer.

[0063] Suitable for big data applications: HBase is designed to store and process PB-level data and supports real-time query and analysis.

[0064] MySQL: MySQL is a relational database management system designed based on the client-server model. It uses the classic SQL (Structured Query Language) as the query language and supports multiple storage engines, such as InnoDB, MyISAM, etc.

[0065] MySQL uses tables to organize data. Each table contains multiple columns and rows and supports complex relational data models. MySQL supports ACID (atomicity, consistency, isolation, and persistence) transaction features to ensure data integrity and reliability. MySQL provides powerful security features, such as user rights management and SSL encrypted transmission, to protect the database from unauthorized access and data leakage. MySQL supports vertical and horizontal expansion, allowing users to flexibly adjust hardware resources and system architecture according to needs.

[0066] Although MySQL can handle a certain amount of concurrent connections, in large-scale, high-concurrency application scenarios, additional load balancing and caching mechanisms may be required to support it.

[0067] HTML (HyperText Markup Language): The full name of HTML is Hypertext Markup Language, which is a markup language.

[0068] Hypertext is a way of organizing information. It links the text, graphics and other information media in the text through hyperlinks. These interrelated information media may be in the same text, or in other files, or files on a computer that is geographically far away. Tags are labels. HTML includes a series of tags, which can unify the document format on the Internet and connect scattered network resources into a logical whole. HTML text is a descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc.

[0069] The existing website content acquisition methods often use crawler tools to crawl website links and then obtain website content. However, when traversing website content, the existing crawler tools can generally only reach the third-level website directory during recursive traversal, and there is a risk of an infinite loop. At the same time, the crawler tools cannot obtain various exclusive pages provided by the website for other systems.

[0070] By using the stream computing framework and distributed message queues, this application can perform real-time stream computing processing on website user access logs, and then perform offline data analysis based on the Hbase database to obtain website content through a user behavior-driven model. This not only solves the problem that existing crawler tools are unable to handle the complexity of the website level, but also reduces the time and space complexity of traversing the website content.

[0071] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a website content acquisition device capable of realizing the above functions, etc. The following takes the website content acquisition device as an example to illustrate this embodiment and the following embodiments.

[0072] Based on this, the present application embodiment provides a method for obtaining website content, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the website content acquisition method of the present application.

[0073] In this embodiment, the method includes steps S110 to S130:

[0074] Step S110, based on the stream computing framework, obtain the website user access log from the distributed message queue and store it in the Hbase database;

[0075] It should be noted that the stream computing framework refers to a computing framework for processing real-time data streams. It can process, analyze and calculate data streams in real time and provide real-time result output. The stream processing framework can be Apache Storm, Apache Samza, Apache Spark, Apache Flink, etc.; the distributed message queue refers to the use of efficient and reliable message passing mechanism for data exchange. By providing message passing and message queuing models, it can provide application decoupling, elastic scaling, redundant storage, traffic peak shaving, asynchronous communication, data synchronization and other functions in a distributed environment. The distributed message queue can be Apache Kafka, RabbitMQ, Apache ActiveMQ, RocketMQ, Apache Pulsar, etc.; the website user access log is a record file obtained by capturing data on the behaviors and events that occur when website users visit the website and processing the captured data.

[0076] This application takes into account that existing website content is often obtained through crawler tools, but crawler tools have the problem of being unable to reach the deepest vertical level of the website and unable to explore non-website root domain names to reach pages. Therefore, a technical solution is proposed for practical application in obtaining website page content.

[0077] Specifically, in this embodiment, the stream computing framework is Spark, and the distributed message queue is Kafka. First, it is necessary to obtain the website user access log from the distributed message queue, so as to perform data analysis on the website user access log, obtain the website user's behavior operation record, and then obtain the website user's website access link, so as to solve the website level complexity problem through the user behavior driven mode. No matter how deep the level of the website related pages is, the content of the website related pages visited by the website users can be obtained through the technical solution proposed in this application.

[0078] Furthermore, in this embodiment, the user behavior log is a log file generated by pre-embedding the website user's visit to the website, browsing the website pages at all levels, clicking the exclusive links provided by the website, etc., and is uploaded to Kafka in real time, so that the subsequent website content acquisition device can obtain the log and perform online data stream processing. Among them, embedding refers to the implementation process of capturing, processing and sending the website user's behavior or events.

[0079] Step S120, performing offline data analysis on the website user access log to obtain a first website page link;

[0080] Specifically, it can be understood that in order to reduce the pressure of online data processing on the server as much as possible, the website content acquisition device uses some common data analysis tools to perform offline data analysis on the website user access log in the Hbase database, and obtains the website related links visited by the users in the log, including multi-layered links of the website, customer-exclusive links, protocol links, other external links, etc. The website related links are the first website page links.

[0081] Among them, the data analysis tools can be Excel, SAS software, MATLAB, SPSS, Hadoop, etc., or related scripts composed of languages ​​​​such as Python and Java; data preparation and processing can also be performed before data analysis, including but not limited to data cleaning, data filtering, format conversion, data normalization, data reduction and other operations.

[0082] In a feasible implementation, step S120 may include steps A01 to A04:

[0083] Step A01, obtaining a first website user access log from the Hbase database;

[0084] Step A02, performing data preprocessing on the first website user access log to obtain a second website user access log;

[0085] Specifically, firstly, the user access log of the first website is obtained from the Hbase database for subsequent offline data analysis.

[0086] Then, the first website user access log is subjected to common data preprocessing, such as data cleaning, invalid or missing value processing, data deduplication, data format conversion, etc., to obtain the website user access log after data preprocessing, i.e., the second website user access log.

[0087] Step A03, performing data analysis on the user access log of the second website to obtain page access links of several related websites;

[0088] Step A04, aggregating the page access links of the several related websites to obtain the first website page link.

[0089] Specifically, offline data analysis is performed on the website user access log after data preprocessing, relevant page links are extracted from the second website user access log, and the relevant page links are deduplicated to obtain page access links of several related websites.

[0090] Furthermore, in this embodiment, regular expressions are used to filter the obtained multiple page access links, and attack links and invalid parameter links in the above multiple page access links are removed by obtaining URI (Uniform Resource Identifier) ​​objects, etc. Regular expressions are a powerful text processing tool that uses a specific pattern to match or find substrings in a string.

[0091] Then, the page access links of the several related websites are aggregated to finally obtain the first website page link.

[0092] Step S130: acquiring the first website content based on the first website page link.

[0093] Specifically, according to the first website page link obtained above, an HTTP (Hypertext Transfer Protocol) request is sent to the relevant website to obtain the corresponding website content, that is, the first website content.

[0094] In a feasible implementation, step S130 may include steps B01 to B04:

[0095] Step B01, based on the first website page link, obtain the corresponding page content;

[0096] Specifically, firstly, according to the first website page link obtained above, an HTTP request is sent to the corresponding website page to request the website page content, and the corresponding page content is obtained.

[0097] Step B02, converting the page content into HTML to obtain a static resource access link;

[0098] It should be noted that static resources refer to static resources of page content, usually content that does not change frequently in a web page or does not need to be dynamically generated by the server. Static resources are usually stored in the file system of the web server and sent directly to the client (such as a web browser) through HTTP requests.

[0099] It is understandable that in order to reduce network traffic and speed up page loading, static resources often exist in the aforementioned obtained page content. In order to further analyze the page content, it is also necessary to obtain the static resource content.

[0100] Specifically, the page content is converted to HTML to obtain a page file in HTML format. In the page file, according to <script>、<Link>标签进行分类,获取到JS、CSS等静态资源的访问链接。

[0101] 步骤B03,基于所述静态资源访问链接,获取对应的静态资源内容;

[0102] 步骤B04,汇总所述页面内容与静态资源内容,得到第一网站内容。

[0103] 具体地,根据得到的静态资源访问链接,可以向相关服务器发送HTTP请求,获取到对应的静态资源内容。

[0104] 然后,将前述根据第一网站页面链接获取的页面内容,与静态资源内容进行汇总,最终得到第一网站内容。

[0105] 示例性的,图2为爬虫工具与降维扁平内容遍历的对比图。在图2中,可以了解到爬虫工具在爬虫内容遍历时,无法通过遍历得到专属链接或协议页面链接,反而通过网站流量监测(即对用户行为进行监测)进行内容遍历时,可以得到降维化的网站页面链接。

[0106] 本实施方式通过上述方案,不仅可以减轻开发人员的维护成本,同时也降低了用户在网站内容获取平台使用中可能存在的风险。

[0107] 本实施例提供了一种网站内容获取方法,具体通过基于流计算框架,从分布式消息队列获取网站用户访问日志,并存储到Hbase数据库;对所述网站用户访问日志进行离线数据分析,得到第一网站页面链接;基于所述第一网站页面链接,获取第一网站内容。

[0108] 本申请通过使用流计算框架与分布式消息队列,可以对网站用户访问日志进行实时流计算处理,再基于Hbase数据库进行离线数据分析,实现通过用户行为驱动模式获取网站内容,不仅解决了现有爬虫工具无法处理网站层级复杂度问题,而且降低了网站内容遍历的时空复杂度。

[0109] 基于本申请第一实施例,在本申请第二实施例中,与上述实施例一相同或相似的内容,可以参考上文介绍,后续不再赘述。在此基础上,请参照图3,在上述步骤130之后,还包括步骤S310~S350:

[0110] 步骤S310,按照预设时间间隔,建立定时任务机制;

[0111] 需要说明的是,预设时间间隔是相关人员依据服务器系统资源或实际需求进行自定义设置的;定时任务机制是指通过定时触发器或任务调度器根据设定的时间规则,在特定的时间点或间隔触发执行任务的任务调度机制。常见的定时触发器有系统级定时器、Cron表达式等。

[0112] 具体地,将网站内容获取的定时任务设置为执行任务,并以预设时间间隔为依据设置任务的循环时间,以建立网站内容获取的定时任务机制。

[0113] 在本申请实施例中,因为相关业务人员可能会对网站内容进行每天更新,所以预设时间间隔通常设置为24小时,即定时任务是设置以24小时为间隔的网站内容获取任务。

[0114] 步骤S320,基于所述定时任务机制,重新获取网站页面链接,得到第二网站页面链接;

[0115] 步骤S330,基于所述第一网站页面链接与第二网站页面链接,确定增量网站页面链接;

[0116] 具体地,依据定时任务机制,再次依据网站用户访问日志,重新获取可能存在更新的网站页面链接,得到第二网站页面链接。

[0117] 应当理解的,因为相关业务人员对网站内容的更新可能仅涉及到增删改部分页面链接或部分页面内容,为了避免不必要的资源浪费,网站内容获取仅对增量页面内容进行更新。

[0118] 具体地,对比前述得到的第一网站页面链接与第二网站页面链接的差异,从而确定增量网站页面链接。

[0119] 步骤S340,基于所述增量网站页面链接,获取增量网站内容;

[0120] 步骤S350,汇总所述增量网站内容与第一网站内容,得到第二网站内容。

[0121] 然后,根据增量网站页面链接,向对应的服务器发送获取网站内容的HTTP请求,进而得到增量网站内容。

[0122] 最后,将增量网站内容与前述获取的第一网站内容进行汇总,最终得到第二网站内容。

[0123] 本实施例提供了一种网站内容获取方法,具体通过基于流计算框架,从分布式消息队列获取网站用户访问日志,并存储到Hbase数据库;对所述网站用户访问日志进行离线数据分析,得到第一网站页面链接;基于所述第一网站页面链接,获取第一网站内容;按照预设时间间隔,建立定时任务机制;基于所述定时任务机制,重新获取网站页面链接,得到第二网站页面链接;基于所述第一网站页面链接与第二网站页面链接,确定增量网站页面链接;基于所述增量网站页面链接,获取增量网站内容;汇总所述增量网站内容与第一网站内容,得到第二网站内容。

[0124] 本实施例通过上述方案,通过使用流计算框架与分布式消息队列,可以对网站用户访问日志进行实时流计算处理,再基于Hbase数据库进行离线数据分析,实现通过用户行为驱动模式获取网站内容,解决现有爬虫工具存在着无法触达网站的纵向最深层级,且无法探索非网站根域名触达页面的问题;同时建立定时任务机制,可以实现在存量页面分析的基础上,对于增量更新页面进行定时任务分析补偿,解决爬虫工具需要每天全量扫描造成的资源浪费,效率低下问题。

[0125] 基于本申请第二实施例,在本申请第三实施例中,与上述实施例二相同或相似的内容,可以参考上文介绍,后续不再赘述。在此基础上,请参照图4,在上述步骤350之后,还包括步骤S410~S420:

[0126] 步骤S410,基于所述第二网站内容,按照预设匹配字符通过正则匹配获取待筛查对象;

[0127] 需要说明的是,预设匹配字符是相关人员根据待筛查对象在HTML格式文档中特有字符而进行设置的,用于后续正则匹配;待筛查对象是指相关人员依据实际需求而进行设置的网站内容中需要被筛查的资源。

[0128] 本实施例中,待筛查对象为涉及黄赌毒非法外链、各类文档和图片。

[0129] 具体通过正则表达式按照预设匹配字符匹配,例如通过链接特有字符HTTP或HTTPS、文档后缀(PDF、DOCX等)以及图片后缀(PNG、JPG等)进行分类过滤,并依次得到第二网站内容中的所有链接、文档以及图片。

[0130] 步骤S420,基于所述Hbase数据库与MySQL数据库,建立并存储所述待筛查对象与网站页面链接的映射关系分页表。

[0131] 需要说明的是,对于总量达上百万页的网站,各类待筛查对象的引用不仅包括在页面内容中,还存在于JS、CSS等静态资源中,因此需要记录各筛查对象跟具体页面的对应关系,并且能分页展示,以便后续可以实现对敏感信息筛查后的确认。

[0132] 虽然HBase具备超强扩展性和高吞吐量,但是HBase不适合分页查询,如果使用Hbase进行分页查询,大量数据在内存中分页易造成OOM、效率低、耗时长等问题。本申请考虑到上述问题,结合MySQL数据库的支持复杂事务处理的特性,从而实现待筛查对象与页面链接对应关系的记录。

[0133] 具体地,网站内容获取设备通过Hbase数据库存储第二网站页面链接(即第一网站页面链接与增量网站页面链接),利用待筛查对象的链接的唯一标识并结合MySQL数据库的特性,从而建立所述待筛查对象与网站页面链接的映射关系分页表,并将其存储在Hbase数据库与MySQL数据库中。

[0134] 其中,唯一标识通常是指通过加密方法来生成一个唯一的、难以预测的标识符,可以通过MD5哈希算法、SHA系列哈希算法或者基于公钥密码学的算法生成得到。

[0135] 在一种可行的实施方式中,步骤S420可以包括步骤C01~C04:

[0136] 步骤C01,对所述待筛查对象进行加密去重,得到待筛查对象的唯一标识;

[0137] 具体地,首先需要获取得到待筛查对象的链接,然后再对待筛查对象的链接进行SM3加密得到待筛查对象的唯一标识RowKey,在内存中以Key(RowKey)、Value(链接)的形式缓存解析得到各类待筛查对象与RowKey之间的对应关系,再对所述链接进行数据去重。

[0138] 步骤C02,根据所述待筛查对象的唯一标识与所述待筛查对象之间的对应关系,建立第一关系表格,并存储到所述MySQL数据库;

[0139] 步骤C03,基于所述待筛查对象的唯一标识,根据所述待筛查对象与网站页面链接的对应关系,建立第二关系表格,并存储到所述Hbase数据库;

[0140] 具体地,利用MySQL数据库作为关系型数据库,可以支持ACID事务的特性,将前述数据去重后的待筛查对象的链接作为索引或者主键,对应的链接唯一标识符作为存储数据,以上述的形式组织成为表格,从而建立存储待筛查对象的唯一标识与所述待筛查对象之间的对应关系的链接目录表格,即第一关系表格,并存储在MySQL数据库中。

[0141] 其中,ACID是原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)、持久性(Durability)的缩写。

[0142] 然后,再利用Hbase数据库的超强扩展性,实现对海量的页面链接数据进行拓展,基于待筛查对象与网站页面链接(第二网站页面链接)的对应关系,得到对应的链接唯一标识符与网站页面链接之间的对应关系,并将对应的链接唯一标识符与网站页面链接之间的对应关系以键值对的形式存储,从而形成第二关系表格。

[0143] 需要说明的是,因为待筛查对象可以存在于多个网站页面中,所以在Hbase数据库存储的第二关系表格中,链接唯一标识符与网站页面链接之间可以是一对一的对应关系,也可以是一对多的对应关系。

[0144] 步骤C04,基于所述第一关系表格与第二关系表格,得到所述待筛查对象与网站页面链接的映射关系分页表。

[0145] 具体地,通过待筛查对象的链接唯一标识符,即可将第一关系表格与第二关系表格关联起来,共同组成待筛查对象与网站页面链接的映射关系分页表。

[0146] 示例性的,根据图5所示的MySQL+HBase组合存储的待筛查对象列表(即待筛查对象与网站页面链接的映射关系分页表),本实施例中将待筛查对象的链接存储到MySQL数据库作为目录管理,利用HBase数据库记录待筛查对象的链接对应的网站页面链接等具体内容。

[0147] 网络内容获取设备利用待筛查对象列表进行分页查询时,首先查询MySQL数据库得到待筛查对象的链接目录,根据链接目录的RowKey在HBase数据库中进行二次查询得到待筛查对象的链接和对应的具体网页链接。

[0148] 本实施例提供了一种网站内容获取方法,具体通过基于流计算框架,从分布式消息队列获取网站用户访问日志,并存储到Hbase数据库;对所述网站用户访问日志进行离线数据分析,得到第一网站页面链接;基于所述第一网站页面链接,获取第一网站内容;按照预设时间间隔,建立定时任务机制;基于所述定时任务机制,重新获取网站页面链接,得到第二网站页面链接;基于所述第一网站页面链接与第二网站页面链接,确定增量网站页面链接;基于所述增量网站页面链接,获取增量网站内容;汇总所述增量网站内容与第一网站内容,得到第二网站内容;基于所述第二网站内容,按照预设匹配字符通过正则匹配获取待筛查对象;基于所述Hbase数据库与MySQL数据库,建立并存储所述待筛查对象与网站页面链接的映射关系分页表。

[0149] 本实施例通过上述方案,通过结合Hbase数据库与MySQL数据库的特性,建立并存储所述待筛查对象与网站页面链接的映射关系分页表,实现分页查询海量的待筛查对象与对应页面的键值对信息,以便后续对网站内容进行敏感信息筛选后,可以根据映射关系分页表轻松且精准地查询到存在疑似敏感信息的网站页面。

[0150] 基于本申请第三实施例,在本申请第四实施例中,与上述实施例三相同或相似的内容,可以参考上文介绍,后续不再赘述。在此基础上,请参照图6,上述步骤S420之后,还包括步骤S610:

[0151] 步骤S610,基于所述映射关系分页表,按照预设信息审核机制对待筛查对象进行敏感信息筛查,确定疑似敏感对象。

[0152] 需要说明的是,预设信息审核机制是指相关人员依据政府有关部门对网站内容的要求和 / 或公司需求而设置的敏感信息筛查机制;疑似敏感对象是指涉及黄赌毒或其他违法的外链、文档、图片等内容。

[0153] 具体地,根据待筛查对象与网站页面链接的映射关系分页表,获取待筛查对象的访问链接,并基于访问链接,向相关服务器发送HTTP请求,将应答返回的文件内容提交给预设信息审核机制,使预设信息审核机制对文件内容进行敏感信息的筛查,确定疑似存在敏感信息的待筛查对象,即疑似敏感对象。

[0154] 本实施例提供了一种网站内容获取方法,具体通过基于流计算框架,从分布式消息队列获取网站用户访问日志,并存储到Hbase数据库;对所述网站用户访问日志进行离线数据分析,得到第一网站页面链接;基于所述第一网站页面链接,获取第一网站内容;按照预设时间间隔,建立定时任务机制;基于所述定时任务机制,重新获取网站页面链接,得到第二网站页面链接;基于所述第一网站页面链接与第二网站页面链接,确定增量网站页面链接;基于所述增量网站页面链接,获取增量网站内容;汇总所述增量网站内容与第一网站内容,得到第二网站内容;基于所述第二网站内容,按照预设匹配字符通过正则匹配获取待筛查对象;基于所述Hbase数据库与MySQL数据库,建立并存储所述待筛查对象与网站页面链接的映射关系分页表;基于所述映射关系分页表,按照预设信息审核机制对待筛查对象进行敏感信息筛查,确定疑似敏感对象。

[0155] 本实施例通过上述方案,通过预设信息审核机制,对映射关系分页表中存储的链接进行敏感信息的筛查,从而实现对网站内容的进一步审核,弥补人工审核可能出现的漏洞,避免出现网站内容涉黄赌毒、以及其他非法信息,对维护良好的网络内容生态具有有益效果。

[0156] 本申请提供一种网站内容获取设备,网站内容获取设备包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述实施一例中的网站内容获取方法。

[0157] 下面参考图7,其示出了适于用来实现本申请实施例的网站内容获取设备的结构示意图。本申请实施例中的网站内容获取设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(Personal Digital Assistant:个人数字助理)、PAD(PortableApplication Description:平板电脑)、PMP(Portable Media Player:便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图7示出的网站内容获取设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。

[0158] 如图7所示,网站内容获取设备可以包括处理装置1001(例如中央处理器、图形处理器等),其可以根据存储在只读存储器(ROM:Read Only Memory)1002中的程序或者从存储装置1003加载到随机访问存储器(RAM:Random Access Memory)1004中的程序而执行各种适当的动作和处理。在RAM1004中,还存储有网站内容获取设备操作所需的各种程序和数据。处理装置1001、ROM1002以及RAM1004通过总线1005彼此相连。输入 / 输出(I / O)接口1006也连接至总线。通常,以下系统可以连接至I / O接口1006:包括例如触摸屏、触摸板、键盘、鼠标、图像传感器、麦克风、加速度计、陀螺仪等的输入装置1007;包括例如液晶显示器(LCD:Liquid Crystal Display)、扬声器、振动器等的输出装置1008;包括例如磁带、硬盘等的存储装置1003;以及通信装置1009。通信装置1009可以允许网站内容获取设备与其他设备进行无线或有线通信以交换数据。虽然图中示出了具有各种系统的网站内容获取设备,但是应理解的是,并不要求实施或具备所有示出的系统。可以替代地实施或具备更多或更少的系统。

[0159] 特别地,根据本申请公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置从网络上被下载和安装,或者从存储装置1003被安装,或者从ROM1002被安装。在该计算机程序被处理装置1001执行时,执行本申请公开实施例的方法中限定的上述功能。

[0160] 本申请提供的网站内容获取设备,采用上述实施例中的网站内容获取方法,能够解决现有爬虫工具存在着无法触达网站的纵向最深层级,且无法探索非网站根域名触达页面的技术问题。与现有技术相比,本申请提供的网站内容获取设备的有益效果与上述实施例提供的网站内容获取方法的有益效果相同,且该网站内容获取设备中的其他技术特征与上一实施例方法公开的特征相同,在此不做赘述。

[0161] 应当理解,本申请公开的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式的描述中,具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。

[0162] 以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

[0163] 本申请提供一种计算机可读存储介质,具有存储在其上的计算机可读程序指令(即计算机程序),计算机可读程序指令用于执行上述实施例中的网站内容获取方法。

[0164] 本申请提供的计算机可读存储介质例如可以是U盘,但不限于电、磁、光、电磁、红外线、或半导体的系统、系统或器件,或者任意以上的组合。计算机可读存储介质的更具体地例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM:Random Access Memory)、只读存储器(ROM:Read Only Memory)、可擦式可编程只读存储器(EPROM:Erasable Programmable Read Only Memory或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM:CD-Read Only Memory)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、系统或者器件使用或者与其结合使用。计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(Radio Frequency:射频)等等,或者上述的任意合适的组合。

[0165] 上述计算机可读存储介质可以是网站内容获取设备中所包含的;也可以是单独存在,而未装配入网站内容获取设备中。

[0166] 上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被网站内容获取设备执行时,使得网站内容获取设备:基于流计算框架,从分布式消息队列获取网站用户访问日志,并存储到Hbase数据库;对所述网站用户访问日志进行离线数据分析,得到第一网站页面链接;基于所述第一网站页面链接,获取第一网站内容。

[0167] 可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如"C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN:Local Area Network)或广域网(WAN:Wide Area Network)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。

[0168] 附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和 / 或流程图中的每个方框、以及框图和 / 或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。

[0169] 描述于本申请实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该单元本身的限定。

[0170] 本申请提供的可读存储介质为计算机可读存储介质,所述计算机可读存储介质存储有用于执行上述网站内容获取方法的计算机可读程序指令(即计算机程序),能够解决现有爬虫工具存在着无法触达网站的纵向最深层级,且无法探索非网站根域名触达页面的技术问题。与现有技术相比,本申请提供的计算机可读存储介质的有益效果与上述实施例提供的网站内容获取方法的有益效果相同,在此不做赘述。

[0171] 本申请实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述的网站内容获取方法的步骤。

[0172] 本申请提供的计算机程序产品能够解决现有爬虫工具存在着无法触达网站的纵向最深层级,且无法探索非网站根域名触达页面的技术问题。与现有技术相比,本申请实施例提供的计算机程序产品的有益效果与上述实施例提供的网站内容获取方法的有益效果相同,在此不做赘述。

[0173] 以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利处理范围内。< / script>

Claims

1. A method for obtaining website content, characterized in that: The method comprises: Based on the stream computing framework, website user access logs are obtained from the distributed message queue and stored in the Hbase database; Performing offline data analysis on the website user access log to obtain a first website page link; Based on the first website page link, the first website content is obtained.

2. The method according to claim 1, characterized in that The step of performing offline data analysis on the website user access log to obtain the first website page link includes: Obtaining a first website user access log from the Hbase database; Performing data preprocessing on the first website user access log to obtain a second website user access log; Performing data analysis on the user access log of the second website to obtain page access links of several related websites; The page access links of the several related websites are aggregated to obtain the first website page link.

3. The method according to claim 1, characterized in that The method further comprises: Establish a timed task mechanism according to preset time intervals; Based on the timed task mechanism, reacquire the website page link to obtain the second website page link; Determining incremental website page links based on the first website page link and the second website page link; Based on the incremental website page link, obtaining incremental website content; The incremental website content and the first website content are aggregated to obtain the second website content.

4. The method according to any one of claims 1 to 3, characterized in that The step of acquiring the first website content based on the first website page link includes: Based on the first website page link, obtaining corresponding page content; Convert the page content into HTML and obtain a static resource access link; Based on the static resource access link, obtain the corresponding static resource content; The page content and the static resource content are aggregated to obtain the first website content.

5. The method according to claim 3, characterized in that After the step of aggregating the incremental website content and the first website content to obtain the second website content, the method further includes: Based on the content of the second website, obtaining the object to be screened by regular matching according to preset matching characters; Based on the Hbase database and the MySQL database, a paging table of mapping relationships between the objects to be screened and the website page links is established and stored.

6. The method according to claim 5, characterized in that The step of establishing and storing a mapping relationship paging table between the objects to be screened and the website page links based on the Hbase database and the MySQL database includes: Encrypting and deduplicating the object to be screened to obtain a unique identifier of the object to be screened; According to the correspondence between the unique identifier of the object to be screened and the object to be screened, a first relationship table is established and stored in the MySQL database; Based on the unique identifier of the object to be screened, and according to the corresponding relationship between the object to be screened and the website page link, a second relationship table is established and stored in the Hbase database; Based on the first relationship table and the second relationship table, a mapping relationship paging table between the objects to be screened and the website page links is obtained.

7. The method according to claim 5, characterized in that After the step of establishing and storing a mapping relationship paging table between the objects to be screened and the website page links based on the Hbase database and the MySQL database, the method further includes: Based on the mapping relationship paging table, sensitive information of the screening object is screened according to the preset information review mechanism to determine suspected sensitive objects.

8. A website content acquisition device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the website content acquisition method according to any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the website content acquisition method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the website content acquisition method according to any one of claims 1 to 7 are implemented.