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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More - R&D
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com
