在两个系统之间传输数据 [英] Transfer data between two systems

查看:196
本文介绍了在两个系统之间传输数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在实施一个程序(MYPRO),以在两个系统之间传输数据;它们之间的通信方法使用套接字.源数据存储在Oracle数据库中(REQUEST表,包含三列.它们是:requestid Number, requestdata Varchar(1000), status Number). MYPRO必须始终检查REQUEST表,如果它有新数据,则MYPRO会获取该数据并将其发送到目标系统.它从目标系统获取响应,并将响应数据更新到源系统(RESPONSE table (requestid Number, responsedata Varchar2(1000))).

REQUEST表中的数据非常大(总计500万条记录,两个系统之间交换的数据约为5000条记录/h).测试时,我发现交换率为1记录/秒(从getdata,更新状态,发送数据,接收数据和更新responsedata),因此源必须为目标系统打开多个套接字.

源系统可以根据允许的用户数(请求数据中的请求用户信息)打开与目标系统的多个连接,发送到目标系统的消息数取决于允许的用户数.

例如,如果源一次具有三个允许的用户,则仅允许源系统向目标系统发送三个消息,其中包含有关三个不同用户的信息.

能否请您告诉我如何实施此程序.对不起,我的英语不好.

谢谢,最好的问候,

Hi all,

I''m implementing a program (MYPRO) to transfer data between two systems; the communication method between them uses sockets. Source data is stored in an Oracle database (REQUEST table, contains three columns. They are: requestid Number, requestdata Varchar(1000), status Number). MYPRO must always check the REQUEST table, if it has new data, MYPRO gets this and sends it to the target system. It gets a response from target system and updates response data to source system (RESPONSE table (requestid Number, responsedata Varchar2(1000))).

Data in REQUEST table is very large (5 million records total and data to exchange between two system is about 5000 record/h). When testing I see that the exchange rate is 1 record/second (from getdata, update status, send data, receive data and update responsedata), so source must open more than one socket to target system.

Source system can open multiple connections to the target system based on the number of permitted users (information for the permitted users is in requestdata) and the number of messages sent to the target system depends on the number of users that have been permitted.

For example, if the source has three permitted users at a time, the source system is only permitted to send three messages with information about the three different users to the target system.

Could you, please show me how to implement this program. Sorry for my bad English.

Thanks and best regards,

推荐答案

我回答这个问题的前提是您要在.Net客户端和.Net服务器之间交换数据.

我要概述的方法已成功用于处理比您的问题所指示的要多得多的数据.

1.直接使用System.Data.OracleClient中的类.
2.创建用于数据交换的"[Serializable]"类,然后使用在.NET中优化序列化的FastSerializer22 [ ^ ]用于序列化和反序列化

3.使用Windows Communication Foundation(WCF)远程处理-这应该减少实现服务器和客户端所需的工作.您知道:

简单性-最大化未完成工作量的艺术-是必不可少的.

  来自敏捷宣言背后的原理
[ ^ ]

希望它将使您免于大量工作,
Espen Harlinn
I''m answering this on the assumption that you are exchanging data between .Net clients and a .Net server.

The aproach I''m going to outline have successfully been used deal with far more data than your question indicates.

1. Use the classes from System.Data.OracleClient directly.
2. Create "[Serializable]" classes for data exchange, and use FastSerializer22 from Optimizing Serialization in .NET[^] for serialization and deserialization

3. Use remoting og windows communication foundation(WCF) - this should cut down on the work required to implement both the server and the client. You know:

Simplicity -- the art of maximizing the amount of work not done -- is essential.

   from Principles behind the Agile Manifesto
[^]

In the hope that it will save you from a lot of work,
Espen Harlinn


嗨Espen Harlinn
首先,感谢您的快速回答.目标系统不是.net服务器,因此我无法使用序列化.
我的问题是如何通过许多渠道将数据分发到目标系统,而这些渠道确实可以并行工作(我不了解设计模式).
你能给个建议吗?谢谢.
Hi Espen Harlinn
First, thanks for your quick answer. Target system here is not .net server so I can''t using serialization.
Problem of me here is how to dispatching data to target system via many channels and those channels do works parallel (I don''t have knowledge about design pattens).
Could you advice. Thanks.


这篇关于在两个系统之间传输数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆