简体   繁体   English

ASP.NET和C#在网站后面进行常量处理可能吗?

[英]ASP.NET and C# constant processing behind the site possible?

Imagine a site where the user logs in and can view their ip webcam (I can do this bit i believe). 想象一下一个用户登录并可以查看其IP网络摄像头的网站(我相信我可以做到这一点)。 The problem is i want the site to do some processing on the images/video coming in even when the user is not logged in ie run some motion detection algorithm and if there is motion log the incident in a database. 问题是,即使用户未登录,我也希望站点对传入的图像/视频进行一些处理,即运行某种运动检测算法,并且如果存在运动日志,则事件会存储在数据库中。

What would i need to learn about to implement this project? 我需要了解什么来实施该项目? I want to use ASP.NET and C# so i assume: 我想使用ASP.NET和C#,所以我假设:

  1. Learn ASP.NET. 了解ASP.NET。
  2. Learn C# (I'm a pretty competent desktop application developer). 学习C#(我是一个非常称职的桌面应用程序开发人员)。
  3. mySQL database (Is this the best kind of database to use in this situation?). mySQL数据库(在这种情况下,这是最好的数据库吗?)。

I've not used ASP.NET before hence i have no idea what it can/can't do. 我之前没有使用过ASP.NET,因此我不知道它能/不能做什么。 I think i can get an ASP.NET site up and displaying a live feed but how do i implement the bit that is always running in the background processing stills from the live feed and logging the incidents? 我想我可以建立一个ASP.NET站点并显示实时供稿,但是如何实现始终在后台运行的位,从实时供稿处理静态事件并记录事件呢?

Any help is appreciated. 任何帮助表示赞赏。 Thanks in advance. 提前致谢。

You probably want to use something like a Windows Service to do the continuous processing. 您可能想要使用Windows服务之类的东西来进行连续处理。 With the ASP.NET site talking to the database and displaying the feed. 通过ASP.NET站点与数据库对话并显示提要。

ASP.NET is not really suited to doing background tasks. ASP.NET确实不适合执行后台任务。

MySQL should work fine and is free, so if this is not a work related task then it might be a good choice. MySQL应该可以正常工作并且是免费的,因此,如果这不是与工作相关的任务,那么它可能是一个不错的选择。 I have a MySQL database here that contains close to 100GB of text. 我这里有一个MySQL数据库,其中包含接近100GB的文本。 So it should handle what you are suggesting. 因此,它应该处理您的建议。

The the web site and database you're on the right track, ASP.Net and MySql will work just fine for the type of project you are describing. 在正确的网站和数据库ASP.Net和MySql上,您所描述的项目类型都可以正常工作。 However, the processing bit doesn't fit very well into the ASP.net model. 但是,处理位不太适合ASP.net模型。

I would recommend that you think about creating a Windows Service to do whatever processing you need to do. 我建议您考虑创建Windows服务以执行所需的任何处理。 It sounds like you want your processor to work on remote video streams so you'll need to consider how you'll get those live streams to you service and how many concurrent streams you could realistically process. 听起来您想让处理器在远程视频流上工作,因此您需要考虑如何将这些实时流提供给您的服务以及可以实际处理的并行流数量。

Perhaps it may make sense to have a client application or service that your users would run locally which would ping your hosted service when it detected a movement? 也许让您的用户在本地运行客户端应用程序或服务可能有意义,当它检测到移动时对您的托管服务执行ping操作? In that case you'll likely want to look at hosting a WCF service which can be done in IIS or any standalone application (such as the aforementioned Windows Service). 在这种情况下,您可能希望托管WCF服务 ,该服务可以在IIS或任何独立的应用程序(例如上述Windows服务)中完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM