CN114925026A - Electronic file utilization method and device, storage medium and electronic equipment - Google Patents

Electronic file utilization method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114925026A
CN114925026A CN202210531690.8A CN202210531690A CN114925026A CN 114925026 A CN114925026 A CN 114925026A CN 202210531690 A CN202210531690 A CN 202210531690A CN 114925026 A CN114925026 A CN 114925026A
Authority
CN
China
Prior art keywords
index
resource
file
target electronic
subfile
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.)
Granted
Application number
CN202210531690.8A
Other languages
Chinese (zh)
Other versions
CN114925026B (en
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 CN202210531690.8A priority Critical patent/CN114925026B/en
Publication of CN114925026A publication Critical patent/CN114925026A/en
Application granted granted Critical
Publication of CN114925026B publication Critical patent/CN114925026B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/164File meta data generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an electronic file utilization method, an electronic file utilization device, a storage medium and electronic equipment, wherein when an electronic file utilization request sent by a client is received, a target electronic file containing a corresponding file resource type is determined according to file resource type information contained in the electronic file utilization request; acquiring file header data information and file body data information of the target electronic file; sending the file header data information and the file body data information of the target electronic file to the client; and when a target electronic subfile resource acquisition request of the target electronic file sent by the client is received, sending corresponding subfile resource data to the client according to a target electronic subfile resource identifier contained in the target electronic subfile resource acquisition request. According to the method, the file content is obtained as required through the file resource type information and the sub-file resource identification, and the problems that a browser client is blocked or even crashed when a large file is used are well avoided.

Description

Electronic file utilization method and device, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of file processing, in particular to an electronic file utilization method, an electronic file utilization device, a storage medium and electronic equipment.
Background
At present, electronic files mainly relate to types of graphic images, documents, audio, video and the like, and in practical application, relationship files generated by an event, an activity (such as a meeting, an annual meeting and the like) and a set of requirements (such as a compiling and researching process, a growth process and the like) are generally required to be organized together, so that the management, the consultation and the utilization are convenient, and the main management and the utilization modes comprise folders, compression packages, databases, directory lists and online utilization.
At present, with the improvement of the maturity of the internet technology, the utilization mode of electronic files is mainly online utilization. The common online utilization implementation mode is mainly implemented by Adobe Flash Player and Html5, the BS framework is adopted, the electronic files are checked through browsers such as Google and IE, various electronic file checking software is not required to be installed, the problems of organization management and utilization of the traditional electronic files are solved, and the electronic files are better utilized. However, when the number of the electronic files is too large or too large, the electronic files occupy the memory of the browser too much, so that the problems of jamming, even breakdown and the like occur when the browser client is used.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a method, an apparatus, a storage medium, and an electronic device for utilizing an electronic file, so as to solve the technical problem in the prior art that when the electronic file is utilized online, and the electronic file is too large or too large in quantity, the browser memory is excessively occupied, and the problem of jamming, even breakdown, and the like occurs when the browser client is utilized.
The technical scheme provided by the invention is as follows:
a first aspect of an embodiment of the present invention provides an electronic file utilization method, which is applied to a file processing device, where a plurality of electronic files of different types are stored in advance in the file processing device; the electronic file utilization method comprises the following steps: when an electronic file utilization request sent by a client is received, determining a target electronic file containing a corresponding file resource type according to file resource type information contained in the electronic file utilization request; acquiring file header data information and file body data information of the target electronic file; sending the file header data information and the file body data information of the target electronic file to the client; and when a target electronic subfile resource acquisition request of the target electronic file sent by the client is received, sending corresponding subfile resource data to the client according to a target electronic subfile resource identifier contained in the target electronic subfile resource acquisition request.
Optionally, the obtaining header data information and file body data information of the target electronic file includes: reading file header data information of the target electronic file according to the file resource type information, wherein the file header data information comprises metadata index position information and index area index position information; reading corresponding metadata information according to the metadata index position information and reading corresponding index area data information according to the index area index position information; and carrying out structural organization processing on the metadata information and the index area data information according to a preset hierarchy to obtain file body data information of the target electronic file.
Optionally, the index area index position information includes list index position information; the reading of the corresponding index area data information according to the index area index position information includes: sequentially reading all index quantities contained in the corresponding index areas according to the index position information of the index areas; for any index area, responding to the traversal operation of the index contained in the index area; when the number of indexes in the traversed index area is less than or equal to the number of all indexes in the index area, sequentially reading the number of each list index and the position information of each list index in the list index area corresponding to the index area, and reading the list data in the corresponding list data area according to the position information of the list indexes until the number of the read list indexes is equal to the number of all list indexes in the index area; repeating the step of responding to the traversal operation of indexes contained in any index area and the step of sequentially reading each list index number and each list index position information of the list index area corresponding to the index area when the number of indexes in the traversed index area is less than or equal to all the index numbers of the index area, and reading the list data of the corresponding list data area according to the list index position information until the number of the read list indexes is equal to all the list index numbers until the list data of all the index areas are read; and taking the read list data of all the index areas and other index data except the list data in the index areas as corresponding index area data information.
Optionally, the sending, when receiving a target electronic subfile resource acquisition request of the target electronic file sent by the client, corresponding subfile resource data to the client according to a target electronic subfile resource identifier included in the target electronic subfile resource acquisition request includes: acquiring a target index position corresponding to the target electronic subfile resource and the length of the target electronic subfile resource according to the target electronic subfile resource identifier; calculating the starting offset and the ending offset of the target electronic subfile resource according to the index position of the target electronic subfile resource and the length of the target electronic subfile resource; and acquiring corresponding subfile resource data according to the starting offset, the ending offset, the index position of the target electronic subfile resource and the length of the target electronic subfile resource.
Optionally, the calculating a corresponding target electronic subfile resource index position according to the target index position includes: acquiring an index area initial index offset position corresponding to the target index position and determining a corresponding list index offset position according to the index area initial index offset position; determining a corresponding list data index position according to the list index offset position and determining a corresponding list data index offset position according to the list data index position; determining a resource data index position corresponding to the target electronic subfile resource according to the list data index offset position and determining a corresponding resource data index offset position according to the resource data index position; and determining the corresponding resource index position of the target electronic subfile according to the resource data index offset position.
Optionally, the calculating a starting offset and an ending offset of the target electronic subfile resource according to the index position of the target electronic subfile resource and the length of the target electronic subfile resource includes: acquiring the byte length corresponding to the resource length of the target electronic subfile; calculating a corresponding starting offset according to the resource index position of the target electronic subfile and the byte length; and calculating a corresponding ending offset according to the resource index position of the target electronic subfile, the resource length of the target electronic subfile and the byte length.
Optionally, the obtaining, according to the starting offset, the ending offset, the target electronic subfile resource index position, and the target electronic subfile resource length, corresponding subfile resource data includes: determining the acquisition range of the corresponding target electronic subfile resource data according to the starting offset and the ending offset; determining the actual reading starting offset of the corresponding target electronic file resource according to the target electronic file resource index position and the starting offset; determining the resource residual length corresponding to the target electronic subfile resource according to the length of the target electronic subfile resource and the starting offset; and acquiring corresponding sub-file resource data in the acquisition range according to the actual reading starting offset and the resource residual length.
A second aspect of the embodiments of the present invention provides an electronic file utilization apparatus, which is applied to a file processing device, where a plurality of electronic files of different types are stored in advance in the file processing device; the electronic file utilization apparatus includes: the system comprises a determining module, a judging module and a processing module, wherein the determining module is used for determining a target electronic file containing a corresponding file resource type according to file resource type information contained in an electronic file utilization request when the electronic file utilization request sent by a client is received; the acquisition module is used for acquiring file header data information and file body data information of the target electronic file; the first sending module is used for sending the file header data information and the file body data information of the target electronic file to the client; and the second sending module is used for sending corresponding sub-file resource data to the client according to a target electronic sub-file resource identifier contained in the target electronic sub-file resource acquisition request when receiving the target electronic sub-file resource acquisition request of the target electronic file sent by the client.
A third aspect of the embodiments of the present invention provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to cause a computer to execute the electronic file utilization method according to any one of the first aspect and the first aspect of the embodiments of the present invention.
A fourth aspect of embodiments of the present invention provides an electronic device, including: the electronic file utilization method comprises a memory and a processor, wherein the memory and the processor are connected with each other in a communication mode, the memory stores computer instructions, and the processor executes the computer instructions so as to execute the electronic file utilization method according to the first aspect and any one of the first aspect.
The technical scheme provided by the invention has the following effects:
according to the electronic file utilization method provided by the embodiment of the invention, when an electronic file utilization request sent by a client is received, a target electronic file containing a corresponding file resource type is determined according to file resource type information contained in the electronic file utilization request; acquiring file header data information and file body data information of the target electronic file; sending the file header data information and the file body data information of the target electronic file to the client; and when a target electronic subfile resource acquisition request of the target electronic file sent by the client is received, sending corresponding subfile resource data to the client according to a target electronic subfile resource identifier contained in the target electronic subfile resource acquisition request. According to the method, the file content is obtained as required through the file resource type information and the sub-file resource identification, and the problems that a browser client is stuck and even crashed when a large file is used are well avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart of an electronic file utilizing method according to an embodiment of the present invention;
FIG. 2 is a flow diagram providing for sequential reading of electronic files in accordance with an embodiment of the present invention;
FIG. 3 is a hierarchy of organization architecture of electronic document data information provided in accordance with an embodiment of the invention;
FIG. 4 is a block diagram showing the construction of an electronic document utilizing apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a computer-readable storage medium provided according to an embodiment of the present invention;
fig. 6 is a schematic structural 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 embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, 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.
The embodiment of the invention provides an electronic file utilization method, which can be applied to file processing equipment, wherein various electronic files of different types are integrated in the file processing equipment in advance, and the file processing equipment can be a file processing terminal or a server; as shown in fig. 1, the method comprises the steps of:
step S101: when an electronic file utilization request sent by a client is received, determining a target electronic file containing a corresponding file resource type according to file resource type information contained in the electronic file utilization request. Specifically, the electronic files mainly include graphic images, documents, audio, video and other types, and generally speaking, relationship files generated by one event, one activity and a group of requirements are organized together to form corresponding electronic files; the file resource type information represents the type information of each electronic file in a plurality of electronic files stored by the server, and the corresponding target electronic file can be determined at the server according to the data resource type information.
Step S102: and acquiring the file header data information and the file body data information of the target electronic file. Specifically, the header data information indicates a piece of data at the beginning of the corresponding electronic file, which is responsible for a certain task, and is generally used to describe some important attributes of the corresponding electronic file at the beginning. For example, the header of an image file mainly includes information of software that generates or edits the image file and parameters of the image itself.
The file body data information represents the file body data information of the corresponding electronic file except the file header data information, that is, the actual content data information of the corresponding electronic file. A file body such as an image file mainly includes image data and color conversion look-up table or palette data, i.e., main body data of the file.
Step S103: and sending the file header data information and the file body data information of the target electronic file to the client. Specifically, the server returns the header data information and the body data information of the corresponding target electronic file to the client, so that the client can acquire the target electronic sub-file resources from the target electronic file as required according to the acquired header data information and body data information of the target electronic file. For example, for a target electronic file composed of images with different resolution sizes, the client may select an image with any resolution that meets the requirements of use and display as required according to the file data information and the file body data information.
Step S104: and when a target electronic subfile resource acquisition request of the target electronic file sent by the client is received, sending corresponding subfile resource data to the client according to a target electronic subfile resource identifier contained in the target electronic subfile resource acquisition request. Specifically, when a client needs to acquire a part of electronic file data (i.e., a target electronic subfile resource) in the target electronic file, a subfile resource acquisition request is sent to a corresponding server, and after receiving the subfile resource acquisition request, the server can obtain content data (i.e., subfile resource data) corresponding to the subfile resource identifier in the target electronic file according to the subfile resource identifier in the subfile resource acquisition request, and finally returns the content data to the client. The subfile resource identifier may include a resource ID, a page number, and other information identifiers.
According to the electronic file utilization method provided by the embodiment of the invention, the file content is obtained as required through the file resource type information and the sub-file resource identifier, and the problems of jamming, even breakdown and the like of a browser client during large file utilization are well avoided.
As an optional implementation manner of the embodiment of the present invention, step S102 includes: reading file header data information of the target electronic file according to the file resource type information, wherein the file header data information comprises metadata index position information and index area index position information; reading corresponding metadata information according to the metadata index position information and reading corresponding index area data information according to the index area index position information; and carrying out structured organization processing on the metadata information and the index area data information according to a preset hierarchy to obtain file body data information of the target electronic file.
Specifically, first, reading header data information, which mainly includes: metadata index position information and index region index position information. The index area index position information may include a dictionary index position, a key index position, a list index position, and the like. The header data information may further include data information such as an identifier, a version number, creation time, a file code, a file check value, and a file type.
Secondly, reading corresponding metadata information according to the metadata index position information sequence, wherein the metadata information may include information such as size, dimension, DPI and the like.
And finally, reading the corresponding index area data information according to the index area index position information, wherein the index area data information can comprise the storage offset index positions of all files in the index area.
When the index location information of the index area further includes the index location information of the manifest, sequentially reading the number and index locations of the manifest indexes in the manifest index area, and sequentially reading the corresponding information of the resource data amount, width, height, resource index location, etc. in the corresponding manifest data area, including: sequentially reading all index quantities contained in the corresponding index areas according to the index position information of the index areas; for any index area, responding to the traversal operation of the index contained in the index area; when the number of indexes in the traversed index area is less than or equal to the number of all indexes in the index area, sequentially reading the number of each list index and the position information of each list index in the list index area corresponding to the index area, and reading the list data in the corresponding list data area according to the position information of the list index until the number of the read list indexes is equal to the number of all list indexes in the index area; repeating the step of responding to the traversal operation of indexes contained in the index area for any index area and the step of sequentially reading each list index number and each list index position information of the list index area corresponding to the index area when the number of indexes in the traversed index area is less than or equal to all the index numbers of the index area, and reading the list data of the corresponding list data area according to the list index position information until the number of the read list indexes is equal to all the list index numbers until the list data of all the index areas are read; and taking the read list data of all the index areas and other index data except the list data in the index areas as corresponding index area data information.
Specifically, as shown in fig. 2, n indexes are read according to the index position information of the index area, and when reading is started, the number of the read indexes is initialized: i is 1; if i < ═ n (namely the number i of indexes in the traversed index area is less than or equal to the number n of all indexes in the index area), continuously reading the number of list indexes and the index positions in the list index area (namely sequentially reading the number of each list index and the information of each list index position in the list index area corresponding to the index area), reading m list indexes according to the information of the list index positions, and firstly initializing the number of the read list indexes: j is 1; if j ≦ m, sequentially reading the corresponding information (i.e. manifest data) such as the resource data amount, width, height, resource index position, etc. in the corresponding manifest data area, and then continuing to read the next manifest index: j is j +1, until j > m (i.e. j > m when reading the next list index after the number of list indexes read is equal to the number of all list indexes in the index area, and at this time, all the list indexes in the list index area are completely read), continuing to read the next index area index: i-i +1, and ending the reading until i > n (i.e. all indexes indicating the index area are completely read).
Then, all the list data in the read list index area and the index data except the list data in the index area are used as the corresponding index area data information.
Finally, the obtained metadata information and the index area data information are structured and organized according to hierarchy to obtain file body data information of the corresponding target electronic file, as shown in fig. 3, a hierarchical structured organization structure diagram representing data information of any target electronic file.
As an optional implementation manner of the embodiment of the present invention, step S104 includes: acquiring a target index position corresponding to the target electronic subfile resource and the length of the target electronic subfile resource according to the target electronic subfile resource identifier; calculating a corresponding target electronic subfile resource index position according to the target index position; calculating the starting offset and the ending offset of the target electronic subfile resource according to the index position of the target electronic subfile resource and the length of the target electronic subfile resource; and acquiring corresponding subfile resource data according to the starting offset, the ending offset, the index position of the target electronic subfile resource and the length of the target electronic subfile resource.
First, the target electronic subfile resource identifier may include information such as identity authentication, resource ID, page number, etc., and according to the information, the corresponding target index position (i.e., the storage position of the target electronic subfile resource) may be found and the corresponding target electronic subfile resource length may be obtained.
Secondly, calculating to obtain the corresponding target electronic subfile resource index position according to the target index position, wherein the method comprises the following steps: acquiring an index area initial index offset position corresponding to the target index position and determining a corresponding list index offset position according to the index area initial index offset position; determining a corresponding list data index position according to the list index offset position and determining a corresponding list data index offset position according to the list data index position; determining a resource data index position corresponding to the target electronic file resource according to the list data index offset position and determining a corresponding resource data index offset position according to the resource data index position; and determining the corresponding resource index position of the target electronic subfile according to the resource data index offset position.
Wherein, the list index offset position is the index area initial index offset position +8 multiplied by the nth; the index position of the list data is obtained by reading 8 bytes of data from the offset position of the list index; the resource data index position is obtained by reading 8 bytes of data from the offset position of the list data index; the resource index position of the target electronic file is obtained by reading 8 bytes of data from the resource data index offset position. Wherein n is used to indicate the number of indexes read in the sequentially read index area, for example, the 1 st index area contains 3 indexes, and when the 2 nd index in the 1 st index area is sequentially read, n is 2 at this time.
In one embodiment, when the target electronic subfile resource is a graphic image class, the corresponding resource index position can be calculated by the following formula:
the list index offset position is the index area initial index offset position +8 multiplied by the nth position;
the list data index offset position is the list data index position (the list index offset position starts to read 8 bytes of data to obtain) +1+ (graphic image level-1) × 24;
the resource data index offset position is equal to the resource data index position (the list data index offset position starts to read 8 bytes of data to obtain) +4+ 4;
resource index position: reading 8 bytes of data starting from the resource data index offset position.
Then, calculating a start offset and an end offset of the target electronic subfile resource includes: acquiring the byte length corresponding to the resource length of the target electronic subfile; calculating a corresponding starting offset according to the resource index position of the target electronic file and the byte length; and calculating a corresponding ending offset according to the index position of the target electronic subfile resource, the length of the target electronic subfile resource and the length of the byte.
Specifically, the start offset and the end offset are determined according to Range in a resource acquisition request header of the target electronic subfile, that is, the start position and the end position of reading relative to the target electronic subfile are indicated (for example, a drag operation during audio and video playing and a skip operation of a document class and the like both dynamically change the start read position), and are calculated according to the following formula:
the starting offset is equal to the index position +8 of the resource of the target electronic subfile (the byte length corresponding to the resource length of the target electronic subfile);
and the ending offset is the index position of the target electronic subfile resource +8 (the byte length corresponding to the resource length of the target electronic subfile) + the resource length of the target electronic subfile.
Wherein the start offset and the end offset each represent a start offset to be read and an end offset to be read for the target electronic subfile resource data.
When the service terminal has no electronic file acquisition request, the corresponding start offset and end offset in the stored electronic file are both data offsets of the electronic file itself, for example, if an electronic file is 200 in length, its start offset is 0, and its end offset is 200-1 or 199.
Finally, acquiring corresponding sub-file resource data, including: determining the acquisition range of the corresponding target electronic subfile resource data according to the starting offset and the ending offset; determining the actual reading starting offset of the corresponding target electronic file resource according to the target electronic file resource index position and the starting offset; determining the resource residual length corresponding to the target electronic file resource according to the target electronic file resource length and the starting offset; and acquiring corresponding sub-file resource data in the acquisition range according to the actual reading starting offset and the resource residual length.
Specifically, first, the acquisition range of the resource data of the target electronic subfile is: range: bytes ═ i (start offset, end offset)
For example, when the start offset is 0 and the end offset is 499, the target electronic file resource data in the range of 0-499 bytes is represented.
Then, the corresponding actual read start offset and resource remaining length are obtained by the following formula:
the actual reading starting offset is the index position of the target electronic file resource plus the starting offset;
the resource residual length is equal to the resource length of the target electronic subfile-the starting offset;
wherein the actual read start offset indicates a start offset of the target electronic sub-file resource data to be read in the entire package file (target electronic file).
And finally, starting reading from the actual reading starting offset in the acquisition range until all the positions corresponding to the resource residual length are completely read, wherein the corresponding resource data in the reading process is the subfile resource data corresponding to the target electronic subfile resource acquisition request.
In the electronic file utilization method, a certain encapsulated electronic file can be randomly positioned in a network environment through indexing, so that the network utilization efficiency is improved; various electronic file reading and playing software does not need to be installed for different electronic files, and dependence of a client on various third-party software is avoided; the support of large files is improved, the files can be analyzed and processed by acquiring a small part of information such as file headers, indexes, lists, metadata and the like, file resources are acquired as required in the processing process, and the files are displayed while being acquired, so that the user experience is improved; the method has the advantages that the support for large pictures is improved, the client can acquire the regional picture content (namely the target electronic sub-file resource) of the display area according to the image magnification and reduction proportion as required, the problem that the browser is crashed due to the fact that the acquired picture is too large is avoided, and meanwhile the browsing efficiency is improved.
The embodiment of the invention also provides an electronic file utilization device which is applied to the file processing equipment, wherein various electronic files of different types are stored in the file processing equipment in advance; as shown in fig. 4, the apparatus includes:
a determining module 401, configured to, when an electronic file utilization request sent by a client is received, determine, according to file resource type information included in the electronic file utilization request, a target electronic file including a corresponding file resource type; for details, refer to the related description of step S101 in the above method embodiment.
An obtaining module 402, configured to obtain header data information and file body data information of the target electronic file; for details, refer to the related description of step S102 in the above method embodiment.
A first sending module 403, configured to send header data information and file body data information of the target electronic file to the client; for details, refer to the related description of step S103 in the above method embodiment.
A second sending module 404, configured to, when a target electronic subfile resource acquiring request of the target electronic file sent by the client is received, send corresponding subfile resource data to the client according to a target electronic subfile resource identifier included in the target electronic subfile resource acquiring request; for details, refer to the related description of step S104 in the above method embodiment.
According to the electronic file utilization device provided by the embodiment of the invention, the file content is obtained as required through the file resource type information and the sub-file resource identifier, so that the problems of jamming, even breakdown and the like of the browser client during the utilization of large files are well avoided.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: the first reading module is used for reading file header data information of the target electronic file according to the file resource type information, wherein the file header data information comprises metadata index position information and index area index position information; the second reading module is used for reading corresponding metadata information according to the metadata index position information and reading corresponding index area data information according to the index area index position information; and the processing module is used for carrying out structured organization processing on the metadata information and the index area data information according to a preset hierarchy and obtaining file body data information of the target electronic file.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: a third reading module, configured to sequentially read all index quantities included in the corresponding index areas according to the index position information of the index areas; the traversing module is used for responding to the traversing operation of indexes contained in any index area; a fourth reading module, configured to, when the number of indexes in the traversed index area is less than or equal to all the index numbers of the index area, sequentially read each list index number and each list index position information of the list index area corresponding to the index area, and read the list data of the corresponding list data area according to the list index position information until the number of read list indexes is equal to all the list index numbers of the index area; a repeating module, configured to repeat the step of responding to the traversal operation on the indexes included in the index area for any index area and the step of sequentially reading each list index number and each list index position information of the list index area corresponding to the index area when the number of indexes in the traversed index area is less than or equal to all the index numbers of the index area, and reading the list data of the corresponding list data area according to the list index position information until the number of read list indexes is equal to all the list index numbers until the list data of all the index areas are read; and the first determining module is used for taking the read list data of all the index areas and other index data except the list data in the index areas as corresponding index area data information.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: the first acquisition module is used for acquiring a target index position corresponding to the target electronic subfile resource and the length of the target electronic subfile resource according to the target electronic subfile resource identifier; the first calculation module is used for calculating the corresponding resource index position of the target electronic subfile according to the target index position; the second calculation module is used for calculating the starting offset and the ending offset of the target electronic subfile resource according to the index position of the target electronic subfile resource and the length of the target electronic subfile resource; and the second acquisition module is used for acquiring corresponding subfile resource data according to the starting offset, the ending offset, the index position of the target electronic subfile resource and the length of the target electronic subfile resource.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: a third obtaining module, configured to obtain an index area initial index offset position corresponding to the target index position and determine a corresponding list index offset position according to the index area initial index offset position; the second determining module is used for determining the corresponding index position of the list data according to the index offset position of the list data and determining the corresponding index offset position of the list data according to the index position of the list data; a third determining module, configured to determine a resource data index position corresponding to the target electronic file resource according to the manifest data index offset position, and determine a corresponding resource data index offset position according to the resource data index position; and the fourth determining module is used for determining the corresponding resource index position of the target electronic subfile according to the resource data index offset position.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: the fourth obtaining module is used for obtaining the byte length corresponding to the resource length of the target electronic subfile; the third calculation module is used for calculating the corresponding starting offset according to the resource index position of the target electronic subfile and the byte length; and the fourth calculation module is used for calculating a corresponding ending offset according to the index position of the target electronic subfile resource, the length of the target electronic subfile resource and the length of the byte.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: a fifth determining module, configured to determine, according to the starting offset and the ending offset, an acquisition range of corresponding resource data of the target electronic subfile; a sixth determining module, configured to determine, according to the target electronic subfile resource index position and the start offset, an actual read start offset of the corresponding target electronic subfile resource; a seventh determining module, configured to determine, according to the length of the target electronic subfile resource and the starting offset, a resource remaining length corresponding to the target electronic subfile resource; and a fifth obtaining module, configured to obtain, in the obtaining range, corresponding subfile resource data according to the actual read start offset and the resource remaining length.
For the functional description of the electronic file utilization apparatus provided in the embodiment of the present invention, reference is made in detail to the description of the electronic file utilization method in the above embodiment.
An embodiment of the present invention further provides a storage medium, as shown in fig. 5, on which a computer program 501 is stored, and when the instructions are executed by a processor, the steps of the electronic file utilization method in the foregoing embodiments are implemented. The storage medium is also stored with audio and video stream data, characteristic frame data, an interactive request signaling, encrypted data, preset data size and the like. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
Those skilled in the art will appreciate that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can include the processes of the embodiments of the methods described above when executed. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, the electronic device may include a processor 61 and a memory 62, where the processor 61 and the memory 62 may be connected through a bus or in another manner, and fig. 6 takes the connection through the bus as an example.
The processor 61 may be a Central Processing Unit (CPU). The Processor 61 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 62, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as the corresponding program instructions/modules in embodiments of the present invention. The processor 61 executes various functional applications and data processing of the processor by executing the non-transitory software programs, instructions, and modules stored in the memory 62, that is, implements the electronic file utilization method in the above-described method embodiment.
The memory 62 may include a storage program area and a storage data area, wherein the storage program area may store an application program required for operating the device, at least one function; the storage data area may store data created by the processor 61, and the like. Further, the memory 62 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 62 may optionally include memory located remotely from the processor 61, and these remote memories may be connected to the processor 61 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 62 and, when executed by the processor 61, perform the electronic file utilization method as in the embodiment shown in fig. 1-3.
The details of the electronic device may be understood by referring to the corresponding descriptions and effects in the embodiments shown in fig. 1 to fig. 3, and are not described herein again.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. The electronic file utilization method is characterized by being applied to file processing equipment, wherein a plurality of electronic files of different types are stored in the file processing equipment in advance; the method comprises the following steps:
when an electronic file utilization request sent by a client is received, determining a target electronic file containing a corresponding file resource type according to file resource type information contained in the electronic file utilization request;
acquiring file header data information and file body data information of the target electronic file;
sending the file header data information and the file body data information of the target electronic file to the client;
and when a target electronic subfile resource acquisition request of the target electronic file sent by the client is received, sending corresponding subfile resource data to the client according to a target electronic subfile resource identifier contained in the target electronic subfile resource acquisition request.
2. The method according to claim 1, wherein said obtaining header data information and body data information of the target electronic file comprises:
reading file header data information of the target electronic file according to the file resource type information, wherein the file header data information comprises metadata index position information and index area index position information;
reading corresponding metadata information according to the metadata index position information and reading corresponding index area data information according to the index area index position information;
and carrying out structural organization processing on the metadata information and the index area data information according to a preset hierarchy to obtain file body data information of the target electronic file.
3. The method of claim 2, wherein the index region index location information comprises manifest index location information; the reading of the corresponding index area data information according to the index area index position information includes:
sequentially reading all index quantities contained in the corresponding index areas according to the index position information of the index areas;
for any index area, responding to the traversal operation of the index contained in the index area;
when the number of indexes in the traversed index area is less than or equal to the number of all indexes in the index area, sequentially reading the number of each list index and the position information of each list index in the list index area corresponding to the index area, and reading the list data in the corresponding list data area according to the position information of the list indexes until the number of the read list indexes is equal to the number of all list indexes in the index area;
repeating the step of responding to the traversal operation of indexes contained in the index area for any index area and the step of sequentially reading each list index number and each list index position information of the list index area corresponding to the index area when the number of indexes in the traversed index area is less than or equal to all the index numbers of the index area, and reading the list data of the corresponding list data area according to the list index position information until the number of the read list indexes is equal to all the list index numbers until the list data of all the index areas are read;
and taking the list data of all the read index areas and other index data except the list data in the index areas as corresponding index area data information.
4. The method according to claim 1, wherein when receiving a target electronic subfile resource obtaining request of the target electronic file sent by the client, sending corresponding subfile resource data to the client according to a target electronic subfile resource identifier included in the target electronic subfile resource obtaining request includes:
acquiring a target index position corresponding to the target electronic subfile resource and a target electronic subfile resource length according to the target electronic subfile resource identifier;
calculating a corresponding target electronic subfile resource index position according to the target index position;
calculating the starting offset and the ending offset of the target electronic subfile resource according to the index position of the target electronic subfile resource and the length of the target electronic subfile resource;
and acquiring corresponding subfile resource data according to the starting offset, the ending offset, the index position of the target electronic subfile resource and the length of the target electronic subfile resource.
5. The method according to claim 4, wherein said calculating the index position of the corresponding target electronic subfile resource according to the target index position comprises:
acquiring an index area initial index offset position corresponding to the target index position and determining a corresponding list index offset position according to the index area initial index offset position;
determining a corresponding list data index position according to the list index offset position and determining a corresponding list data index offset position according to the list data index position;
determining a resource data index position corresponding to the target electronic file resource according to the list data index offset position and determining a corresponding resource data index offset position according to the resource data index position;
and determining the corresponding resource index position of the target electronic subfile according to the resource data index offset position.
6. The method according to claim 5, wherein the calculating the starting offset and the ending offset of the target electronic subfile resource according to the target electronic subfile resource index position and the target electronic subfile resource length comprises:
acquiring the byte length corresponding to the resource length of the target electronic subfile;
calculating a corresponding starting offset according to the resource index position of the target electronic subfile and the byte length;
and calculating a corresponding ending offset according to the index position of the target electronic subfile resource, the length of the target electronic subfile resource and the length of the byte.
7. The method according to claim 6, wherein the obtaining corresponding subfile resource data according to the start offset, the end offset, the index location of the target electronic subfile resource and the length of the target electronic subfile resource comprises:
determining the acquisition range of the corresponding target electronic subfile resource data according to the starting offset and the ending offset;
determining the actual reading starting offset of the corresponding target electronic subfile resource according to the target electronic subfile resource index position and the starting offset;
determining the resource residual length corresponding to the target electronic file resource according to the target electronic file resource length and the starting offset;
and acquiring corresponding sub-file resource data in the acquisition range according to the actual reading starting offset and the resource residual length.
8. An electronic file utilization device is characterized by being applied to file processing equipment, wherein a plurality of electronic files of different types are stored in the file processing equipment in advance; the method comprises the following steps:
the system comprises a determining module, a judging module and a processing module, wherein the determining module is used for determining a target electronic file containing a corresponding file resource type according to file resource type information contained in an electronic file utilization request when the electronic file utilization request sent by a client is received;
the acquisition module is used for acquiring file header data information and file body data information of the target electronic file;
the first sending module is used for sending the file header data information and the file body data information of the target electronic file to the client;
and the second sending module is used for sending corresponding sub-file resource data to the client according to a target electronic sub-file resource identifier contained in the target electronic sub-file resource acquisition request when receiving the target electronic sub-file resource acquisition request of the target electronic file sent by the client.
9. A computer-readable storage medium characterized in that it stores computer instructions for causing the computer to execute the electronic-file utilizing method according to any one of claims 1 to 7.
10. An electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the electronic document utilization method according to any one of claims 1 to 7.
CN202210531690.8A 2022-05-16 2022-05-16 Electronic file utilization method and device, storage medium and electronic equipment Active CN114925026B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210531690.8A CN114925026B (en) 2022-05-16 2022-05-16 Electronic file utilization method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210531690.8A CN114925026B (en) 2022-05-16 2022-05-16 Electronic file utilization method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114925026A true CN114925026A (en) 2022-08-19
CN114925026B CN114925026B (en) 2022-12-20

Family

ID=82808944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210531690.8A Active CN114925026B (en) 2022-05-16 2022-05-16 Electronic file utilization method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114925026B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464900A (en) * 2009-01-15 2009-06-24 上海交通大学 Light file hiding method in NTFS file system
CN102073624A (en) * 2009-11-25 2011-05-25 李成龙 Method for storing electronic book format
JP2012065087A (en) * 2010-09-15 2012-03-29 For-A Co Ltd Video recording and reproducing apparatus, recording and reproducing method of the same, program of the same, and memory storing program
CN103905694A (en) * 2014-04-10 2014-07-02 中央电视台 Key frame processing method and system
CN106557707A (en) * 2015-09-29 2017-04-05 苏宁云商集团股份有限公司 A kind of method and system for processing document data
CN108806773A (en) * 2018-05-21 2018-11-13 上海熙业信息科技有限公司 Medical image cloud storage platform designing method
CN109413487A (en) * 2018-11-07 2019-03-01 成都索贝数码科技股份有限公司 A method of spelling is dodged after storing fragment transcoding/synthetic video file based on object

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464900A (en) * 2009-01-15 2009-06-24 上海交通大学 Light file hiding method in NTFS file system
CN102073624A (en) * 2009-11-25 2011-05-25 李成龙 Method for storing electronic book format
JP2012065087A (en) * 2010-09-15 2012-03-29 For-A Co Ltd Video recording and reproducing apparatus, recording and reproducing method of the same, program of the same, and memory storing program
CN103905694A (en) * 2014-04-10 2014-07-02 中央电视台 Key frame processing method and system
CN106557707A (en) * 2015-09-29 2017-04-05 苏宁云商集团股份有限公司 A kind of method and system for processing document data
CN108806773A (en) * 2018-05-21 2018-11-13 上海熙业信息科技有限公司 Medical image cloud storage platform designing method
CN109413487A (en) * 2018-11-07 2019-03-01 成都索贝数码科技股份有限公司 A method of spelling is dodged after storing fragment transcoding/synthetic video file based on object

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陆刚兰: "顾及用户体验的复杂三维城市模型组织方法", 《地理与地理信息科学》 *

Also Published As

Publication number Publication date
CN114925026B (en) 2022-12-20

Similar Documents

Publication Publication Date Title
US20100083098A1 (en) Streaming Information that Describes a Webpage
CN110781372B (en) Method and device for optimizing website, computer equipment and storage medium
CN111385316A (en) Resource refreshing method, access method and device
CN109710827B (en) Picture attribute management method and device, picture server and business processing terminal
CN108958755B (en) Method and device for generating application program installation package and electronic equipment
CN109213950B (en) Data processing method and device for browser application of IPTV (Internet protocol television) intelligent set top box
CN109597566B (en) Data reading and storing method and device
CN114925026B (en) Electronic file utilization method and device, storage medium and electronic equipment
CN112565886A (en) Video frame extraction method and device, electronic equipment and readable storage medium
CN110995830B (en) Network resource processing method and device
CN114625407A (en) Method, system, equipment and storage medium for implementing AB experiment
CN115659087B (en) Page rendering method, equipment and storage medium
CN107291870B (en) Method for reading files in distributed storage in batch
CN112491939B (en) Multimedia resource scheduling method and system
CN110362790B (en) Font file processing method and device, electronic equipment and readable storage medium
CN109889608B (en) Dynamic resource loading method and device, electronic equipment and storage medium
CN114637499A (en) Visualization component processing method, device, equipment and medium
CN111143293B (en) Metadata acquisition method, device, equipment and computer readable storage medium
CN114328747A (en) Data synchronization method, data synchronization device, computer equipment and medium
US11379653B2 (en) Rendering method for on-demand loading of PDF file on network
CN113821166A (en) Method, device and equipment for aggregating multi-version small objects
CN113918861A (en) Icon library display method and device
US20140237133A1 (en) Page download control method, system and program for ie core browser
CN104978339A (en) File processing method and equipment, and network system
US20240045701A1 (en) Method, device and system for loading page data

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
GR01 Patent grant
GR01 Patent grant