CN115757300A - Electronic file encapsulation method and electronic file decapsulation reading method - Google Patents

Electronic file encapsulation method and electronic file decapsulation reading method Download PDF

Info

Publication number
CN115757300A
CN115757300A CN202211659170.1A CN202211659170A CN115757300A CN 115757300 A CN115757300 A CN 115757300A CN 202211659170 A CN202211659170 A CN 202211659170A CN 115757300 A CN115757300 A CN 115757300A
Authority
CN
China
Prior art keywords
file
electronic
electronic file
attribute information
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211659170.1A
Other languages
Chinese (zh)
Inventor
徐伟
丁祖军
郝志军
崔光振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Hangxing Yongzhi Technology Co ltd
Original Assignee
Beijing Hangxing Yongzhi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Hangxing Yongzhi Technology Co ltd filed Critical Beijing Hangxing Yongzhi Technology Co ltd
Priority to CN202211659170.1A priority Critical patent/CN115757300A/en
Publication of CN115757300A publication Critical patent/CN115757300A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to the technical field of data storage, in particular to an electronic file encapsulation method and an electronic file decapsulation reading method. The electronic file packaging method comprises the following steps: firstly, traversing a plurality of electronic files to be moved to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size. Then creating an empty package file; determining storage position information of each electronic file in an empty package file according to the file size of each electronic file; and sequentially writing the electronic files into the empty package body file according to the storage position information of the electronic files in the empty package body file to obtain an electronic file package body file. Therefore, a plurality of electronic files are uniformly packaged into one electronic file package file, and the time spent on transmitting the electronic file package file to the mobile equipment is short.

Description

Electronic file encapsulation method and electronic file decapsulation reading method
Technical Field
The invention relates to the technical field of data storage, in particular to an electronic file encapsulation method and an electronic file decapsulation reading method.
Background
At present, a common electronic file utilization method is mainly managed and utilized by using a computer device, and with the popularization of mobile devices in recent years, partial functions which have been required to be managed and utilized by computers in the past are gradually expanded to the mobile devices.
For example, in the archive industry, part of functions of archive inquiry, utilization and the like of the archive management system can be expanded to mobile equipment for implementation, and inquiry and utilization are performed in a mobile application program client mode, so that the experience of portability, touch and the like different from the experience of the traditional computer equipment is brought. The mobile device mainly uses the electronic files in an online mode and an offline mode, the online mode can access the electronic files on the server through the network anytime and anywhere, but in some application scenes where the mobile device network cannot be used or is not allowed to be used, the offline mode needs to be adopted. The off-line mode mainly copies a plurality of electronic files to the mobile equipment for utilization, and the main method at present is to directly copy the electronic files to be utilized to the mobile equipment or copy the electronic files after compression, and the two methods have some defects through practice. When directly copying electronic files, if the number of the electronic files is large, the copying speed is very slow; when the mobile device uses the electronic file, the mobile device needs to decompress the electronic file first and then use the electronic file, which occupies more storage space and system resources of the mobile device.
Therefore, in the prior art, certain technical defects still exist when the electronic file is transmitted to the mobile device for use.
Disclosure of Invention
The invention provides an electronic file encapsulation method and an electronic file decapsulation reading method, which are used for solving the technical problem that a long time is required for transmitting a plurality of electronic files to mobile equipment in the prior art.
In one aspect, the present invention provides an electronic file packaging method, including:
traversing a plurality of electronic files to be moved to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size;
creating an empty capsule file;
determining storage position information of each electronic file in the empty package body file according to the file size of each electronic file;
and sequentially writing each electronic file into the empty packaging body file according to the storage position information of each electronic file in the empty packaging body file to obtain an electronic file packaging body file.
The electronic file packaging method provided by the invention further comprises the following steps: updating the storage position information of each electronic file in the empty packaging body file into attribute information corresponding to the electronic file;
the storage position information comprises an attribute information storage position and a file content storage position;
determining storage location information of each electronic file in the empty package body file according to the file size of each electronic file, including:
determining the attribute information storage position of the attribute information of the electronic file in the empty packaging body file according to the size of the attribute information of each electronic file; determining the file content storage position of the file content of the electronic file in the empty package body file according to the size of the file content of each electronic file;
the sequentially writing the electronic files into the empty package body file according to the storage location information of the electronic files in the empty package body file to obtain an electronic file package body file, including:
sequentially writing the attribute information of each electronic file into the empty packaging body file according to the attribute information storage position of each electronic file; and sequentially writing the file contents of the electronic files into the empty package body file according to the file content storage positions of the electronic files to obtain the electronic file package body file.
According to the electronic file packaging method provided by the invention, the attribute information of the electronic file further comprises the storage structure information of a plurality of subfiles in each electronic file.
The electronic file packaging method provided by the invention further comprises the following steps:
before sequentially writing the attribute information of each electronic file into the empty packaging body file according to the attribute information storage position of each electronic file, the electronic file packaging method further comprises the steps of encrypting the storage position information and the attribute information of each electronic file into first byte information;
before sequentially writing the file contents of each electronic file into the empty packaging body file according to the file content storage position of each electronic file, the electronic file packaging method further comprises the step of encrypting the file contents corresponding to the electronic file into second byte information.
On the other hand, the invention also provides an electronic file decapsulation reading method, which comprises the following steps:
downloading the electronic file package body file to a target mobile device; the electronic file packaging body file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files; the attribute information of the electronic file comprises a file name, a file type, a file size and storage position information;
reading the electronic file packaging body file to obtain attribute information of each electronic file;
and acquiring the file content of each electronic file according to the attribute information of each electronic file.
According to the electronic file decapsulation reading method provided by the invention, the method further comprises the following steps:
after reading the electronic file packaging body file to obtain the attribute information of each electronic file, allocating unique identification information to the attribute information of each electronic file, and writing the unique identification information and the file information corresponding to each electronic file into a cache position in a key value pair mode;
and acquiring unique identification information corresponding to the electronic file after acquiring the file content of each electronic file according to the attribute information of each electronic file, and calling the file content corresponding to the unique identification information according to the unique identification information corresponding to the electronic file when acquiring the electronic file next time.
According to the electronic file packaging method provided by the invention, reading the electronic file packaging body file to acquire the attribute information of each electronic file comprises the following steps: reading first byte information corresponding to each electronic file in the electronic file packaging body file, and decrypting the first byte information to obtain attribute information corresponding to each electronic file;
the obtaining the file content of each electronic file according to the attribute information of each electronic file includes: and acquiring second byte information corresponding to the electronic files according to the attribute information of each electronic file, and decrypting the second byte information to obtain file contents corresponding to the electronic files.
In another aspect, the present invention further provides an electronic file packaging apparatus, including:
the acquisition module is used for traversing a plurality of electronic files to be moved so as to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size;
the creating module is used for creating an empty packaging body file;
the processing module is used for determining the storage position information of each electronic file in the empty packaging body file according to the file size of each electronic file;
and the packaging module is used for sequentially writing the electronic files into the empty packaging body file according to the storage position information of the electronic files in the empty packaging body file to obtain an electronic file packaging body file.
On the other hand, the invention also provides an electronic file decapsulation reading device, comprising:
the downloading module is used for downloading the electronic file packaging body file to the target mobile equipment; the electronic file packaging body file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files; the attribute information of the electronic file comprises a file name, a file type, a file size and storage position information; the first reading module is used for reading the electronic file packaging body file so as to obtain attribute information of each electronic file;
and the second reading module is used for acquiring the file content of each electronic file according to the attribute information of each electronic file.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes any one of the electronic file packaging methods when executing the program; or any one of the electronic file decapsulation reading methods.
The present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the electronic file packaging method as described in any of the above; or any one of the electronic file decapsulation reading methods.
The invention also provides a computer program product comprising a computer program, wherein the computer program realizes the electronic file packaging method according to any one of the above methods when being executed by a processor; or any one of the electronic file decapsulation reading methods.
The electronic file packaging method provided by the invention comprises the steps that at an equipment end, a plurality of electronic files to be moved are traversed to obtain attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size; then creating an empty package file; determining storage position information of each electronic file in an empty package file according to the file size of each electronic file; and sequentially writing the electronic files into the empty package body file according to the storage position information of the electronic files in the empty package body file to obtain an electronic file package body file. Therefore, a plurality of electronic files are uniformly packaged into one electronic file package body file, and the time spent when the electronic file package body file is transmitted to the mobile equipment is short.
And after the mobile equipment receives the electronic file packaging body file, the attribute information and the file content in the electronic file packaging body file can be directly read without decompression, so that more storage space and processor resources are saved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of an electronic document packaging method according to an embodiment of the present invention;
fig. 2 is a flowchart of an electronic file decapsulation reading method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an electronic document packaging apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic file decapsulation reading apparatus according to an embodiment of the present invention;
fig. 5 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the embodiments of the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B, which may indicate: a exists singly, A and B exist simultaneously, and B exists singly, wherein A and B can be singular or plural. In the description of the present invention, the character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
If a plurality of electronic files are directly copied to the mobile device, the copying speed is very slow if the number of the electronic files is large; if a plurality of electronic files are copied in a compressed package mode by packaging, the electronic files need to be decompressed and then utilized when being utilized on the mobile device, and therefore more storage space and system resources of the mobile device are occupied. In order to overcome the two technical defects, an embodiment of the present invention provides an electronic file packaging method, where when a plurality of electronic files on a computer device need to be transmitted to a mobile device, a plurality of electronic files to be moved are traversed first to obtain attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size; and then writing the attribute information and the file content of each electronic file into an empty package file to obtain an electronic file package file. Thus, the electronic files are packaged into the electronic file packaging body file, so that the time spent when the electronic files are transmitted to the mobile equipment is short. And after the mobile equipment receives the electronic file packaging body file, the attribute information and the file content in the electronic file packaging body file can be directly read without decompression, so that more storage space and processor resources are saved.
Hereinafter, the electronic file packaging method provided by the present invention will be described in detail by using several specific embodiments and drawings. It is to be understood that the following detailed description may be combined with other embodiments, and that the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a schematic flowchart of an electronic file packaging method according to an embodiment of the present invention, where the electronic file packaging method can be executed by a software and/or hardware device. The hardware device may be an embedded device, or a personal computer, or a device such as a server. As shown in fig. 1, the electronic file packaging method includes:
s101, traversing a plurality of electronic files to be moved to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size.
Generally, an electronic file mainly includes two parts, namely attribute information and file content, where the attribute information is used to describe or mark a file name, a file type and a file size of the electronic file, for example, the file name is "zhang san personal profile", and the file type may also be understood as a file format, for example, the file type is a TXT format file, a DOC format file or a PPT format file, and the like. The file size indicates the amount of storage space occupied by the electronic file. The content of the file, i.e. the content information contained in the electronic file, may be in a text format, a picture, a type of video or audio. For example, an electronic file having a file name of "zhang san person profile" corresponds to the personal information or personal history information of zhang san in text format.
For example, the attribute information of the electronic file further includes storage structure information of a plurality of subfiles in each electronic file, for example, a plurality of subfiles are included in one electronic file, each subfile may include a plurality of subfiles, and the storage structure information refers to a storage location of each subfile in the current electronic file and a storage location of a file subordinate to each subfile.
For example, an electronic file encapsulation module or electronic file encapsulation software is installed on the computer device, and the electronic file encapsulation software is opened, so that the storage location on the computer device can be browsed. Then, the user selects all electronic files to be packaged, and after the electronic files are packaged by clicking, electronic file packaging software can automatically traverse all the electronic files to obtain the file name, the file type, the file size, the storage structure information of the sub files and the file content of each electronic file. At the same time, the electronic file packaging software also creates a temporary copy of all electronic files in a temporary directory.
S102, creating an empty package file.
Illustratively, an empty storable capsule file is created, i.e., a single complete transport file that includes a file header and file contents. For example, the electronic file packaging software creates an empty package file on the default electronic file package output path.
S103, determining the storage position information of each electronic file in the empty package file according to the file size of each electronic file.
The storage position information of each electronic file comprises an attribute information storage position and a file content storage position, wherein the attribute information storage position is used for storing the attribute information of the electronic file, and the file content storage position is used for storing the file content of the electronic file.
After the storage position information of each electronic file in the empty packaging body file is determined, the storage position information of each electronic file in the empty packaging body file is updated into the attribute information corresponding to the electronic file, and therefore the storage position of the file content of the electronic file can be determined according to the attribute information.
In an example, determining storage location information of each electronic file in an empty package file according to a file size of each electronic file specifically includes:
determining the attribute information storage position of the attribute information of the electronic file in the empty package file according to the size of the attribute information of each electronic file; and determining the file content storage position of the file content of the electronic file in the empty package file according to the size of the file content of each electronic file.
And S104, sequentially writing each electronic file into the empty package file according to the storage position information of each electronic file in the empty package file to obtain an electronic file package file.
Illustratively, according to the storage location information of each electronic file in the empty package file, sequentially writing each electronic file into the empty package file to obtain an electronic file package file, which specifically includes:
sequentially writing the attribute information of each electronic file into an empty packaging body file according to the attribute information storage position of each electronic file; and sequentially writing the file contents of the electronic files into the empty package files according to the file content storage positions of the electronic files to obtain the electronic file package files.
In other words, an empty package file is first created, and then the file contents and attribute information of the respective electronic files are sequentially written into the empty package file. Specifically, the temporary copies of all electronic files created in the temporary directory may be sequentially written into the empty capsule file. For example, the attribute information of all electronic files is written into an empty package file sequentially, the attribute information of each electronic file may further include storage location information of the electronic file in the package file, and a start location and an end location corresponding to the file content of the electronic file may be determined according to the size of the file content. Generally, the attribute information of each electronic file is sequentially stored in the head position of an empty package file, and after the attribute information of all the electronic files is stored, the file content of each electronic file is sequentially stored, wherein the attribute information storage sequence of the electronic files corresponds to the file content storage sequence. As can be seen from the above, the header part of the packaged electronic file is the file name, file type, file size, storage structure information of a plurality of subfiles, and the like of each electronic file stored sequentially. After the attribute information of all the electronic files is stored, the file contents are stored according to a mode corresponding to the storage sequence of the attribute information of the electronic files, namely the storage position of the file attribute signal is advanced, and then the storage position of the file contents is advanced, so that a plurality of electronic files are packaged into an integral electronic file package file.
For example, in order to facilitate storage and transmission of the electronic files, before the attribute information of each electronic file is sequentially written into the empty package file according to the attribute information storage location of each electronic file, the electronic file packaging method further includes encrypting the storage location information and the attribute information of each electronic file into first byte information. Namely, the storage position information and the attribute information of each electronic file are converted into corresponding byte information for storage.
Meanwhile, before the file contents of each electronic file are sequentially written into an empty package file according to the file content storage position of each electronic file, the electronic file packaging method further comprises the following steps: and encrypting the file content corresponding to the electronic file into second byte information. That is, the file content corresponding to the electronic file is also converted into byte information for storage.
If a plurality of electronic files are transmitted to the mobile device in sequence, the mobile device needs to calculate the size of each electronic file, allocate a storage position to each electronic file, and wait for only one electronic file to be stored and then continue to store the next electronic file, which greatly affects the transmission efficiency of the electronic files.
It can be seen that, by using the electronic file packaging method of the embodiment, information of a plurality of electronic files can be read and uniformly packaged to obtain an integral electronic file package body file. Therefore, when the electronic file packaging body file is transmitted to the mobile equipment, the mobile equipment only needs to calculate and determine a storage position according to the size of the electronic file packaging body file, and then continuous storage can be completed, so that the file transmission and storage efficiency is improved.
Fig. 2 is a flowchart of an electronic file decapsulation reading method according to an embodiment of the present invention, and as shown in fig. 2, the electronic file decapsulation reading method includes:
s201, downloading an electronic file package file to a target mobile device, wherein the electronic file package file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files. The attribute information of the electronic file comprises a file name, a file type, a file size and storage position information.
For example, the electronic file enclosure file may be downloaded to a designated location on the target mobile device.
Optionally, the electronic file decapsulation reading software that responds may be installed in advance on the target mobile device, and then the electronic file encapsulation body file is copied to the read target of the electronic file decapsulation reading software, where the directory is read, that is, the preset read path of the electronic file decapsulation reading software.
S202, reading the electronic file package files to obtain attribute information of each electronic file.
Opening electronic file decapsulation reading software, and acquiring attribute information and file contents of each electronic file included in an electronic file encapsulation file in a read target, namely reading a file name, a file type, a file size and storage structure information of a plurality of sub-files of the electronic file; then the user can browse the attribute information of each electronic file on the mobile device, and when the user needs to read the file content of a certain electronic file, the user clicks the electronic file to generate an electronic file content acquisition request.
Optionally, before reading the electronic file package file, the electronic file package file is also checked to determine whether the electronic file package file is damaged or part of the information is lost during transmission, so as to ensure the integrity of the information in the electronic file package file.
For example, when the attribute information of the electronic file is read, first byte information corresponding to each electronic file in the electronic file package file is read first, and the first byte information is decrypted to obtain the attribute information corresponding to each electronic file. The stored byte information is converted, recombined and restored into initial readable file information, and the readable file information comprises a text file, a picture file or a video file and the like.
S203, acquiring the file content of each electronic file according to the attribute information of each electronic file.
For example, according to the electronic file content obtaining request and the attribute information (including the storage location information) of the electronic file, the corresponding file content may be obtained, and then the corresponding file content may be displayed, so that the user may browse the file content of the electronic file.
Illustratively, when the file content of each electronic file is read, second byte information corresponding to the electronic file is acquired according to the attribute information of each electronic file, the second byte information is decrypted to obtain the file content corresponding to the electronic file, and the stored byte information corresponding to the file content is converted and recombined to restore the original readable file content, wherein the readable file content comprises a text file, a picture file or a video file. And finally, responding the decrypted file content to the corresponding acquisition request.
Optionally, after the electronic file package file is read to obtain the attribute information of each electronic file, unique identification processing is further performed on the file name, the file type, the file size, the storage structure information of a plurality of subfiles, and the like of each electronic file, that is, unique identification information is allocated to the attribute information of each electronic file, and then the unique identification information and the file information corresponding to each electronic file are written into the cache position in a key value pair manner. The method comprises the steps of obtaining unique identification information corresponding to the electronic files after obtaining file contents of the electronic files according to attribute information of the electronic files, namely simultaneously recording the unique identification information corresponding to the electronic files by the mobile equipment, and directly calling the file contents corresponding to the unique identification information according to the unique identification information corresponding to the electronic files when obtaining the electronic files next time so as to improve the efficiency of reading the file contents.
Therefore, by adopting the electronic file decapsulation reading method of the embodiment, the mobile device can read the related information of the electronic file without decoding the electronic file encapsulation file, thereby saving the storage space and the system resources.
The electronic file encapsulation device and the electronic file decapsulation reading device provided by the present invention are described below, the electronic file encapsulation device described below and the electronic file encapsulation method described above may be referred to in a corresponding manner, and the electronic file decapsulation reading device and the electronic file decapsulation reading method described above may be referred to in a corresponding manner.
Fig. 3 is a schematic structural diagram of an electronic file packaging device according to an embodiment of the present invention, and as shown in fig. 3, the electronic file packaging device 30 includes: an acquisition module 301, a creation module 302, a processing module 303, and an encapsulation module 304.
The acquiring module 301 is configured to traverse a plurality of electronic files to be moved to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size.
A creating module 302 for creating an empty capsule file.
The processing module 303 is configured to determine, according to the file size of each electronic file, storage location information of each electronic file in an empty package file.
The packaging module 304 is configured to sequentially write each electronic file into an empty package file according to the storage location information of each electronic file in the empty package file, so as to obtain an electronic file package file.
Optionally, the attribute information of the electronic file further includes storage structure information of a plurality of subfiles in each electronic file.
Optionally, the electronic file packaging apparatus 30 further includes an updating module, configured to update the storage location information of each electronic file in the empty package file into the attribute information corresponding to the electronic file; the storage location information includes an attribute information storage location and a file content storage location.
Optionally, the processing module 303 is specifically configured to:
determining the attribute information storage position of the attribute information of the electronic file in the empty package file according to the size of the attribute information of each electronic file; and determining the file content storage position of the file content of the electronic file in the empty package file according to the size of the file content of each electronic file.
Optionally, the encapsulation module 304 is specifically configured to:
sequentially writing the attribute information of each electronic file into an empty package file according to the attribute information storage position of each electronic file; and sequentially writing the file contents of the electronic files into the empty package files according to the file content storage positions of the electronic files to obtain the electronic file package files.
Optionally, the encapsulation module 304 is specifically further configured to: before sequentially writing the attribute information of each electronic file into an empty package file according to the attribute information storage location of each electronic file, the storage location information and the attribute information of each electronic file are encrypted into first byte information.
Optionally, the encapsulation module 304 is further specifically configured to:
before sequentially writing the file contents of each electronic file into the empty package file according to the file content storage location of each electronic file, the electronic file packaging method further includes: and encrypting the file content corresponding to the electronic file into second byte information.
The electronic file packaging apparatus 30 provided in the embodiment of the present invention can implement the technical solution of the electronic file packaging method in any of the above embodiments, and the implementation principle and the beneficial effects thereof are similar to those of the electronic file packaging method, and reference may be made to the implementation principle and the beneficial effects of the electronic file packaging method, which are not described herein again.
Fig. 4 is a schematic structural diagram of an electronic file decapsulation reading apparatus according to an embodiment of the present invention, and as shown in fig. 4, the electronic file decapsulation reading apparatus 40 may include:
a downloading module 401, configured to download the electronic file package file to a target mobile device; the electronic file packaging body file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files; the attribute information of the electronic file comprises a file name, a file type, a file size and storage position information.
The first reading module 402 is configured to read the electronic file package file to obtain attribute information of each electronic file.
The second reading module 403 is configured to obtain file contents of each electronic file according to the attribute information of each electronic file.
Optionally, the first reading module 402 is further configured to:
after the electronic file packaging body file is read to obtain the attribute information of each electronic file, unique identification information is distributed to the attribute information of each electronic file, and the unique identification information and the file information corresponding to each electronic file are written into a cache position in a key value pair mode.
Optionally, the first reading module 402 is further configured to:
and acquiring unique identification information corresponding to the electronic files after acquiring the file contents of the electronic files according to the attribute information of the electronic files, and calling the file contents corresponding to the unique identification information according to the unique identification information corresponding to the electronic files when acquiring the electronic files next time.
Optionally, the first reading module 402 is specifically configured to:
and reading first byte information corresponding to each electronic file in the electronic file packaging body file, and decrypting the first byte information to obtain attribute information corresponding to each electronic file.
Optionally, the second reading module 403 is specifically configured to:
and acquiring second byte information corresponding to the electronic files according to the attribute information of each electronic file, and decrypting the second byte information to obtain the file content corresponding to the electronic files.
Fig. 5 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device may include: a processor (processor) 510, a communication Interface (Communications Interface) 520, a memory (memory) 530, and a communication bus 540, wherein the processor 510, the communication Interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call logic instructions in the memory 530 to execute an electronic file encapsulation method or an electronic file decapsulation reading method provided by the above methods.
The electronic file packaging method comprises the following steps: traversing a plurality of electronic files to be moved to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size; creating an empty capsule file; determining storage position information of each electronic file in the empty packaging body file according to the file size of each electronic file; and sequentially writing the electronic files into the empty package body file according to the storage position information of the electronic files in the empty package body file to obtain an electronic file package body file.
The electronic file decapsulation reading method may include: downloading an electronic file package file to a target mobile device, wherein the electronic file package file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files; the attribute information of the electronic file comprises a file name, a file type, a file size and storage position information; reading electronic file package files to obtain attribute information of each electronic file; and acquiring the file content of each electronic file according to the attribute information of each electronic file.
In addition, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention further provides a computer program product, which includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute the electronic file encapsulation method or the electronic file decapsulation reading method provided by the above methods.
The electronic file packaging method comprises the following steps: traversing a plurality of electronic files to be moved to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size; creating an empty capsule file; determining storage position information of each electronic file in the empty packaging body file according to the file size of each electronic file; and sequentially writing the electronic files into the empty package body file according to the storage position information of the electronic files in the empty package body file to obtain an electronic file package body file.
The electronic file decapsulation reading method may include: downloading an electronic file package file to a target mobile device, wherein the electronic file package file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files; the attribute information of the electronic file comprises a file name, a file type, a file size and storage position information; reading electronic file package files to obtain attribute information of each electronic file; and acquiring the file content of each electronic file according to the attribute information of each electronic file.
In still another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, is implemented to perform the electronic file encapsulation method or the electronic file decapsulation reading method provided by the above methods.
The electronic file packaging method can comprise the following steps: traversing a plurality of electronic files to be moved to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size; creating an empty capsule file; determining storage position information of each electronic file in the empty package body file according to the file size of each electronic file; and sequentially writing the electronic files into the empty package body file according to the storage position information of the electronic files in the empty package body file to obtain an electronic file package body file.
The electronic file decapsulation reading method may include: downloading an electronic file package file to a target mobile device, wherein the electronic file package file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files; the attribute information of the electronic file comprises a file name, a file type, a file size and storage position information; reading electronic file package files to obtain attribute information of each electronic file; and acquiring the file content of each electronic file according to the attribute information of each electronic file.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. An electronic file packaging method, comprising:
traversing a plurality of electronic files to be moved to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size;
creating an empty capsule file;
determining storage position information of each electronic file in the empty package body file according to the file size of each electronic file;
and sequentially writing the electronic files into the empty packaging body file according to the storage position information of the electronic files in the empty packaging body file to obtain an electronic file packaging body file.
2. The electronic file packaging method according to claim 1, further comprising: updating the storage position information of each electronic file in the empty packaging body file into attribute information corresponding to the electronic file;
wherein the storage location information comprises an attribute information storage location and a file content storage location;
determining storage location information of each electronic file in the empty package body file according to the file size of each electronic file, including: determining the attribute information storage position of the attribute information of the electronic file in the empty packaging body file according to the size of the attribute information of each electronic file; determining the file content storage position of the file content of each electronic file in the empty package body file according to the size of the file content of the electronic file;
the sequentially writing the electronic files into the empty package body file according to the storage location information of the electronic files in the empty package body file to obtain an electronic file package body file, including: sequentially writing the attribute information of each electronic file into the empty packaging body file according to the attribute information storage position of each electronic file; and sequentially writing the file contents of the electronic files into the empty package body file according to the file content storage positions of the electronic files to obtain the electronic file package body file.
3. The electronic file encapsulation method according to claim 1, wherein the attribute information of the electronic file further includes storage structure information of a plurality of subfiles in each electronic file.
4. The electronic file packaging method according to claim 2, wherein before sequentially writing the attribute information of the respective electronic files into the empty package file according to the attribute information storage locations of the respective electronic files, the electronic file packaging method further comprises encrypting the storage location information and the attribute information of the respective electronic files into first byte information;
before sequentially writing the file contents of each electronic file into the empty packaging body file according to the file content storage position of each electronic file, the electronic file packaging method further comprises the step of encrypting the file contents corresponding to the electronic file into second byte information.
5. An electronic file decapsulation reading method is characterized by comprising the following steps:
downloading the electronic file package file to a target mobile device; the electronic file packaging body file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files; the attribute information of the electronic file comprises a file name, a file type, a file size and storage position information;
reading the electronic file packaging body file to obtain attribute information of each electronic file;
and acquiring the file content of each electronic file according to the attribute information of each electronic file.
6. The electronic file unsealing reading method according to claim 5, further comprising:
after reading the electronic file packaging body file to obtain the attribute information of each electronic file, allocating unique identification information to the attribute information of each electronic file, and writing the unique identification information and the file information corresponding to each electronic file into a cache position in a key value pair mode;
and acquiring unique identification information corresponding to the electronic file after acquiring the file content of each electronic file according to the attribute information of each electronic file, and calling the file content corresponding to the unique identification information according to the unique identification information corresponding to the electronic file when acquiring the electronic file next time.
7. The method for reading the electronic file decapsulation according to claim 5, wherein the reading the electronic file encapsulation file to obtain the attribute information of each electronic file includes: reading first byte information corresponding to each electronic file in the electronic file packaging body file, and decrypting the first byte information to obtain attribute information corresponding to each electronic file;
the obtaining the file content of each electronic file according to the attribute information of each electronic file includes: and acquiring second byte information corresponding to the electronic files according to the attribute information of each electronic file, and decrypting the second byte information to obtain file contents corresponding to the electronic files.
8. An electronic document packaging apparatus, comprising:
the acquisition module is used for traversing a plurality of electronic files to be moved so as to acquire attribute information and file contents of each electronic file; the attribute information of the electronic file comprises a file name, a file type and a file size;
the creating module is used for creating an empty packaging body file;
the processing module is used for determining the storage position information of each electronic file in the empty packaging body file according to the file size of each electronic file;
and the packaging module is used for sequentially writing each electronic file into the empty packaging body file according to the storage position information of each electronic file in the empty packaging body file to obtain an electronic file packaging body file.
9. An electronic file decapsulation reading apparatus, comprising:
the downloading module is used for downloading the electronic file packaging body file to the target mobile equipment; the electronic file packaging body file is formed by uniformly packaging a plurality of electronic files, and the electronic files comprise attribute information and file contents of the electronic files; the attribute information of the electronic file comprises a file name, a file type, a file size and storage position information;
the first reading module is used for reading the electronic file packaging body file so as to obtain attribute information of each electronic file;
and the second reading module is used for acquiring the file content of each electronic file according to the attribute information of each electronic file.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the electronic file encapsulation method of any of claims 1 to 6; or the electronic file unsealing and reading method according to any one of claims 5 to 7.
CN202211659170.1A 2022-12-22 2022-12-22 Electronic file encapsulation method and electronic file decapsulation reading method Pending CN115757300A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211659170.1A CN115757300A (en) 2022-12-22 2022-12-22 Electronic file encapsulation method and electronic file decapsulation reading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211659170.1A CN115757300A (en) 2022-12-22 2022-12-22 Electronic file encapsulation method and electronic file decapsulation reading method

Publications (1)

Publication Number Publication Date
CN115757300A true CN115757300A (en) 2023-03-07

Family

ID=85347291

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211659170.1A Pending CN115757300A (en) 2022-12-22 2022-12-22 Electronic file encapsulation method and electronic file decapsulation reading method

Country Status (1)

Country Link
CN (1) CN115757300A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107622067A (en) * 2016-07-13 2018-01-23 杭州海康威视数字技术股份有限公司 A kind of storage, reading and display methods and device to multiple multimedia files
US20220147508A1 (en) * 2020-11-10 2022-05-12 Northrop Grumman Systems Corporation Method of ensuring confidentiality and integrity of stored data and metadata in an untrusted environment
CN115269511A (en) * 2022-07-25 2022-11-01 北京航星永志科技有限公司 Generic electronic file packaging method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107622067A (en) * 2016-07-13 2018-01-23 杭州海康威视数字技术股份有限公司 A kind of storage, reading and display methods and device to multiple multimedia files
US20220147508A1 (en) * 2020-11-10 2022-05-12 Northrop Grumman Systems Corporation Method of ensuring confidentiality and integrity of stored data and metadata in an untrusted environment
CN115269511A (en) * 2022-07-25 2022-11-01 北京航星永志科技有限公司 Generic electronic file packaging method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
GHOTSL: "小文件合并存储问题", 《CSDN》 *

Similar Documents

Publication Publication Date Title
KR102240557B1 (en) Method, device and system for storing data
CN110462578B (en) System for storing data in a tape reel container
US20210181963A1 (en) Native key-value storage enabled distributed storage system
JP5316711B2 (en) File storage device, file storage method and program
US20150339314A1 (en) Compaction mechanism for file system
US10965732B2 (en) Streaming zip
CN105049486A (en) Version management and file pulling control methods for static files, version management and file pulling control devices, and version control system
US11061867B2 (en) Application aware deduplication allowing random access to compressed files
CN109885577B (en) Data processing method, device, terminal and storage medium
JP2012089094A5 (en)
CN109710185B (en) Data processing method and device
US11289115B1 (en) Copying a storage tape
KR101568947B1 (en) Method and system for downloading font file
US20220286511A1 (en) Network attached device for accessing removable storage media
CN107145449B (en) Storage device and storage method
CN108205482A (en) File mount restoration methods
JP2016514393A (en) Serialization for differential encoding
CN111414339B (en) File processing method, system, device, equipment and medium
US7685186B2 (en) Optimized and robust in-place data transformation
EP2686791B1 (en) Variants of files in a file system
CN115757300A (en) Electronic file encapsulation method and electronic file decapsulation reading method
CN114422538B (en) Multi-cloud storage system, multi-cloud data reading and writing method and electronic equipment
CN115292265B (en) Method, equipment and storage medium for automatically importing container mirror image files across network
CN115801769B (en) Channel package acquisition method, electronic equipment and storage medium
US8655929B2 (en) Modification of data within a file

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination