Home Database Mysql Tutorial 现在公开一个DHT网络爬虫网络爬虫供大家一起交流_MySQL

现在公开一个DHT网络爬虫网络爬虫供大家一起交流_MySQL

Jun 01, 2016 pm 01:07 PM

 P2P系统的应用越来越广泛,在文件共享、流媒体服务、即时通讯交流、计算和存储能力共享以及协同处理与服务等方面都能看到P2P的存在,一些P2P应用如Napster、eMule、BitTorrent等早已是家喻户晓了。现在公开一个DHT网络爬虫网络爬虫供大家一起交流
    P2P按其拓扑关系大致可以分为两类四种形式:
       1.非结构化拓扑。包括中心化拓扑、分布式拓扑、半分布式拓扑,其分别对应着Napster、BitTorrent、Kazaa这三种知名的应用。
       2.结构化拓扑。主要形式为分布式结构化拓扑,也就是所谓的DHT网络。
    DHT——Distributed Hash Table 分布式哈希表:
       1.哈希表被分割成不连续的块,每个节点被分配给一个属于自己的哈希块,并成为这个哈希块的管理者。
       2.通过加密哈希函数,一个对象的名字或关键词被映射为128位或160位的散列值。
         DHT网络的基本思想如下:
       1.每一份资源都由一组关键字进行标识。
       2.系统对其中的每一个关键字进行Hash,根据Hash的结果决定此关键字对应的那条信息(即资源索引中的一项)由哪个用户负责储存。
       3.用户搜索的时候,用同样的算法计算每个关键字的Hash,从而获得该关键字对应的信息存储位置,并迅速定位资源。
   
    DHT关键字定位:
       1.DHT通过分布式散列函数,将输入的关键字唯一映射到某个节点上,然后通过某些路由算法同该节点建立连接。
       2.每个节点并不需要保存整个系统的节点视图信息,只在节点中存储其邻近的几个后继节点信息,当一个节点收到一个查询操作时,如果它发现所查询的标识不在自己关联的区间内,那么该节点将会把该查询发送给其存储节点信息表中它认为最靠近目标的邻居。
       3.每次转发都能更进一步地接近数据源。因此较少的路由信息就可以有效地实现到达目标节点。
 
    DHT的具体算法实现过程:
    (1)对每个节点的一定特征(如IP地址)进行Hash,使得到的每个节点的节点值唯一。将节点按照节点值的从小到大构成一个环(Chord环)。(此处节点值可以看作是新环中的IP地址)
    (2)通过节点值,获取每个节点与下一个临近节点之间的距离,从而获得每个节点所需负责的值区间。(此过程类似于建立路由表)
    (3)对每个节点上的资源提取关键字,并对关键字进行Hash,得到的Hash值按照(2)中的每个节点负责的区间进行分配,从而使每一项资源的存储信息都被存储在一个节点上。(此步骤获得了资源的索引列表)
    (4)当搜索一项资源时,对其关键字进行Hash,得到的值与当前节点的值区间表相比较,从而获得资源的索引信息最有可能存在的节点。查询该节点,获取资源的索引,根据索引,即可找到资源所在的节点,并建立通信。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Reduce the use of MySQL memory in Docker Reduce the use of MySQL memory in Docker Mar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How to solve the problem of mysql cannot open shared library How to solve the problem of mysql cannot open shared library Mar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin) Run MySQl in Linux (with/without podman container with phpmyadmin) Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overview What is SQLite? Comprehensive overview Mar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Running multiple MySQL versions on MacOS: A step-by-step guide Running multiple MySQL versions on MacOS: A step-by-step guide Mar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles