术语“序列化”在哪里? 来自?

发布于 2024-07-26 07:43:49 字数 135 浏览 5 评论 0原文

我知道序列化是什么,但对我来说,这个术语并没有描述它的含义。

为什么我们称序列化序列化? 将对象转换为原始数据(以及就此而言的膨胀/反序列化)有何适合与术语“串行”相关的任何内容? 谁创造了这个术语以及为什么?

I know what serialization is, but to me, this is one term that does not describe what it means.

Why do we call serialization serialization? What is it about converting objects to raw data (and inflating/deserializing, for that matter) lends itself towards anything that related to the term "serial"? Who coined this term and why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

红玫瑰 2024-08-02 07:43:49

它可能来自网络和通信,需要将数据转换为由 1 和 0 组成的串行流。

维基百科 说:

在计算机科学领域,
数据存储和传输,
序列化的过程是
将对象转换为序列
位以便它可以被持久化
存储介质(例如文件或
内存缓冲区)或通过传输
网络连接链接。 当。。。的时候
重新读取所得的一系列位
根据序列化格式,
它可以用来创建一个
语义相同的克隆
原始对象。 对于很多复杂的
物体,例如那些制造
大量使用参考文献,这
过程并不简单。


我还记得昨晚,我参与的第一个网络项目(1983)使用术语“序列化器”来表示将消息从 C 中的结构转换为一系列字节以写入网络传输的代码部分。 它必须采用逻辑上表示消息的结构,并将其输出到下一个字节到线路上。

这段代码的作者来自 BB&N,所以这给了你寻找历史的方向。

It's probably from networking and communications, where it is necessary to convert data into a serial stream of ones and zeros.

Wikipedia says:

In computer science, in the context of
data storage and transmission,
serialization is the process of
converting an object into a sequence
of bits so that it can be persisted on
a storage medium (such as a file, or a
memory buffer) or transmitted across a
network connection link. When the
resulting series of bits is reread
according to the serialization format,
it can be used to create a
semantically identical clone of the
original object. For many complex
objects, such as those that make
extensive use of references, this
process is not straightforward.


I also remembered last night that the first networking project I worked on (1983) used the term "serializer" for the part of the code that translated messages from structs in C to a series of bytes to be written out to the network transport. It had to take the struct, which logically represented the message, and output it each byte following the next onto the wire.

The authors of this code came from BB&N, so that gives you a direction in which to look for history.

凑诗 2024-08-02 07:43:49

我认为约翰桑德斯是在正确的轨道上,数据作为“流”发送到磁盘或通过网络的事实几乎可以肯定是这个术语的起源。

然而,另一种思考方式是这样的:程序的状态分布在整个内存中,指针/链接指向各处。 您有数组、列表、树、调用堆栈、分配的内存堆等,没有特定的顺序。

当您想要保存某些状态时,您无法使用程序中的大部分信息。 例如,任何指针值或堆栈偏移量(无论是直接使用还是由语言运行时内部使用等)在下次程序运行时都可能无效,因为堆将用于分配稍微不同系列的内存块。 保存这些指针值是没有用的。

为了保存某些状态,您必须“将您的事务按顺序排列”,以便保存的信息只是稍后相关的部分。

I think John Saunders is on the right track, the fact that data is sent to disk or over a network as a "stream" is almost certainly the origin of this term.

Another way to think of it, however, is like this: The state of a program is spread all over memory, with pointers/links pointing all over the place. You have arrays, lists, trees, call stacks, heaps of allocated memory, etc., in no particular order.

When you want to save some state, you cannot use much of the information in your program. For example, any pointer values or stack offsets (whether used directly or used internally by the language runtime, etc.) will likely not be valid the next time your program runs because the heap will have been used to allocate slightly different series of memory blocks. Saving these pointer values would be useless.

To save some state, you have to "put your affairs in order" such that the information being saved is only that part that will be relevant later on.

他夏了夏天 2024-08-02 07:43:49

序列化使用数据结构和指针将内存中的数据转换为一系列字节,旨在保存在顺序介质(例如硬盘)上或通过串行连接等方式传输。

Serialization transforms data in memory with data structures and pointers into a series of bytes designed to be saved on a sequential media, such as a hard disk or transferred through something like a serial connection.

木落 2024-08-02 07:43:49

Serial 的意思是一个接着一个。 因此,它变成了一长串字节流。

Serial means one right after another. Hence, that it becomes one long stream of bytes.

榕城若虚 2024-08-02 07:43:49

它基本上只是指订单中的一系列商品。 连载这个词有时也在文学中使用。

It basically just means a series of items put in an order. The word serialized is also used sometime in literature.

死开点丶别碍眼 2024-08-02 07:43:49

早期,我们将数据保存到磁带等介质上,然后保存到软盘上,这些介质一次只能读/写一位,而存储的本质是相对于读/写头以一定速率移动的磁性介质。 因此,数据的物理布局是 1 和 0,从介质上的某个点开始,到另一个点结束。 因此,数据实际上是以串行方式传输到存储的。

Back in the early days, we saved data to media like tape and then floppy disk, which could only read/write one bit a time, and the nature of the storage was a magnetic media moving at some rate relative to a read/write head. So the physical layout of the data was 1's and 0's starting from some point on the media and ending at another. So data was transferred to storage literally in a serial manner.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文