Data decompression methods, apparatuses, electronic devices, media and software products
By decompressing the file on the server-side network, processing and sending the decompressed data directly in the memory, the problem of failure to utilize Internet services in the existing technology is solved, and the processing efficiency of the compressed file is improved.
Patent Information
- Application Number
- CN202111249931.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-10-26
AI Technical Summary
When decompressing files, the existing technology fails to fully utilize the network and computing capabilities of the Internet service, resulting in waste of local disk IO reading and writing and low processing efficiency.
Obtain the file header data of the compressed file through the network for analysis, obtain and decompress the data according to the analysis results, and process and send it in the memory to avoid writing the data to the hard disk.
It reduces local disk IO operations, makes full use of the network and computing capabilities of Internet services, and improves the processing efficiency of compressed files.
Smart Images

Figure CN114172968B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of cloud storage technology, and in particular to a data decompression method, device, electronic device, medium and program product. Background Art
[0002] Cloud storage is one of the applications of cloud technology. Users can upload various files or data to cloud servers for storage. Files stored in the server can include compressed files, such as rar compressed files, zip compressed files, etc. When users want to use the content in the compressed file, they need to decompress the compressed file. The conventional decompression method is to download the compressed file from the server to the user's local client, and then serially read and decompress the compressed file content. This method wastes the read and write of local disk IO and does not fully utilize the network and computing power of Internet services. Summary of the invention
[0003] In order to solve the problems in the related art, the embodiments of the present disclosure provide a data decompression method, device, electronic device, medium and program product.
[0004] In a first aspect, a data decompression method is provided in an embodiment of the present disclosure.
[0005] Specifically, the data decompression method comprises:
[0006] Obtain file header data of compressed files through the network;
[0007] Parsing the file header data to obtain a parsing result;
[0008] According to the parsing result, obtaining compressed data corresponding to the file header data in the compressed file through the network;
[0009] Decompressing the compressed data to obtain decompressed data;
[0010] sending the decompressed data over a network,
[0011] The file header data, the parsing result, the compressed data, and the decompressed data are all stored in the memory of the device executing the data decompression method but are not written into the hard disk of the device.
[0012] In combination with the first aspect, in a first implementation method of the first aspect of the present disclosure, the compressed file includes multiple sub-files, the file header data includes sub-file headers of the sub-files, and the sub-files include: a first type of sub-files corresponding to the compressed directory; and / or a second type of sub-files corresponding to the compressed file.
[0013] In combination with the first implementation of the first aspect, in the second implementation of the first aspect of the present disclosure:
[0014] The obtaining of the file header data of the compressed file through the network includes concurrently obtaining the sub-file headers of the plurality of sub-files through the network; and / or
[0015] The parsing the file header data to obtain the parsing result includes concurrently parsing the multiple sub-file headers to obtain the parsing result; and / or
[0016] The obtaining, through the network, the compressed data corresponding to the file header data in the compressed file according to the parsing result, comprises concurrently obtaining, through the network, the sub-compressed data in the sub-file according to the parsing result; and / or
[0017] The decompressing the compressed data to obtain the decompressed data includes concurrently decompressing corresponding sub-compressed data of a plurality of sub-files to obtain the decompressed data.
[0018] In combination with the first implementation of the first aspect, in a third implementation of the first aspect of the present disclosure:
[0019] The file header also includes a total file header of the compressed file, and the parsing result of the total file header includes the position of the sub-file header in the compressed file;
[0020] The obtaining of the file header data of the compressed file through the network includes obtaining the sub-file header through the network according to the position of the sub-file header in the compressed file.
[0021] In combination with the first implementation of the first aspect, in a fourth implementation of the first aspect of the present disclosure:
[0022] The parsing result of the sub-file header of the first type of sub-file includes the directory name of the corresponding compressed directory;
[0023] The second type of sub-files also include sub-compressed data obtained by compressing the corresponding compressed file, and the parsing result of the sub-file header of the second type of sub-files includes the file name of the corresponding compressed file and the position of the corresponding sub-compressed data in the compressed file.
[0024] In combination with the fourth implementation of the first aspect, in a fifth implementation of the first aspect of the present disclosure, the method further includes:
[0025] Sending, via the network, the directory name of the corresponding compressed directory obtained by parsing the sub-file header of the first type of sub-file; and / or
[0026] Decompressed data obtained by decompressing the sub-compressed data of the second-type sub-files is sent through the network.
[0027] In combination with the first implementation of the first aspect, in a sixth implementation of the first aspect of the present disclosure:
[0028] The file header data includes the total file header of the compressed file;
[0029] The parsing result of the total file header includes: the directory name of the compressed directory corresponding to the first-category sub-file; and / or the file name of the compressed file corresponding to the second-category sub-file and the position of the corresponding sub-compressed data in the compressed file.
[0030] In combination with the first aspect, in a seventh implementation of the first aspect of the present disclosure:
[0031] The parsing of the file header data includes parsing an unparsed file header in the compressed file while acquiring compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0032] The decompressing the compressed data includes decompressing the obtained compressed data while obtaining the compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0033] The sending of the decompressed data through the network includes sending the decompressed data while decompressing the acquired compressed data.
[0034] In a second aspect, a data decompression device is provided in an embodiment of the present disclosure.
[0035] Specifically, the data decompression device comprises:
[0036] A first acquisition module is configured to acquire file header data of a compressed file through a network;
[0037] A parsing module is configured to parse the file header data and obtain a parsing result;
[0038] A second acquisition module is configured to acquire, through the network, compressed data corresponding to the file header data in the compressed file according to the parsing result;
[0039] A decompression module, configured to decompress the compressed data to obtain decompressed data;
[0040] The first sending module is configured to send the decompressed data through a network.
[0041] In combination with the second aspect, in a first implementation method of the second aspect of the present disclosure, the compressed file includes multiple sub-files, the file header data includes sub-file headers of the sub-files, and the sub-files include: a first type of sub-files corresponding to the compressed directory; and / or a second type of sub-files corresponding to the compressed file.
[0042] In combination with the first implementation of the second aspect, in the second implementation of the second aspect of the present disclosure:
[0043] The obtaining of the file header data of the compressed file through the network includes concurrently obtaining the sub-file headers of the plurality of sub-files through the network; and / or
[0044] The parsing the file header data to obtain the parsing result includes concurrently parsing the multiple sub-file headers to obtain the parsing result; and / or
[0045] The obtaining, through the network, the compressed data corresponding to the file header data in the compressed file according to the parsing result, comprises concurrently obtaining, through the network, the sub-compressed data in the sub-file according to the parsing result; and / or
[0046] The decompressing the compressed data to obtain the decompressed data includes concurrently decompressing corresponding sub-compressed data of a plurality of sub-files to obtain the decompressed data.
[0047] In combination with the first implementation of the second aspect, in a third implementation of the second aspect of the present disclosure:
[0048] The file header also includes a total file header of the compressed file, and the parsing result of the total file header includes the position of the sub-file header in the compressed file;
[0049] The obtaining of the file header data of the compressed file through the network includes obtaining the sub-file header through the network according to the position of the sub-file header in the compressed file.
[0050] In combination with the first implementation of the second aspect, in a fourth implementation of the second aspect of the present disclosure:
[0051] The parsing result of the sub-file header of the first type of sub-file includes the directory name of the corresponding compressed directory;
[0052] The second type of sub-files also include sub-compressed data obtained by compressing the corresponding compressed file, and the parsing result of the sub-file header of the second type of sub-files includes the file name of the corresponding compressed file and the position of the corresponding sub-compressed data in the compressed file.
[0053] In combination with the fourth implementation manner of the second aspect, in a fifth implementation manner of the second aspect of the present disclosure, the device further includes:
[0054] A second sending module is configured to send, through the network, a directory name of a corresponding compressed directory obtained by parsing the sub-file header of the first type of sub-file; and / or
[0055] The third sending module is configured to send, through the network, decompressed data obtained by decompressing the sub-compressed data of the second-type sub-file.
[0056] In combination with the first implementation of the second aspect, in a sixth implementation of the second aspect of the present disclosure:
[0057] The file header data includes the total file header of the compressed file;
[0058] The parsing result of the total file header includes: the directory name of the compressed directory corresponding to the first-category sub-file; and / or the file name of the compressed file corresponding to the second-category sub-file and the position of the corresponding sub-compressed data in the compressed file.
[0059] In combination with the second aspect, in a seventh implementation of the second aspect of the present disclosure:
[0060] The parsing of the file header data includes parsing an unparsed file header in the compressed file while acquiring compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0061] The decompressing the compressed data includes decompressing the obtained compressed data while obtaining the compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0062] The sending of the decompressed data through the network includes sending the decompressed data while decompressing the acquired compressed data.
[0063] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer instructions, and wherein the one or more computer instructions are executed by the processor to implement a method as described in any one of the first aspect to the seventh implementation manner of the first aspect.
[0064] In a fourth aspect, a computer-readable storage medium is provided in an embodiment of the present disclosure, on which computer instructions are stored. When the computer instructions are executed by a processor, a method as described in any one of the first aspect to the seventh implementation manner of the first aspect is implemented.
[0065] In a fifth aspect, a computer program product is provided in an embodiment of the present disclosure, comprising computer instructions, which, when executed by a processor, implement the method steps as described in any one of the first aspect to the seventh implementation manner of the first aspect.
[0066] According to the technical solution provided by the embodiment of the present disclosure, the file header data of the compressed file is obtained through the network, the file header data is parsed to obtain the parsing result, and according to the parsing result, the compressed data corresponding to the file header data in the compressed file is obtained through the network, the compressed data is decompressed to obtain the decompressed data, and the decompressed data is sent through the network, wherein the file header data, the parsing result, the compressed data, and the decompressed data are all stored in the memory of the device executing the data decompression method without being written to the hard disk of the device. The decompression server of the technical solution obtains the file header data of the compressed file through the network for parsing, and then obtains the compressed data according to the parsing result for decompression. The data obtained and generated during the whole decompression process are all stored in the memory without being written to the hard disk. Compared with the method of downloading the compressed file to the local and then decompressing it, it makes full use of the network and powerful computing power of the Internet service, reduces the IO operation of the local disk, reduces the processing load of the local client, and improves the processing efficiency of the compressed file.
[0067] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:
[0069] Figure 1 A flow chart showing a data decompression method according to an embodiment of the present disclosure;
[0070] Figure 2 A schematic diagram showing the structure of a compressed file containing multiple sub-files;
[0071] Figure 3A A schematic diagram showing an application scenario of a data decompression method according to an embodiment of the present disclosure;
[0072] Figure 3B A specific implementation example of the data decompression method according to an embodiment of the present disclosure is shown;
[0073] Figure 4 A structural block diagram of a data decompression device according to an embodiment of the present disclosure is shown;
[0074] Figure 5A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;
[0075] Figure 6 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0076] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.
[0077] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.
[0078] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0079] In the present disclosure, the acquisition of user information or user data is an operation authorized and confirmed by the user, or actively selected by the user.
[0080] As mentioned above, the conventional decompression method is to download the compressed file from the server to the user's local client, and then serially read and decompress the compressed file content. This method wastes read and write of local disk IO and does not fully utilize the network and computing power of Internet services.
[0081] The data decompression method provided by the embodiment of the present disclosure is that the decompression server obtains the file header data of the compressed file through the network for parsing, and then obtains the compressed data according to the parsing result for decompression. The data obtained and generated in the whole decompression process are stored in the memory without writing to the hard disk. Compared with the method of downloading the compressed file to the local and then decompressing it, the network and powerful computing power of the Internet service are fully utilized, the IO operation of the local disk is reduced, the processing load of the local client is reduced, and the processing efficiency of the compressed file is improved.
[0082] Figure 1 A flow chart of a data decompression method according to an embodiment of the present disclosure is shown.
[0083] According to an embodiment of the present disclosure, the data decompression method may be executed by a decompression server connected to a server storing compressed files through a network.
[0084] like Figure 1As shown, the data decompression method includes the following steps S101-S105:
[0085] In step S101, the file header data of the compressed file is obtained through the network;
[0086] In step S102, the file header data is parsed to obtain a parsing result;
[0087] In step S103, according to the parsing result, compressed data corresponding to the file header data in the compressed file is obtained through the network;
[0088] In step S104, the compressed data is decompressed to obtain decompressed data;
[0089] In step S105, the decompressed data is sent via a network.
[0090] The file header data, the parsing result, the compressed data, and the decompressed data are all stored in the memory of the device executing the data decompression method but are not written into the hard disk of the device.
[0091] According to an embodiment of the present disclosure, the compressed file format may be ".7z", ".rar", ".zip", ".apz", ".ar", ".bz", ".car", ".dar", ".cpgz", ".f", ".ha", ".hbc", ".hbc2", ".hbe", ".hpk", ".hyp", etc., and the present disclosure does not impose any limitation on this.
[0092] According to an embodiment of the present disclosure, the data obtained and generated by the decompression server during the decompression process can be stored in the memory, and the obtained decompressed data can be sent from the memory to the receiving end without writing to the hard disk, thereby reducing the load of the local IO of the decompression server.
[0093] For example, the file header data of the compressed file obtained through the network can be stored in the memory. The decompression server can read the file header data from the memory and parse the file header data to obtain the parsing result. The compressed data corresponding to the file header data in the compressed file obtained through the network can also be stored in the memory of the decompression server. The decompression server reads the compressed data from the memory for decompression, stores the obtained decompressed data in the memory, and sends the decompressed data through the network. The data obtained and generated during the entire decompression process do not need to be written to the hard disk, which reduces the load of the local IO of the decompression server.
[0094] According to an embodiment of the present disclosure, the compressed file includes multiple sub-files, the file header data includes sub-file headers of the sub-files, and the sub-files include: a first type of sub-files corresponding to the compressed directory; and / or a second type of sub-files corresponding to the compressed file.
[0095] Specifically, the compressed file may be obtained by compressing one or more files, or may be obtained by compressing one or more directories. When the compressed file is obtained by compressing one or more files, the compressed file may only contain a file header data and corresponding compressed data. The parsing result of the file header data may include the position of the compressed data in the compressed file (for example, the offset in the compressed file), and may also include any one or more of the following: the file name of the compressed file, the compression method, encryption information, etc. By parsing the file header data, the position of the compressed data in the compressed file can be obtained, and according to the position, the compressed data can be obtained through the network, and then the compressed data is decompressed according to the compression method and / or encryption information of the compressed data obtained by parsing the file header data to obtain the decompressed data.
[0096] On the other hand, when the compressed file is obtained by compressing one or more directories, the compressed file may include multiple sub-files, such as the first type of sub-files obtained by compressing the directories. When the compressed directory contains files, the compressed file also includes the second type of sub-files obtained by compressing the files. The first type of sub-files may include a sub-file header, and the parsing result of the sub-file header may include the directory name of the corresponding compressed directory, and the first type of sub-files may not include compressed data. The second type of sub-file may include a sub-file header and sub-compressed data, and the parsing result of the sub-file header may include the position of the sub-compressed data in the compressed file (for example, the offset in the compressed file), and may also include any one or more of the following: the file name of the compressed file, the compression method, the encryption information, etc. The sub-compressed data of the second type of sub-file may include the compressed data obtained by compressing the file.
[0097] According to an embodiment of the present disclosure, when a compressed file includes multiple sub-files, it may also include a general file header, and the parsing result of the general file header includes: the directory name of the compressed directory corresponding to the first type of sub-files; and / or the file name of the compressed file corresponding to the second type of sub-files and the position of the corresponding sub-compressed data in the compressed file. The information in the general file header may also be included in the sub-file header. The information included in the general file header and the sub-file header may vary depending on the compression method, and the present disclosure does not specifically limit this.
[0098] Figure 2 A schematic diagram showing the structure of a compressed file containing multiple sub-files.
[0099] Assume that the compressed file 200 is obtained by compressing directory A, which contains two sub-directories B and C, and directory B contains file a. Figure 2 As shown, the compressed file 200 includes a total file header 201 and subfiles 1 to 4. Subfiles 1, 2, and 3 are obtained by compressing directories A, B, and C, respectively, and belong to the first type of subfiles. Subfiles 1, 2, and 3 include subfile header 1, subfile header 2, and subfile header 3, respectively, but do not include sub-compressed data. Subfile 4 is obtained by compressing file a, and belongs to the second type of subfile, including subfile header 4 and sub-compressed data 4. For the first type of subfiles, taking subfile 1 as an example, subfile header 1 may include the directory name of directory A. For the second type of subfiles, taking subfile 4 as an example, subfile header 4 may include the file name of file a and the position of sub-compressed data 4 in the compressed file 200.
[0100] By parsing the subfile header of the first-category subfile, the directory name of the compressed directory can be obtained. The directory name can be a full path name. According to the parsing results of each first-category subfile header, the directory name of each compressed directory is obtained, and the inclusion relationship between the compressed directories can be determined.
[0101] By parsing the sub-file header of the second type of sub-file, the file name of the compressed file can be obtained. The file name can be a full path name, and according to the file name of the compressed file, it can be determined which directory the file belongs to.
[0102] According to an embodiment of the present disclosure, each second-category sub-file may be compressed from one or more files. When the second-category sub-file is compressed from multiple files, the sub-file header of the second-category sub-file may contain the file names of the multiple files.
[0103] According to an embodiment of the present disclosure, the data decompression method further includes:
[0104] Sending, through the network, the directory name of the corresponding compressed directory obtained by parsing the sub-file header of the first type of sub-file; and / or
[0105] Decompressed data obtained by decompressing the sub-compressed data of the second-type sub-files is sent through the network.
[0106] In the disclosed method, when a compressed file includes a first type of sub-file, after parsing the sub-file header of the first type of sub-file to obtain the directory name of the corresponding compressed directory, the directory name of the compressed directory can be sent to a receiving end for storing the decompression result through a network. The receiving end can be, for example, a user's client, or other receiving ends specified by the user, or a server for storing compressed files. The receiving end can generate a corresponding directory structure based on the directory name of the full path. In the disclosed method, when a compressed file includes a second type of sub-file, after decompressing the sub-compressed data to obtain decompressed data, the decompressed data can be sent to the receiving end through a network. The receiving end can use the file name to save the received decompressed data (i.e., the file obtained by decompression).
[0107] According to an embodiment of the present disclosure, the total file header 201 may include the directory names of the compressed directories A, B, and C and the file name of the compressed file a, and may also include the position of the sub-compressed data 4 corresponding to the file a in the compressed file 200. In this case, various information required for decompressing the compressed file 200 can be obtained by parsing the total file header, without reading and parsing the sub-file header.
[0108] According to an embodiment of the present disclosure, when a compressed file includes a total file header and a sub-file header, the parsing result of the total file header of the compressed file includes the position of the sub-file header in the compressed file;
[0109] The obtaining of the file header data of the compressed file through the network includes obtaining the sub-file header through the network according to the position of the sub-file header in the compressed file.
[0110] According to an embodiment of the present disclosure, the obtaining of the file header data of the compressed file through the network includes concurrently obtaining the sub-file headers of the plurality of sub-files through the network; and / or
[0111] The parsing the file header data to obtain the parsing result includes concurrently parsing the multiple sub-file headers to obtain the parsing result; and / or
[0112] The obtaining, through the network, the compressed data corresponding to the file header data in the compressed file according to the parsing result, comprises concurrently obtaining, through the network, the sub-compressed data in the sub-file according to the parsing result; and / or
[0113] The decompressing the compressed data to obtain the decompressed data includes concurrently decompressing corresponding sub-compressed data of a plurality of sub-files to obtain the decompressed data.
[0114] According to an embodiment of the present disclosure, for example Figure 2As shown, when decompressing a compressed file, the decompression server can first obtain the total file header through the network, and obtain the position of the sub-file header in the compressed file by parsing the total file header. Then, sub-file header 1, sub-file header 2, ... sub-file header 4 can be obtained through the network, and the position of the sub-compressed data can be quickly obtained by parsing the sub-file headers. Then, the sub-compressed data is read through the network according to the position of the sub-compressed data and decompressed. According to the embodiments of the present disclosure, multiple sub-file headers can be obtained concurrently, and / or multiple sub-file headers can be parsed concurrently, and / or sub-compressed data can be obtained concurrently, and / or sub-compressed data can be decompressed concurrently, thereby improving the efficiency of decompression.
[0115] According to the embodiment of the present disclosure, concurrent execution of two operations means that the two operations are executed at least partially simultaneously, but do not need to be executed strictly synchronously.
[0116] According to the embodiments of the present disclosure, after parsing the sub-file header to obtain the directory name and / or file name of the compressed directory and / or file, these directory names and / or file names can be displayed and the user can be allowed to select the desired directory and / or file. Then, the sub-compressed data corresponding to the directory and / or file selected by the user is read through the network for decompression without decompressing all the compressed files, thereby saving network transmission and processing resources and improving decompression efficiency.
[0117] According to an embodiment of the present disclosure, the parsing of the file header data includes parsing an unparsed file header in the compressed file while acquiring compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0118] The decompressing the compressed data includes decompressing the obtained compressed data while obtaining the compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0119] The sending of the decompressed data through the network includes sending the decompressed data while decompressing the acquired compressed data.
[0120] In the disclosed method, in order to improve the efficiency of decompressing compressed files, the unparsed file header can be parsed while the compressed data corresponding to the parsed file header is transmitted over the network; and / or the compressed data corresponding to the parsed file header can be decompressed while the compressed data obtained is transmitted over the network, thereby making full use of network and computing resources and improving the processing efficiency of compressed files. On the other hand, the decompressed data can be sent while the compressed data obtained is decompressed. In this way, the streaming reading, decompression and sending of compressed data can be realized, further improving the decompression efficiency.
[0121] Figure 3A The application scenario schematic diagram of the data decompression method according to the embodiment of the present disclosure is shown. The data decompression method is applied to a decompression server, and the compressed file is stored in a storage server. As shown in FIG3 , the decompression server sends a compressed file acquisition request to the storage server, and the storage server sends the file header data of the compressed file to the decompression server through the network. The decompression server parses the file header data to obtain the parsing result, thereby quickly knowing the content of the compressed file, and then sends a compressed data acquisition request corresponding to the file header data to the storage server according to the parsing result. The storage server sends the compressed data through the network, and the decompression server decompresses the compressed data to obtain the decompressed data. Then, the decompression server can send the decompressed data to a receiving end for storing the decompressed data, and the receiving end can be, for example, a client of a user who triggers the decompression operation, or other receiving ends specified by the user, or a server for storing compressed files. The receiving end can generate a corresponding directory structure according to the directory name of the full path and store the decompressed file in the corresponding position.
[0122] According to an embodiment of the present disclosure, when the receiving end is not the client of the user who triggered the decompression operation, the decompression server can send an access link to the user's client, and the user's client can obtain the decompressed data from the receiving end through the access link.
[0123] Figure 3B A specific implementation example of the data decompression method according to an embodiment of the present disclosure is shown.
[0124] like Figure 3B As shown, the decompression server starts the decompression process in response to receiving the decompression request. The decompression request may carry the storage location information of the compressed file, and the decompression server may obtain various data of the compressed file through the network according to the storage location information of the compressed file. After starting the decompression, the overall structure analysis of the compressed file is first performed. For example, the total file header of the compressed file may be obtained through the network according to the storage location information of the compressed file, and the number of sub-files in the compressed file, the location information of the sub-files in the compressed file, etc. may be obtained by parsing the total file header.
[0125] Then, according to the storage location information of the subfile in the compressed file, the subfile header can be obtained through the network, and the subfile structure analysis can be performed based on the subfile header. When the compressed file contains multiple subfiles, the subfile headers of the multiple subfiles can be obtained through the network concurrently, and the structure analysis of the corresponding subfiles can be performed concurrently based on the multiple subfile headers. Alternatively, the subfile headers of the multiple subfiles can be obtained serially, and while obtaining the subfile headers, the subfile structure analysis can be performed based on the obtained subfile headers, so as to improve the efficiency of the subfile structure analysis.
[0126] By performing a sub-file structure analysis, the directory name corresponding to the sub-file, or the file name corresponding to the sub-file and the storage location of the sub-compressed data of the file in the compressed file can be obtained. Then, the directory name corresponding to the sub-file can be sent to the receiving end through the network. According to the storage location of the sub-compressed data of the file, the sub-compressed data is obtained through the network for decompression. According to an embodiment of the present disclosure, multiple sub-compressed data can be obtained concurrently, and the multiple sub-compressed data can be decompressed concurrently. Alternatively, multiple sub-compressed data can also be obtained serially, and while obtaining the sub-compressed data, the obtained sub-compressed data can be decompressed to improve the efficiency of decompression.
[0127] According to the embodiments of the present disclosure, the obtained decompressed data can be sent to the receiving end while decompressing, thereby reducing the occupation of the local storage space of the decompression server.
[0128] According to the embodiments of the present disclosure, by analyzing the overall structure of the compressed file and the structure of the sub-files, multiple sub-files can be decompressed concurrently to improve the decompression efficiency. In addition, since the embodiments of the present disclosure adopt a streaming decompression scheme that obtains compressed data, decompresses, and sends the compressed data, the occupation of local storage space can be reduced, and the decompression operation can be achieved using only local memory without using hard disk storage space, thereby reducing local IO operations and saving system resources.
[0129] According to an embodiment of the present disclosure, the overall structural analysis results of the compressed file and the sub-file structural analysis results may also include description information of the compressed file and the sub-files. The decompression server may save the description information so that when a decompression request for the compressed file is received again in the future, there is no need to re-execute the decompression operation, but the previous decompression results can be directly provided to improve the response speed of the decompression service and save system resources.
[0130] Figure 4 The structural block diagram of the data decompression device according to the embodiment of the present disclosure is shown. The device can be implemented as part or all of the electronic device through software, hardware or a combination of both.
[0131] like Figure 4 As shown, the data decompression device 400 includes a first acquisition module 410 , a parsing module 420 , a second acquisition module 430 , a decompression module 440 and a first sending module 450 .
[0132] The first acquisition module 410 is configured to acquire file header data of a compressed file through a network;
[0133] The parsing module 420 is configured to parse the file header data and obtain a parsing result;
[0134] The second acquisition module 430 is configured to acquire, through the network, the compressed data corresponding to the file header data in the compressed file according to the parsing result;
[0135] The decompression module 440 is configured to decompress the compressed data to obtain decompressed data;
[0136] The first sending module 450 is configured to send the decompressed data through a network,
[0137] The file header data, the parsing result, the compressed data, and the decompressed data are all stored in the memory of the device executing the data decompression method but are not written into the hard disk of the device.
[0138] The data decompression device provided by the embodiment of the present disclosure obtains the file header data of the compressed file through the network for parsing, and then obtains the compressed data for decompression according to the parsing result. Compared with the method of downloading the compressed file to the local and then decompressing it, it fully utilizes the network and powerful computing power of the Internet service, reduces the IO operations on the local disk, reduces the processing load of the local client, and improves the processing efficiency of the compressed file.
[0139] According to an embodiment of the present disclosure, the compressed file includes multiple sub-files, the file header data includes sub-file headers of the sub-files, and the sub-files include: a first type of sub-files corresponding to the compressed directory; and / or a second type of sub-files corresponding to the compressed file.
[0140] According to an embodiment of the present disclosure, wherein:
[0141] The obtaining of the file header data of the compressed file through the network includes concurrently obtaining the sub-file headers of the plurality of sub-files through the network; and / or
[0142] The parsing the file header data to obtain the parsing result includes concurrently parsing the multiple sub-file headers to obtain the parsing result; and / or
[0143] The obtaining, through the network, the compressed data corresponding to the file header data in the compressed file according to the parsing result, comprises concurrently obtaining, through the network, the sub-compressed data in the sub-file according to the parsing result; and / or
[0144] The decompressing the compressed data to obtain the decompressed data includes concurrently decompressing corresponding sub-compressed data of a plurality of sub-files to obtain the decompressed data.
[0145] According to an embodiment of the present disclosure, wherein:
[0146] The file header also includes a total file header of the compressed file, and the parsing result of the total file header includes the position of the sub-file header in the compressed file;
[0147] The obtaining of the file header data of the compressed file through the network includes obtaining the sub-file header through the network according to the position of the sub-file header in the compressed file.
[0148] According to an embodiment of the present disclosure, wherein:
[0149] The parsing result of the sub-file header of the first type of sub-file includes the directory name of the corresponding compressed directory;
[0150] The second type of sub-files also include sub-compressed data obtained by compressing the corresponding compressed file, and the parsing result of the sub-file header of the second type of sub-files includes the file name of the corresponding compressed file and the position of the corresponding sub-compressed data in the compressed file.
[0151] According to an embodiment of the present disclosure, the device further includes:
[0152] The second sending module 460 is configured to send, through the network, the directory name of the corresponding compressed directory obtained by parsing the sub-file header of the first type of sub-file; and / or
[0153] The third sending module 470 is configured to send, through the network, the decompressed data obtained by decompressing the sub-compressed data of the second-type sub-file.
[0154] According to an embodiment of the present disclosure, wherein:
[0155] The file header data includes the total file header of the compressed file;
[0156] The parsing result of the total file header includes: the directory name of the compressed directory corresponding to the first-category sub-file; and / or the file name of the compressed file corresponding to the second-category sub-file and the position of the corresponding sub-compressed data in the compressed file.
[0157] According to an embodiment of the present disclosure, wherein:
[0158] The parsing of the file header data includes parsing an unparsed file header in the compressed file while acquiring compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0159] The decompressing the compressed data includes decompressing the obtained compressed data while obtaining the compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0160] The sending of the decompressed data through the network includes sending the decompressed data while decompressing the acquired compressed data.
[0161] The present disclosure also discloses an electronic device, Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0162] like Figure 5 As shown, the electronic device 500 includes a memory 501 and a processor 502, wherein the memory 501 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 502 to implement the method according to an embodiment of the present disclosure:
[0163] Obtain file header data of compressed files through the network;
[0164] Parsing the file header data to obtain a parsing result;
[0165] According to the parsing result, obtaining compressed data corresponding to the file header data in the compressed file through the network;
[0166] Decompressing the compressed data to obtain decompressed data;
[0167] sending the decompressed data over a network,
[0168] The file header data, the parsing result, the compressed data, and the decompressed data are all stored in the memory of the device executing the data decompression method but are not written into the hard disk of the device.
[0169] According to an embodiment of the present disclosure, the compressed file includes multiple sub-files, the file header data includes sub-file headers of the sub-files, and the sub-files include: a first type of sub-files corresponding to the compressed directory; and / or a second type of sub-files corresponding to the compressed file.
[0170] According to an embodiment of the present disclosure, wherein:
[0171] The obtaining of the file header data of the compressed file through the network includes concurrently obtaining the sub-file headers of the plurality of sub-files through the network; and / or
[0172] The parsing the file header data to obtain the parsing result includes concurrently parsing the multiple sub-file headers to obtain the parsing result; and / or
[0173] The obtaining, through the network, the compressed data corresponding to the file header data in the compressed file according to the parsing result, comprises concurrently obtaining, through the network, the sub-compressed data in the sub-file according to the parsing result; and / or
[0174] The decompressing the compressed data to obtain the decompressed data includes concurrently decompressing corresponding sub-compressed data of a plurality of sub-files to obtain the decompressed data.
[0175] According to an embodiment of the present disclosure, wherein:
[0176] The file header also includes a total file header of the compressed file, and the parsing result of the total file header includes the position of the sub-file header in the compressed file;
[0177] The obtaining of the file header data of the compressed file through the network includes obtaining the sub-file header through the network according to the position of the sub-file header in the compressed file.
[0178] According to an embodiment of the present disclosure, wherein:
[0179] The parsing result of the sub-file header of the first type of sub-file includes the directory name of the corresponding compressed directory;
[0180] The second type of sub-files also include sub-compressed data obtained by compressing the corresponding compressed file, and the parsing result of the sub-file header of the second type of sub-files includes the file name of the corresponding compressed file and the position of the corresponding sub-compressed data in the compressed file.
[0181] According to an embodiment of the present disclosure, the method further includes:
[0182] Sending, via the network, the directory name of the corresponding compressed directory obtained by parsing the sub-file header of the first type of sub-file; and / or
[0183] The decompressed data obtained by decompressing the sub-compressed data of the second-type sub-file is sent through the network.
[0184] According to an embodiment of the present disclosure, wherein:
[0185] The file header data includes the total file header of the compressed file;
[0186] The parsing result of the total file header includes: the directory name of the compressed directory corresponding to the first-category sub-file; and / or the file name of the compressed file corresponding to the second-category sub-file and the position of the corresponding sub-compressed data in the compressed file.
[0187] According to an embodiment of the present disclosure, wherein:
[0188] The parsing of the file header data includes parsing an unparsed file header in the compressed file while acquiring compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0189] The decompressing the compressed data includes decompressing the obtained compressed data while obtaining the compressed data corresponding to the parsed file header in the compressed file through the network; and / or
[0190] The sending of the decompressed data through the network includes sending the decompressed data while decompressing the acquired compressed data.
[0191] Figure 6 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown.
[0192] like Figure 6 As shown, the computer system 600 includes a processing unit 601, which can perform various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The processing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0193] The following components are connected to the I / O interface 605: an input part 606 including a keyboard, a mouse, etc.; an output part 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part 608 including a hard disk, etc.; and a communication part 609 including a network interface card such as a LAN card, a modem, etc. The communication part 609 performs communication processing via a network such as the Internet. The drive 610 is also connected to the I / O interface 605 as needed. Removable media 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive 610 as needed, so that the computer program read therefrom is installed into the storage part 608 as needed. Among them, the processing unit 601 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.
[0194] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes computer instructions, and the computer instructions are executed by a processor to implement the method steps described above. In such an embodiment, the computer program product can be downloaded and installed from a network through the communication part 609, and / or installed from a removable medium 611.
[0195] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0196] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or programmable hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.
[0197] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into a device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.
[0198] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.
Claims
1. A data decompression method, comprising: Get the total file header of the compressed file through the network; Parsing the total file header to obtain the number of sub-files in the compressed file and the position information of the sub-files in the compressed file; According to the storage location information of the sub-file in the compressed file, obtaining the sub-file header of the sub-file through the network; Performing a sub-file structure analysis on the sub-file header to obtain a directory name corresponding to the sub-file, and / or a file name corresponding to the sub-file and a storage location of the sub-compressed data in the compressed file; wherein, while obtaining the sub-file header, performing a sub-file structure analysis based on the obtained sub-file header; According to the storage location of the sub-compressed data in the compressed file, the sub-compressed data is obtained through a network; the sub-compressed data is decompressed to obtain decompressed data; While the acquired sub-compressed data is being decompressed, the decompressed data is sent through the network.
2. The method according to claim 1, wherein: The obtaining of the sub-file header of the sub-file through the network includes concurrently obtaining the sub-file headers of a plurality of sub-files through the network; and / or The obtaining of the sub-compressed data through the network includes concurrently obtaining the sub-compressed data in the sub-file through the network; and / or The decompressing the sub-compressed data to obtain the decompressed data includes concurrently decompressing corresponding sub-compressed data of a plurality of sub-files to obtain the decompressed data.
3. The method according to claim 1, further comprising: The directory name of the corresponding compressed directory parsed from the sub-file header is sent through the network.
4. The method according to claim 1, wherein: The decompressing the sub-compressed data includes decompressing the acquired sub-compressed data while acquiring the sub-compressed data corresponding to the parsed sub-file header in the compressed file through the network.
5. A data decompression device, comprising: A first acquisition module is configured to acquire a total file header of a compressed file through a network; A parsing module is configured to parse the total file header to obtain the number of sub-files in the compressed file and the position information of the sub-files in the compressed file; A second acquisition module is configured to acquire the sub-file header of the sub-file through a network according to the storage location information of the sub-file in the compressed file; The parsing module is further configured to perform sub-file structure analysis on the sub-file header to obtain the directory name corresponding to the sub-file, and / or the file name corresponding to the sub-file and the storage location of the sub-compressed data in the compressed file; wherein, while obtaining the sub-file header, the sub-file structure analysis is performed based on the obtained sub-file header; The second acquisition module is further configured to acquire the sub-compressed data through a network according to the storage location of the sub-compressed data in the compressed file; the decompression module is configured to decompress the sub-compressed data to obtain decompressed data; The first sending module is configured to send the decompressed data through a network while the decompression module decompresses the acquired sub-compressed data.
6. An electronic device comprising a memory and a processor; wherein: The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps described in any one of claims 1-4.
7. A readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method steps described in any one of claims 1 to 4.
8. A computer program product, comprising computer instructions, which, when executed by a processor, implement the method steps of any one of claims 1 to 4.
