WO2013087012A1 - 一种网络数据的采集方法和系统 - Google Patents

一种网络数据的采集方法和系统 Download PDF

Info

Publication number
WO2013087012A1
WO2013087012A1 PCT/CN2012/086584 CN2012086584W WO2013087012A1 WO 2013087012 A1 WO2013087012 A1 WO 2013087012A1 CN 2012086584 W CN2012086584 W CN 2012086584W WO 2013087012 A1 WO2013087012 A1 WO 2013087012A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
url
webpage
link address
chapter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2012/086584
Other languages
English (en)
French (fr)
Inventor
吴新丽
杨建武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Original Assignee
Peking University
Peking University Founder Group Co Ltd
Beijing Founder Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Peking University, Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University
Priority to JP2014532241A priority Critical patent/JP5823620B2/ja
Priority to EP12857177.5A priority patent/EP2793143A4/en
Priority to US14/123,036 priority patent/US9525605B2/en
Publication of WO2013087012A1 publication Critical patent/WO2013087012A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/06Generation of reports
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Definitions

  • the invention belongs to the technical field of information retrieval and data integration, and in particular relates to a method and system for collecting network data. Background technique
  • Internet literature refers to newly-created literary works, literary texts and online art works containing a part of literary composition, which are represented by hypertext links and multimedia deductions, using the Internet as a platform and medium of communication. Among them, the original works of the network are the main ones. Online literature can be divided into three categories: one is to form digital resources by means of electronic scanning technology or manual input; the first is literary works that are "published” directly on the Internet; Computer creation or literary works generated by computer software enters the Internet, as well as the "relay novel" with the openness of the Internet, dozens of writers and even hundreds of netizens. The second category is mostly in the form.
  • the invention provides a network data collection method and system, which can collect the latest network data in real time.
  • the method of the present invention provides a method for collecting network data, which is used for collecting data of a network document respectively associated with M topics posted on a website, where M is a positive integer, and the method includes: Configuring a webpage link address of the network data to be collected, and configuring a webpage link address of the network data to be collected into a queue of a corresponding type, where the webpage link address of the network data to be collected is a link address of a webpage where the data of the network document related to the M topics are respectively located; obtaining a network of the network data to be collected in the queue of the corresponding type a webpage source code corresponding to the page link address; a uniform resource locator URL information corresponding to the webpage source code and
  • the set depth value of the URL extracts data of the network document corresponding to the URL.
  • the refresh time interval is set according to an update frequency of the network document respectively related to the M topics, and the webpage link address of the network data to be collected is refreshed based on the refresh time interval.
  • each of the M topics is a network literature
  • the method further includes: configuring a depth value of the URL according to the structure of the network literature, specifically:
  • the type corresponding to the webpage link address of the network data to be collected includes a topic name page, a list page, and a content page, and the theme name page is configured to extract a topic name; and the list page is configured to extract a topic. Chapter catalog or topic section; Configuring the content page for extracting topic body content.
  • the configuring the webpage link address of the network data to be collected into the queue of the corresponding type specifically: adding a link address of the type name page to the topic name page queue; The link address of the list page is added to the list page queue; the link address of the type of the content page is added to the content page queue.
  • the webpage source code corresponding to the webpage link address of the network data to be collected in the queue of the corresponding type is specifically: acquiring the link of the topic name page in the topic name page queue The source code of the web page corresponding to the address.
  • the extracting the data of the network document corresponding to the URL according to the URL information corresponding to the webpage source code and the collected depth value of the URL specifically: if the set depth value is the first threshold, then extracting a name of the theme and a URL corresponding to the name, and the set depth value of the URL corresponding to the name is marked as a second threshold and added to the list page queue; if the set depth value is the second threshold, The name of the topic and the URL corresponding to the name are extracted, and the set depth value of the URL corresponding to the name is marked as a third threshold, and then added to the list page queue.
  • the webpage source code corresponding to the webpage link address of the network data to be collected in the queue of the corresponding type is specifically: acquiring the link address of the list page in the list page queue Web page source code.
  • the extracting, according to the URL information corresponding to the webpage source code and the collected depth value of the URL, the data of the network document corresponding to the URL is: if the set depth value is a second threshold, extracting a topic The chapter directory and the URL corresponding to the chapter directory, and mark the depth value of the URL corresponding to the chapter directory as the third The threshold value is added to the list page queue; if the set depth value is the third threshold, it is determined whether the URL corresponding to the webpage source code has a superior URL: if yes, the chapter title of the topic is extracted and the chapter title corresponds to a URL of the chapter, and adding the URL of the chapter to the content page queue; if not, extracting the name of the topic, the chapter title of the topic, and the URL of the chapter corresponding to the chapter title, and the URL of the chapter Join the content page queue.
  • the webpage source code corresponding to the webpage link address of the webpage data to be collected in the queue of the corresponding type is specifically: acquiring the link address of the contentpage in the contentpage queue Web page source code.
  • the extracting the data of the web document corresponding to the URL according to the URL information corresponding to the webpage source code and the collected depth value of the URL is: extracting a chapter title of the topic from the webpage source code, a chapter body content, and extracting a chapter ID of a chapter corresponding to the chapter title from a URL corresponding to the webpage source code.
  • the first page link of the chapter body content is a unique key value
  • the content of the page is stored
  • the end tag is given when the last page is collected.
  • Another aspect of the present invention provides a system for collecting network data, which is used for collecting data of a network document respectively associated with M topics posted on a website, where M is a positive integer, and the system includes a configuration module, Configuring a webpage link address of the network data to be collected according to the type corresponding to the webpage link address of the network data to be collected, and configuring the webpage link address of the network data to be collected as a webpage source code of the webpage link address of the webpage data of the corresponding type of the webpage And a data extraction module, configured to extract data of the network document corresponding to the URL according to the uniform resource locator URL information corresponding to the webpage source code and the collected depth value of the URL.
  • the system further includes a refreshing module, configured to: according to the website, publish an update frequency of the network document respectively related to the M topics, set a refresh time interval, and refresh the to-be-set based on the refresh time interval.
  • the web page link address of the network data is not limited to: publishing an update frequency of the network document respectively related to the M topics, set a refresh time interval, and refresh the to-be-set based on the refresh time interval.
  • the type corresponding to the webpage link address of the network data to be collected includes a topic name page, a list page, and a content page
  • the configuration module includes a webpage configuration module, configured to configure the topic name page for extracting a topic.
  • Name, configuration The list page is used to extract a topic chapter directory or topic chapter and configure the content page for extracting topic content.
  • the configuration module further includes a queue configuration module, configured to configure a webpage link address of the network data to be collected into a queue of a corresponding type, where the queue allocation module includes: a first allocation unit, configured to: Assigning a link address of the type name page to the topic name page queue; a second allocation unit, configured to assign a link address of the type of the list page to the list page queue; A link address of the type of the content page is assigned to the content page queue.
  • a queue configuration module configured to configure a webpage link address of the network data to be collected into a queue of a corresponding type
  • the queue allocation module includes: a first allocation unit, configured to: Assigning a link address of the type name page to the topic name page queue; a second allocation unit, configured to assign a link address of the type of the list page to the list page queue; A link address of the type of the content page is assigned to the content page queue.
  • a network data collection system is used to collect network data.
  • the system acquires a link address of the network data and then configures the type of the link address, and places the link address into the corresponding queue according to the type of the link address.
  • the source code corresponding to the link address is obtained from the queue, and the information of the network data is extracted according to the corresponding URL information in the source code and the collected depth value of the URL, thereby achieving the technical effect of collecting network data in real time.
  • the content merge module is also used, and the network documents belonging to the same topic can be merged, so that the convenient centralized browsing effect can be achieved on the basis of collecting network data in real time.
  • FIG. 1 is a flowchart of a method for collecting a set according to an embodiment of the present invention
  • FIG. 2 is a detailed flowchart of the method for collecting the data in FIG. 1 according to the present invention
  • FIG. 3 is a structural diagram of a collection system according to a first embodiment of the present invention.
  • FIG. 4 is a structural diagram of a configuration module in an embodiment of the present invention.
  • FIG. 5 is a structural diagram of a webpage obtaining module according to an embodiment of the present invention.
  • FIG. 6 is a structural diagram of a data extraction module according to an embodiment of the present invention.
  • FIG. 7 is a structural diagram of a collection system according to a second embodiment of the present invention.
  • FIG. 8 is a structural diagram of a collection system according to a third embodiment of the present invention.
  • FIG. 9 is a structural diagram of a collection system according to a fourth embodiment of the present invention. detailed description
  • FIG. 1 is a method for collecting network data, which is used for collecting and publishing on a website.
  • FIG. 1 is a flowchart of the method for collecting the data in the embodiment. As shown in Figure 1, the method of collecting data includes:
  • Step 11 Configuring a webpage link address of the network data to be collected according to the type of the webpage link address of the network data to be collected, to the queue of the corresponding type, and the webpage link address of the network data to be collected For the place The link address of the webpage where the data of the web document related to the M topics are respectively located;
  • Step 12 Obtain a webpage source code corresponding to a webpage link address of the network data to be collected in the queue of the corresponding type;
  • Step 13 Extract data of the network document corresponding to the URL according to the Uniform Resource Locator (URL) information corresponding to the webpage source code and the collected depth value of the URL.
  • URL Uniform Resource Locator
  • the M topics published on the website may be M part network literature works.
  • Web literature has a publishing structure that is different from topics such as web news.
  • General online news is single-page, and online literary works are generally presented in two forms on the website.
  • One is similar to the "literature name -> chapter directory page of the novel reading website -> a specific chapter of the network literature content page", some online literature will also exist in the "chapter directory page” before the "volume” Concept; the other is a content directory page similar to a general news website.
  • the chapters of different literary works are interspersed together, but will be marked in the same title as "literary work name (5), Different chapters in the work.
  • the link address of the web page where the data of the network document is located In this embodiment, according to the structure published by the network literary works on the website, the data of the network document generally includes the name of the network literary work to which the network document belongs, the name of the volume and/or chapter of the network literary work to which the network document belongs, and the network.
  • the body content of the document Correspondingly, the type of the link address of the webpage where the data of the network document is located includes: a topic name page, which is used to extract the name of the network literature belonging to the network document; a list page, a chapter directory link and a chapter for extracting the network literature work. Link, where the chapter directory includes the volume catalog and chapter catalog of the network literature; the content page is used to extract the subject text content.
  • the link addresses of the web pages where the data of the M network literatures are located are respectively placed in different queues according to their types. Specifically, a link address of the type of the title page is assigned to the topic name page queue; a link address of the type of the list page is assigned to the list page queue; and a link address of the type of the content page is assigned to the content page queue.
  • a link address of the type of the title page is assigned to the topic name page queue
  • a link address of the type of the list page is assigned to the list page queue
  • a link address of the type of the content page is assigned to the content page queue.
  • there are three online literary works published on the A website namely Al, A2, and A3.
  • the publication structure of A1 on website A is: literature name -> volume directory -> chapter directory -> specific chapter of the network literature content page;
  • A2 publication structure on website A is: literature name -> Chapter directory->Specific chapter of the network literature content page;
  • A3's publication structure on the website A is: Chapter name->Specific chapter of the network literature content page,
  • A3 chapter name is A3
  • the combination of the name of the work and the number of chapters, for example, the chapter name of the first chapter of A3 is: A3 (-);
  • the chapter name of Chapter 5 of A3 is A3 (5).
  • the link address B 1 of the web page having the name of the A1 work is placed in the topic name page queue; the link address B2 of the web page having the name of the A2 work is placed in the topic In the name page queue; the address B3 of the chapter link with the A3 work is placed in the list page queue waiting to be collected.
  • the timing refresh strategy can be used.
  • the adaptive refresh strategy can also be used.
  • the website automatically publishes the frequency of different network literature works to automatically adjust the refresh interval. When it is detected that the network literary works has reached the refresh interval time, the refreshed webpage link address of the network data to be collected is put into the queue of its corresponding type.
  • the webpage source code corresponding to the webpage link address of the network data to be collected in each queue is specifically a URL acquisition policy according to a system setting, for example, according to system operation conditions or queues.
  • the personnel can set the URL acquisition policy according to the time requirement, obtain a link address to be collected from each queue, and then the system obtains the source code of the webpage through the Http request.
  • the webpage link addresses B1 and B2 of the network data to be collected extracted from the topic name page queue are set according to the system.
  • the predetermined URL acquisition strategy respectively obtains the webpage source code corresponding to B1 and the webpage source code corresponding to B2; extracts the webpage link address B3 of the network data to be collected from the list page queue, and acquires the webpage link address according to the URL acquisition policy set by the system. Web page source code.
  • the URL information corresponding to the webpage source code includes a network literary work name, a chapter directory, a chapter link, and a link to the body content.
  • the depth value of the URL is configured according to the structure of the network literature, specifically:
  • N ft ⁇ second threshold, indicating that the structure of the work is "name ⁇ chapter ⁇ content"
  • the third threshold indicates that the structure of the work is "Chapter ⁇ Content"
  • the first threshold is 3, the second threshold is 2, and the third threshold is 1.
  • the first threshold value is 3, the second threshold value is 2, and the third threshold value is 1.
  • the depth value of the network configuration according to the structure of the network literature can be understood in conjunction with Al, A2, and A3 posted on the website A.
  • the corresponding URL ie, URL-A1
  • the structure of A1 is "literature name->volume directory->chapter directory->specific
  • the structure of A2 is "literature name -> chapter directory -> a specific chapter of the network literature content page, then the collection of the URL corresponding to the source code according to B2 (ie URL-A2)
  • the depth value is 2
  • the structure of A3 is "chapter name -> specific part of the network literature content page”, then the depth value of the URL corresponding to the source code (ie URL-A3) obtained according to B3 is 3.
  • Step 13 specifically includes: (Please refer to Figure 2)
  • Step 131 Extract the data of the network document corresponding to the URL according to the URL information corresponding to the webpage source code corresponding to the link address of the topic name page obtained from the topic name page queue and the URL collection depth value.
  • Step 132 Corresponding to the webpage source code corresponding to the link address of the list page obtained from the list page queue
  • the URL information and the URL collect the depth value, and extract the data of the network document corresponding to the URL.
  • Step 133 Extract the chapter title and the chapter body content of the topic from the source code of the webpage according to the URL corresponding to the webpage source code corresponding to the link address of the content page obtained from the content page queue, and from the URL corresponding to the source code of the webpage.
  • the chapter ID of the chapter corresponding to the chapter title is extracted.
  • the foregoing steps 131, 132, and 133 are not limited in order of implementation.
  • the link addresses of the collections can be collected to obtain the network data to be collected.
  • the webpage source code corresponding to the webpage link address is used to extract the data of the web document corresponding to the URL according to the URL information corresponding to the webpage source code and the URL depth value. The process of extracting the network document data in each step will be described in detail below.
  • step 131 the data of the network document corresponding to the extracted URL is specifically:
  • the depth of the URL is 3, the name of the topic and the URL corresponding to the name are extracted, and the depth value of the URL corresponding to the name is marked as the second threshold and then added to the queue of the list page;
  • the depth of the URL is 2
  • the name of the topic and the URL corresponding to the name are extracted, and the depth of the URL corresponding to the name is marked as 1 and added to the list page queue.
  • the link address extracted from the topic name page queue is the link address B 1 of A1 and the link address B2 of A2. Since the depth of the URL-A1 corresponding to the source code of B1 is 3, the topic name of A1 should be extracted and represented by "name A1". You should also extract the URL corresponding to "name A1", denoted by "URL-A11", and mark the depth value of "URL-A11” as 2 and add it to the list page queue to extract the URL-A11 belonging to the work. Additional information for A1. For the link address B2, since the depth of the URL-A2 is 2, the topic name of A2 should be extracted and represented by "name A2". You should also extract the URL corresponding to "name A2", denoted by "URL-A21", and mark the depth value of "URL-A21” as 1 and add it to the list page queue to extract the work belonging to URL-A21. Additional information for A2.
  • step 132 the network document data corresponding to the extracted URL is specifically:
  • the depth of the URL is 2, the chapter directory of the topic and the URL corresponding to the chapter directory are extracted, and the depth value of the URL corresponding to the chapter directory is marked as 1 and added to the queue of the list page;
  • the name of the topic, the chapter title of the topic, and the URL of the chapter corresponding to the chapter title are extracted, and the URL of the chapter is added to the content page queue.
  • the URL-A11 and the to-be-collected have been stored in the list page queue after step 131 URL-A2L
  • the link address B3 corresponding to the work A3 has been placed in the list page queue.
  • URL-A11 For URL-A11, if the set depth value is 2, the chapter directory of A1 and the URL corresponding to the chapter directory are extracted, which is represented by "URL-A12". Mark the URL depth value of URL-A12 as 1 and add it to the list page queue.
  • the set depth value is 1 and it has the upper URL (and URL-A21), so the chapter title of A2 and the URL of the chapter corresponding to the chapter title are extracted, represented by "URL-A22", and the URL is -A22 is added to the content page queue.
  • step 133 if the chapter body has a page break, it is necessary to extract the link address of the next page, and simultaneously mark the page number of the current page and the page number of the next page and add the link address of the next page to the content page queue for waiting. set.
  • the first page link of the chapter body content is a unique key value, and the content of the page is stored, and the end mark is given when the last page is collected.
  • the website, the name of the theme, the chapter title of the theme, the chapter ID, and the chapter body content are uploaded to the database.
  • the chapter body content can also be stored as an attachment to the file server and the path of the stored file is recorded in the database.
  • the method for collecting and merging network data can make the network literature appear in the form of a book. Further, the real-time data collection can be realized by automatically refreshing the collected data, so this embodiment Get the benefits of real-time, convenient, and centralized browsing of online literature.
  • a first embodiment of the present invention provides a system for collecting network data, which is used to collect data of network documents respectively associated with M topics posted on a website, where M is a positive integer, please refer to FIG. FIG. 3 is a structural diagram of the collection system in the embodiment.
  • the system for collecting data includes a configuration module 31, a webpage obtaining module 32, and a data extracting module 33.
  • the configuration module 31 is configured to configure, according to the type corresponding to the webpage link address of the network data to be collected, the webpage link address of the network data to be collected into the queue of the corresponding type, and the webpage link address of the network data to be collected.
  • the link address of the web page where the data of the web document related to the M topics are respectively located.
  • the webpage obtaining module 32 is configured to obtain a webpage source code corresponding to a webpage link address of the network data to be collected in the corresponding type of queue.
  • the data extraction module 33 is configured to extract data of the network document corresponding to the URL according to the URL information corresponding to the webpage source code and the collected depth value of the URL.
  • the type corresponding to the webpage link address of the network data to be collected includes a theme name page, a list page, and a content page.
  • the configuration module 31 includes a webpage configuration module 311 for configuring a topic name page for extracting a topic name, a configuration list page for extracting a topic chapter directory or a topic chapter, and a configuration content page for extracting topic content.
  • the configuration module 31 further includes a queue configuration module 312, configured to configure a webpage link address of the network data to be collected into a queue of a corresponding type.
  • the queue allocation module 312 further includes: a first allocating unit 3121, configured to allocate a link address of the type of the topic name page into the topic name page queue; and a second allocating unit 3122, configured to allocate the link address of the type of the list page.
  • the third allocation unit 3123 is configured to allocate a link address of the type of the content page into the content page queue.
  • the webpage obtaining module 32 includes: a first obtaining unit 321 configured to obtain a webpage source code corresponding to a link address of the topic name page in the topic name page queue.
  • the second obtaining unit 322 is configured to obtain a webpage source code corresponding to the link address of the list page in the list page queue.
  • the third obtaining unit 323 is configured to obtain a webpage source code corresponding to the link address of the content page in the content page queue. Please refer to Figure 5.
  • the data extraction module 33 further includes: a first extraction unit 331, configured to: when the depth value of the URL corresponding to the URL of the webpage source code is the first threshold, extract the name of the theme and the URL corresponding to the name, and name the name The set depth value of the corresponding URL is marked as the second threshold and then sent to the second allocation unit 3122.
  • the second extracting unit 332 is configured to: when the depth value of the URL corresponding to the URL of the webpage source code is a second threshold, extract the URL corresponding to the name and the name of the topic, and mark the depth value of the URL corresponding to the URL as the third threshold. It is sent to the second distribution unit 3122.
  • the third extracting unit 333 is configured to: when the depth value of the webpage source code corresponding URL is a second threshold, extract the chapter directory of the topic and the URL of the chapter directory, and mark the set depth value of the URL of the chapter directory as the first The three thresholds are then sent to the second allocation unit 3122.
  • the fourth extracting unit 334 is configured to determine whether the URL corresponding to the source code of the webpage has a superior URL, and when the determination result is yes, extract the URL of the chapter title and the chapter corresponding to the chapter title, and send the URL of the chapter to the third.
  • the fifth extracting unit 335 is configured to extract a chapter title and a chapter body content of the topic from the webpage source code, and extract a chapter ID of the chapter corresponding to the chapter title from the URL corresponding to the webpage source code.
  • the page determining unit 336 is configured to determine whether the chapter body content has a page break; when the chapter body content has a page break, the fifth extracting unit 335 is further configured to extract the link address of the next page and simultaneously mark the page number of the current page and the next page. The page number is sent to the third allocation unit 3123.
  • the page storage unit 337 is used to store the content of the page by the first page link of the chapter body content, and to give the end mark when the last page is collected. Please refer to Figure 6.
  • the system further includes a refresh module 34 for And publishing an update frequency of the network document respectively related to the M topics, setting a refresh time interval, and refreshing the webpage link address of the network data to be collected based on the refresh time interval. Please refer to FIG. 7 for this embodiment.
  • the system further includes a content merge module 35 for combining the extracted body contents of all the pages and outputting them in conjunction with the chapter titles. Please refer to FIG. 8 for this embodiment.
  • the refreshing module in the second embodiment can also be used for the collection work.
  • the system used in combination will not be described in detail.
  • the system further includes a first data storage module 36 for using the website, the name of the theme, the chapter title of the theme, the chapter ID, and the chapter.
  • the body content is uploaded to the database.
  • a second data storage module 37 configured to: when the chapter body content may occupy more database space, select the database to upload the website, the name of the topic, the chapter title of the topic, the chapter ID, and the storage path of the chapter body content into the database,
  • the chapter body content storage path refers to the path of storing the chapter body content as an attachment to the file server. Please refer to FIG. 9 for this embodiment.
  • the refreshing module in the second embodiment can also be used for the collection work.
  • the system used in combination is not described in detail.
  • the systems of the first, second, third and fourth embodiments described above can be implemented in accordance with an embodiment of the network data collection method provided by the present invention and a description thereof. This is for the cleaning of the instructions, so it will not be detailed.
  • a network data collection system is used to collect network data.
  • the system acquires a link address of the network data and then configures the type of the link address, and places the link address into the corresponding queue according to the type of the link address.
  • the source code corresponding to the link address is obtained from the queue, and the information of the network data is extracted according to the corresponding URL information in the source code and the collected depth value of the URL, thereby achieving the technical effect of collecting network data in real time.
  • the content merge module is also used, and the network documents belonging to the same topic can be merged, so that the convenient centralized browsing effect can be achieved on the basis of collecting network data in real time.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the present invention can be embodied in the form of a computer program product embodied on one or more computer-usable storage interfaces (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
  • computer-usable storage interfaces including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种网络数据的釆集方法和系统。该方法用于釆集发布于网站上的与M个主题分别相关的网络文档的数据,其中M为正整数,所述方法包括:根据待釆集的网络数据的网页链接地址所对应的类型,将所述待釆集的网络数据的网页链接地址配置到对应类型的队列中,所述待釆集的网络数据的网页链接地址为与所述M个主题分别相关的网络文档的数据所在网页的链接地址;获取所述对应类型的队列中的所述待釆集的网络数据的网页链接地址对应的网页源代码;根据所述网页源代码对应的URL信息及所述URL的釆集深度值抽取所述URL对应的网络文档的数据。

Description

一种网络数据的采集方法和系统 本申请要求在 2011年 12月 13日提交中国专利局、 申请号为 201110415356.8、 发明名 称为"一种网络数据的釆集方法和系统"的中国专利申请的优先权, 其全部内容通过引用结 合在本申请中。 技术领域
本发明属于信息检索和数据集成技术领域, 尤其涉及一种网络数据的釆集方法和系 统。 背景技术
随着互联网的出现及普及,互联网络为上亿网民提供了各类文学资料信息,与此同时, 一种以这种新兴媒体为载体、 以网民为接受对象, 具有不同于传统文学特点的网络文学正 悄然勃兴。
网络文学, 指新近产生的, 以互联网为展示平台和传播媒介的, 借助超文本连接和多 媒体演绎等手段来表现的文学作品、 类文学文本及含有一部分文学成分的网络艺术品。 其 中, 以网络原创作品为主。 网络文学可以分为三类: 一类是将已发表的文学作品经过电子 扫描技术或人工录入等方式形成数字资源; 一类是直接在互联网络上"发表"的文学作品; 还有一类是通过计算机创作或通过有关计算机软件生成的文学作品进入互联网络, 以及具 有互联网络开放性特点、 几位作家几十位作家甚至数百位网民共同创作的 "接力小说 "等。 其中第二类的形式居多。
伴随网络文学的发展, 由此产生的版权问题、 文学创作内容问题等各种问题也朴面而 来。 如何便捷集中的浏览网络文学的最新内容, 如何实现对网络文学的检索或监管。 由于 没有网络文学相关数据的支撑, 这些问题目前还得不到有效的解决。 发明内容
本发明提供一种网络数据釆集方法和系统, 能够实时釆集最新的网络数据。
本发明方法一方面提供了一种网络数据釆集的方法,用于釆集发布于网站上的与 M个 主题分别相关的网络文档的数据, 其中 M为正整数, 所述方法包括: 根据待釆集的网络数 据的网页链接地址所对应的类型, 将所述待釆集的网络数据的网页链接地址配置到对应类 型的队列中,所述待釆集的网络数据的网页链接地址为与所述 M个主题分别相关的网络文 档的数据所在网页的链接地址; 获取所述对应类型的队列中的所述待釆集的网络数据的网 页链接地址对应的网页源代码; 根据所述网页源代码对应的统一资源定位符 URL信息及
URL的釆集深度值抽取所述 URL对应的网络文档的数据。
优选地,根据所述网站发布与所述 M个主题分别相关的网络文档的更新频率设置刷新 时间间隔; 以及基于所述刷新时间间隔刷新所述待釆集的网络数据的网页链接地址。
优选地, 所述 M个主题中每个主题为一部网络文学, 所述方法还包括: 根据所述网络 文学的结构配置所述 URL的釆集深度值, 具体为:
【第 值 表示作品結构为 "名称卷 ··素 Ψ―内容"
- 1第二與植, 表示伟 ¾結翁为 .S 拿 ;
I第三闻值 表 .^作品結抅为 "素节― 容
优选地, 所述待釆集的网络数据的网页链接地址对应的类型包括主题名称页、 列表页 和内容页, 配置所述主题名称页用于提取主题名称; 配置所述列表页用于提取主题章节目 录或主题章节; 配置所述内容页用于提取主题正文内容。
优选地, 所述将所述待釆集的网络数据的网页链接地址配置到对应类型的队列中, 具 体包括: 将类型为所述主题名称页的链接地址加入到主题名称页队列中; 将类型为所述列 表页的链接地址加入到列表页队列中; 将类型为所述内容页的链接地址加入到内容页队列 中。
优选地, 所述获取所述对应类型的队列中的所述待釆集的网络数据的网页链接地址对 应的网页源代码具体为: 在所述主题名称页队列中获取所述主题名称页的链接地址对应的 网页源代码。
优选地, 所述根据所述网页源代码对应的 URL信息及所述 URL的釆集深度值抽取所 述 URL对应的网络文档的数据, 具体为: 若釆集深度值为第一阈值, 则抽取主题的名称 及所述名称对应的 URL, 并将所述名称对应的 URL的釆集深度值标记为第二阈值后加入 到所述列表页队列中; 若釆集深度值为第二阈值, 则抽取主题的名称及所述名称对应的 URL, 并将所述名称对应的 URL的釆集深度值标记为第三阈值后加入到所述列表页队列 中。
优选地, 所述获取所述对应类型的队列中的所述待釆集的网络数据的网页链接地址对 应的网页源代码具体为: 在所述列表页队列中获取所述列表页的链接地址对应的网页源代 码。
优选地, 所述根据所述网页源代码对应的 URL信息及所述 URL的釆集深度值抽取所 述 URL对应的网络文档的数据具体为: 若釆集深度值为第二阈值, 则抽取主题的章节目 录及所述章节目录对应的 URL, 并将所述章节目录对应的 URL的釆集深度值标记为第三 阈值后加入到所述列表页队列中; 若釆集深度值为第三阈值, 则判断所述网页源代码对应 的 URL是否存在上级 URL: 若是, 则抽取主题的章节标题及所述章节标题对应章节的 URL, 并将所述章节的 URL加入到所述内容页队列中; 若否, 则抽取主题的名称、 主题 的章节标题及所述章节标题对应章节的 URL, 并将所述章节的 URL加入到所述内容页队 列中。
优选地, 所述获取所述对应类型的队列中的所述待釆集的网络数据的网页链接地址对 应的网页源代码具体为: 在所述内容页队列中获取所述内容页的链接地址对应的网页源代 码。
优选地, 所述根据所述网页源代码对应的 URL信息及所述 URL的釆集深度值抽取所 述 URL对应的网络文档的数据具体为: 从所述网页源代码中抽取主题的章节标题、 章节 正文内容, 并从所述网页源代码对应的 URL中抽取所述章节标题对应章节的章节 ID。
优选地, 判断所述章节正文内容是否存在分页: 若是, 则提取下一页的链接地址, 并 同时标记当前页的页码以及下一页的页码并将下一页的链接地址加入到所述内容页队列 中等待釆集。
优选地, 以所述章节正文内容的第一页链接为唯一键值, 存放所述分页的内容, 当釆 集到最后一页时给予结束标识。
优选地, 将抽取出的所有分页的正文内容合并到一起, 结合所述章节标题进行输出。 本发明另一方面提供一种网络数据釆集的系统,用于釆集发布于网站上的与 M个主题 分别相关的网络文档的数据, 其中 M为正整数, 所述系统包括配置模块, 用于根据待釆集 的网络数据的网页链接地址所对应的类型, 将待釆集的网络数据的网页链接地址配置到对 应类型的队列中,所述待釆集的网络数据的网页链接地址为与所述 M个主题分别相关的网 络文档的数据所在网页的链接地址; 网页获取模块, 用于获取所述对应类型的队列中的所 述待釆集的网络数据的网页链接地址对应的网页源代码; 数据抽取模块, 用于根据所述网 页源代码对应的统一资源定位符 URL信息及 URL的釆集深度值抽取所述 URL对应的网 络文档的数据。
优选地, 所述系统还包括刷新模块, 用于根据所述网站发布与所述 M个主题分别相关 的网络文档的更新频率, 设置刷新时间间隔并基于所述刷新时间间隔刷新所述待釆集的网 络数据的网页链接地址。
优选地, 所述待釆集的网络数据的网页链接地址对应的类型包括主题名称页、 列表页 和内容页,所述配置模块包括网页配置模块,用于配置所述主题名称页用于提取主题名称、 配置所述列表页用于提取主题章节目录或主题章节及配置所述内容页用于提取主题内容。 优选地, 所述配置模块还包括队列配置模块, 用于将所述待釆集的网络数据的网页链 接地址配置到对应类型的队列中, 所述队列分配模块包括: 第一分配单元, 用于将类型为 所述主题名称页的链接地址分配到主题名称页队列中; 第二分配单元, 用于将类型为所述 列表页的链接地址分配到列表页队列中; 第三分配单元, 用于将类型为所述内容页的链接 地址分配到内容页队列中。
本发明有益效果如下:
本发明一实施例釆用一网络数据釆集系统釆集网络数据, 系统获取网络数据的链接地 址然后配置链接地址的类型, 并根据链接地址的类型将链接地址放入对应的队列中。 从队 列中获取链接地址对应的源代码, 根据源代码中对应的 URL信息及 URL的釆集深度值提 取网络数据的信息, 从而达到实时釆集网络数据的技术效果。
进一步, 还釆用了内容合并模块, 可以对属于同一主题的网络文档进行合并, 所以可 以在实时釆集网络数据的基础上达到便捷集中浏览的效果。 附图说明
图 1为本发明一实施例中的釆集方法的流程图;
图 2为本发明图 1中釆集方法的详细流程图;
图 3为本发明第一实施例的釆集系统架构图;
图 4为本发明一实施例中的配置模块的架构图;
图 5为本发明一实施例中的网页获取模块的架构图;
图 6为本发明一实施例中的数据抽取模块的架构图;
图 7为本发明第二实施例的釆集系统架构图;
图 8为本发明第三实施例的釆集系统架构图;
图 9为本发明第四实施例的釆集系统架构图。 具体实施方式
为让本领域所属技术人员更清楚, 更完整理解本发明, 下面结合附图作详细介绍: 本发明一实施例提供了一种网络数据釆集的方法,用于釆集发布于一网站上的与 M个 主题分别相关的网络文档的数据, 其中 M为正整数, 请参考图 1 , 图 1为本实施例中的釆 集方法的流程图。 如图 1所示, 釆集数据的方法包括:
步骤 11: 根据待釆集的网络数据的网页链接地址所对应的类型, 将待釆集的网络数据 的网页链接地址配置到对应类型的队列中, 所述待釆集的网络数据的网页链接地址为与所 述 M个主题分别相关的网络文档的数据所在网页的链接地址;
步骤 12:获取所述对应类型的队列中的所述待釆集的网络数据的网页链接地址对应的 网页源代码;
步骤 13: 根据所述网页源代码对应的统一资源定位符 (Uniform Resource Locator, URL )信息及所述 URL的釆集深度值抽取所述 URL对应的网络文档的数据。
在步骤 11中, 网站上所发布的 M个主题可以为 M部网络文学作品, 为方便理解本发 明, 以下实施例以网络文学为例, 但并不限于网络文学。 网络文学具有不同于例如网络新 闻等主题的发布结构。 一般的网络新闻都是单篇的, 而网络文学作品发表在网站上一般有 2种形式呈现。 一种是类似于小说阅读网站的 "文学名称- >章节目录页- >具体的某一章节 的网络文学内容页", 有的网络文学还会在 "章节目录页" 前存在 "卷" 的概念; 另外一 种则是类似普通新闻网站的内容目录网页, 不同文学作品的章节会穿插在一起呈现, 但会 在标题中以类似 "文学作品名称(5 ),, 的形式来标明是同一个作品中的不同章节。
对不同结构的网络文学作品的网络文档的数据进行釆集, 应先获取网络文档的数据所 在网页的链接地址。 在本实施例中, 根据网络文学作品在网站上发布的结构, 网络文档的 数据一般包括网络文档所属的网络文学作品的名称、 网络文档所属的网络文学作品中卷及 /或章节的名称、 网络文档的正文内容。 相应地, 网络文档的数据所在的网页的链接地址对 应的类型包括: 主题名称页, 用于提取网络文档所属的网络文学作品的名称; 列表页, 用 于提取网络文学作品的章节目录链接和章节链接, 其中, 章节目录包括网络文学的卷目录 和章目录; 内容页, 用于提取主题正文内容。
在本实施例中,将 M个网络文学的数据所在的网页的链接地址根据其类型分别放入不 同队列中。 具体地, 将类型为主题名称页的链接地址分配到主题名称页队列中; 将类型为 列表页的链接地址分配到列表页队列中; 将类型为内容页的链接地址分配到内容页队列 中。 例如 A网站上发布有三部网络文学作品, 分别为 Al、 A2、 A3。 其中, A1在网站 A 上的发表结构为: 文学名称- >卷目录 ->章目录 ->具体的某一章节的网络文学内容页; A2在 网站 A上的发表结构为: 文学名称- >章目录 ->具体的某一章节的网络文学内容页; A3在 网站 A上的发表结构为: 章名称 ->具体的某一章节的网络文学内容页, A3 的章名称即为 A3的作品名称与章数的结合, 例如 A3的第一章的章名称是: A3 (—); A3的第五章的章 名称是 A3 (五)。 在针对网站 A进行的一次釆集过程起始时, 将具有 A1作品的名称的网 页的链接地址 B 1放入主题名称页队列中; 将具有 A2作品的名称的网页的链接地址 B2放 入主题名称页队列中;将具有 A3作品的章节链接的地址 B3放入列表页队列中等待被釆集。 而内容页队列在釆集起始时, 并不会有待釆集的链接地址放入。 在实际的釆集过程中, 由于网络文档会定时更新但更新频率不会像网络新闻和论坛信 息那样快速, 故可以釆用定时刷新的策略, 当然也可以釆用自适应刷新的策略, 即根据网 站自身发布不同网络文学作品的频率自动调整刷新间隔。 当检测到有网络文学作品到了其 刷新间隔时间, 则将刷新的待釆集的网络数据的网页链接地址放入到其对应类型的队列 中。
在步骤 12 中, 获取各个队列中的待釆集的网络数据的网页链接地址对应的网页源代 码具体为根据系统设定的 URL获取策略, 例如根据系统运行情况或者各队列的情况, 本 领域技术人员在实际操作时可根据时间需要设定 URL 的获取策略, 从各个队列中获取一 个待釆集的链接地址, 然后系统通过 Http请求的方式获取网页源代码。 在本实施例中, 例 如针对网站 A上的三部网络文学作品的釆集起始时,从主题名称页队列中提取的待釆集的 网络数据的网页链接地址 B 1、 B2, 根据系统设定的 URL获取策略分别获取 B 1对应的网 页源代码和 B2对应的网页源代码; 从列表页队列中提取待釆集的网络数据的网页链接地 址 B3并根据系统设定的 URL获取策略获取其网页源代码。
在步骤 13中, 网页源代码对应的 URL信息包括网络文学作品名称、 章节目录及章节 链接、 正文内容的链接。 URL的釆集深度值根据网络文学作品的结构配置, 具体为:
'第一阈值, 表示作品结构为 "名称→卷→章节→内容"]
Nft^ = 第二阈值, 表示作品结构为 "名称→章节→内容"
第三阈值, 表示作品结构为 "章节→内容"
在本实施例中, 第一阈值为 3 , 第二阈值为 2, 第三阈值为 1 , 当然本领域技术人员也 可以釆用其他数值或标记来标示不同的阈值, 为方便说明本发明, 以下以第一阈值为 3、 第二阈值为 2、 第三阈值为 1进行举例说明, 按照网络文学作品的结构配置的釆集深度值 可以结合网站 A上发布的 Al、 A2、 A3进行理解。 当从主题名称页队列中获取链接地址 B1后, 根据 B1对应的源代码获取对应的 URL (即 URL-A1 ), 而 A1的结构为 "文学名称 ->卷目录 ->章目录 ->具体的某一章节的网络文学内容页",则 URL-A1的釆集深度值应为 3。 同理, A2的结构为 "文学名称- >章目录 ->具体的某一章节的网络文学内容页,,, 则根据 B2 得到的源代码所对应的 URL (即 URL-A2 )的釆集深度值为 2; A3的结构为 "章名称- >具 体的某一章节的网络文学内容页", 则根据 B3得到的源代码所对应的 URL (即 URL-A3 ) 的釆集深度值为 3。
步骤 13具体包括: (请参考图 2 )
步骤 131 : 根据从主题名称页队列中获取的主题名称页的链接地址对应的网页源代码 所对应的 URL信息及 URL釆集深度值, 抽取 URL对应的网络文档的数据。 步骤 132: 根据从列表页队列中获取的列表页的链接地址对应的网页源代码所对应的
URL信息及 URL釆集深度值, 抽取 URL对应的网络文档的数据。
步骤 133: 根据从内容页队列中获取的内容页的链接地址对应的网页源代码所对应的 URL, 从网页源代码中抽取主题的章节标题、 章节正文内容, 并从网页源代码对应的 URL 中抽取所述章节标题对应章节的章节 ID。
上述步骤 131、 132、 133在实现时没有先后顺序的限制, 只要当各个队列中有需要待 釆集的链接地址时, 就可以对待釆集的链接地址进行釆集, 获取待釆集的网络数据的网页 链接地址对应的网页源代码并根据网页源代码对应的 URL信息及 URL 釆集深度值抽取 URL对应的网络文档的数据, 下面将详细说明各步骤中对网络文档数据进行抽取的过程。
在步骤 131中, 抽取 URL对应的网络文档的数据具体为:
若 URL的釆集深度值为 3 , 则抽取主题的名称及该名称对应的 URL, 并将该名称对 应的 URL的釆集深度值标记为第二阈值后加入到列表页队列中;
若 URL的釆集深度值为 2, 则抽取主题的名称及该名称对应的 URL, 并将该名称对 应的 URL的釆集深度标记为 1后加入到列表页队列中。
在本实施例中, 从主题名称页队列中提取的链接地址为 A1的链接地址 B 1及 A2的链 接地址 B2。 因 B1对应源代码所对应的 URL-A1的釆集深度值为 3 , 则应抽取 A1的主题 名称, 用 "名称 A1" 表示。 还应抽取 "名称 A1" 对应的 URL, 用 "URL-A11" 表示, 并 将 "URL-A11" 的釆集深度值标记为 2后加入到列表页队列中, 以便抽取 URL-A11 中属 于作品 A1的其他信息。 而对于链接地址 B2, 因 URL-A2的釆集深度值为 2, 故应抽取 A2 的主题名称, 用 "名称 A2" 表示。 还应抽取 "名称 A2" 对应的 URL, 用 "URL-A21" 表 示, 并将 "URL-A21" 的釆集深度值标记为 1后加入到列表页队列中, 以便抽取 URL-A21 中属于作品 A2的其他信息。
在步骤 132中, 抽取 URL对应的网络文档数据具体为:
若 URL的釆集深度值为 2, 则抽取主题的章节目录及章节目录对应的 URL, 并将章 节目录对应的 URL的釆集深度值标记为 1后加入到列表页队列中;
若 URL的釆集深度值为 1 , 则判断网页源代码对应的 URL是否存在上级 URL:
若是, 则抽取主题的章节标题及章节标题对应章节的 URL, 并将章节的 URL加入到 内容页队列中;
若否, 则抽取主题的名称、 主题的章节标题及章节标题对应章节的 URL, 并将章节的 URL加入到内容页队列中。
在本实施例中, 列表页队列中在经过步骤 131 后已存放了待釆集的 URL-A11 和 URL-A2L 另外, 在针对网站 Al 的网络文学作品釆集的起始时, 已经将作品 A3对应的 链接地址 B3放入列表页队列中。
对于 URL-A11,其釆集深度值为 2 , 则抽取 A1的章节目录及章节目录对应的 URL, 用 "URL-A12" 表示。 将 URL-A12的釆集深度值标记为 1后加入到列表页队列中。
对于 URL-A21 , 其釆集深度值为 1且其存有上级 URL (及 URL-A21 ),故抽取 A2的 章节标题及章节标题对应章节的 URL, 用 "URL-A22" 表示, 并将 URL-A22加入到内容 页队列中。
对于列表页队列中的 B3 , 因为 B3对应源代码所对应的 URL-A3的釆集深度值为 1且 不具有上级 URL, 故抽取 A3的名称, 用 "名称 A3"表示、 章节标题, 还应抽取章节标题 对应章节的 URL, 用 "URL-A31" 表示并将 URL-A31加入到内容页队列中。
在步骤 133中, 若章节正文存在分页, 则需要提取下一页的链接地址, 并同时标记当 前页的页码以及下一页的页码并将下一页的链接地址加入到内容页队列中等待釆集。
进而, 以章节正文内容的第一页链接为唯一键值, 存放分页的内容, 当釆集到最后一 页时给予结束标识。
进一步地, 还可以将抽取出的所有分页的正文内容合并到一起, 结合章节标题进行输 出。
再进一步地, 将网站、 主题的名称、 主题的章节标题、 章节 ID、 章节正文内容上载到 数据库中。 其中, 也可以将章节正文内容以附件的形式存储到文件服务器并将存放文件的 路径记录到数据库中。
在本实施例中, 对网络数据的釆集和合并的方法可以使得网络文学以一本书的形式展 现, 进一步地, 釆用自动刷新釆集数据可以实现数据的实时釆集, 所以本实施例可以获得 实时、 便捷、 集中浏览网络文学作品的有益效果。
本发明第一实施例提供了一种网络数据釆集的系统, 用于釆集发布于一网站上的与 M 个主题分别相关的网络文档的数据, 其中 M为正整数, 请参考图 3 , 图 3为本实施例中的 釆集系统的架构图。 如图 3所示, 釆集数据的系统包括配置模块 31、 网页获取模块 32、 数据抽取模块 33。配置模块 31用于根据待釆集的网络数据的网页链接地址所对应的类型, 将待釆集的网络数据的网页链接地址配置到对应类型的队列中, 待釆集的网络数据的网页 链接地址为与 M个主题分别相关的网络文档的数据所在网页的链接地址。
网页获取模块 32 用于获取对应类型的队列中的待釆集的网络数据的网页链接地址对 应的网页源代码。 数据抽取模块 33用于根据网页源代码对应的 URL信息及 URL的釆集 深度值抽取 URL对应的网络文档的数据。 本实施例中, 待釆集的网络数据的网页链接地址对应的类型包括主题名称页、 列表页 和内容页。 请参考图 4, 配置模块 31包括网页配置模块 311 , 用于配置主题名称页用于提 取主题名称、 配置列表页用于提取主题章节目录或主题章节及配置内容页用于提取主题内 容。
请继续参考图 4, 配置模块 31还包括队列配置模块 312, 用于将所述待釆集的网络数 据的网页链接地址配置到对应类型的队列中。 队列分配模块 312还包括包括: 第一分配单 元 3121 , 用于将类型为主题名称页的链接地址分配到主题名称页队列中; 第二分配单元 3122, 用于将类型为列表页的链接地址分配到列表页队列中; 第三分配单元 3123 , 用于将 类型为内容页的链接地址分配到内容页队列中。
本实施例中, 网页获取模块 32包括: 第一获取单元 321 , 用于在主题名称页队列中获 取主题名称页的链接地址对应的网页源代码。 第二获取单元 322, 用于在列表页队列中获 取列表页的链接地址对应的网页源代码。 第三获取单元 323 , 用于在内容页队列中获取内 容页的链接地址对应的网页源代码。 请参考图 5。
本实施例中, 数据抽取模块 33还包括: 第一抽取单元 331 , 用于当网页源代码对应 URL的釆集深度值为第一阈值时,抽取主题的名称及名称对应的 URL,并将名称对应 URL 的釆集深度值标记为第二阈值后发送到第二分配单元 3122中。 第二抽取单元 332, 用于当 网页源代码对应 URL的釆集深度值为第二阈值, 抽取主题的名称及名称对应的 URL, 并 将名称对应 URL的釆集深度值标记为第三阈值后发送到第二分配单元 3122中。 第三抽取 单元 333 , 用于当网页源代码对应 URL的釆集深度值为第二阈值, 则抽取主题的章节目录 及章节目录的 URL, 并将章节目录的 URL的釆集深度值标记为第三阈值后发送到第二分 配单元 3122中。第四抽取单元 334,用于判断网页源代码对应的 URL是否存在上级 URL, 并当判断结果为是时,抽取主题的章节标题及章节标题对应章节的 URL,并将章节的 URL 发送到第三分配单元 3123中, 当判断结果为否时, 抽取主题的名称、 章节标题及章节标 题对应章节的 URL, 并将章节的 URL发送到第三分配单元 3123中。 第五抽取单元 335 , 用于从网页源代码中抽取主题的章节标题、 章节正文内容, 并从网页源代码对应的 URL 中抽取章节标题对应章节的章节 ID。 分页判断单元 336, 用于判断章节正文内容是否存在 分页; 当章节正文内容存在分页时, 第五抽取单元 335还用于提取下一页的链接地址并同 时标记当前页的页码以及下一页的页码并将下一页的链接地址发送到第三分配单元 3123 中。 分页存放单元 337, 用于以章节正文内容的第一页链接为唯一键值, 存放分页的内容, 并当釆集到最后一页时给予结束标识。 请参考图 6。
在第二实施例中, 与第一实施例不同的是系统还包括刷新模块 34, 用于根据所述网站 发布与所述 M个主题分别相关的网络文档的更新频率,设置刷新时间间隔并基于所述刷新 时间间隔刷新所述待釆集的网络数据的网页链接地址。 本实施例请参考图 7。
在第三实施例中, 与第一、 第二实施例不同的是系统还包括内容合并模块 35 , 用于将 抽取出的所有分页的正文内容合并到一起, 并结合章节标题进行输出。 本实施例请参考图 8。
在实施例中也可以结合第二实施例中的刷新模块进行釆集工作, 为了说明书的筒洁, 本处不再对结合使用的系统进行详细的介绍。
在第四实施例中, 与第一、 第二、 第三实施例都不同的是系统还包括第一数据存储模 块 36, 用于将网站、 主题的名称、 主题的章节标题、 章节 ID、 章节正文内容上载到数据 库中。 第二数据存储模块 37, 用于当章节正文内容可能占用较多数据库空间时, 选择该数 据库将网站、 主题的名称、 主题的章节标题、 章节 ID、 章节正文内容的存放路径上载到数 据库中, 其中, 章节正文内容存放路径是指将章节正文内容以附件的形式存储到文件服务 器的路径。 本实施例请参考图 9。
在本实施例中也可以结合第二实施例中的刷新模块进行釆集工作, 为了说明书的筒 洁, 本处不再对结合使用的系统进行详细的介绍。
上述第一、 第二、 第三及第四实施例中的系统可以根据本发明提供的一种网络数据釆 集方法的实施例中对方法及其各种变化形式的描述进行实施。 本处为了说明书的筒洁, 所 以不再详述。
本发明一实施例釆用一网络数据釆集系统釆集网络数据, 系统获取网络数据的链接地 址然后配置链接地址的类型, 并根据链接地址的类型将链接地址放入对应的队列中。 从队 列中获取链接地址对应的源代码, 根据源代码中对应的 URL信息及 URL的釆集深度值提 取网络数据的信息, 从而达到实时釆集网络数据的技术效果。 进一步, 还釆用了内容合并 模块, 可以对属于同一主题的网络文档进行合并, 所以可以在实时釆集网络数据的基础上 达到便捷集中浏览的效果。
本领域内的技术人员应明白, 本发明的实施例可提供为方法、 系统、 或计算机程序产 品。 因此, 本发明可釆用完全硬件实施例、 完全软件实施例、 或结合软件和硬件方面的实 施例的形式。 而且, 本发明可釆用在一个或多个其中包含有计算机可用程序代码的计算机 可用存储介盾 (包括但不限于磁盘存储器、 CD-ROM、 光学存储器等)上实施的计算机程 序产品的形式。
本发明是参照根据本发明实施例的方法、 设备(系统)、 和计算机程序产品的流程图 和 /或方框图来描述的。 应理解可由计算机程序指令实现流程图和 /或方框图中的每一流 程和 /或方框、 以及流程图和 /或方框图中的流程和 /或方框的结合。 可提供这些计算机 程序指令到通用计算机、 专用计算机、 嵌入式处理机或其他可编程数据处理设备的处理器 以产生一个机器, 使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用 于实现在流程图一个流程或多个流程和 /或方框图一个方框或多个方框中指定的功能的 装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方 式工作的计算机可读存储器中, 使得存储在该计算机可读存储器中的指令产生包括指令装 置的制造品, 该指令装置实现在流程图一个流程或多个流程和 /或方框图一个方框或多个 方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上, 使得在计算机 或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理, 从而在计算机或其他 可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和 /或方框图一个 方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例, 但本领域内的技术人员一旦得知了基本创造性概 念, 则可对这些实施例作出另外的变更和修改。 所以, 所附权利要求意欲解释为包括优选 实施例以及落入本发明范围的所有变更和修改。
显然, 本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实 施例的精神和范围。 这样, 倘若本发明实施例的这些修改和变型属于本发明权利要求及其 等同技术的范围之内, 则本发明也意图包含这些改动和变型在内。

Claims

1、 一种网络数据釆集的方法, 用于釆集发布于网站上的与 M个主题分别相关的网络 文档的数据, 其中 M为正整数, 其特征在于, 所述方法包括:
根据待釆集的网络数据的网页链接地址所对应的类型, 将所述待釆集的网络数据的网 页链接地址配置到对应类型的队列中, 所述待釆集的网络数据的网页链接地址为与所述 M 个主题分别相关的网络文档的数据所在网页的链接地址;
获取所述对应类型的队列中的所述待釆集的网络数据的网页链接地址对应的网页源 代码;
根据所述网页源代码对应的统一资源定位符 URL信息及 URL的釆集深度值抽取所述 URL对应的网络文档的数据。
2、 如权利要求 1所述的方法, 其特征在于, 所述方法还包括:
根据所述网站发布与所述 M个主题分别相关的网络文档的更新频率,设置刷新时间间 隔; 以及
基于所述刷新时间间隔刷新所述待釆集的网络数据的网页链接地址。
3、 如权利要求 1所述的方法, 其特征在于, 所述 M个主题中每个主题为一部网络文 学, 所述方法还包括: 根据所述网络文学的结构配置所述 URL的釆集深度值, 具体为:
第一阈值, 表示作品结构为 "名称→卷→章节→内容"]
NDeep = 第二阈值, 表示作品结构为 "名称→章节→内容"
第三阈值, 表示作品结构为 "章节→内容"
4、 如权利要求 1所述的方法, 其特征在于, 所述待釆集的网络数据的网页链接地址 对应的类型包括主题名称页、 列表页和内容页, 配置所述主题名称页用于提取主题名称; 配置所述列表页用于提取主题章节目录或主题章节; 配置所述内容页用于提取主题正文内 容。
5、 如权利要求 4所述的方法, 其特征在于, 所述将所述待釆集的网络数据的网页链 接地址配置到对应类型的队列中, 具体包括:
将类型为所述主题名称页的链接地址分配到主题名称页队列中;
将类型为所述列表页的链接地址分配到列表页队列中;
将类型为所述内容页的链接地址分配到内容页队列中。
6、 如权利要求 5所述的方法, 其特征在于, 所述获取所述对应类型的队列中的所述 待釆集的网络数据的网页链接地址对应的网页源代码具体为: 在所述主题名称页队列中获取所述主题名称页的链接地址对应的网页源代码。
7、 如权利要求 6所述的方法, 其特征在于, 所述根据所述网页源代码对应的 URL信 息及所述 URL的釆集深度值抽取所述 URL对应的网络文档的数据, 具体为:
若釆集深度值为第一阈值, 则抽取主题的名称及所述名称对应的 URL, 并将所述名称 对应的 URL的釆集深度值标记为第二阈值后加入到所述列表页队列中;
若釆集深度值为第二阈值, 则抽取主题的名称及所述名称对应的 URL, 并将所述名称 对应的 URL的釆集深度值标记为第三阈值后加入到所述列表页队列中。
8、 如权利要求 5所述的方法, 其特征在于, 所述获取所述对应类型的队列中的所述 待釆集的网络数据的网页链接地址对应的网页源代码具体为:
在所述列表页队列中获取所述列表页的链接地址对应的网页源代码。
9、 如权利要求 8所述的方法, 其特征在于, 所述根据所述网页源代码对应的 URL信 息及所述 URL的釆集深度值抽取所述 URL对应的网络文档的数据具体为:
若釆集深度值为第二阈值, 则抽取主题的章节目录及所述章节目录对应的 URL, 并将 所述章节目录对应的 URL的釆集深度值标记为第三阈值后加入到所述列表页队列中; 若釆集深度值为第三阈值, 则判断所述网页源代码对应的 URL是否存在上级 URL: 若是,则抽取主题的章节标题及所述章节标题对应章节的 URL,并将所述章节的 URL 加入到所述内容页队列中;
若否, 则抽取主题的名称、 主题的章节标题及所述章节标题对应章节的 URL, 并将所 述章节的 URL加入到所述内容页队列中。
10、 如权利要求 5所述的方法, 其特征在于, 所述获取所述对应类型的队列中的所述 待釆集的网络数据的网页链接地址对应的网页源代码具体为:
在所述内容页队列中获取所述内容页的链接地址对应的网页源代码。
11、 如权利要求 10所述的方法, 其特征在于, 所述根据所述网页源代码对应的 URL 信息及所述 URL的釆集深度值抽取所述 URL对应的网络文档的数据具体为:
从所述网页源代码中抽取主题的章节标题、 章节正文内容, 并从所述网页源代码对应 的 URL中抽取所述章节标题对应章节的章节 ID。
12、 如权利要求 11所述的方法, 其特征在于, 所述方法还包括:
当所述章节正文内容存在分页时, 提取下一页的链接地址, 并同时标记当前页的页码 以及下一页的页码并将下一页的链接地址加入到所述内容页队列中等待釆集。
13、 如权利要求 12所述的方法, 其特征在于, 所述方法还包括:
以所述章节正文内容的第一页链接为唯一键值, 存放所述分页的内容, 当釆集到最后 一页时给予结束标识。
14、 如权利要求 13所述的方法, 其特征在于, 所述方法还包括:
将抽取出的所有分页的正文内容合并到一起, 结合所述章节标题进行输出。
15、一种网络数据釆集的系统, 用于釆集发布于网站上的与 M个主题分别相关的网络 文档的数据, 其中 M为正整数, 其特征在于, 所述系统包括:
配置模块, 用于根据待釆集的网络数据的网页链接地址所对应的类型, 将待釆集的网 络数据的网页链接地址配置到对应类型的队列中, 所述待釆集的网络数据的网页链接地址 为与所述 M个主题分别相关的网络文档的数据所在网页的链接地址;
网页获取模块, 用于获取所述对应类型的队列中的所述待釆集的网络数据的网页链接 地址对应的网页源代码;
数据抽取模块, 用于根据所述网页源代码对应的统一资源定位符 URL信息及 URL的 釆集深度值抽取所述 URL对应的网络文档的数据。
16、 如权利要求 15 所述的系统, 其特征在于, 所述系统还包括: 刷新模块, 用于根 据所述网站发布与所述 M个主题分别相关的网络文档的更新频率,设置刷新时间间隔并基 于所述刷新时间间隔刷新所述待釆集的网络数据的网页链接地址。
17、 如权利要求 15所述的系统, 其特征在于, 所述待釆集的网络数据的网页链接地 址对应的类型包括主题名称页、 列表页和内容页, 所述配置模块包括: 网页配置模块, 用 于配置所述主题名称页用于提取主题名称、 配置所述列表页用于提取主题章节目录或主题 章节及配置所述内容页用于提取主题内容。
18、 如权利要求 17所述的系统, 其特征在于, 所述配置模块还包括: 队列配置模块, 用于将所述待釆集的网络数据的网页链接地址配置到对应类型的队列中, 所述队列分配模 块包括:
第一分配单元, 用于将类型为所述主题名称页的链接地址分配到主题名称页队列中; 第二分配单元, 用于将类型为所述列表页的链接地址分配到列表页队列中; 第三分配单元, 用于将类型为所述内容页的链接地址分配到内容页队列中。
PCT/CN2012/086584 2011-12-13 2012-12-13 一种网络数据的采集方法和系统 Ceased WO2013087012A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2014532241A JP5823620B2 (ja) 2011-12-13 2012-12-13 ネットデータの採集方法及びシステム
EP12857177.5A EP2793143A4 (en) 2011-12-13 2012-12-13 METHOD AND SYSTEM FOR COLLECTING NETWORK DATA
US14/123,036 US9525605B2 (en) 2011-12-13 2012-12-13 Method of and system for collecting network data

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110415356.8 2011-12-13
CN201110415356.8A CN103164435B (zh) 2011-12-13 2011-12-13 一种网络数据的采集方法和系统

Publications (1)

Publication Number Publication Date
WO2013087012A1 true WO2013087012A1 (zh) 2013-06-20

Family

ID=48587529

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/086584 Ceased WO2013087012A1 (zh) 2011-12-13 2012-12-13 一种网络数据的采集方法和系统

Country Status (5)

Country Link
US (1) US9525605B2 (zh)
EP (1) EP2793143A4 (zh)
JP (1) JP5823620B2 (zh)
CN (1) CN103164435B (zh)
WO (1) WO2013087012A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110297994A (zh) * 2019-06-03 2019-10-01 北京金蝶管理软件有限公司 网页数据的采集方法、装置、计算机设备和存储介质

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9596313B2 (en) * 2013-04-12 2017-03-14 Tencent Technology (Shenzhen) Company Limited Method, terminal, cache server and system for updating webpage data
CN104426900B (zh) * 2013-09-11 2019-12-06 腾讯科技(深圳)有限公司 一种多媒体数据采集方法和系统
CN104065741B (zh) * 2014-07-04 2018-06-19 用友网络科技股份有限公司 数据采集系统和数据采集方法
CN105630942B (zh) * 2015-12-23 2019-05-21 北京奇虎科技有限公司 电子书更新章节的调度方法和装置
CN106919722A (zh) * 2017-04-28 2017-07-04 暴风集团股份有限公司 一种用于体育赛事的网络数据获取方法和系统
CN109067853B (zh) * 2018-07-16 2021-07-30 郑州云海信息技术有限公司 一种Web动态网页源码自动化尝试获取方法
CN109376327B (zh) * 2018-10-10 2021-09-21 北京北信源信息安全技术有限公司 一种网站url的管理方法
CN109543086B (zh) * 2018-11-23 2022-11-22 北京信息科技大学 一种面向多数据源的网络数据采集与展示方法
CN109670099A (zh) * 2018-12-21 2019-04-23 全通教育集团(广东)股份有限公司 基于教育网络信息主题采集方法
GB2583771B (en) * 2019-05-10 2022-06-15 Samsung Electronics Co Ltd Improvements in and relating to data analytics in a telecommunication network
CN111858476A (zh) * 2020-07-20 2020-10-30 上海闻泰电子科技有限公司 文件处理方法、装置、电子设备和计算机可读存储介质
CN112035723A (zh) * 2020-08-28 2020-12-04 光大科技有限公司 资源库的确定方法和装置、存储介质及电子装置
CN113569181B (zh) * 2021-07-29 2024-12-20 山东亿云信息技术有限公司 一种分页数据采集方法及系统
CN115017430B (zh) * 2022-06-27 2024-10-18 京东科技控股股份有限公司 列表页面的确定方法、装置、电子设备及存储介质
CN115827942A (zh) * 2022-11-25 2023-03-21 四川文化产业职业学院 基于Ajax的新闻网页动态数据的抓取方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094135A (zh) * 2006-06-23 2007-12-26 腾讯科技(深圳)有限公司 一种互联网内容信息的提取方法和提取系统
CN101136026A (zh) * 2007-05-15 2008-03-05 北京聚生科技有限公司 一种基于xmlhttp组件技术的网页内容采集方法
CN101593200A (zh) * 2009-06-19 2009-12-02 淮海工学院 基于关键词频度分析的中文网页分类方法
CN102118400A (zh) * 2009-12-31 2011-07-06 北京四维图新科技股份有限公司 数据采集方法和数据采集系统

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6292796B1 (en) * 1999-02-23 2001-09-18 Clinical Focus, Inc. Method and apparatus for improving access to literature
US7275061B1 (en) * 2000-04-13 2007-09-25 Indraweb.Com, Inc. Systems and methods for employing an orthogonal corpus for document indexing
US6718363B1 (en) * 1999-07-30 2004-04-06 Verizon Laboratories, Inc. Page aggregation for web sites
US6665665B1 (en) * 1999-07-30 2003-12-16 Verizon Laboratories Inc. Compressed document surrogates
US6757866B1 (en) * 1999-10-29 2004-06-29 Verizon Laboratories Inc. Hyper video: information retrieval using text from multimedia
FR2807537B1 (fr) * 2000-04-06 2003-10-17 France Telecom Moteur de recherche de ressources hypermedia et procede d'indexation associe
US6912525B1 (en) * 2000-05-08 2005-06-28 Verizon Laboratories, Inc. Techniques for web site integration
US7013323B1 (en) * 2000-05-23 2006-03-14 Cyveillance, Inc. System and method for developing and interpreting e-commerce metrics by utilizing a list of rules wherein each rule contain at least one of entity-specific criteria
US7080073B1 (en) * 2000-08-18 2006-07-18 Firstrain, Inc. Method and apparatus for focused crawling
US7330850B1 (en) * 2000-10-04 2008-02-12 Reachforce, Inc. Text mining system for web-based business intelligence applied to web site server logs
JP2004118415A (ja) * 2002-09-25 2004-04-15 Fujitsu Ltd 情報収集方法及びその方法における処理をコンピュータに行なわせるためのプログラム
JP4350001B2 (ja) * 2004-08-17 2009-10-21 富士通株式会社 ページ情報収集プログラム、ページ情報収集方法、及びページ情報収集装置
JP4718205B2 (ja) * 2005-02-22 2011-07-06 三菱電機株式会社 選択的Web情報収集装置
CN101178713A (zh) * 2006-11-29 2008-05-14 腾讯科技(深圳)有限公司 一种采集网页的方法及系统
WO2010041517A1 (ja) * 2008-10-08 2010-04-15 インターナショナル・ビジネス・マシーンズ・コーポレーション 情報収集装置、検索エンジン、情報収集方法およびプログラム
US8140526B1 (en) * 2009-03-16 2012-03-20 Guangsheng Zhang System and methods for ranking documents based on content characteristics
US8229873B1 (en) * 2009-09-18 2012-07-24 Google Inc. News topic-interest-based recommendations twiddling
US8650195B2 (en) * 2010-03-26 2014-02-11 Palle M Pedersen Region based information retrieval system
JP5063729B2 (ja) * 2010-03-31 2012-10-31 ヤフー株式会社 クローラ管理システム及び方法
US20140108445A1 (en) * 2011-05-05 2014-04-17 Google Inc. System and Method for Personalizing Query Suggestions Based on User Interest Profile
US8538949B2 (en) * 2011-06-17 2013-09-17 Microsoft Corporation Interactive web crawler

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094135A (zh) * 2006-06-23 2007-12-26 腾讯科技(深圳)有限公司 一种互联网内容信息的提取方法和提取系统
CN101136026A (zh) * 2007-05-15 2008-03-05 北京聚生科技有限公司 一种基于xmlhttp组件技术的网页内容采集方法
CN101593200A (zh) * 2009-06-19 2009-12-02 淮海工学院 基于关键词频度分析的中文网页分类方法
CN102118400A (zh) * 2009-12-31 2011-07-06 北京四维图新科技股份有限公司 数据采集方法和数据采集系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2793143A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110297994A (zh) * 2019-06-03 2019-10-01 北京金蝶管理软件有限公司 网页数据的采集方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
US9525605B2 (en) 2016-12-20
JP2014528136A (ja) 2014-10-23
US20140289394A1 (en) 2014-09-25
JP5823620B2 (ja) 2015-11-25
EP2793143A1 (en) 2014-10-22
CN103164435A (zh) 2013-06-19
EP2793143A4 (en) 2015-08-12
CN103164435B (zh) 2016-03-09

Similar Documents

Publication Publication Date Title
WO2013087012A1 (zh) 一种网络数据的采集方法和系统
CN102708174B (zh) 一种浏览器中的富媒体信息的展示方法和装置
WO2013097632A1 (zh) 一种信息发布方法及装置
CN103531218B (zh) 一种在线多媒体文件编辑方法及系统
CN104572870B (zh) 提供文档在线阅读的方法和装置以及系统
CN103034722B (zh) 一种网络视频评论聚合装置及方法
WO2015021199A1 (en) Access and management of entity-augmented content
JP2010536075A5 (zh)
CN106372113A (zh) 新闻内容的推送方法及系统
CN105138557B (zh) 一种音乐随机播放方法和装置
CN105095211A (zh) 多媒体数据的获取方法和装置
WO2017107620A1 (zh) 一种页面数据的加载方法和系统
CN106033428A (zh) 统一资源定位符的选择方法和统一资源定位符的选择装置
WO2012083870A9 (zh) 一种论坛回帖增量采集方法及系统
CN104504006A (zh) 对新闻客户端的数据采集及解析的方法及系统
WO2014108040A1 (zh) 在电子设备上呈现内容的方法和装置
CN103034655B (zh) 一种用户行为信息的收集方法、系统及相关设备
CN102118400B (zh) 数据采集方法和数据采集系统
CN102629265A (zh) 一种建立网页数据库的方法及系统
CN104536972B (zh) 基于cdn的网页内容感知系统及方法
CN102819613B (zh) Rss信息分页抓取系统及方法
CN103164438B (zh) 一种网络评论的采集方法及系统
JP2014142738A (ja) 管理方法、管理装置および管理プログラム
CN103020195A (zh) 文件浏览方法及装置
CN104113464A (zh) 基于即时通讯提示的交互方法、装置和系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12857177

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14123036

Country of ref document: US

ENP Entry into the national phase

Ref document number: 2014532241

Country of ref document: JP

Kind code of ref document: A

REEP Request for entry into the european phase

Ref document number: 2012857177

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE