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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


