如何将实时更改数据提取到本地服务器?

时间:2021-11-02 14:22:22

we have to develop a local server which will load itself with the real-time data of a industry (particularly time stamped data points like the temperature of a boiler,pressure values etc) which are stored in industrial server and we want to fetch them and populate our server with it, the data is not streamed at server end so how to fetch it continuously and populate the server...

我们必须开发一个本地服务器,它将自己加载一个行业的实时数据(特别是时间戳数据点,如锅炉的温度,压力值等),它们存储在工业服务器中,我们想要获取它们使用它填充我们的服务器,数据不在服务器端流式传输,以便如何连续获取它并填充服务器...

we would like to store only past 2-3 days of history data as time advances, any recommendations about the server and the back end process to be used to fetch data are welcome, we don't have any idea were to start.. please help...

我们希望只保存过去2-3天的历史数据随着时间的推移,欢迎任何有关服务器的建议和用于获取数据的后端流程,我们都没有任何想法开始..请救命...

1 个解决方案

#1


0  

As others have stated,
You need to provide more information on how do you intend to populate your server.
What API do you have for the "real time server"?
I worked on a management system for solar engery devices
(i.e - devices that produce electricity from solar energy - they are called photo-volatic cells if I remember correctly).
In my case these devices had an FTP access , which provided me files with time-based information.
I constructed a java server that used the following technologies:


A. Apache tomcat web container - This web container allowed me on one hand to hold java logic, and on the other hand to expose HTTP-based interface to the customer.
The Java logic was located in a Servlet- which exposes methods to handle HTTP requests (and allows writing returned data using response objects).

B. The servlet has an init method, I used it to perform some initialization, such as starting a quartz periodic task to probe the ftp servers of the devices.

C. I used a database (postgresql database, which is an open source database) to store configuration for the application, and also to store results.
D. I used another periodic task to archive old data in an archiving table, so the main data table will hold relatively new data.

I ran the archiving task once in a few days, and it simple checked for record that were "too" old, inserted them to the archiving table, and deleted them from the main data table. In order to peform this efficiently I have have decided to use a function that I coded on the database.
E. In order to access the database from the application, I used the Hibernate object relational mapping technology.
This technology allowed me to define mappings between tables and their relations to java objects, and gave me generated create,read (by-id), delete and updated SQL statements.
Using the HQL query language, I wrote some more complex queries.

F. For presentation/client side - I used plain JSP.

You may choose other alternatives such as :
GWT, Apache Wicket, JSF

You may consider using some MVC framework to have some seperation between the logic and the presentation. Such frameworks can be:
Spring-MVC , Struts, and many others.

To conclude, you must understand that Java offers you a variety of technologies, you must define requirements well, and then start investigating which technology can meet your needs.

正如其他人所说,您需要提供有关如何填充服务器的更多信息。您对“实时服务器”有什么API?我研究过太阳能设备的管理系统(即用太阳能发电的设备 - 如果我没记错的话,它们被称为光挥发细胞)。在我的情况下,这些设备具有FTP访问权限,它为我提供了基于时间的信息。我构建了一个使用以下技术的java服务器:A。Apache tomcat web容器 - 这个Web容器一方面允许我保存java逻辑,另一方面允许我向客户公开基于HTTP的接口。 Java逻辑位于Servlet中,它公开处理HTTP请求的方法(并允许使用响应对象写入返回的数据)。 B. servlet有一个init方法,我用它来执行一些初始化,比如启动一个quartz周期任务来探测设备的ftp服务器。 C.我使用了一个数据库(postgresql数据库,它是一个开源数据库)来存储应用程序的配置,也用于存储结果。 D.我使用另一个周期性任务来存档归档表中的旧数据,因此主数据表将保存相对较新的数据。我在几天内运行了一次归档任务,并简单地检查了“太旧”的记录,将它们插入到归档表中,并从主数据表中删除它们。为了有效地执行此操作,我决定使用我在数据库上编码的函数。 E.为了从应用程序访问数据库,我使用了Hibernate对象关系映射技术。这项技术允许我定义表之间的映射及其与java对象的关系,并给我生成了create,read(by-id),删除和更新的SQL语句。使用HQL查询语言,我写了一些更复杂的查询。 F.对于演示文稿/客户端 - 我使用了普通的JSP。您可以选择其他替代方案,例如:GWT,Apache Wicket,JSF您可以考虑使用一些MVC框架在逻辑和表示之间进行一些分离。这样的框架可以是:Spring-MVC,Struts等等。总而言之,您必须了解Java为您提供了各种技术,您必须很好地定义需求,然后开始研究哪种技术可以满足您的需求。

#1


0  

As others have stated,
You need to provide more information on how do you intend to populate your server.
What API do you have for the "real time server"?
I worked on a management system for solar engery devices
(i.e - devices that produce electricity from solar energy - they are called photo-volatic cells if I remember correctly).
In my case these devices had an FTP access , which provided me files with time-based information.
I constructed a java server that used the following technologies:


A. Apache tomcat web container - This web container allowed me on one hand to hold java logic, and on the other hand to expose HTTP-based interface to the customer.
The Java logic was located in a Servlet- which exposes methods to handle HTTP requests (and allows writing returned data using response objects).

B. The servlet has an init method, I used it to perform some initialization, such as starting a quartz periodic task to probe the ftp servers of the devices.

C. I used a database (postgresql database, which is an open source database) to store configuration for the application, and also to store results.
D. I used another periodic task to archive old data in an archiving table, so the main data table will hold relatively new data.

I ran the archiving task once in a few days, and it simple checked for record that were "too" old, inserted them to the archiving table, and deleted them from the main data table. In order to peform this efficiently I have have decided to use a function that I coded on the database.
E. In order to access the database from the application, I used the Hibernate object relational mapping technology.
This technology allowed me to define mappings between tables and their relations to java objects, and gave me generated create,read (by-id), delete and updated SQL statements.
Using the HQL query language, I wrote some more complex queries.

F. For presentation/client side - I used plain JSP.

You may choose other alternatives such as :
GWT, Apache Wicket, JSF

You may consider using some MVC framework to have some seperation between the logic and the presentation. Such frameworks can be:
Spring-MVC , Struts, and many others.

To conclude, you must understand that Java offers you a variety of technologies, you must define requirements well, and then start investigating which technology can meet your needs.

正如其他人所说,您需要提供有关如何填充服务器的更多信息。您对“实时服务器”有什么API?我研究过太阳能设备的管理系统(即用太阳能发电的设备 - 如果我没记错的话,它们被称为光挥发细胞)。在我的情况下,这些设备具有FTP访问权限,它为我提供了基于时间的信息。我构建了一个使用以下技术的java服务器:A。Apache tomcat web容器 - 这个Web容器一方面允许我保存java逻辑,另一方面允许我向客户公开基于HTTP的接口。 Java逻辑位于Servlet中,它公开处理HTTP请求的方法(并允许使用响应对象写入返回的数据)。 B. servlet有一个init方法,我用它来执行一些初始化,比如启动一个quartz周期任务来探测设备的ftp服务器。 C.我使用了一个数据库(postgresql数据库,它是一个开源数据库)来存储应用程序的配置,也用于存储结果。 D.我使用另一个周期性任务来存档归档表中的旧数据,因此主数据表将保存相对较新的数据。我在几天内运行了一次归档任务,并简单地检查了“太旧”的记录,将它们插入到归档表中,并从主数据表中删除它们。为了有效地执行此操作,我决定使用我在数据库上编码的函数。 E.为了从应用程序访问数据库,我使用了Hibernate对象关系映射技术。这项技术允许我定义表之间的映射及其与java对象的关系,并给我生成了create,read(by-id),删除和更新的SQL语句。使用HQL查询语言,我写了一些更复杂的查询。 F.对于演示文稿/客户端 - 我使用了普通的JSP。您可以选择其他替代方案,例如:GWT,Apache Wicket,JSF您可以考虑使用一些MVC框架在逻辑和表示之间进行一些分离。这样的框架可以是:Spring-MVC,Struts等等。总而言之,您必须了解Java为您提供了各种技术,您必须很好地定义需求,然后开始研究哪种技术可以满足您的需求。