(转)C#/VB - Automated WebSpider / WebRobot

WebRobot1.8 最新版WebRobot1.8,还不错的一个工具。要用的功能双击就行。 立即下载

Introduction

What is a WebSpider

A WebSpider or crawler is an automated program that follows links on websites and calls a WebRobot to handle the contents of each link.

What is a WebRobot

A WebRobot is a program that processes the content found through a link, a WebRobot can be used for indexing a page or extracting useful information based on a predefined query, common examples are - Link checkers, e-mail address extractors, multimedia extractors and update watchers.

Background

I had a recent contract to build a web page link checker, this component had to be able to check links that were stored in a database as well as to check links on a website, both through the local file system and over the internet.

This article explains the WebRobot, the WebSpider and how to enhance the WebRobot through specialized content handlers, the code shown has some superfluous code such try blocks, variable initialization and minor methods removed.

Class overview

The classes that make up the WebRobot are; WebPageState, which represents a URI and its current state in the process chain and an implementation of IWebPageProcessor, which performs the actual reading of the URI, calling content handlers and dealing with page errors.

The WebSpider has only one class WebSpider, this maintains a list of pending/processed URI's contained in a list of WebPageState objects and runs WebPageProcessor against each WebPageState to extract links to other pages and to test whether the URI's are valid.

Using the code - WebRobot

Web page processing is handled by an object that implements IWebPageProcessor. The Process method expects to receive a WebPageState, this will be updated during page processing and if all is successful the method will return true. Any number of content handlers can be also be called after the page has been read, by assigning WebPageContentDelegate delegates to the processor.

public delegate void WebPageContentDelegate( WebPageState state );

public interface IWebPageProcessor
{
   bool Process( WebPageState state );

   WebPageContentDelegate ContentHandler { get; set; }
}

The WebPageState object holds state and content information for the URI being processed. All properties of this object are read/write accept for the URI which must be passed in through the constructor.

public class WebPageState
{
   private WebPageState( ) {}

   public WebPageState( Uri uri )
   {
      m_uri             = uri;
   }

   public WebPageState( string uri )
      : this( new Uri( uri ) ) { }

   Uri      m_uri;                           // URI to be processed
   string   m_content;                       // Content of webpage
   string   m_processInstructions   = "";    // User defined instructions 
                 // for content handlers
   bool     m_processStarted        = false; 
                // Becomes true when processing starts
   bool     m_processSuccessfull    = false; 
                // Becomes true if process was successful
   string   m_statusCode;                    
                // HTTP status code
   string   m_statusDescription;             
               // HTTP status description, or exception message

   // Standard Getters/Setters....
}

The WebPageProcessor is an implementation of the IWebPageProcessor that does the actual work of reading in the content, handling error codes/exceptions and calling the content handlers. WebPageProcessor may be replaced or extended to provide additional functionality, though adding a content handler is generally a better option.

   public class WebPageProcessor : IWebPageProcessor
   {
      public bool Process( WebPageState state )
      {
         state.ProcessStarted       = true;
         state.ProcessSuccessfull   = false;

         // Use WebRequest.Create to handle URI's for 
         // the following schemes: file, http & https
         WebRequest  req = WebRequest.Create( state.Uri );
         WebResponse res = null;

         try
         {
            // Issue a response against the request. 
            // If any problems are going to happen they
            // they are likly to happen here in the form of an exception.
            res = req.GetResponse( );

            // If we reach here then everything is likly to be OK.
            if ( res is HttpWebResponse )
            {
               state.StatusCode        = 
                ((HttpWebResponse)res).StatusCode.ToString( );
               state.StatusDescription = 
                ((HttpWebResponse)res).StatusDescription;
            }
            if ( res is FileWebResponse )
            {
               state.StatusCode        = "OK";
               state.StatusDescription = "OK";
            }

            if ( state.StatusCode.Equals( "OK" ) )
            {
               // Read the contents into our state 
               // object and fire the content handlers
               StreamReader   sr    = new StreamReader( 
                 res.GetResponseStream( ) );

               state.Content        = sr.ReadToEnd( );

               if ( ContentHandler != null )
               {
                  ContentHandler( state );
               }
            }

            state.ProcessSuccessfull = true;
         }
         catch( Exception ex )
         {
            HandleException( ex, state );
         }
         finally
         {
            if ( res != null )
            {
               res.Close( );
            }
         }

         return state.ProcessSuccessfull;
      }
   }

   // Store any content handlers
   private WebPageContentDelegate m_contentHandler = null;

   public WebPageContentDelegate ContentHandler
   {
      get { return m_contentHandler; }
      set { m_contentHandler = value; }
   }

There are additonal private methods in the WebPageProcessor to handle HTTP error codes and file not found errors when dealing with the "file://" scheme as well as more severe exceptions.

Using the code - WebSpider

The WebSpider class is really just a harness for calling the WebRobot in a particular way. It provides the robot with a specialized content handler for crawling through web links and maintains a list of both pending pages and already visited pages. The current WebSpider is designed to start from a given URI and to limit full page processing to a base path.

// CONSTRUCTORS
//
// Process a URI, until all links are checked, 
// only add new links for processing if they
// point to the same host as specified in the startUri.
public WebSpider(
   string            startUri
   ) : this ( startUri, -1 ) { }

// As above only limit the links to uriProcessedCountMax.
public WebSpider(
   string            startUri,
   int               uriProcessedCountMax
   ) : this ( startUri, "", uriProcessedCountMax, 
     false, new WebPageProcessor( ) ) { }

// As above, except new links are only added if
// they are on the path specified by baseUri.
public WebSpider(
   string            startUri,
   string            baseUri,
   int               uriProcessedCountMax
   ) : this ( startUri, baseUri, uriProcessedCountMax, 
     false, new WebPageProcessor( ) ) { }

// As above, you can specify whether the web page
// content is kept after it is processed, by
// default this would be false to conserve memory
// when used on large sites.
public WebSpider(
   string            startUri,
   string            baseUri,
   int               uriProcessedCountMax,
   bool              keepWebContent,
   IWebPageProcessor webPageProcessor )
{
   // Initialize web spider ...
}

Why is there a base path limit?

Since there are trillions of pages on the Internet, this spider will check all links that it finds to see if they are valid, but it will only add new links to the pending queue if those links belong within the context of the initial website or sub path of that website.

So if we are starting from www.myhost.com/index.html and this page has link to www.myhost.com/pageWithSomeLinks.html and www.google.com/pageWithManyLinks.html then the WebRobot will be called against both links to check if they are valid but it will only add new links found within www.myhost.com/pageWithSomeLinks.html

Call the Execute method to start the spider. This method will add the startUri to a Queue of pending pages and then call the IWebPageProcessor until there are no pages left to process.

public void Execute( )
{
   AddWebPage( StartUri, StartUri.AbsoluteUri );

   while ( WebPagesPending.Count > 0 &&
      ( UriProcessedCountMax == -1 || UriProcessedCount 
        < UriProcessedCountMax ) )
   {
      WebPageState state = (WebPageState)m_webPagesPending.Dequeue( );

      m_webPageProcessor.Process( state );

      if ( ! KeepWebContent )
      {
         state.Content = null;
      }

      UriProcessedCount++;
   }
}

A web page can only be added to the queue if the Uri "excluding anchor" points to a path or a valid page (e.g. .html, .aspx, .jsp etc...) and has not already been seen before.

private bool AddWebPage( Uri baseUri, string newUri )
{
   Uri      uri      = new Uri( baseUri, 
     StrUtil.LeftIndexOf( newUri, "#" ) );

   if ( ! ValidPage( uri.LocalPath ) || m_webPages.Contains( uri ) )
   {
      return false;
   }
   WebPageState state = new WebPageState( uri );

   if ( uri.AbsoluteUri.StartsWith( BaseUri.AbsoluteUri ) )
   {
      state.ProcessInstructions += "Handle Links";
   }

   m_webPagesPending.Enqueue  ( state );
   m_webPages.Add             ( uri, state );

   return true;
}

Examples of running the spider

The following code shows three examples for calling the WebSpider, the paths shown are examples only, they don't represent the true structure of this website. Note: the Bondi Beer website in the example, is a site that I built using my own SiteGenerator. This easy to use program produces static websites from dynamic content such as proprietary data files, XML / XSLT files, databases, RSS feeds and more...

/*
* Check for broken links found on this website, limit the spider to 100 pages.
*/
WebSpider spider = new WebSpider( "http://www.bondibeer.com.au/", 100 );
spider.execute( );

/*
* Check for broken links found on this website, 
* there is no limit on the number
* of pages, but it will not look for new links on
* pages that are not within the
* path http://www.bondibeer.com.au/products/.  This
* means that the home page found
* at http://www.bondibeer.com.au/home.html may be
* checked for existence if it was
* called from the somepub/index.html but any
* links within that page will not be
* added to the pending list, as there on an a lower path.
*/
spider = new WebSpider(
      "http://www.bondibeer.com.au/products/somepub/index.html",
      "http://www.bondibeer.com.au/products/", -1 );
spider.execute( );

/*
* Check for pages on the website that have funny 
* jokes or pictures of sexy women.
*/
spider = new WebSpider( "http://www.bondibeer.com.au/" );
spider.WebPageProcessor.ContentHandler += 
  new WebPageContentDelegate( FunnyJokes );
spider.WebPageProcessor.ContentHandler += 
  new WebPageContentDelegate( SexyWomen );
spider.execute( );

private void FunnyJokes( WebPageState state )
{
   if( state.Content.IndexOf( "Funny Joke" ) > -1 )
   {
      // Do something
   }
}
private void SexyWomen( WebPageState state )
{
   Match       m     = RegExUtil.GetMatchRegEx( 
     RegularExpression.SrcExtractor, state.Content );
   string      image;

   while( m.Success )
   {
      m     = m.NextMatch( );
      image = m.Groups[1].ToString( ).toLowerCase( );

      if ( image.indexOf( "sexy" ) > -1 || 
        image.indexOf( "women" ) > -1 )
      {
         DownloadImage( image );
      }
   }
}

Conclusion

The WebSpider is flexible enough to be used in a variety of useful scenarios, and could be powerful tool for Data Mining websites on the Internet and Intranet. I would like to here how people have used this code.

Outstanding Issues

These issues are minor but if anyone has any ideas then please share them.

  • state.ProcessInstructions - This is really just a quick hack to provide instructions that the content handlers can use as they see fit. I am looking for a more elegant solution to this problem.
  • MultiThreaded Spider - This project 1st started of as a multi threaded spider but that soon fell by the wayside when I found that performance was much slower using threads to process each URI. It seems that the bottle neck is in the GetResponse, which does not seem to run in multiple threads.
  • Valid URI, but the query data that returns a bad page. - The current processor does not handle the scenario where the URI points to a valid page, but the page returned by the webserver is considered to be bad. Eg. http://www.validhost.com/validpage.html?opensubpage=invalidid. One idea to to resolve this problem is to read the contents of a returned page and look for key pieces of information but that technique is a little flakey.

About David Cruwys


I have been programming commercially since 1990, with the last 4 years spent mainly in Java. I made the transition to .NET six months ago and have not looked back. I have written e-commerce solutions, desktop and mobile phone applications in a variety of languages (VB6, Delphi, Java, Foxpro, Clipper 87 etc...) and am currently developing a Web Application Framework in C#.

I have just launched www.offyourbutt.com for showcasing my products and services and this will become a test bed for my C# framework. Click here to see my full profile

Click here to view David Cruwys's online profile.

Introduction

What is a WebSpider

A WebSpider or crawler is an automated program that follows links on websites and calls a WebRobot to handle the contents of each link.

What is a WebRobot

A WebRobot is a program that processes the content found through a link, a WebRobot can be used for indexing a page or extracting useful information based on a predefined query, common examples are - Link checkers, e-mail address extractors, multimedia extractors and update watchers.

Background

I had a recent contract to build a web page link checker, this component had to be able to check links that were stored in a database as well as to check links on a website, both through the local file system and over the internet.

This article explains the WebRobot, the WebSpider and how to enhance the WebRobot through specialized content handlers, the code shown has some superfluous code such try blocks, variable initialization and minor methods removed.

Class overview

The classes that make up the WebRobot are; WebPageState, which represents a URI and its current state in the process chain and an implementation of IWebPageProcessor, which performs the actual reading of the URI, calling content handlers and dealing with page errors.

The WebSpider has only one class WebSpider, this maintains a list of pending/processed URI's contained in a list of WebPageState objects and runs WebPageProcessor against each WebPageState to extract links to other pages and to test whether the URI's are valid.

Using the code - WebRobot

Web page processing is handled by an object that implements IWebPageProcessor. The Process method expects to receive a WebPageState, this will be updated during page processing and if all is successful the method will return true. Any number of content handlers can be also be called after the page has been read, by assigning WebPageContentDelegate delegates to the processor.

public delegate void WebPageContentDelegate( WebPageState state );

public interface IWebPageProcessor
{
   bool Process( WebPageState state );

   WebPageContentDelegate ContentHandler { get; set; }
}

The WebPageState object holds state and content information for the URI being processed. All properties of this object are read/write accept for the URI which must be passed in through the constructor.

public class WebPageState
{
   private WebPageState( ) {}

   public WebPageState( Uri uri )
   {
      m_uri             = uri;
   }

   public WebPageState( string uri )
      : this( new Uri( uri ) ) { }

   Uri      m_uri;                           // URI to be processed
   string   m_content;                       // Content of webpage
   string   m_processInstructions   = "";    // User defined instructions 
                 // for content handlers
   bool     m_processStarted        = false; 
                // Becomes true when processing starts
   bool     m_processSuccessfull    = false; 
                // Becomes true if process was successful
   string   m_statusCode;                    
                // HTTP status code
   string   m_statusDescription;             
               // HTTP status description, or exception message

   // Standard Getters/Setters....
}

The WebPageProcessor is an implementation of the IWebPageProcessor that does the actual work of reading in the content, handling error codes/exceptions and calling the content handlers. WebPageProcessor may be replaced or extended to provide additional functionality, though adding a content handler is generally a better option.

   public class WebPageProcessor : IWebPageProcessor
   {
      public bool Process( WebPageState state )
      {
         state.ProcessStarted       = true;
         state.ProcessSuccessfull   = false;

         // Use WebRequest.Create to handle URI's for 
         // the following schemes: file, http & https
         WebRequest  req = WebRequest.Create( state.Uri );
         WebResponse res = null;

         try
         {
            // Issue a response against the request. 
            // If any problems are going to happen they
            // they are likly to happen here in the form of an exception.
            res = req.GetResponse( );

            // If we reach here then everything is likly to be OK.
            if ( res is HttpWebResponse )
            {
               state.StatusCode        = 
                ((HttpWebResponse)res).StatusCode.ToString( );
               state.StatusDescription = 
                ((HttpWebResponse)res).StatusDescription;
            }
            if ( res is FileWebResponse )
            {
               state.StatusCode        = "OK";
               state.StatusDescription = "OK";
            }

            if ( state.StatusCode.Equals( "OK" ) )
            {
               // Read the contents into our state 
               // object and fire the content handlers
               StreamReader   sr    = new StreamReader( 
                 res.GetResponseStream( ) );

               state.Content        = sr.ReadToEnd( );

               if ( ContentHandler != null )
               {
                  ContentHandler( state );
               }
            }

            state.ProcessSuccessfull = true;
         }
         catch( Exception ex )
         {
            HandleException( ex, state );
         }
         finally
         {
            if ( res != null )
            {
               res.Close( );
            }
         }

         return state.ProcessSuccessfull;
      }
   }

   // Store any content handlers
   private WebPageContentDelegate m_contentHandler = null;

   public WebPageContentDelegate ContentHandler
   {
      get { return m_contentHandler; }
      set { m_contentHandler = value; }
   }

There are additonal private methods in the WebPageProcessor to handle HTTP error codes and file not found errors when dealing with the "file://" scheme as well as more severe exceptions.

Using the code - WebSpider

The WebSpider class is really just a harness for calling the WebRobot in a particular way. It provides the robot with a specialized content handler for crawling through web links and maintains a list of both pending pages and already visited pages. The current WebSpider is designed to start from a given URI and to limit full page processing to a base path.

// CONSTRUCTORS
//
// Process a URI, until all links are checked, 
// only add new links for processing if they
// point to the same host as specified in the startUri.
public WebSpider(
   string            startUri
   ) : this ( startUri, -1 ) { }

// As above only limit the links to uriProcessedCountMax.
public WebSpider(
   string            startUri,
   int               uriProcessedCountMax
   ) : this ( startUri, "", uriProcessedCountMax, 
     false, new WebPageProcessor( ) ) { }

// As above, except new links are only added if
// they are on the path specified by baseUri.
public WebSpider(
   string            startUri,
   string            baseUri,
   int               uriProcessedCountMax
   ) : this ( startUri, baseUri, uriProcessedCountMax, 
     false, new WebPageProcessor( ) ) { }

// As above, you can specify whether the web page
// content is kept after it is processed, by
// default this would be false to conserve memory
// when used on large sites.
public WebSpider(
   string            startUri,
   string            baseUri,
   int               uriProcessedCountMax,
   bool              keepWebContent,
   IWebPageProcessor webPageProcessor )
{
   // Initialize web spider ...
}

Why is there a base path limit?

Since there are trillions of pages on the Internet, this spider will check all links that it finds to see if they are valid, but it will only add new links to the pending queue if those links belong within the context of the initial website or sub path of that website.

So if we are starting from www.myhost.com/index.html and this page has link to www.myhost.com/pageWithSomeLinks.html and www.google.com/pageWithManyLinks.html then the WebRobot will be called against both links to check if they are valid but it will only add new links found within www.myhost.com/pageWithSomeLinks.html

Call the Execute method to start the spider. This method will add the startUri to a Queue of pending pages and then call the IWebPageProcessor until there are no pages left to process.

public void Execute( )
{
   AddWebPage( StartUri, StartUri.AbsoluteUri );

   while ( WebPagesPending.Count > 0 &&
      ( UriProcessedCountMax == -1 || UriProcessedCount 
        < UriProcessedCountMax ) )
   {
      WebPageState state = (WebPageState)m_webPagesPending.Dequeue( );

      m_webPageProcessor.Process( state );

      if ( ! KeepWebContent )
      {
         state.Content = null;
      }

      UriProcessedCount++;
   }
}

A web page can only be added to the queue if the Uri "excluding anchor" points to a path or a valid page (e.g. .html, .aspx, .jsp etc...) and has not already been seen before.

private bool AddWebPage( Uri baseUri, string newUri )
{
   Uri      uri      = new Uri( baseUri, 
     StrUtil.LeftIndexOf( newUri, "#" ) );

   if ( ! ValidPage( uri.LocalPath ) || m_webPages.Contains( uri ) )
   {
      return false;
   }
   WebPageState state = new WebPageState( uri );

   if ( uri.AbsoluteUri.StartsWith( BaseUri.AbsoluteUri ) )
   {
      state.ProcessInstructions += "Handle Links";
   }

   m_webPagesPending.Enqueue  ( state );
   m_webPages.Add             ( uri, state );

   return true;
}

Examples of running the spider

The following code shows three examples for calling the WebSpider, the paths shown are examples only, they don't represent the true structure of this website. Note: the Bondi Beer website in the example, is a site that I built using my own SiteGenerator. This easy to use program produces static websites from dynamic content such as proprietary data files, XML / XSLT files, databases, RSS feeds and more...

/*
* Check for broken links found on this website, limit the spider to 100 pages.
*/
WebSpider spider = new WebSpider( "http://www.bondibeer.com.au/", 100 );
spider.execute( );

/*
* Check for broken links found on this website, 
* there is no limit on the number
* of pages, but it will not look for new links on
* pages that are not within the
* path http://www.bondibeer.com.au/products/.  This
* means that the home page found
* at http://www.bondibeer.com.au/home.html may be
* checked for existence if it was
* called from the somepub/index.html but any
* links within that page will not be
* added to the pending list, as there on an a lower path.
*/
spider = new WebSpider(
      "http://www.bondibeer.com.au/products/somepub/index.html",
      "http://www.bondibeer.com.au/products/", -1 );
spider.execute( );

/*
* Check for pages on the website that have funny 
* jokes or pictures of sexy women.
*/
spider = new WebSpider( "http://www.bondibeer.com.au/" );
spider.WebPageProcessor.ContentHandler += 
  new WebPageContentDelegate( FunnyJokes );
spider.WebPageProcessor.ContentHandler += 
  new WebPageContentDelegate( SexyWomen );
spider.execute( );

private void FunnyJokes( WebPageState state )
{
   if( state.Content.IndexOf( "Funny Joke" ) > -1 )
   {
      // Do something
   }
}
private void SexyWomen( WebPageState state )
{
   Match       m     = RegExUtil.GetMatchRegEx( 
     RegularExpression.SrcExtractor, state.Content );
   string      image;

   while( m.Success )
   {
      m     = m.NextMatch( );
      image = m.Groups[1].ToString( ).toLowerCase( );

      if ( image.indexOf( "sexy" ) > -1 || 
        image.indexOf( "women" ) > -1 )
      {
         DownloadImage( image );
      }
   }
}

Conclusion

The WebSpider is flexible enough to be used in a variety of useful scenarios, and could be powerful tool for Data Mining websites on the Internet and Intranet. I would like to here how people have used this code.

Outstanding Issues

These issues are minor but if anyone has any ideas then please share them.

  • state.ProcessInstructions - This is really just a quick hack to provide instructions that the content handlers can use as they see fit. I am looking for a more elegant solution to this problem.
  • MultiThreaded Spider - This project 1st started of as a multi threaded spider but that soon fell by the wayside when I found that performance was much slower using threads to process each URI. It seems that the bottle neck is in the GetResponse, which does not seem to run in multiple threads.
  • Valid URI, but the query data that returns a bad page. - The current processor does not handle the scenario where the URI points to a valid page, but the page returned by the webserver is considered to be bad. Eg. http://www.validhost.com/validpage.html?opensubpage=invalidid. One idea to to resolve this problem is to read the contents of a returned page and look for key pieces of information but that technique is a little flakey.

About David Cruwys


I have been programming commercially since 1990, with the last 4 years spent mainly in Java. I made the transition to .NET six months ago and have not looked back. I have written e-commerce solutions, desktop and mobile phone applications in a variety of languages (VB6, Delphi, Java, Foxpro, Clipper 87 etc...) and am currently developing a Web Application Framework in C#.

I have just launched www.offyourbutt.com for showcasing my products and services and this will become a test bed for my C# framework. Click here to see my full profile

Click here to view David Cruwys's online profile.

基于MATLAB的太阳能光伏电力仿真,模拟每日太阳能发电,可视化功率曲线,并通过数值积分计算总能量输出。.zip 1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 立即下载

相关推荐

人脸识别签到考勤系统实战源码

这是一套可直接运行的人脸识别智能签到考勤系统,基于OpenCV YuNet人脸检测与SFace特征识别实现,全程本机运行,数据保存在本地SQLite,不上传任何服务器。配套交付完整Python源码、9章实战教程(md/html/pdf三种格式)、逐步骤操作截图和答辩PPT讲解。 系统围绕五个功能模块展开:人脸注册支持照片批量导入并提取特征入库;识别签到支持照片或摄像头两种方式,实时框出人脸并标注姓名、相似度与考勤状态;考勤规则引擎按config.py里配置的上下班时间与宽限分钟,自动判定迟到、早退、缺勤;Tkinter管理面板完成人员管理、流水查询与月度汇总;最后通过openpyxl一键导出整月考勤矩阵,正常绿、迟到黄、缺勤红,Excel打开即用。 选型上特意选了YuNet+SFace路线:纯pip安装免编译,CPU单帧识别不到100ms,两个ONNX模型共约37MB,出自OpenCV官方模型仓库,毕设报告引用有据可查。教程第7章整理了16条Windows下真实踩过的报错及排查方法,第8章给出换模型、换人脸、加功能的二次开发路径。 适合做计算机视觉方向毕设或课程设计的学生,也适合想给班级、实验室、小团队搭一套本地签到工具的Python学习者。运行环境为Python 3.9以上、Windows 10/11,不需要GPU。 使用时先pip install -r requirements.txt装齐依赖,再运行download_data.py下载模型,最后启动main.py即可进入图形界面;命令行register、recognize、report子命令也可脱离界面单独调用。

【亲测免费】 探索WebRobot v1.8.2:一款强大的网页自动化工具

探索WebRobot v1.8.2:一款强大的网页自动化工具 在数字时代,自动化是提升效率的关键。对于开发者和数据分析师来说,WebRobot是一个值得探索的项目,它是一个高效的网页自动化工具,能够帮助用户轻松执行各种网页上的任务。接下来,我们将深入探讨这个项目的特性、技术分析以及它可以解决的问题。 项目简介 WebRobot 是一个基于Python的库,利用Selenium和PyQuery等强大...

gitblog_00021的博客 1306

【无人机航测】MATLAB重叠率与地面分辨率协同设计:航线间距及飞行方向优化系统 MATLAB 无人机航测重叠率设计|地面分辨率与航线间距计算

内容概要:本文档介绍了基于MATLAB R2025b开发的无人机航测重叠率与航线间距计算系统,旨在通过建立统一的航测几何计算体系,实现重叠率、地面分辨率与航线间距的动态协同设计。系统结合相机参数、飞行参数、地形数据与风场信息,通过自动化候选航向搜索与多目标优化,选择兼顾覆盖质量、飞行效率与安全性的最优航线方向。项目涵盖从参数输入、摄影测量计算、地形与安全修正,到候选路线生成、综合评价与结果可视化的全流程,并构建了五万组模拟数据用于算法验证与模型训练,支持桌面交互、批量处理与服务化部署,适用于多种复杂场景下的无人机航测任务规划。 适合人群:具备一定MATLAB编程基础和摄影测量知识的科研人员、工程技术人员及高校师生,尤其适合从事无人机航测、地理信息系统(GIS)、遥感与测绘等相关领域的从业者。 使用场景及目标:① 实现无人机航测任务中地面分辨率与航线间距的精确计算与动态优化;② 解决复杂地形与风场环境下航线方向选择困难、覆盖质量难以保障的问题;③ 通过自动化设计减少人为经验依赖,提升航测任务的可靠性与效率;④ 为后续的三维建模、正射影像生成与灾害应急评估等应用提供高质量的数据基础。 阅读建议:建议读者结合文中提供的完整代码示例与GUI界面设计,逐步实践参数配置、模型计算与结果分析流程。重点关注摄影测量公式推导、地形修正策略与多目标优化算法的实现细节,并利用模拟数据进行敏感性分析与模型验证,以深入理解系统的设计理念与工程应用价值。

WebRobot1.8.2网站多功能网络安全渗透检测工具

新版介绍 最新版的Webrobot使用的是插件模式,插件存放在主程序目录下的plugin文件夹里,所有插件的配置文件及字典等其他文件也存放在这个文件夹内。我们需要用到哪个插件,只需要双击它便可打开,需要关闭也是双击关闭。 主界面 抓取链接 自动抓取 注入检测 文件检测 PS:C段查询(C段实用的必应接口作者提供的KEY已经失效,如果需要用到可自行修改KE...

aici0819的博客 1039

【电力负荷预测】项目介绍 MATLAB实现基于BO-Transformer-LSTM贝叶斯优化算法(BO)优化Transformer-LSTM组合模型进行居民用户多步电力负荷预测(含模型描述及部分示例

内容概要:本文介绍了一个基于BO-Transformer-LSTM的组合模型,用于实现居民用户多步电力负荷预测的完整项目实例。该模型融合Transformer的全局注意力机制与LSTM的局部时序记忆能力,构建能够捕捉长时依赖与周期性特征的深度学习架构,并引入贝叶斯优化(BO)自动搜索最优超参数组合,提升预测精度与训练效率。项目涵盖从原始数据清洗、特征工程、滑动窗口样本构建、模型设计到超参数优化、反归一化及多步误差评估的全流程,强调时间顺序划分以防止信息泄露,并通过周期编码、外生变量融合等方式增强数据表达能力。文中提供了详细的MATLAB代码示例,包括数据预处理、网络搭建、贝叶斯优化配置和预测结果评估等关键步骤。 适合人群:具备一定机器学习和时间序列分析基础,熟悉MATLAB编程环境,从事电力系统预测、智能电网、负荷管理等相关领域的研究人员、工程师及研究生。 使用场景及目标:①应用于居民级或多用户聚合负荷的短期至中期多步预测(如未来24小时);②服务于配电系统运行调度、需求响应基线设定、家庭能源管理系统优化、分布式能源协调控制等实际工程场景;③为科研提供可复现的深度学习+贝叶斯优化的技术路线参考。 阅读建议:此资源以实际项目为导向,建议读者结合提供的代码逐步实现并调试模型,重点关注数据质量控制、时间特征编码、组合网络结构设计与贝叶斯优化稳定性之间的协同关系,在实践中深入理解多步预测中的误差累积机制与超参数敏感性问题。

测试用的衣橱app小软件,自己玩撒打算

测试用的衣橱app小软件,自己玩撒打算

技术讨论 | 简谈渗透测试各阶段我常用的那些“神器”

前言 本人所有文章都很用心的写作完成,并时常总结如何分享更有用的东西给朋友们。这篇更是如此,晚上准备到凌晨四点开始写作,为了需要的朋友而写,不喜欢的右上角点叉不要像上次文章一样在下面喷粪逼我骂你,另疏漏之处欢迎有心的道友下方补充帮助更多的朋友们。 flagellantX’s Windows Weapon是我整理的在windows下针对基础入侵渗透的一个工具包,放置在百度网盘,为了方便需要的朋...

weixin_30768661的博客 984

【智能制造排程】基于双层编码遗传算法的柔性作业车间调度模型:工序排序与机器选择联合优化 项目介绍 MATLAB 柔性作业车间排程|遗传算法与机器选择双层编码

内容概要:本文介绍了一个基于MATLAB的柔性作业车间排程项目,采用遗传算法与双层染色体编码技术实现工序排序与机器选择的联合优化。项目构建了统一的排程模型,涵盖工件工序、候选机器、加工时间、设备能力、能耗及交付时间等要素,通过双层编码结构(工序序列层与机器选择层)分别处理加工顺序和设备分配问题,并设计了相应的解码机制、遗传操作与综合适应度函数,以最小化最大完工时间、降低设备空闲损失、提升负载均衡与能源效率为目标。系统支持模拟数据生成,融合多种概率分布反映实际生产不确定性,并输出甘特图、收敛曲线和设备利用率等结果,具备良好的可扩展性,可用于智能制造排程算法研究与实际系统开发。; 适合人群:具备一定编程基础,熟悉MATLAB环境,从事生产调度、智能制造、运筹优化等相关领域的研究人员、工程技术人员及高校研究生;有志于学习遗传算法在工业排程中应用的1-3年经验研发人员。; 使用场景及目标:①解决柔性作业车间中工序排序与机器选择耦合的复杂调度问题;②优化制造系统的最大完工时间、设备利用率、能耗与订单交付表现;③为MES、数字孪生、智能车间等系统提供核心排程算法模块;④作为教学案例或科研平台,用于算法对比、参数调优与动态重排程研究。; 阅读建议:此资源以MATLAB实现为核心,包含完整代码结构与数据生成逻辑,建议结合文中提供的代码示例进行实践运行与调试,深入理解双层编码机制、解码流程与遗传操作的设计思想,并可根据实际需求调整适应度权重或引入新约束条件进行二次开发。

C#/VB - Automated WebSpider / WebRobot

Introduction What is a WebSpider A WebSpider or crawler is an automated program that follows links on websites and calls a WebRobot to handle the contents of each link. What is a WebRobot A WebRo...

weixin_30488313的博客 164

国央企创新负责人如何通过平台实现科研成果的快速识别与转化?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

PotPlayer自用皮肤

自用 PotPlayer 皮肤,仅微调了字体大小与颜色,是按个人习惯调整,未做适配性调整。

超全Mathcad全桥LLC谐振变换器开关电源设计mathcad计算书

内容概要:本文介绍了“Plecs全桥LLC谐振变换器仿真模型”这一技术资源,该模型基于Plecs仿真平台构建,完整实现了全桥LLC谐振变换器的电路拓扑与控制系统,用于深入研究其在变频与移相混合控制策略下的动态行为。模型涵盖了软开关实现机制、谐振腔参数设计、功率传输特性、效率优化以及闭环控制策略等核心内容,支持对启动过程、负载突变、频率调节等工况的仿真分析,有助于全面掌握LLC变换器在高效率、高功率密度电源系统中的工作原理与设计方法。; 适合人群:具备电力电子技术基础、熟悉开关电源设计原理的研究生、硬件工程师及从事高频电源产品研发的技术人员。; 使用场景及目标:①用于高校教学与科研中对LLC谐振变换器运行机理的深入理解与验证;②辅助工程师在实际产品开发中进行关键参数设计、性能预测与优化;③支持对变频控制、软启动过程、零电压开关(ZVS)实现条件、负载调整率及系统稳定性等关键指标的仿真分析与验证。; 阅读建议:建议使用者具备Plecs或类似电力电子仿真软件的操作经验,结合经典电力电子教材与LLC设计指南进行学习,通过调整谐振元件参数、开关频率与负载条件,观察系统响应变化,以深化对谐振变换器非线性动态特性的理解,并建议将仿真结果与理论计算对照分析,提升工程设计能力。

2-shell及常用命令-续.pdf

2-shell及常用命令-续.pdf

game.c.docx

game.c.docx

【顶级EI复现】基于KKT条件与分段解析优化的双有源桥DC-DC变换器软开关协同最小应力闭环控制方法(Simulink仿真实现)

内容概要:本文详细介绍了一种基于KKT(Karush-Kuhn-Tucker)最优性条件与分段解析优化技术的双有源桥(DAB)DC-DC变换器闭环控制方法,旨在实现软开关条件下器件电压和电流应力的协同最小化,从而提升变换器的转换效率与系统可靠性。该方法通过建立精确的数学模型,结合KKT条件进行优化求解,并采用分段解析策略提高实时控制性能,在Simulink环境中完成了完整的闭环控制系统建模与仿真验证。作为“顶级EI复现”级别的研究成果,内容涵盖控制算法设计、优化机制分析、仿真架构搭建及结果对比,具有较强的理论深度与工程应用价值,适用于电力电子高频化、高效化发展的前沿研究方向。; 适合人群:面向具备电力电子、自动控制或电气工程等相关专业背景,熟悉Simulink仿真平台,且从事科研工作1年以上的研究生、博士生及科研人员;特别适合致力于DC-DC变换器拓扑优化、软开关技术、最小化开关应力控制、能量高效传输等领域研究的专业人士。; 使用场景及目标:① 复现高水平EI期刊论文中的先进优化控制算法;② 掌握KKT条件在非线性约束优化问题中的具体应用;③ 深入理解DAB变换器在不同工况下的软开关实现机制与应力抑制策略;④ 构建高精度仿真模型以支撑学术论文撰写、科研项目申报或实际工程系统的控制方案设计。; 阅读建议:建议结合提供的Simulink仿真模型同步学习,重点关注KKT条件推导过程与分段解析优化模块的实现逻辑。由于内容涉及较强的数学建模与优化理论,推荐具备扎实的电路理论、现代控制理论及数值优化基础后再行研读,并可参考同系列“顶级EI复现”资源以构建系统性知识体系。

交错并联图腾柱PFC变换器仿真设计(Simulink仿真实现)

内容概要:本文档系统性地介绍了基于Simulink平台的“交错并联图腾柱PFC变换器”仿真设计,聚焦于高效率功率因数校正技术的建模与实现。内容涵盖双闭环控制策略(电压外环与电流内环)、PI控制器设计、交错并联结构优化以及图腾柱拓扑的工作原理,旨在提升系统动态响应性能、降低输入电流谐波含量并改善功率因数。文档不仅提供详细的仿真模型构建流程,还配套Mathcad计算书用于参数设计与功率等级扩展,并列举了多种相关电力电子变换器的仿真案例,如三相维也纳整流器、LLC谐振变换器、双向Buck-Boost电路等,形成了一套完整的电力电子系统仿真资源体系,适用于从理论分析到工程实践的全流程学习与研究。; 适合人群:电气工程、自动化、电力电子及相关专业的高校本科生、研究生,以及从事新能源发电、电源设计、电能质量治理、工业自动化等领域的研发工程师;具备基本电路理论知识和Simulink/Matlab使用经验者更佳。; 使用场景及目标:①支持高校课程设计、毕业设计或科研项目中对先进PFC拓扑的仿真验证与性能优化;②帮助工程技术人员快速掌握图腾柱PFC的核心控制逻辑与建模方法,缩短产品开发周期;③作为电力电子系统教学与技术培训的标准化参考案例,强化理论与实践结合能力。; 其他说明:文档由“荔枝科研社”整理发布,所有资源可通过指定公众号或百度网盘链接获取,建议按照目录顺序系统学习,并结合提供的Mathcad计算书、参考文献及仿真文件进行参数验证与二次开发,以深化理解与应用能力。

上一篇: 读《人月神话》之我见
下一篇: (转)如何用C#语言构造蜘蛛程序
halfpro
博客等级 码龄24年 2粉丝 5原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值