Check patentability & draft patents in minutes with Patsnap Eureka AI!

Methods for serialization and de-serialization, device and system

A deserialization and serialization technology, applied in the computer field, can solve problems such as increasing the cost of BitSet maintenance, and achieve the effect of reducing costs

Active Publication Date: 2011-09-21
SHENZHEN KINGDEE MIDDLEWARE
View PDF2 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] Since each programming language only supports a set of serialization and deserialization methods provided by itself, the existing serialization and deserialization methods are limited by the specific programming language, thus increasing the maintenance of BitSet. cost

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Methods for serialization and de-serialization, device and system
  • Methods for serialization and de-serialization, device and system
  • Methods for serialization and de-serialization, device and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0034] Such as figure 1 As shown, the embodiment of the present invention provides a serialization method, including:

[0035] Step 101: Obtain its own length from the BitSet, and store the length in the data stream;

[0036] Step 102: Obtain each status bit from the BitSet, form each obtained eight status bits into a byte and store it in the data stream.

[0037] In the embodiment of the present invention, each status bit is obtained from the BitSet, and eight status bits obtained each time are formed into a byte and stored in the data stream. Since byte is a basic unit of measurement for measuring storage capacity and transmission capacity, each programming language can recognize bytes, so each programming language can support the serialization method provided by this embodiment, thus Breaking away from the restrictions of specific programming languages ​​reduces the cost of maintaining BitSet.

Embodiment 2

[0039] Such as figure 2 As shown, the embodiment of the present invention provides a serialization method, including:

[0040] Step 201: Obtain its own length from the BitSet and store it in the data stream, wherein the length of the BitSet is the total number of status bits included in itself;

[0041] Wherein, the data stream is a pre-divided storage area, and the data stream may be in the form of a file stream or the like, and is used to store the result obtained after serializing the BitSet.

[0042] Wherein, the object includes one or more conditions, and the status bit of each condition is represented by binary data 0 or 1. BitSet is a data structure, BitSet is used to store the length of the BitSet and the status bit of each condition in the order of the conditions in the object. In addition, one or more bytes of space are allocated in the data stream in advance to store the length of the BitSet, and usually the space of the first four bytes is allocated in the data ...

Embodiment 3

[0061] Such as image 3 As shown, the embodiment of the present invention provides a method for deserializing the data stream obtained in Embodiment 1, including:

[0062] Step 301: Create a BitSet, obtain the length of the BitSet from the data stream, and store the length in the established BitSet;

[0063] Step 302: performing an AND operation on each byte storing the status bits in the data stream with the eight status codes to recover the eight status bits included in each byte;

[0064] Step 303: Store the eight status bits of each byte in the established BitSet.

[0065] In the embodiment of the present invention, each byte storing status bits in the data stream is bit-ANDed with eight status codes, and each byte includes eight status bits, and each byte includes The eight status bits are stored in a BitSet. Since byte is a basic measurement unit for measuring storage capacity and transmission capacity, every programming language can recognize byte, so every programmi...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses methods for serialization and de-serialization, a device and a system, and belongs to the field of computers. The method for the serialization comprises the following steps of: acquiring the length of a BitSet from the BitSet, and storing the length in a data stream; and acquiring each status bit from the BitSet, forming a byte by using the acquired eight-bit status bits acquired each time, and storing the byte in the data stream. The method for the de-serialization comprises the following steps of: establishing one BitSet, acquiring the length of the BitSet from the data stream, and storing the length in the established BitSet; performing bit-AND operation on each byte storing the status bits in the data stream and eight status codes respectively, and restoring the eight-bit status bits contained in each byte; and storing the eight-bit status bits of each byte in the established BitSet. The invention can provide the methods for the serialization and the de-serialization, which breaks away from the limitation of specific programming languages to reduce the maintenance cost of the BitSet.

Description

technical field [0001] The present invention relates to the computer field, in particular to a serialization and deserialization method, device and system. Background technique [0002] BitSet (bit set) is used to store the status bit of each condition in the object, and each status bit is represented by binary data 0 or 1. The status bits stored in the BitSet need to be saved persistently. The status bits stored in the BitSet can be saved by serialization, and each status bit can be restored by deserialization. [0003] At present, programming languages ​​such as Java, C++, and C# all have their own serialization and deserialization methods. Therefore, the serialization methods provided by programming languages ​​such as Java, C++, or C# can be used to serialize BitSet, and correspondingly , use the deserialization method provided by programming languages ​​such as Java, C++ or C# to restore the status bit of each bit in the BitSet. [0004] In the process of realizing th...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/44
Inventor 林育智
Owner SHENZHEN KINGDEE MIDDLEWARE
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More