Dynamically scalable distributed crawler system, data processing method and device

By designing a dynamically scalable distributed crawler system, we solve the problems of high coupling and insufficient throughput of the existing crawler system, achieve low coupling and efficient data processing of the system, and improve development efficiency and system performance.

CN112650570BActive Publication Date: 2024-09-20BIGO TECH PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011598949.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-29
Publication Date
2024-09-20
Estimated Expiration
2040-12-29

AI Technical Summary

Technical Problem

The existing crawler system is highly coupled, inconvenient to expand, and cannot effectively handle a large number of rich media files. The system throughput is insufficient and development efficiency is low.

Method used

A dynamically scalable distributed crawler system is designed. Through the crawler task configuration unit, distributed crawler processing unit, crawler result queue unit and big data processing unit, the dynamic configuration and allocation of tasks is realized, the system coupling is reduced, and multiple Thread processing and message queue caching improve system scalability and throughput.

Benefits of technology

It achieves low coupling and easy scalability of the system, avoids memory leaks, improves development efficiency and system throughput, and can effectively process and store large amounts of rich media data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112650570B
    Figure CN112650570B
Patent Text Reader

Abstract

The embodiment of the present application discloses a dynamically scalable distributed crawler system, a data processing method and a device. The technical solution provided by the embodiment of the present application optimizes the system, isolates the crawler task configuration and the condition configuration in the crawler task configuration, lists the crawler tasks with different task information in different task queues when executing the crawler task, and executes the crawler tasks of the task queues non-stop by multiple threads; by reducing the coupling degree within the system, improving the dynamic scalability performance, avoiding memory leaks, greatly improving the development efficiency, and improving the throughput of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of data crawler technology, and in particular to a dynamically scalable distributed crawler system, a data processing method, a data processing apparatus, a data processing device, and a storage medium. Background Art

[0002] With the rapid popularization of domestic smartphones and the rapid development of mobile networks, people can enjoy a variety of information flows, especially a group of apps headed by short videos are very popular. How to dig deep into the commercial value brought by short videos and bring monetization value to the company's business has become a hot topic. To obtain these media content, you need to rely on crawler technology, so developing a powerful crawler system is the foundation of all these businesses.

[0003] Currently, short video content comes from different platforms, and the crawling methods are different, and the tools used are also diverse. At present, there is no unified standard for crawler systems in the industry. The system is highly coupled and not easy to expand. When adding third-party tools, the changes are large, which will bring additional workload. On the other hand, after the video and other content are obtained, these rich media contents are often large and cannot be processed in the same way as ordinary text. At present, the crawler systems in the industry are all modules responsible for crawling, and cannot handle a large number of rich media files. Summary of the invention

[0004] The embodiments of the present application provide a dynamically scalable distributed crawler system, data processing method, device, equipment and storage medium to achieve the effect of low coupling and easy expansion of the system.

[0005] In a first aspect, an embodiment of the present application provides a dynamically scalable distributed crawler system, comprising a crawler task configuration unit, a distributed crawler processing unit, a crawler result queue unit, and a big data processing unit connected in sequence;

[0006] The crawler task configuration unit is used for users to configure crawler tasks and crawling content limitation conditions, and the crawler task includes task information; the distributed crawler processing unit is used to receive crawler tasks, and assign the crawler tasks to the crawler task queue corresponding to the task information according to the task information of the crawler tasks, obtain crawler tasks from multiple crawler task queues respectively, and obtain target resources according to the crawling content limitation conditions corresponding to the crawler tasks; the crawler result queue unit is used to receive the target resources and cache the target resources; the big data processing unit is used to read the target resources from the crawler result queue unit, and execute the target resource processing action according to the target resources to obtain the target data corresponding to the target resources and store the target data.

[0007] In a second aspect, an embodiment of the present application provides a data processing method based on a distributed crawler, comprising:

[0008] Receiving a crawler task and crawling content limiting conditions configured by a user, wherein the crawler task includes task information;

[0009] According to the task information of the crawler task, the crawler task is assigned to the crawler task queue corresponding to the task information;

[0010] Obtain a crawler task from the crawler task queue and obtain target resources according to the crawling content restriction conditions of the crawler task;

[0011] A target resource processing action is performed according to the target resource to obtain target data corresponding to the target resource, and the target data is stored.

[0012] In a third aspect, an embodiment of the present application provides a data processing device based on a distributed crawler, comprising:

[0013] Task receiving module: used to receive crawler tasks and crawling content limiting conditions configured by users, wherein the crawler tasks include task information;

[0014] Task allocation module: used to allocate the crawler task to the crawler task queue corresponding to the task information according to the task information of the crawler task;

[0015] Result acquisition module: used to obtain crawler tasks from the crawler task queue and obtain target resources according to the crawling content restriction conditions of the crawler task;

[0016] The data transmission module is used to execute the target resource processing action according to the target resource to obtain the target data corresponding to the target resource and store the target data. In a fourth aspect, the embodiment of the present application provides a data processing device, including: a memory and one or more processors;

[0017] The memory is used to store one or more programs;

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method based on the distributed crawler as described in the first aspect.

[0019] In a fourth aspect, an embodiment of the present application provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute the distributed crawler-based data processing method as described in the first aspect.

[0020] The embodiment of the present application optimizes the system, isolates the crawler task configuration and condition configuration in the crawler task configuration, and when executing the crawler task, the crawler tasks with different task information are included in different task queues for waiting, and multiple threads execute the crawler tasks in the task queues separately; by reducing the internal coupling of the system, improving the dynamic scalability performance, avoiding memory leaks, greatly improving the development efficiency, and improving the throughput of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a structural diagram of a dynamically scalable distributed crawler system provided in an embodiment of the present application;

[0022] Figure 2 It is a structural diagram of another dynamically scalable distributed crawler system provided in an embodiment of the present application;

[0023] Figure 3 It is a structural diagram of another dynamically scalable distributed crawler system provided in an embodiment of the present application;

[0024] Figure 4 It is a structural diagram of another dynamically scalable distributed crawler system provided in an embodiment of the present application;

[0025] Figure 5 It is a structural diagram of another dynamically scalable distributed crawler system provided in an embodiment of the present application;

[0026] Figure 6 It is a structural diagram of another dynamically scalable distributed crawler system provided in an embodiment of the present application;

[0027] Figure 7 is a flow chart of a data processing method based on a distributed crawler provided in an embodiment of the present application;

[0028] Figure 8 is a flow chart of another data processing method based on a distributed crawler provided in an embodiment of the present application;

[0029] Fig. 9 is a flow chart of another data processing method based on a distributed crawler provided in an embodiment of the present application;

[0030] Fig.10 is a flow chart of another data processing method based on a distributed crawler provided in an embodiment of the present application;

[0031] Fig.11 It is a schematic diagram of the overall process of a data processing method based on a distributed crawler provided in an embodiment of the present application;

[0032] Fig.12It is a structural schematic diagram of a data processing device based on a distributed crawler provided in an embodiment of the present application;

[0033] Fig.13 It is a structural diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0035] The embodiment of the present application provides a dynamically scalable distributed crawler system, a data processing method, a data processing device, a data processing equipment and a storage medium. The embodiment of the present application optimizes the system, isolates the crawler task configuration and the condition configuration in the crawler task configuration, lists the crawler tasks with different task information in different task queues when executing the crawler task, and executes the crawler tasks of the task queues non-stop in multiple threads respectively; by reducing the coupling degree within the system, improving the dynamic scalability performance, avoiding memory leaks, greatly improving the development efficiency, and improving the throughput of the system.

[0036] The following are detailed descriptions respectively.

[0037] Figure 1 A schematic diagram of the structure of a dynamically scalable distributed crawler system provided in an embodiment of the present application is given. Figure 1 As shown, a dynamically scalable distributed crawler system includes a crawler task configuration unit 101, a distributed crawler processing unit 102, a crawler result queue unit 103 and a big data processing unit 104, wherein the crawler task configuration unit 101, the distributed crawler processing unit 102, the crawler result queue unit 103 and the big data processing unit 104 are connected in sequence.

[0038] In this embodiment, the crawler task configuration unit 101 is used for users to configure crawler tasks and crawl content limiting conditions, and the crawler task includes task information. The embodiment of the present application sets a task configuration system upstream of the system to provide an interface for users to operate and configure. The crawler task configuration unit 101 provides users with a framework for configuring crawler tasks and crawl content limiting conditions respectively, so that the two behaviors between crawler tasks and limiting conditions are decoupled, and data that meets industry needs can be dynamically screened.

[0039] Combination Figure 2 As shown, Figure 2 A further schematic diagram of the structure of a dynamically scalable distributed crawler system is shown. Figure 2 As shown, in this embodiment, the crawler task configuration unit 101 includes a task configuration module 1011 and a condition configuration module 1012 that are interconnected. The task configuration module 1011 is used for the user to configure multiple crawler tasks that are respectively suitable for different platforms, and the condition configuration module 1012 is used for the user to configure crawling content limitation conditions.

[0040] In the embodiment of the present application, according to business needs, the user configures crawler tasks applicable to different platforms in the task configuration module 1011 of the task configuration unit 101. Developers can independently develop crawler scripts for different platforms, which is easy to expand crawlers for different platforms. It is easy to understand that a platform usually contains multiple different crawling channels, such as search methods such as personal pages, hashtags and keywords, which are all implementable crawling channels. As an application scenario, the user of the embodiment of the present application configures two different crawler tasks applied to short video playback platforms and paper publishing platforms in the crawler task configuration unit 101. The crawler tasks corresponding to the short video playback platform are divided into crawler tasks for obtaining different channels of data in the short video playback platform, such as the search channel of the short video playback platform and the comment channel of the short video playback platform. Similarly, the crawler tasks corresponding to the paper publishing platform are different according to the different acquisition channels of the paper publishing platform. Each crawler task contains task information. Task information includes platform information and channel information, platform information is used to indicate different platforms, and channel information is used to indicate different channels.

[0041] In the embodiment of the present application, according to the needs of the scenario, it is necessary to configure the crawling content limiting conditions for the crawler task. The user can directly configure through the page to control the crawling behavior of the crawler. Since the task configuration unit 101 includes a task configuration module 1011 and a condition configuration module 1012, the two behaviors of the configuration of the crawling task and the configuration of the crawling content limiting conditions are decoupled. In one embodiment, after the user configures the crawler task, the user can continue to configure the crawling content limiting conditions related to and matching the previously configured crawler task through the condition configuration module 1012. In another implementation example, since a large number of crawling content limiting conditions have been configured in the condition configuration module before, these crawling content limiting conditions include crawling content limiting conditions applicable to different crawling tasks on multiple platforms and multiple channels. After configuring the crawler task, the user can not configure the crawling content limiting conditions through the condition configuration module 1012, but obtain the matching crawling content limiting conditions from the multiple crawling content limiting conditions existing in the condition configuration module 1012 itself.

[0042] The distributed crawler processing unit 102 in this embodiment is specifically used to receive crawler tasks, and assign the crawler tasks to the crawler task queue corresponding to the task information according to the task information of the crawler tasks, obtain crawler tasks from multiple crawler task queues respectively, and obtain target resources according to the crawling content limitation conditions corresponding to the crawler tasks.

[0043] The distributed crawler processing unit 102 of the embodiment of the present application receives the crawler task and distributes the crawler task queue. The first step is to receive the crawler task and distribute the crawler task to different task queues according to the different task information of the crawler task. For example, there are currently 5 groups of crawler tasks that are newly configured, among which the task information of crawler task 1 is indicated as platform A and channel B, the task information of crawler task 2 is indicated as platform A and channel C, the task information of crawler task 3 is indicated as platform B and channel A, the task information of crawler task 4 is indicated as platform C and channel B, and the task information of crawler task 5 is indicated as platform A and channel B. Then both crawler task 1 and crawler task 5 are distributed to the task queue corresponding to platform A and channel B, while crawler task 2 is distributed to the task queue of platform A and channel C, crawler task 3 is distributed to the task queue of platform B and channel A, and crawler task 4 is distributed to the task queue of platform C and channel B. It can be seen that although the task information of the two crawler tasks points to the same platform, if the crawling channels are different, they are also distributed to different task queues. If only the crawling channels are the same but correspond to different platforms, they are also distributed to different task queues. Only when the platform and channel are completely consistent, they are distributed to the same task queue, such as crawling task 1 and crawling task 5 in the above example.

[0044] Crawlers on different platforms and channels will rely on various third-party plug-ins. The existing crawler frameworks are highly coupled and are not easy to add third-party plug-ins. The distributed crawler processing unit 102 provided in the embodiment of the present application uses a distributed task scheduling framework, which only provides the ability to schedule crawler tasks. It is not coupled with any third party, and the crawler dependencies are unified into an open source crawler distribution version. Each business crawler can add dependencies according to its own needs. Through the decoupling of distributed task scheduling and dependent environments, the crawler system can quickly expand third-party tools, thereby avoiding annoying environmental dependency conflicts.

[0045] In terms of crawler task execution, in the embodiment of the present application, different crawler tasks are distributed to separate executors for execution, and the number of executors can be adjusted according to the number of tasks to adapt to the task load balancing of different channels.

[0046] Figure 3 FIG. 1 shows another structural diagram of a dynamically scalable distributed crawler system. Figure 1 and Figure 3 In this embodiment, the distributed crawler processing unit 102 includes a scheduling module 1021 and multiple execution modules 1022, and the multiple execution modules are connected to the scheduling module, the scheduling module is connected to the crawler task configuration unit, and the multiple execution modules are connected to the crawler result queue unit. The scheduling module 1021 is used to receive crawler tasks and assign the crawler tasks to the crawler task queue corresponding to the task information according to the task information of the crawler tasks; the multiple execution modules 1022 are used to obtain crawler tasks from different crawler task queues respectively, and obtain target resources according to the crawling content restriction conditions of the crawler tasks.

[0047] The execution module 1022 is the aforementioned executor. In the embodiment of the present application, the scheduling module 1021 only receives crawler tasks, distributes the crawler tasks to task queues, and does not execute the crawler tasks. In the entire distributed crawler processing unit 102, there may be a large number of task queues at the same time, so multiple execution modules 1022 are configured. Multiple execution modules execute multiple different crawler tasks simultaneously. In this embodiment, the number of execution modules 1022 may be the same as the number of task queues, may be greater than the number of task queues, and may be less than the number of task queues. When the number of execution modules 1022 is the same as the number of task queues, it indicates that the execution module 1022 is configured to correspond one-to-one with the task queues. At this time, for example, if there are 5 task queues, there are also five execution modules 1022, and the five execution modules 1022 are executed simultaneously, working concurrently in different processes. When the number of execution modules 1022 is greater than the number of task queues, it means that there may be multiple crawler tasks in the same task queue corresponding to one execution module 1022. This situation may usually be that a certain task queue has more crawler tasks, the number of crawler tasks is large, and the execution pressure is large. Therefore, multiple execution modules 1022 are configured to execute the crawler tasks of the task queue, relieve the tasks of the crawler queue, and maintain the load balance between the task queues. For example, there are 25 groups of crawler tasks currently queued in task queue A, and there are 10 groups of crawler tasks currently queued in task queue B, and there are 8 groups of crawler tasks currently queued in task queue C. The number of crawler tasks in task queue A is more than twice the number of crawler tasks in the other two groups of task queues. At this time, when task queue B and task queue C are both assigned to one execution module 1022, three execution modules 1022 can be distributed to task queue A first. When the number of execution modules 1022 is less than the number of task queues, it indicates that some task queues may have a small number of crawler tasks and a small execution pressure, and the number of crawler tasks in other task queues is not large either, and the overall crawler pressure is small. You can choose to wait for the crawler tasks of one task queue to be executed before executing the crawler tasks of another task queue, or the crawler tasks of several task queues are executed alternately. For example, three execution modules 1022 are currently allocated to the distributed crawler processing unit 102, and there are five task queues at the same time. Task queue 1 has two crawler tasks, and the other four task queues all have one crawler task, so it can be seen that the crawler pressure is small.

[0048] In the embodiment of the present application, each execution module 1022 is monitored by a process monitoring tool to ensure the continuous operation of the execution module 1022. After the task is executed, the target resource is sent to the cache queue using the same protocol format to wait for the next step of processing. In this embodiment, the task scheduling behavior is abstracted into a common platform, and the platform itself is not responsible for the business logic. The scheduling module 1021 is only responsible for managing scheduling information, and supports visualization and simple dynamic management of scheduling information. The execution module 1022 is responsible for executing the task logic. The execution 1022 module focuses on the execution of tasks, and development and maintenance are simpler and more efficient. The scheduling module 1021 and the execution module 1022 are separately decoupled, which can improve the stability and scalability of the framework.

[0049] The crawler result queue unit 103 of the embodiment of the present application is used to receive the target resource and cache the target resource. In this embodiment, the message queue is applied as a communication method between processes or threads. The message sender sends a copy of the data to the message queue, and then the consumer takes the data from the message queue. When the consumption capacity of the upstream and downstream is inconsistent, it can be used as a message buffer, and the message will be taken away when the downstream is capable of processing. The present application uses a message queue in the crawler result queue unit 103 to cache the crawled results, and wait for the big data processing unit 104 to take away the crawler data one by one, and proceed to the next step of processing.

[0050] The big data processing unit 104 provided in the embodiment of the present application is used to read the target resource from the crawler result queue unit, and execute the target resource processing action according to the target resource to obtain the target data corresponding to the target resource and store the target data.

[0051] Data is an abstraction of an event stream and an unbounded data set, which will be added continuously over time. Stream processing refers to processing one or more event streams in real time, reading data sets, processing them and generating results. The whole process is continuous. The stream processing framework provides a data interface embedded in the data stream, through which users can freely process single or multiple streams and maintain consistency and fault tolerance. At the same time, users can register callback processing for event time and processing time to implement complex computing logic. The big data processing unit 104 of this implementation provides a streaming data processing framework. Combined with Figure 1 and Figure 4 Another dynamically expandable distributed crawler system provided in an embodiment of the present application includes a crawler task configuration unit 101, a distributed crawler processing unit 102, a crawler result queue unit 103 and a big data processing unit 104, wherein the crawler task configuration unit 101, the distributed crawler processing unit 102, the crawler result queue unit 103 and the big data processing unit 104 are connected in sequence.

[0052] Among them, reference Figure 4 , the big data processing unit 104 includes a plurality of processing modules, each of the processing modules includes a reading module 1041 and a downloading module 1042 connected to each other, and the reading module 1041 is connected to the crawler result queue unit 103;

[0053] The reading module 1041 is used to read the target resource from the crawler result queue unit 103; the downloading module 1042 is used to download the target data corresponding to the target resource according to the target resource, and store the downloaded target data; wherein the target resource includes a download address.

[0054] The target resource is an original resource. If the target resource is not downloaded and placed on a network platform, it is often time-sensitive, and some even become invalid within a few hours. In order to prevent the resource from becoming invalid, the target resource is downloaded in this embodiment. The target resource includes a download address, so according to the download address, the target data corresponding to the target resource can be accurately obtained.

[0055] As a preferred embodiment, the processing module of the big data processing unit 104 further includes an upload module 1043 connected to the download module 1042, and the upload module 1043 is used to obtain the stored target data and upload the target data to the intranet service platform. The intranet service platform is an internal service platform of the company that serves to set crawler tasks, which can permanently store the target data and facilitate internal processing and the company's business lines to reuse the target data.

[0056] like Figure 5 As shown, this embodiment provides a structural diagram of another dynamically scalable distributed crawler system. In this embodiment, the distributed crawler system also includes a database 105, and the processing module of the big data processing unit 104 also includes a sending module 1044 connected to the upload module 1043. The sending module 1044 is connected to the database 105, and the sending module 1044 is used to send the target data from the upload module 1043 to the database 105; wherein the download module 1042, the upload module 1043 and the sending module 1044 are executed sequentially, but different processing modules are executed concurrently. The big data processing unit 104 includes multiple processing modules in order to form multiple download, upload, and send threads.

[0057] The upload module 1043 uploads the target data downloaded by the download module 1042, and the sending module 1044 pushes the target data to the database 105. More specifically, before the sending module 1044 is actually sent to the database 105, it will first pass through an audit interface to audit the target data, and then be transmitted to the database 105 after passing the audit.

[0058] As a preferred implementation, in an embodiment of the present application, the target resource also includes resource information, and the resource information is composed of a crawling channel code, a crawler type, and a unique identification code in sequence, and the unique identification code is composed of a timestamp and a unique code.

[0059] In order to ensure that the target resource will not be downloaded repeatedly and waste resource space, the target resource is set to contain resource information for identifying the identity information of the target resource, and as a unique identity mark. The resource information set in this application is composed of the crawling channel code, crawler type and unique identification code in sequence, that is, the composition of crawling channel code + crawler type + unique identification code constitutes the resource information of this application. As a preferred unique identification code, the 16-bit self-incrementing ID code is further composed of a timestamp and a unique code. The timestamp refers to the current timestamp of the target resource, which is composed of the first 10 digits of the 16-bit self-incrementing ID code, and the last six digits are the self-incrementing ID, which can ensure that the resource information of the target resource of each crawler is unique when the daily new crawling volume is less than one million.

[0060] Combination Figure 1 and Figure 6 As shown, the dynamically scalable distributed crawler system provided in this embodiment also includes a visualization unit 106, the crawler task configuration unit 101, the distributed crawler processing unit 102, and the crawler result queue unit 103 are all connected to the visualization unit 106, and the visualization unit 106 is used to generate a crawler result report according to the target resources in the crawler result queue unit 103, and when each new target resource is added to the crawler result queue unit 103, the content in the crawler result report is added for the newly added target resource; the crawler result report is displayed every preset time; and the user's crawl result query instruction is received, and the crawl result corresponding to the crawler task is obtained according to the crawl result query instruction. In the process of obtaining the crawl result of the crawling task, the crawling result includes any node where the corresponding crawler task is located after the user configures the crawler task, including being in the task queue waiting to be executed, or having downloaded the target resource. In addition, the user's crawl result query instruction can be input through the input port provided by the crawler task configuration unit 101 to the user. This application uses crawler tasks as the dimension and provides task-level data access, which can be used to query a crawler task by clicking, and can respond quickly to find out the crawling results corresponding to the task.

[0061] Fig.11The overall flow diagram of the data processing method based on the distributed crawler provided by the embodiment of the present application is shown. It includes a user logging in to the crawler task background, and configuring the crawler task and crawler content limiting conditions in the crawler task configuration unit according to different platforms and channels. Then the crawler task is pushed to the task consumption queue. During the push process, the push may be successful or failed. If the push is successful, it is directly pushed to the task consumption queue. If the push fails, it returns to the previous step and continues to receive the user's configuration. The task consumption queue here refers to the scheduling module of the distributed crawler processing unit, and the distributed crawler processing unit is provided with a plurality of execution modules as crawler units to perform different crawler tasks respectively. After executing the crawler task, the corresponding target resources are stored in the cache queue, that is, stored in the crawler result queue unit. After that, the big data processing unit actively obtains the target resource and performs a series of actions of downloading, uploading, and pushing according to the target resource. In the big data processing unit, downloading, uploading, and pushing the target resource in the same thread are executed sequentially, but they are executed concurrently between different threads. That is, assuming that the current timestamp has target resources 1, 2, and 3, the big data processing unit downloads target resources 1, 2, and 3 respectively, and there is a new target resource 4 at the next timestamp, then the target resources 1, 2, and 3 are uploaded respectively, and target resource 4 is downloaded at the same time. That is, in the big data processing unit, downloading, uploading, and pushing can be performed simultaneously as thousands of tasks.

[0062] Please refer to Figures 7 to 10 , Figures 7 to 10 A flow chart of a distributed crawler-based data processing method provided in an embodiment of the present application is given. The distributed crawler-based data processing method provided in an embodiment of the present application can be executed by a dynamically expandable distributed crawler system or a distributed crawler-based data processing device, which can be implemented in hardware and / or software and integrated in a computer device.

[0063] like Figure 7 As shown, the data processing method based on distributed crawlers includes:

[0064] 701: Receive a crawler task and crawling content restriction conditions configured by a user, wherein the crawler task includes task information.

[0065] 702: Allocate the crawler task to a crawler task queue corresponding to the task information according to the task information of the crawler task.

[0066] 703: Obtain a crawler task from the crawler task queue and obtain target resources according to the crawling content restriction condition of the crawler task.

[0067] 704: Execute a target resource processing action according to the target resource to obtain target data corresponding to the target resource, and store the target data.

[0068] The embodiments of the present application can configure crawler tasks for different platforms and channels, and can configure crawler tasks to limit the conditions for crawling content.

[0069] As a more preferred embodiment, Figure 8 Another distributed crawler-based data processing method is shown, including:

[0070] 801: Receive a crawler task and crawling content restriction conditions configured by a user, wherein the crawler task includes task information.

[0071] 802 allocates the crawler task to a crawler task queue corresponding to the task information according to the task information of the crawler task.

[0072] 803: Obtain a crawler task from a crawler task queue and obtain a target resource according to a crawling content restriction condition of the crawler task; and cache the target resource.

[0073] 804: Read the target resource from the cache.

[0074] 805: Download target data corresponding to the target resource according to the target resource, and store the target data; the target resource includes a download address.

[0075] 806: Acquire the stored target data, and upload the target data to the intranet service platform and database.

[0076] In this embodiment, the acquired target resources are first queued and cached to adapt to the situation of large data volume, and the target resources are taken away when the consumer is capable.

[0077] This embodiment discloses that the processing of target data includes downloading, uploading, and pushing to a database, wherein downloading, uploading, and pushing are concurrently executed processes.

[0078] In this embodiment, the target resource also includes resource information, which is composed of a crawling channel code, a crawler type and a unique identification code in sequence. The unique identification code is a 16-bit unique identification code, and the 16-bit unique identification code is composed of a 10-bit timestamp and a 6-bit unique code.

[0079] In order to ensure that the target resource will not be downloaded repeatedly and waste resource space, the target resource is set to contain resource information for identifying the identity information of the target resource, and as a unique identity mark. The resource information set in this application is composed of the crawling channel code, crawler type and unique identification code in sequence, that is, the composition of crawling channel code + crawler type + unique identification code constitutes the resource information of this application. As a preferred unique identification code, a 16-bit unique identification code, that is, a 16-bit self-incrementing ID code, the unique identification code is further composed of a timestamp and a unique code. The timestamp refers to obtaining the current timestamp of the target resource, which is composed of the first 10 bits of the 16-bit self-incrementing ID code, and the last 6 bits are the self-incrementing ID.

[0080] Fig. 9 Another data processing method based on distributed crawlers is shown, such as Fig. 9 As shown, the data processing method includes:

[0081] 901: Receive a crawler task and crawling content restriction conditions configured by a user, wherein the crawler task includes task information.

[0082] 902: Allocate the crawler task to a crawler task queue corresponding to the task information according to the task information of the crawler task.

[0083] 903: Obtain a crawler task from the crawler task queue and obtain target resources according to the crawling content restriction condition of the crawler task.

[0084] 904: Execute a target resource processing action according to the target resource to obtain target data corresponding to the target resource, and store the target data.

[0085] 905: Generate a crawler result report according to the target resource, and add content in the crawler result report for each newly added target resource when a target resource is added to the crawler result queue unit.

[0086] 906: Display the crawler result report at preset intervals.

[0087] This embodiment is equivalent to providing users with a visual result display. The preset time period is, for example, one day, half a day, or two hours, etc. The crawler results within the preset time period are counted into a report to facilitate subsequent query and intuitive display.

[0088] Further, such as Fig.10 As shown, the data processing method based on the distributed crawler may further include:

[0089] 1007: Receive a crawling result query instruction from a user, where the crawling result query instruction includes task information for indicating a corresponding crawling task;

[0090] 1008: Obtain the crawling result corresponding to the crawling task according to the crawling result query instruction.

[0091] This application uses crawler tasks as the dimension and provides task-level data access, which can be used to query a crawler task by clicking, and can respond quickly to find out the crawling results corresponding to the task.

[0092] The essential process of the data processing method based on the distributed crawler provided in the embodiment of the present application is the same as the dynamically expandable distributed crawler system proposed in the present application. Therefore, the substantial introduction of the principles of the data processing method is relatively omitted in this implementation. For details, please refer to the dynamically expandable distributed crawler system provided in the embodiment of the present application.

[0093] like Fig.12 As shown, an embodiment of the present application also provides a data processing device based on a distributed crawler, including a task receiving module 1201, a task assigning module 1202, a result obtaining module 1203 and a data transmission module 1204.

[0094] Among them, the task receiving module 1201 is used to receive the crawler task and crawling content limitation conditions configured by the user, and the crawler task includes task information. The task allocation module 1202 is used to allocate the crawler task to the crawler task queue corresponding to the task information according to the task information of the crawler task. The result acquisition module 1203 is used to obtain the crawler task from the crawler task queue and obtain the target resource according to the crawling content limitation conditions of the crawler task. The data transmission module 1203 is used to perform the target resource processing action according to the target resource to obtain the target data corresponding to the target resource, and store the target data.

[0095] like Fig.13 As shown, an embodiment of the present application also provides a data processing device, including: a memory 1301 and one or more processors 1302; the memory 1301 is used to store one or more programs; when the one or more programs are executed by the one or more processors 1302, the one or more processors implement the distributed crawler-based data processing method as described in the present application.

[0096] An embodiment of the present application also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute the distributed crawler-based data processing method provided in the above embodiment.

[0097] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present application, whose computer executable instructions are not limited to the distributed crawler-based data processing method as described above, can also execute related operations in the distributed crawler-based data processing method provided in any embodiment of the present application.

[0098] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A dynamically scalable distributed crawler system, characterized in that: It includes a crawler task configuration unit, a distributed crawler processing unit, a crawler result queue unit and a big data processing unit connected in sequence; The crawler task configuration unit is used for users to configure crawler tasks and crawling content limitation conditions. The crawler task configuration unit includes a task configuration module and a condition configuration module that are interconnected. The task configuration module is used for users to configure multiple crawler tasks that are respectively applicable to different platforms. The condition configuration module is used for users to configure crawling content limitation conditions. The crawler task includes task information, and the task information includes platform information and channel information; the distributed crawler processing unit is used to receive crawler tasks, and assign the crawler tasks to the crawler task queue corresponding to the task information according to the task information of the crawler task, obtain crawler tasks from multiple crawler task queues respectively, and obtain target resources according to the crawling content limitation conditions corresponding to the crawler task; the crawler result queue unit is used to receive the target resources and cache the target resources; the big data processing unit is used to read the target resources from the crawler result queue unit, and perform target resource processing actions according to the target resources to obtain target data corresponding to the target resources and store the target data.

2. The distributed crawler system according to claim 1, characterized in that: The distributed crawler processing unit includes a scheduling module and multiple execution modules, the multiple execution modules are connected to the scheduling module, the scheduling module is connected to the crawler task configuration unit, and the multiple execution modules are connected to the crawler result queue unit; The scheduling module is used to receive a crawler task and assign the crawler task to a crawler task queue corresponding to the task information according to the task information of the crawler task; The multiple execution modules are used to obtain crawler tasks from different crawler task queues respectively, and obtain target resources according to crawling content limitation conditions of the crawler tasks.

3. The distributed crawler system according to any one of claims 1 to 2, characterized in that: The big data processing unit includes a plurality of processing modules, each of which includes a reading module and a downloading module connected to each other, and the reading module is connected to the crawler result queue unit; The reading module is used to read the target resource from the crawler result queue unit; the downloading module is used to download the target data corresponding to the target resource according to the target resource, and store the downloaded target data; wherein the target resource includes a download address.

4. The distributed crawler system according to claim 3, characterized in that: The processing module also includes an upload module connected to the download module, and the upload module is used to obtain the stored target data and upload the target data to the intranet service platform.

5. The distributed crawler system according to claim 4, characterized in that: The distributed crawler system also includes a database, and the processing module also includes a sending module connected to the upload module, the sending module is connected to the database, and the sending module is used to send the target data from the upload module to the database; wherein the multiple processing modules are executed concurrently.

6. The distributed crawler system according to claim 1, characterized in that: The target resource also includes resource information, which is composed of a crawling channel code, a crawler type, and a unique identification code in sequence. The unique identification code is a 16-bit unique identification code, and the 16-bit unique identification code is composed of a 10-bit timestamp and a 6-bit unique code.

7. The distributed crawler system according to claim 1, characterized in that: It also includes a visualization unit, the crawler task configuration unit, the distributed crawler processing unit, and the crawler result queue unit are all connected to the visualization unit, and the visualization unit is used to generate a crawler result report according to the target resources in the crawler result queue unit, and when each target resource is added to the crawler result queue unit, the content in the crawler result report is added for the newly added target resource; Display the crawler result report at preset intervals; And receive the user's crawling result query instruction, and obtain the crawling result corresponding to the crawler task according to the crawling result query instruction.

8. A data processing method based on a distributed crawler, characterized in that: include: Receive multiple crawler tasks configured by a user and applicable to different platforms, as well as crawling content limiting conditions, wherein the crawler tasks include task information, and the task information includes platform information and channel information; According to the task information of the crawler task, the crawler task is assigned to the crawler task queue corresponding to the task information; Obtain a crawler task from the crawler task queue and obtain target resources according to the crawling content restriction conditions of the crawler task; A target resource processing action is performed according to the target resource to obtain target data corresponding to the target resource, and the target data is stored.

9. The data processing method according to claim 8, characterized in that: Executing a target resource processing action according to the target resource includes: Download target data corresponding to the target resource according to the target resource, and store the target data; the target resource includes a download address; Acquire the stored target data and upload the target data to the intranet service platform and database.

10. The data processing method according to claim 8, characterized in that: Also includes: Generate a crawler result report according to the target resource, and add content in the crawler result report for each newly added target resource in the crawler result queue unit; Display the crawler result report at preset intervals; Receive a crawling result query instruction from a user, wherein the crawling result query instruction includes task information for indicating a corresponding crawling task; Get the crawling results corresponding to the crawling task according to the crawling result query instruction.

11. A data processing device based on a distributed crawler, characterized in that: include: Task receiving module: used to receive multiple crawler tasks configured by users and applicable to different platforms, as well as crawling content limiting conditions, wherein the crawler tasks include task information, and the task information includes platform information and channel information; Task allocation module: used to allocate the crawler task to the crawler task queue corresponding to the task information according to the task information of the crawler task; Result acquisition module: used to obtain crawler tasks from the crawler task queue and obtain target resources according to the crawling content restriction conditions of the crawler task; Data transmission module: used to execute target resource processing actions according to the target resource to obtain target data corresponding to the target resource and store the target data.

12. A data processing device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed crawler-based data processing method as described in any one of claims 8 to 10.

13. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the distributed crawler-based data processing method as described in any one of claims 8 to 10.