如何将突发数据打包成连续的拨号式连接?
我正在开发一个项目,需要从 Iridium 的 短突发数据服务。这是为了取代拨号连接,因此我需要从短突发中取出这些突发数据,并将它们转换为拨号连接的连续流。
我是一个相对缺乏经验的程序员,我唯一知道的语言是java。
我该如何转换数据?有没有关于信息包类型如何操作以及如何在java中操作它们的背景材料?
[为清楚起见进行编辑]
EDIT2:我不需要以相反的方式转换数据(从流到块)
I am working on a project where I need to convert bursts of data (in the range of 300 bytes) from Iridium's short burst data service . This is meant to replace a dial-up connection, so I need to take those bursts of data from the short bursts and convert them into the continuous stream of a dial-up connection.
I'm a relatively inexperienced programmer, and the only language I know is java.
How could I go about converting the data? Are there any background materials on how types of information packets operate and how to manipulate them in java?
[Edited for clarity]
EDIT2: I do not need to convert the data the other way around (from the stream to the chunks)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的问题不清楚你是否正在编写与铱星收发器通信的软件,或者你是否在服务器端,但我假设你在客户端,因为从他们的网站来看,服务器端是标准IP联网。
该程序使用 RS-232 接口和 AT(调制解调器)命令集与收发器通信。使用 Java,您将需要某种串行库;我在这方面拥有丰富的经验,特别是管理一组调制解调器的程序,将其通信桥接到 IP 网络,当时唯一有效且稳定的通信包是 来自 SerialIO 的串行端口。另一个潜在可行的选择是 RxTx 但当我几年前使用它时,它不稳定并且每隔几天就会使 JVM 崩溃。无论使用哪一种,您都可以(并且应该)将自己限制在 JavaComm API 这将使您能够轻松切换串行库。
一旦您与串行端口通信,操作收发器应该与操作调制解调器相同,您将需要参考 doco 了解详细信息。如果它忠实于调制解调器,它将以两种模式运行:命令和数据。在命令模式下,您正在发送以 CRLF 结尾的 AT xxx 命令。当您处于数据模式时,您正在发送二进制数据。
二进制数据的结构几乎肯定是由 Iridium 系统决定的,您需要遵守这一点;再次看到他们的 doco。
如果您有能力定义自己的数据协议,或者如果您在其协议上有自由格式的消息,我最好的建议是使您的消息逻辑上为关键字/值对,以确保长期灵活性。如果您的空间有限(而且 Iridiums 设备的大小限制似乎相当严格),您可以预定义关键字(由客户端和服务器商定)并发送二进制整数,而不是 UTF-8 或 ASCII细绳。该协议应该包含或推断一个非常基本的类型,以便尤其是数字值可以尽可能压缩。
无论如何,我希望这能为您提供一些指导和想法...请随时通过评论提出问题,特别是有关使用 Java 串行端口的特定问题。
Your question is not clear on whether you are writing software to talk to the Iridium transceiver, or whether you are on the server-side, but I will assume you are on the client side since, judging by their website the server side is standard IP networking.
The program talks to the transceiver using an RS-232 interface and the AT (modem) command set. Using Java you will need some sort of serial library; I have had extensive experience with such, in particular with a program to manage a bank of modems bridging their comms to an IP network and at that time the only comms package which worked and was stable was SerialPort from SerialIO. The other potentially viable option is RxTx but when I worked with that several years ago it was unstable and would crash the JVM every few days. With either one you can (and should) constrain yourself to the JavaComm API which will enable you to easily switch out serial libraries.
Once you are talking to your serial port manipulating the transceiver should be the same as manipulating a modem, you will need to refer to the doco for specifics. If it's faithful to a modem, it will operate it two modes, command and data. In command mode you are sending AT xxx commands terminated by CRLF. When you are in data mode you are sending binary data.
The structure of the binary data will almost surely be dictated by the Iridium system, and you will need to conform to that; again see their doco.
If you have the luxury of defining your own data protocol, or if you have free-form messages atop their protocol my best advice is to make your messages logically keyword/value pairs to ensure long-term flexibility. If you are tight on space (and it seems like the size restrictions for Iridiums devices are fairly severe) you could make your keywords predefined (agreed on by client and server) and send a binary integer instead of, say a UTF-8 or ASCII string. The protocol should include or infer a very basic type so that numeric values, especially, can be as condensed as possible.
Anyway, I hope that gives you some direction and ideas of what to expect... please feel free to ask questions via comments, especially for particular questions about using a serial port from Java.