简体   繁体   English

如何将数据推送到客户端的服务器

[英]How to push data to client's server

We have a system in place which collects data from multiple sensors and stores the data into the database, we have a website where our customers can log in and view their data. 我们有一个系统来收集来自多个传感器的数据并将数据存储到数据库中,我们有一个网站,我们的客户可以登录并查看他们的数据。

Now one of our customers wants to display the data from our server into their web site. 现在,我们的一位客户希望将服务器中的数据显示在他们的网站上。 I created a web service and gave them access to collect the data from the our database and import it into their website, but they are requesting us to push the data to their server. 我创建了一个Web服务,并允许他们从我们的数据库中收集数据并将其导入他们的网站,但他们要求我们将数据推送到他们的服务器。 I am not sure how this can be done! 我不确定如何做到这一点! Can anyone help me with this? 谁能帮我这个?

Thanks 谢谢

You cannot push your data to any other server unless you have remote access to their server. 除非您可以远程访问其服务器,否则无法将数据推送到任何其他服务器。 You can either ask them to provide you the remote access to their database and write a service to push your data into their server or database . 您可以要求他们为您提供对其数据库的远程访问,并编写服务以将您的数据推送到他们的服务器或数据库中。 Or you can work out with your client to design a mechanism where their website would call you web service to display you data into their website. 或者,您可以与您的客户一起设计一种机制,让他们的网站称您为网络服务,以便将数据显示在他们的网站上。

Ajax-Push-Engine project could be useful in your scenario. Ajax-Push-Engine项目在您的场景中非常有用。

I did the same thing that you're trying to do a year ago. 我做了一年前你想做的事情。 Apart from viewing the data at the client's side, I also displayed an almost real-time graph where the graph would be updated after a specific interval of time set by you (I set it as 1 second). 除了在客户端查看数据外,我还显示了一个几乎实时的图表,其中图表将在您设置的特定时间间隔后更新(我将其设置为1秒)。 The real-time data transmission thing was handled by PubNub framework. 实时数据传输事物由PubNub框架处理。 You can go through my implementation on GitHub below. 您可以在下面的GitHub上完成我的实现。

RealTime Arduino Sensor Data Visualization RealTime Arduino传感器数据可视化

Well, I think your client want you to export their data with you and put it on their servers. 好吧,我认为您的客户希望您随身携带数据并将其放在服务器上。 Copy whatever sensor data they wish to have, give it away as a deliverable unit. 复制他们希望拥有的任何传感器数据,将其作为可交付单元提供。 Modify your webservice code to be called from and through their web server. 修改要从其Web服务器调用的Web服务代码。 It is almost like finishing up the project. 这几乎就像完成了项目。

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

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