Unlock instant, AI-driven research and patent intelligence for your innovation.

A method and a system for reducing the storage space occupied by object serialization

A storage space and object technology, applied in the direction of program control design, program control devices, instruments, etc., can solve the problems of large hard disk space, slow file speed, and occupation of hard disk space, so as to reduce the size of hard disk space and increase the writing speed , the effect of saving memory resources

Active Publication Date: 2019-01-11
WUHAN DOUYU NETWORK TECH CO LTD
View PDF6 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] On the one hand, because the json file format or the xml file format belongs to the text stream format and contains certain rules when storing, the content stored in the file is much larger than the actual content, which makes the speed of writing the file slower, and Take up more hard drive space
[0005] On the other hand, in some cases, although the total memory of the object is large, some bytes in the total memory do not store content, and the actual memory used by the object is small
When the memcpy function is directly called to serialize the object, since the object is directly copied to the memory and then written to the hard disk, this process will cause memory waste, and memory data without storage content will also be Serialized to the hard disk, resulting in larger files written to the hard disk, making the writing speed of the file slower, and resulting in a larger hard disk space occupied, and poor user experience

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
  • A method and a system for reducing the storage space occupied by object serialization
  • A method and a system for reducing the storage space occupied by object serialization
  • A method and a system for reducing the storage space occupied by object serialization

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] see figure 1 As shown, the embodiment of the present invention provides a method for reducing the storage space occupied by object serialization, including steps:

[0050] S1: define a Pickle object, and the Pickle object is used to save the content of the object to be serialized in byte stream format;

[0051] S2: Write the content of the object to be serialized into the Pickle object;

[0052]S3: Create a local hard disk file according to the memory address pointer of the Pickle object and the size of the occupied memory, and write the content of the Pickle object into the local hard disk.

[0053] In the embodiment of the present invention, the storage space includes memory space and local hard disk space.

[0054] In the method for reducing the storage space occupied by object serialization in the embodiment of the present invention, by using the Pickle object to perform object serialization, since the Pickle object stores the content of the object to be serialize...

Embodiment 2

[0082] Corresponding to the above-mentioned method for reducing the storage space occupied by object serialization, the embodiment of the present invention also provides an embodiment of a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the The steps of the method for reducing the storage space occupied by object serialization described above, specifically implement the following steps:

[0083] Define a Pickle object, and the Pickle object is used to save the content of the object to be serialized in byte stream format;

[0084] Write the content of the object to be serialized into the Pickle object;

[0085] Create a local hard disk file according to the memory address pointer of the Pickle object and the size of the occupied memory, and write the content of the Pickle object into the local hard disk.

[0086] It should be noted that the method used in the embodiment of the present invention and ...

Embodiment 3

[0089] see Figure 4 As shown, corresponding to the above-mentioned method for reducing the storage space occupied by object serialization, the embodiment of the present invention also provides an embodiment of an electronic device, the electronic device stores a computer program, and when the computer program is executed by a processor, the above-mentioned embodiments are realized. The steps of the method for reducing the storage space occupied by object serialization.

[0090] The electronic device includes a memory and a processor, the memory stores a computer program running on the processor, and the processor implements the following steps when executing the computer program:

[0091] Define a Pickle object, and the Pickle object is used to save the content of the object to be serialized in byte stream format;

[0092]Write the content of the object to be serialized into the Pickle object;

[0093] Create a local hard disk file according to the memory address pointer of...

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 a method and a system for reducing the storage space occupied by object serialization, which relate to the technical field of software development. The method comprises the following steps: a Pickle object is defined, wherein the Pickle object is used for storing the contents of the object to be serialized in a byte stream format; the contents of the object to be serializedare written into the Pickle object; according to the memory address pointer of the Pickle object and the size of the occupied memory, a local hard disk file is created, and the contents of the Pickleobject are written into the local hard disk. The method for reducing the storage space occupied by object serialization provided by the invention reduces the memory occupied by the serialized objectby using the Pickle object, thereby improving the writing speed of the file and reducing the hard disk space required for storing the file.

Description

technical field [0001] The invention relates to the technical field of software development, in particular to a method and system for reducing storage space occupied by object serialization. Background technique [0002] Generally, object serialization refers to the process of converting the state information of an object into a form that can be stored; during serialization, the object writes its current state to the memory or the local hard disk; Reads or deserializes the state of an object from disk and recreates the object. [0003] In the prior art, the general serialization process is: call the memcpy function, copy the object to a memory, and then store the memory data in the hard disk by writing a file, and store the file in the serialization process The format is json file format or xml file format. [0004] On the one hand, because the json file format or the xml file format belongs to the text stream format and contains certain rules when storing, the content sto...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/448
CPCG06F9/4488
Inventor 黄浩
Owner WUHAN DOUYU NETWORK TECH CO LTD