Decompression method of compressed data, electronic device, storage medium, and program product
By generating decompression interruption records, identifying the interruption point, and resuming decompression from the interruption point, the problem of repetitive operations caused by decompression interruptions in compressed data is solved, thus improving decompression efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ALIBABA CLOUD COMPUTING CO LTD
- Filing Date
- 2024-12-06
- Publication Date
- 2026-06-09
AI Technical Summary
When decompression is interrupted due to network instability or equipment failure during the decompression process, it is necessary to start decompression again from the beginning, which leads to repeated operations and increased time consumption, reducing decompression efficiency.
By generating decompression interruption records, the interruption point is determined, and decompression continues from the data after the interruption point, thus avoiding the re-execution of completed decompression operations.
Shorten decompression time, improve decompression efficiency, and avoid repeated operations caused by interruption.
Smart Images

Figure CN122178919A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method for decompressing compressed data, an electronic device, a computer-readable storage medium, and a computer program product, which can be applied to the field of data decompression technology. Background Technology
[0002] Compressed data is familiar to most people. However, during the decompression process, it may be interrupted due to factors such as network instability or equipment failure. When decompression is interrupted, it needs to be restarted from the beginning. This means that the previously performed decompression operations need to be executed again, which not only involves repetitive operations but also increases decompression time and reduces decompression efficiency. Summary of the Invention
[0003] This application provides a method for decompressing compressed data, an electronic device, a computer-readable storage medium, and a computer program product to alleviate or solve one or more technical problems existing in the prior art.
[0004] In a first aspect, embodiments of this application provide a method for decompressing compressed data, applied to a decompression device, comprising: responding to a decompression command for target compressed data, and, upon obtaining a decompression interruption record of the target compressed data, determining an interruption point based on the decompression interruption record, wherein the decompression interruption record is generated when a decompression interruption occurs during any historical decompression of the target compressed data; obtaining data to be decompressed in the target compressed data after the interruption point; and decompressing the data to be decompressed to obtain corresponding decompressed data.
[0005] Secondly, embodiments of this application provide a method for decompressing compressed data, applied to the sender, including:
[0006] In response to the decompression conditions of the target compressed data being met, a decompression command for the target compressed data is sent to the decompression device;
[0007] Upon receiving a first data transmission request sent by the decompression device, the data to be transmitted in the target compressed data after the interruption point is determined according to the first data transmission request. The first data transmission request is generated based on the decompression interruption record of the target compressed data. The decompression interruption record is generated when a decompression interruption occurs during any historical decompression of the target compressed data.
[0008] The data to be transmitted is transmitted to the decompression device.
[0009] Thirdly, embodiments of this application provide a decompression system for compressed data, comprising: a client for sending a decompression command for target compressed data; and a decompression device for receiving the decompression command and implementing any of the methods described in the embodiments of this application.
[0010] Fourthly, embodiments of this application provide a decompression system for compressed data, comprising: a client for transmitting target compressed data to a server; the server for receiving the target compressed data and sending a decompression command for the target compressed data; and a decompression device for receiving the decompression command and implementing any of the methods described in the embodiments of this application.
[0011] Fifthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the methods of embodiments of this application when executing the computer program.
[0012] Sixthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method of any one of the embodiments of this application.
[0013] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method of any one of the embodiments of this application.
[0014] According to the decompression method for compressed data provided in the embodiments of this application, when a decompression interruption occurs during the decompression of the target compressed data, a decompression interruption record is generated. When the target compressed data restarts decompression, the interruption point can be determined based on the decompression interruption record, and the decompression of the data to be decompressed after the interruption point can continue from the interruption point without having to start decompression from the beginning. Therefore, the repeated execution of the decompression operation is avoided, the decompression time is shortened, and the decompression efficiency is improved.
[0015] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application, it can be implemented according to the contents of the specification. In order to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0016] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments according to this application and should not be construed as limiting the scope of this application.
[0017] Figure 1A and Figure 1B This illustration shows an application scenario diagram of the decompression method for compressed data provided in the embodiments of this application;
[0018] Figure 2 A flowchart of a decompression method 200 for compressed data provided in an embodiment of this application is shown;
[0019] Figure 3 A flowchart of a decompression method 300 for compressed data provided in an embodiment of this application is shown;
[0020] Figure 4 A flowchart of a decompression method 400 for compressed data provided in an embodiment of this application is shown;
[0021] Figure 5 A block diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0022] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the concept or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0023] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and all of them fall within the protection scope of the embodiments of this application.
[0024] The following terms will be used in the following text:
[0025] Container image: A compressed package containing the application and its related dependent software.
[0026] Decompression breakpoint: The point where the decompression process is interrupted, i.e., the break point.
[0027] Image Index: An index for container images, which allows random access to the contents of container images by searching the index.
[0028] As service demands increase and dependencies between different services grow, container images are becoming increasingly large, especially those for artificial intelligence, which often reach tens of gigabytes (GB). The decompression time for container images is often directly proportional to their size. If decompression is interrupted, the process must begin again from scratch, resulting in significant computational and time costs. In other words, this not only involves repetitive operations but also increases decompression time and reduces efficiency.
[0029] The embodiments of this application aim to provide a method, electronic device, storage medium, and program product for decompressing compressed data, so as to avoid the repeated execution of decompression operations, shorten decompression time, and improve decompression efficiency. Figure 1A This is a schematic diagram illustrating an application scenario of a method for decompressing compressed data provided in an embodiment of this application, such as... Figure 1A As shown, this scenario provides a decompression system for compressed data, which includes a client 110 and a decompression device 120.
[0030] The client 110 may be configured with a data transfer application. The client 110 is used to send a decompression command for the target compressed data to the decompression device 120 in response to a data transfer command input by the user through the data transfer application. For example, the data transfer application may be a standalone application (App), a small program embedded in other applications, or a web application, etc.
[0031] The decompression device 120 maintains an interrupt handling strategy and a decompression strategy. The interrupt handling strategy instructs the generation of a decompression interruption record when a decompression interruption occurs during the decompression of the target compressed data. The interrupt handling strategy also instructs, in response to a decompression command for the target compressed data, that, upon obtaining the decompression interruption record, determine the interrupt point based on the record, acquire the data to be decompressed following the interruption point, and decompress the data to be decompressed to obtain the corresponding decompressed data.
[0032] The client 110 and the decompression device 120 can interact via a network, which can be a wired network or a wireless network. Both the client 110 and the decompression device 120 can be terminal devices or servers. For example, the terminal device can be a mobile phone, desktop computer, laptop, tablet computer, vehicle terminal, smart wearable device, etc., and the server can be a physical server, cloud server, etc.
[0033] Furthermore, such as Figure 1BAs shown, in one embodiment, in the above application scenario, the decompression system may further include a server 130. Accordingly, the client 110 is used to transmit target compressed data to the server 130 in response to a data transmission command input by a user through a data transmission application. The server 130 is used to receive the target compressed data transmitted by the client 110 and send a decompression command for the target compressed data to the decompression device 120. The server 130 may be a physical server, a cloud server, or a server cluster composed of multiple servers.
[0034] exist Figure 1A and Figure 1B The example shown uses a portable laptop as the client (110), a physical server as the decompression device (120), and a physical server as the server (130). It should be understood that... Figure 1A and Figure 1B The illustration is merely a schematic representation of an application scenario for the decompression method of compressed data involved in this application and does not constitute a limitation on the technical solution of this application. In other embodiments, the application scenario of the decompression method of compressed data involved in this application may include more or fewer components.
[0035] It should be noted that the application scenarios or examples provided in this application embodiment are for ease of understanding, and this application embodiment does not specifically limit the application of the technical solution. Furthermore, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0036] The technical solution of this application and how it solves the aforementioned technical problems are described in detail below with specific embodiments. The listed specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0037] Figure 2 A flowchart of a decompression method 200 for compressed data according to an embodiment of this application is shown. This method can be applied to a decompression device, such as the decompression device 120 in FIG1. Figure 2 As shown, the method may include steps S201, S202 and S203.
[0038] Step S201: In response to a decompression command for the target compressed data, if a decompression interruption record of the target compressed data is obtained, the interruption point is determined based on the decompression interruption record, wherein the decompression interruption record is generated when a decompression interruption occurs during any historical decompression of the target compressed data.
[0039] Figure 2 The decompression method 200 for the compressed data shown can be derived from... Figure 1A and Figure 1B The decompression device 120 shown below (hereinafter referred to as the decompression device) performs the following: Upon receiving a decompression command for the target compressed data, the decompression device can obtain the data identifier of the target compressed data from the decompression command and determine whether an associated decompression interruption record is found in the second storage area based on this data identifier. The second storage area is used to store decompression interruption records and can be a storage area in memory. If a decompression interruption record is found, it indicates that the target compressed data is not being decompressed for the first time, and that a decompression interruption occurred during a previous decompression process. The decompression device determines the interruption point of any previous decompression process based on the found decompression interruption record. In other words, if the decompression device finds one decompression interruption record, it can determine the interruption point of the previous decompression process based on that record; if the decompression device finds multiple decompression interruption records, it can determine the interruption point of the corresponding historical decompression process based on any of the found decompression interruption records. The target compressed data can be the aforementioned container image, or compressed data of video, images, files, etc. The target compressed data can be any compression format among RAR (Roshal ARchive), ZIP (Zone Information Protocol), GZIP (GNU ZIP), ZSTD (Zstandard), etc.
[0040] In one implementation, the decompression interruption record may include a data identifier of the compressed data. Accordingly, determining whether an associated decompression interruption record is found in the second storage area based on this data identifier may include: comparing the data identifier of the target compressed data with the data identifiers in each decompression interruption record stored in the second storage area. If the comparison result is consistent, it is determined that an associated decompression interruption record has been found, and the decompression interruption record containing the consistent data identifier is identified as the decompression interruption record of the target compressed data. If the comparison results are inconsistent, it is determined that no associated decompression interruption record has been found.
[0041] In another implementation, after generating the decompression interruption record, a first association between the data identifier of the compressed data and the decompression interruption record can be established. Accordingly, determining whether an associated decompression interruption record is found in the first storage area based on the data identifier may include: comparing the data identifier of the target compressed data with each data identifier in the first association. If the comparison results are consistent, it is determined that an associated decompression interruption record has been found, and the decompression interruption record associated with the consistent data identifier is identified as the decompression interruption record of the target compressed data. If all comparison results are inconsistent, it is determined that no associated decompression interruption record has been found.
[0042] The decompression interruption record includes information used to determine the interruption point. The specific content of the decompression interruption record can be found in the relevant description below. The decompression interruption record can be a single data entry or a file. This application does not specifically limit the form of the decompression interruption record; it can be set according to actual needs.
[0043] Step S202: Obtain the data to be decompressed from the target compressed data after the breakpoint.
[0044] In one implementation, the decompression command includes a portion of the target compressed data to be decompressed. Accordingly, the decompression device obtains this portion of the target compressed data from the decompression command and determines the data to be decompressed after the breakpoint based on this portion of the target compressed data.
[0045] In another implementation, the decompression command does not include the target compressed data. Accordingly, the decompression device can send a first data transmission request to the sender of the decompression command based on the decompression interruption record, and receive the partial target compressed data to be decompressed sent by the sender. Based on this partial target compressed data, the device determines the data to be decompressed after the interruption point. Specifically, the sender determines the partial target compressed data to be decompressed based on the received first data transmission request and sends this partial target compressed data to the decompression device. The specific content of the first data transmission request and the specific process by which the sender determines the partial target compressed data to be decompressed based on the first data transmission request can be found in the relevant descriptions below; repetitions will not be repeated here.
[0046] It is understood that when the embodiments of this application are applied to Figure 1A In the application scenario shown, the sender of the decompression command is the client. When this application embodiment is applied to... Figure 1B In the application scenario shown, the sender of the decompression command is the server.
[0047] Step S203: Decompress the data to be decompressed to obtain the corresponding decompressed data.
[0048] Specifically, the decompression algorithm is obtained from the decompression interruption record, and the data to be decompressed is decompressed according to the decompression algorithm to obtain the corresponding decompressed data.
[0049] According to the technical solution of the embodiments of this application, when a decompression interruption occurs during the decompression of target compressed data, a decompression interruption record is generated. When the target compressed data restarts decompression, the interruption point can be determined based on the decompression interruption record, and the decompression of the data to be decompressed after the interruption point can continue from the interruption point without having to start decompression from the beginning. Therefore, the repeated execution of the decompression operation is avoided, the decompression time is shortened, and the decompression efficiency is improved.
[0050] In one implementation, the target compressed data includes multiple data fragments of a first size, and the order in which the multiple data fragments are arranged in the target compressed data indicates the transmission order of the multiple data fragments. Accordingly, determining the interruption point based on the decompression interruption record in step S101 may include the following steps A1 and A2:
[0051] Step A1: Obtain the second size and the third size from the decompression interruption record. The second size represents the total size of the compressed data received at the time of the decompression interruption, and the third size represents the size of the decompressed compressed data in the last data fragment that has been decompressed in the target compressed data.
[0052] For the first data fragment of the target compressed data, decompression is typically performed after the complete first data fragment is received; therefore, the second size is not less than the first size. Since the decompressed compressed data within a data fragment may be part or all of the compressed data in that fragment, the third size is not greater than the first size. Because decompression interruption may occur when all data fragments have been received, or when only part of the compressed data in a data fragment has been received, the received compressed data may be at least one complete data fragment, or at least one data fragment and a portion of the compressed data within a data fragment.
[0053] In one implementation, the decompression interruption record may include a protocol header, a data segment, and checksum data. Examples of the contents and descriptions of the protocol header, data segment, and checksum data are as follows:
[0054]
[0055] The value of the Algorithm field can be the name of the decompression algorithm or its algorithm identifier. For example, the algorithm identifier for the GZIP compression algorithm is 0, the algorithm identifier for the LZ4 (LZ4 CompressionAlgorithm) decompression algorithm is 1, and the algorithm identifier for the ZSTD decompression algorithm is 2, etc.
[0056] Corresponding to the decompression interruption record in the example above, the decompression device can obtain the second size from the data segment of the decompression interruption record and the third size from the field value of the SourceOffset field in the protocol header.
[0057] Furthermore, as can be seen from the above example, the decompression interruption record may also include first verification data. Accordingly, in order to ensure the validity of the decompression interruption record, in one embodiment, before step A1, the method may further include: determining second verification data for each data in the decompression interruption record other than the first verification data according to the verification algorithm in the decompression interruption record; if the second verification data is the same as the first verification data, then step A1 is executed.
[0058] By verifying the first verification data in the decompression interruption record, the validity of the decompression interruption record is ensured, thereby ensuring the accuracy of the subsequently determined interruption points and providing a guarantee for the effective decompression of the data.
[0059] It should be noted that the specific content of the decompression interruption log is not limited to the example above, and can be set as needed in actual applications.
[0060] Step A2: Determine the breakpoint based on the first size, the second size, and the third size.
[0061] In one implementation, the first arrangement position of the last decompressed data fragment in the target compressed data can be determined based on a first size and a second size. If the third size is equal to the first size, the first end position of the last data fragment in the target compressed data is determined based on the first arrangement position and the first size, and this first end position is designated as an interruption point. Alternatively, if the third size is less than the first size, the second end position of the decompressed compressed data in the target compressed data is determined based on the second arrangement position, the first size, and the third size, and this second end position is designated as an interruption point. The second arrangement position is the preceding arrangement position of the first arrangement position. The first size is included in the decompression command or in the decompression interrupt record. Accordingly, the decompression device can obtain the first size from the decompression command or the second size from the decompression interrupt record.
[0062] Considering that in practical applications, decompression interruptions are often caused by abnormal communication links between the sender and the decompression device, or by sender malfunctions, preventing the decompression device from continuing to receive data fragments, decompression is interrupted. Furthermore, the transmission speed of data fragments may exceed the decompression speed. Therefore, when a decompression interruption occurs, if the decompression device determines that there are received but undecompressed data fragments, it can continue decompressing those fragments and generate a decompression interruption record based on the relevant information of the last decompressed data fragment. Accordingly, determining the first arrangement position of the last decompressed data fragment in the target compressed data based on the first and second sizes can include: dividing the second size by the first size and determining the first arrangement position based on the division result. Specifically, determining the first arrangement position based on the division result can include: if the division result is an integer, determining the arrangement position corresponding to that integer as the first arrangement position; if the division result is not an integer, rounding the division result down to the nearest integer and determining the arrangement position corresponding to that integer as the first arrangement position. For example, the first size is 32k, the second size is 100k, and the result of 100 / 32 is rounded down to 3. The first arrangement position is determined to be the third, that is, in the order from front to back, the last data fragment that has been decompressed is the third data fragment among the multiple data fragments included in the target compressed data.
[0063] Considering that in practical applications, interruptions may occur during the decompression of a data segment or during the transmission of a data segment, and the interruption point is the end position of the currently decompressed compressed data, meaning the interruption point is related to both the position of the last decompressed data segment in the target compressed data and the size of the decompressed data segment within that last data segment, the decompression device first determines the first arrangement position of the last decompressed data segment in the target compressed data based on the first and second sizes of the data segments. Then, it determines the relationship between the third size and the first size. If the third size equals the first size, it indicates that the last decompressed data segment has been completely decompressed. Therefore, the first end position of the last data segment in the target compressed data is the interruption point, i.e., interruption point = first end position = first arrangement position * first size. When the third size is smaller than the first size, it indicates that the last data fragment that has been decompressed has only been partially decompressed. Therefore, the second end position of this part of the data in the target compressed data is the interruption point, that is, the interruption point = the second arrangement position * the first size + the third size, where the second arrangement position = the first arrangement position - 1.
[0064] Therefore, by determining the first position of the last decompressed data fragment in the target compressed data and determining the breakpoint based on the relationship between the third size and the first size, the accuracy of the determined breakpoint can be improved.
[0065] It should be noted that the size of the decompressible compressed data in any data fragment that meets the decompression algorithm's decompression conditions may be less than or equal to the first size. For example, some decompression algorithms require complete data to be decompressed. If data is split into two parts during transmission, with the first part in one data fragment and the second part in the next data fragment, the size of the decompressible compressed data in that data fragment is less than the first size. Conversely, some decompression algorithms decompress compressed data of a first size; in this case, the size of the decompressible compressed data in any data fragment is equal to the first size.
[0066] For example, the first size is 32K, and the decompression command includes the first size. After receiving the second data fragment, the decompression device determines, according to the decompression algorithm, that the first 30K of compressed data in the second data fragment can be decompressed. After decompressing this 30K of compressed data, the second size = 32 * 2 = 64K, and the third size = 30K. When the third data fragment is received for 5K, an interrupt is generated. At this time, the second size = 64 + 5 = 69K, and the third size remains unchanged. From the decompression interrupt record, we can obtain that the second size is 69K and the third size is 30K, and we can determine that the last data fragment that has been decompressed is the second data fragment, that is, the first position of the last data fragment that has been decompressed in the target compressed data is 2, and the interrupt point = (2-1) * 32 + 30 = 62K.
[0067] Therefore, by recording the second and third sizes in the decompression interrupt log, when re-decompressing the target decompressed data based on the decompression command, the interrupt point can be determined according to the second and third sizes in the decompression interrupt log and the first size of the acquired fragmented data. This allows decompression to resume from the interrupt point without starting from the beginning, thus avoiding the re-execution of already performed decompression operations and improving decompression efficiency.
[0068] After determining the breakpoint, the data to be decompressed following the breakpoint can be obtained. In one implementation, obtaining the data to be decompressed following the breakpoint in the target compressed data can include: if the third size is equal to the first size, determining the data in the target data segment that meets the decompression algorithm's decompression conditions as the data to be decompressed following the breakpoint, where the target data segment is the current data segment to be decompressed; or, if the third size is less than the first size, obtaining a partial data segment from the decompression break record, and determining the data in the partial data segment and the target data segment that meet the decompression algorithm's decompression conditions as the data to be decompressed following the breakpoint, wherein the partial data segment includes the undecompressed data in the last data segment.
[0069] Specifically, if the third size equals the first size, it indicates that the last decompressed data segment has been completely decompressed. Therefore, the data in the target data segment to be decompressed that meets the decompression algorithm's decompression conditions is identified as the data to be decompressed after the interruption point. If the third size is less than the first size, it indicates that only a portion of the last decompressed data segment has been decompressed. Therefore, the undecompressed data in that last data segment, i.e., the partial data segment, is obtained from the data segment of the decompression interrupt record. This partial data segment and the data in the target data segment to be decompressed that meet the decompression algorithm's decompression conditions are identified as the data to be decompressed after the interruption point.
[0070] In other words, after determining the interruption point based on the decompression interruption record, the data to be decompressed in the target compressed data after the interruption point can be determined based on the size relationship between the third size and the first size in the decompression interruption record. Thus, the data to be decompressed after the interruption point can be decompressed directly without having to start decompressing from the beginning, thereby improving decompression efficiency.
[0071] Considering that a decompression interruption may result in partial data loss during transmission of data fragments, and that the sender of the decompression command may not be aware of how much compressed data the decompression device has received, thus repeatedly transmitting already transmitted data fragments, the decompression interruption record can further include summary data of the compressed data already received by the decompression device, based on any of the above embodiments. Accordingly, after determining the interruption point based on the decompression interruption record in step S201, the method may further include: obtaining first summary data from the decompression interruption record, wherein the first summary data is a summary of the received compressed data; and sending a first data transmission request to the sender of the decompression command based on the first summary data and the second size, wherein the first data transmission request is used to request the sender to transmit data fragments of the target compressed data that are after the second size when the first summary data is verified as valid.
[0072] Furthermore, upon receiving the first data transmission request, the sender of the decompression command can retrieve compressed data of a second size from the target compressed data in a sequential order, and calculate a second digest of this second-size compressed data according to a preset digest algorithm. It also determines whether the first digest and the second digest are consistent. If they are consistent, the first digest is verified, and the data to be transmitted after the second size in the target compressed data (i.e., the data fragments to be transmitted after the second size) is identified. These data fragments are then transmitted to the decompression device sequentially according to their position in the target compressed data. If they are inconsistent, the data fragments are transmitted sequentially to the decompression device, starting from the first data fragment, according to their position in the target compressed data. The preset digest algorithm can be SHA-256 (Secure Hash Algorithm 256-bit).
[0073] In one implementation, determining the data fragments to be transmitted in the target compressed data after the second size may include: if the third end position corresponding to the second size is determined to be the middle position of the last transmitted data fragment, the sender of the decompression command may divide the compressed data after the third end position in the target compressed data according to the first size to obtain the data fragments to be transmitted. The last data fragment to be transmitted may be smaller than the first size; alternatively, if the last data fragment to be transmitted is smaller than the first size, preset data may be padded to make it the first size.
[0074] In another implementation, determining the data fragments to be transmitted after the second size in the target compressed data may include: if the third end position corresponding to the second size is determined to be the middle position of the last transmitted data fragment, the sender of the decompression command may obtain the untransmitted portion of compressed data in the last data fragment and determine this portion of compressed data as the first data fragment to be transmitted, or fill this portion of compressed data with preset data to the first size according to a preset rule and then determine it as the first data fragment to be transmitted; and, determining the data fragments after the last data fragment as data fragments to be transmitted. When the preset data is filled with preset data according to the preset rule, when the decompression device receives the corresponding data fragment, it can parse the data fragment according to the preset rule to obtain the portion of compressed data. For example, the preset rule may be to fill the data fragment with preset data after the portion of compressed data. Accordingly, after receiving the data fragment, if the decompression device determines that the data fragment includes the preset data, it obtains the data before the preset data from the data fragment to obtain the portion of compressed data.
[0075] Furthermore, the above-mentioned determination of the data fragments to be transmitted after the second size in the target compressed data may also include: when determining that the third end position corresponding to the second size is the end position of the last transmitted data fragment, determining each data fragment after the last data fragment as the data fragment to be transmitted.
[0076] It should be noted that when the application scenario of this application embodiment is... Figure 1B In the illustrated application scenario, if decompression is interrupted due to factors such as an abnormal communication link between the server and the decompression device, while the communication link between the client and the server remains normal, the server can, upon determining that the first decompression recovery condition is met (e.g., the communication link with the decompression device has returned to normal), send a decompression command for the target compressed data to the decompression device based on the data identifier of the target compressed data. Upon receiving the first data transmission request from the decompression device, the server processes it in the aforementioned manner. If decompression is interrupted due to an abnormal communication link between the server and the client, or due to a client malfunction, the client can also record the transmission failure location of the target compressed data. Upon determining that the second decompression recovery condition is met (e.g., the communication link with the server has returned to normal, or the client has recovered), the client transmits each data fragment and the data identifier of the target compressed data to the server, starting from the data fragment where the transmission failure location occurred, according to the order of the data fragments in the target compressed data. When the server receives the data fragments and data identifiers transmitted by the client, it sends a decompression instruction for the target compressed data to the decompression device according to the data identifiers. When it receives the first data transmission request sent by the decompression device, it determines at least one data fragment in the target compressed data that is located after the second size from the data fragments currently transmitted by the client in the manner described above, and transmits it to the decompression device.
[0077] Therefore, by sending a first data transmission request to the sender of the decompression command, the sender of the decompression command, after verifying the first digest data, transmits the data fragments from the target compressed data that are after the second size. This achieves both verification of the accuracy of the compressed data received by the decompression device and avoids the repeated transmission of already transmitted compressed data, thus reducing the overall time consumption.
[0078] The above describes the process of decompression interruption during the decompression of target compressed data, and the resumption of decompression based on the decompression interruption record. Considering that in practical applications, the target compressed data may also be undergoing its first decompression, i.e., without any decompression interruption, the method may further include: saving the initial values of the second and third sizes to the first storage area if no decompression interruption record is obtained; and decompressing the obtained data to be decompressed to obtain the corresponding decompressed data.
[0079] The initial values of the second and third sizes are both zero, and the first storage area can be a different storage region in memory than the second storage area.
[0080] Decompressing the acquired data to be decompressed may include: if the decompression command includes data fragments, obtaining the decompression algorithm and data fragments from the decompression command; creating a decompressor corresponding to the decompression algorithm, identifying the data in the data fragments that meet the decompression conditions of the decompression algorithm as the data to be decompressed, and using the created decompressor to decompress the data to be decompressed. If the decompression command does not include data fragments, obtaining the decompression algorithm and the data identifier of the target compressed data from the decompression command; creating a decompressor corresponding to the decompression algorithm, and sending a second data transmission request to the sender of the decompression command according to the data identifier, the second data transmission request instructing the sender to transmit the data fragments of the target compressed data; receiving the data fragments transmitted by the sender, identifying the data in the data fragments that meet the decompression conditions of the decompression algorithm as the data to be decompressed, and using the created decompressor to decompress the data to be decompressed.
[0081] Therefore, when the target compressed data is decompressed for the first time, the initial values of the second and third sizes are saved to the first storage area, which facilitates timely updates of the second and third sizes during the decompression process. This allows for the quick generation of a decompression interruption record when a decompression interruption occurs.
[0082] Considering that in practical applications, decompression interruptions may occur during the decompression process, whether it's the first time the target compressed data is decompressed or after a decompression interruption and subsequent resumption. To ensure the accuracy of the decompression interruption record generated when an interruption occurs, in one implementation, after each decompression to obtain the corresponding decompressed data, the second and third sizes in the first storage area are updated. That is, after obtaining the corresponding decompressed data, the process may further include: updating the second size in the first storage area based on the currently received data fragment; and updating the third size in the first storage area based on the size of the decompressed compressed data in the last decompressed data fragment.
[0083] Specifically, as described above, in the absence of a decompression interruption record, the initial values of the second and third sizes are saved to the first storage area. Therefore, after obtaining the corresponding decompressed data, the second size in the first storage area can be updated based on the currently received data fragment, and the third size can be updated based on the size of the decompressed compressed data in the last decompressed data fragment. If a decompression interruption record is obtained, the second and third sizes can also be retrieved from the record and saved to the first storage area. Furthermore, after obtaining the corresponding decompressed data, the second size in the first storage area is updated based on the currently received data fragment, and the third size is updated based on the size of the decompressed compressed data in the last decompressed data fragment. In other words, when a decompression interruption record is obtained, the second and third sizes in the first storage area are copied from the interruption record.
[0084] Updating the second size in the first storage area may include: reading the currently stored second size in the first storage area, adding the currently stored second size to the first size of the received data fragment, obtaining the sum, and replacing the currently stored second size with the sum. Updating the third size in the first storage area may include: replacing the currently stored third size in the first storage area with the size of the decompressed compressed data in the last decompressed data fragment.
[0085] For example, if the second size currently stored in the first storage area is 64k, the third size currently stored in the first storage area is 30k, the first size of the currently received data fragment is 32k, and the size of the compressed data that has been decompressed in the last data fragment is 28k, then the updated second size = 64k + 32k = 96k, and the updated third size = 28k.
[0086] Therefore, by updating the second and third sizes in the first storage area after each decompression of the data to be decompressed and obtaining the corresponding decompressed data, not only can timely data statistics be achieved, but also effective data basis can be provided for quickly generating decompression interruption records when a decompression interruption occurs.
[0087] Furthermore, as mentioned above, the decompression interruption record may also include first digest data. Correspondingly, if the decompression interruption record is not obtained, the method may further include: storing the initial value of the first digest in the first storage area. If the decompression interruption record is obtained, the method may further include: copying the first digest data from the decompression interruption record to the first storage area. And, after each decompression of the data to be decompressed and obtaining the corresponding decompressed data, the method further includes: updating the first digest data in the first storage area according to the currently received data fragment. For example, the first digest data is SHA256 digest data, which can be used to calculate new first digest data based on the currently received data fragment and the first digest data currently stored in the first storage area, and then updating the first digest data currently stored in the first storage area to this new first digest data. The specific calculation process for SHA256 digest data can be found in related technologies, and will not be detailed here. By updating the first digest data in the first storage area in a timely manner, the rapid generation of decompression interruption records is also guaranteed.
[0088] Furthermore, to enable rapid access to the content of the target compressed data subsequently, in one embodiment, after each decompression of the data to be decompressed to obtain the corresponding decompressed data, the method may further include: generating an index of the decompressed data and outputting the decompressed data and its index. The index of the decompressed data indicates the offset of the decompressed data within the target compressed data, allowing direct access to the corresponding content (e.g., an image) even before the target compressed data is decompressed. Outputting the decompressed data and its index can be done by sending the decompressed data and its index to the sender of the decompression command or to the recipient specified in the decompression command (e.g., a device that needs to use the decompressed data). The process of generating the decompressed data index can be found in related technologies, and will not be detailed here. Therefore, by generating the decompressed data index during the decompression process, rather than generating the index only after all the target compressed data has been transmitted and decompressed as in related technologies, the index generation efficiency is greatly improved.
[0089] It should be noted that the above-mentioned update operations on each data in the first storage area and index generation operations can be performed simultaneously; or the update operation can be performed first and then the generation operation can be performed; or the generation operation can be performed first and then the update operation can be performed. This application does not make specific limitations on this.
[0090] Considering that in practical applications, network issues, equipment failures, etc., often prevent the decompression device from receiving data fragments, leading to decompression interruptions, one implementation method can determine whether a decompression interruption occurs based on a preset duration. Specifically, based on any of the aforementioned implementation methods, the method may further include: if the currently received data fragment does not contain a transmission end identifier and no data fragment is received within the preset duration, generating a new decompression interruption record for the target compressed data based on the second and third sizes in the first storage area and the undecompressed data in the last currently decompressed fragment.
[0091] In other words, if the target compressed data has not been fully transmitted and no data fragments are received within a preset time period, a decompression interruption is determined. After all received data fragments have been decompressed, a decompression interruption record is generated based on the second and third sizes in the current first storage area and the undecompressed data in the last decompressed fragment. In one embodiment, the decompression interruption record may include the fields of the aforementioned example. Accordingly, the decompression device can determine the field values of each field in the aforementioned example and generate a new decompression interruption record based on each field and its value. The preset time period can be set as needed in practical applications; for example, the preset time period is 30 seconds.
[0092] Therefore, when a decompression interruption occurs, by generating a decompression interruption record, the interruption point can be determined based on the decompression interruption record when the next decompression command for the target compressed data is received. This allows the data to be decompressed after the interruption point to be decompressed without having to start decompressing from the beginning, thus improving decompression efficiency.
[0093] As described above, the target compressed data is transmitted to the decompression device one by one in the form of data fragments. In order to ensure the orderliness of data transmission and decompression, in one embodiment, the decompression device determines the data to be decompressed based on the currently received data fragments. After decompressing the data to be decompressed to obtain the corresponding decompressed data, the decompressed data can also be sent to the sender of the decompression command and wait for the next data fragment transmitted by the sender.
[0094] Furthermore, to improve decompression efficiency while ensuring orderly data transmission and compression, in another implementation, the decompression device can save the received data fragments to a third storage area. Following the order in which the data fragments were saved, it sequentially retrieves the currently uncompressed data fragment from the third storage area and determines the data to be decompressed based on the current fragment. The third storage area can be a cached storage region. This ensures orderly transmission and decompression of data fragments, and because the transmission and decompression of data fragments are performed asynchronously, it significantly improves the decompression efficiency of the target compressed data.
[0095] Figure 3 A flowchart of a decompression method 300 for compressed data provided in an embodiment of this application is shown, as follows: Figure 3 As shown, the method may include the following steps S301 to S312.
[0096] Step S301: Receive a decompression command sent by the sender, wherein the decompression command includes a data identifier of the target compressed data, and the target compressed data includes multiple data fragments.
[0097] Step S302: Determine whether an associated decompression interruption record has been obtained based on the data identifier. If a decompression interruption record has been obtained, proceed to step S305; if no decompression interruption record has been obtained, proceed to step S303.
[0098] Step S303: Create a corresponding decompressor according to the decompression algorithm in the decompression instruction, save the initial values of the second size, third size, fourth size and the first digest to the first storage area, and send a second data transmission request to the sender according to the data identifier.
[0099] When the sender receives the second data transmission request, it transmits the data fragments to the decompression device one by one according to the order in which each data fragment is arranged in the target compressed data.
[0100] Step S304: Receive the data fragments transmitted by the sender, and determine the data that meets the decompression conditions of the decompression algorithm as the data to be decompressed, and execute step S308.
[0101] Step S305: Determine the interruption point based on the first size in the decompression command, the second size and the third size in the decompression interruption record.
[0102] Step S306: Based on the second size and the first digest data in the decompression interrupt record, send a first data transmission request to the sender, and copy the second size, the third size and the first digest to the first storage area.
[0103] The operations performed by the sender after receiving the first data transmission request can be found in the previous descriptions, and will not be repeated here.
[0104] Step S307: Receive the data fragments transmitted by the sender, and determine the data to be decompressed after the interruption point based on the relationship between the third size and the first size, and then execute step S308.
[0105] Step S308: Use the decompressor corresponding to the decompression algorithm to decompress the data to be decompressed, and obtain the corresponding decompressed data.
[0106] Step S309: Update the second size in the first storage area according to the size of the currently received data fragment, update the third size in the first storage area according to the size of the decompressed compressed data in the last data fragment currently being decompressed, and update the first digest data in the first storage area according to the currently received data fragment.
[0107] In one implementation, the decompression interruption record includes the fourth size (i.e., the DecompOffest field and its value) as described in the previous example. Accordingly, step S309 may further include updating the fourth size in the first storage area based on the size of the obtained decompressed data. It is understood that the size of compressed data changes after decompression. For example, after decompressing a 32k data fragment, the fourth size of the obtained decompressed data is typically greater than 32k.
[0108] Step S310: Generate an index for the decompressed data and output the decompressed data and its index.
[0109] In one implementation, after obtaining the corresponding decompressed data in step S308, the decompressed data can be saved to a fourth storage area. Then, after outputting the decompressed data and its index in step S309, the decompressed data in the fourth storage area is deleted. The fourth storage area can be a different storage area in the cache than the aforementioned third storage area.
[0110] Step S311: Determine whether the currently received data fragment contains a transmission end identifier. If it contains an end identifier, determine that the target compressed data decompression is complete and end the process. If it does not contain an end identifier, return to step S304.
[0111] Step S312: If the currently received data fragment does not contain a transmission end identifier and no new data fragment is received within the preset time period, generate a new decompression interruption record for the target compressed data based on the second size, third size, first digest data in the first storage area, and the undecompressed data in the last data fragment currently decompressed, and return to step S301.
[0112] It should be noted that the specific implementation methods of steps S301 to S312 can be found in the relevant descriptions above, and the repeated parts will not be repeated here. Figure 3 This is for illustrative purposes only and not intended to limit the scope of operations. The execution order of some operations can be interchanged, or they can be performed simultaneously. For example, the execution order of steps S305 and S306 can be interchanged, or they can be performed simultaneously. The return from step S312 to step S301 indicates that a decompression interruption has occurred, and the sender resends the decompression command for the target compressed data.
[0113] Figure 4A flowchart of a decompression method 400 for compressed data according to an embodiment of this application is shown. This method can be applied to the sender, for example, executed by the client 110 in FIG1, or by... Figure 2 The server-side program 130 executes. For example... Figure 4 As shown, the method may include steps S401, S402 and S403.
[0114] Step S401: In response to the decompression conditions of the target compressed data being met, a decompression command for the target compressed data is sent to the decompression device.
[0115] Specifically, when the sender is a client, decompression is often interrupted due to factors such as abnormal communication links between the client and the decompression device, or client malfunction. Therefore, when the client detects that the communication link with the decompression device has returned to normal, or when the client is in a normal state, it can determine that the decompression conditions for the target compressed data are met, and sends a decompression command for the target compressed data to the decompression device based on information such as the data identifier of the target compressed data. When the sender is a server, decompression may be interrupted due to factors such as the communication link between the server and the decompression device, but the communication link between the server and the client is normal, meaning the server can receive data transmitted by the client normally. Accordingly, when the server determines that the communication link with the decompression device has returned to normal, it determines that the decompression conditions for the target compressed data are met, and sends a decompression command for the target compressed data to the decompression device based on information such as the data identifier of the target compressed data. When the sender is the server, decompression can be interrupted due to factors such as abnormal communication links between the server and the client, or client malfunction. In this case, once the client determines that the communication link with the server has been restored or the client has recovered, it can, based on the transmission failure position of the target compressed data recorded by the client, start transmitting each data fragment and the data identifier of the target compressed data from the data fragment at the failure position to the server. Correspondingly, when the server receives the data transmitted by the client, it determines that the decompression conditions of the target compressed data are met, and sends a decompression command for the target compressed data to the decompression device based on the data identifier and other information of the target compressed data.
[0116] Step S402: Upon receiving a first data transmission request sent by the decompression device, determine the data to be transmitted in the target compressed data that is located after the interruption point according to the first data transmission request. The first data transmission request is generated based on the decompression interruption record of the target compressed data. The decompression interruption record is generated when a decompression interruption occurs during any historical decompression of the target compressed data.
[0117] Step S403: Transmit the data to be transmitted to the decompression device.
[0118] The specific implementation methods of steps S402 and S403 can be found in the relevant descriptions above, and the repeated parts will not be repeated here.
[0119] Therefore, during the decompression of the target compressed data, when a decompression interruption occurs, the decompression device generates a decompression interruption record. Upon receiving a decompression command for the target compressed data, it can send a first data transmission request to the sender based on the decompression interruption record. The sender can then determine the data to be transmitted after the interruption point in the target compressed data based on the first data transmission request and send the data to be transmitted to the decompression device. This allows the decompression device to continue decompressing the data after the interruption point from the interruption point, without having to start decompressing from the beginning. Thus, the repeated execution of decompression operations is avoided, decompression time is shortened, and decompression efficiency is improved.
[0120] Corresponding to the decompression method and application scenarios of compressed data provided in the embodiments of this application, the embodiments of this application also provide a decompression device for compressed data, including: an interruption point determination module, used to determine an interruption point based on a decompression interruption record of the target compressed data when a decompression interruption record of the target compressed data is obtained, wherein the decompression interruption record is generated when a decompression interruption occurs during the previous decompression of the target compressed data; a data to be decompressed acquisition module, used to acquire the data to be decompressed located after the interruption point in the target compressed data; and a decompression module, used to decompress the data to be decompressed to obtain the corresponding decompressed data.
[0121] In one implementation, the target compressed data includes multiple data fragments of a first size, the arrangement order of the data fragments in the target compressed data being used to indicate the transmission order of the data fragments. Accordingly, the interruption point determination module is specifically used to: obtain a second size and a third size from the decompression interruption record, the second size representing the total size of the compressed data received at the time of the decompression interruption, and the third size representing the size of the compressed data decompressed in the last data fragment currently decompressed; and determine the interruption point based on the first size, the second size, and the third size.
[0122] In one embodiment, the interruption point determination module is further configured to: determine a first arrangement position of the last data fragment in the target compressed data based on the first size and the second size; if the third size is equal to the first size, determine a first end position of the last data fragment in the target compressed data based on the first arrangement position and the first size, and determine the first end position as the interruption point; or, if the third size is less than the first size, determine a second end position of the decompressed compressed data in the target compressed data based on a second arrangement position, the first size, and the third size, and determine the second end position as the interruption point, wherein the second arrangement position is the preceding arrangement position of the first arrangement position.
[0123] In one implementation, the decompression interruption record further includes a decompression algorithm. Accordingly, the data to be decompressed determination module is specifically used to: when the third size is equal to the first size, determine the data in the target data segment that meets the decompression conditions of the decompression algorithm as the data to be decompressed after the interruption point, wherein the target data segment is the current data segment to be decompressed; or, when the third size is less than the first size, obtain a partial data segment from the decompression interruption record, and determine the data in the partial data segment and the target data segment that meet the decompression conditions as the data to be decompressed after the interruption point, wherein the partial data segment includes the undecompressed data in the last data segment.
[0124] In one embodiment, the device further includes an acquisition module and a transmission module. The acquisition module is configured to acquire first digest data from the decompression interruption record after the interruption point determination module determines the interruption point based on the decompression interruption record, wherein the first digest data is a digest of the received compressed data; the transmission module is configured to send a first data transmission request to the sender of the decompression instruction based on the first digest data and the second size, wherein the first data transmission request requests the sender to transmit data fragments of the target compressed data located after the second size when the first digest data has been verified.
[0125] In one embodiment, the device further includes: a storage module, configured to save the initial values of the second size and the third size to a first storage area if the decompression interruption record is not obtained; the decompression module is further configured to decompress the obtained data to be decompressed to obtain the corresponding decompressed data.
[0126] In one embodiment, the device further includes: an update module, configured to, after the decompression module obtains the corresponding decompression data, update the second size in the first storage area according to the currently received data fragment; and update the third size in the first storage area according to the size of the decompressed compressed data in the last currently decompressed data fragment; wherein, in the case of obtaining the decompression interruption record, the second size and the third size in the first storage area are copied from the decompression interruption record to the first storage area.
[0127] In one embodiment, the apparatus further includes a generation module, configured to generate a new decompression interruption record for the target compressed data based on the second size and the third size in the first storage area and the undecompressed data in the last data segment when the currently received data segment does not contain a transmission end identifier and no new data segment is received within a preset time period.
[0128] Corresponding to the decompression method and application scenarios of compressed data provided in the embodiments of this application, the embodiments of this application also provide a decompression device for compressed data, including: a decompression command sending module, used to send a decompression command for the target compressed data to a decompression device in response to meeting the decompression conditions of the target compressed data; a determining module, used to determine, upon receiving a first data transmission request sent by the decompression device, the data to be transmitted in the target compressed data located after an interruption point according to the first data transmission request, wherein the first data transmission request is generated based on a decompression interruption record of the target compressed data, the decompression interruption record being generated when a decompression interruption occurs during any historical decompression of the target compressed data; and a data transmission module, used to transmit the data to be transmitted to the decompression device.
[0129] The functions of each module in each device in the embodiments of this application can be found in the corresponding description in the above method, and they have corresponding beneficial effects, which will not be repeated here.
[0130] Figure 5 This is a block diagram of an electronic device used to implement embodiments of this application. Figure 5 As shown, the electronic device includes a memory 501 and a processor 502. The memory 501 stores a computer program that can run on the processor 502. When the processor 502 executes the computer program, it implements the method described in the above embodiments. The number of memories 501 and processors 502 can be one or more. In a specific implementation, the electronic device may also include a communication interface 503 for communicating with external devices and exchanging data.
[0131] In practical implementation, if the memory 501, processor 502, and communication interface 503 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0132] Optionally, in a specific implementation, if the memory 501, processor 502 and communication interface 503 are integrated on a single chip, the memory 501, processor 502 and communication interface 503 can communicate with each other through an internal interface.
[0133] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in this application.
[0134] This application provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in this application.
[0135] This application also provides a chip including a processor for calling and executing instructions stored in a memory, causing a communication device with the chip installed to perform the method provided in this application.
[0136] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in the application embodiment.
[0137] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or 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, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.
[0138] Further, optionally, the aforementioned memory may include read-only memory and random access memory. The memory may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0139] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.
[0140] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0141] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0142] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.
[0143] The logic and / or steps described in the flowchart or otherwise herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0144] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.
[0145] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0146] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope described in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for decompressing compressed data, applied to a decompression device, comprising: In response to a decompression command for target compressed data, if a decompression interruption record of the target compressed data is obtained, an interruption point is determined based on the decompression interruption record, wherein the decompression interruption record is generated when a decompression interruption occurs during any historical decompression of the target compressed data; Obtain the decompressed data located after the interruption point in the target compressed data; The data to be decompressed is decompressed to obtain the corresponding decompressed data.
2. The method according to claim 1, wherein the target compressed data comprises a plurality of data fragments of a first size, the arrangement order of the data fragments in the target compressed data is used to indicate the transmission order of the data fragments, and the step of determining the interruption point based on the decompression interruption record comprises: The second size and the third size are obtained from the decompression interruption record. The second size represents the total size of the compressed data received at the time of the decompression interruption, and the third size represents the size of the compressed data that has been decompressed in the last data fragment that has been decompressed. The breakpoint is determined based on the first size, the second size, and the third size.
3. The method according to claim 2, wherein determining the breakpoint based on the first size, the second size, and the third size comprises: Based on the first size and the second size, determine the first arrangement position of the last data fragment in the target compressed data; When the third size is equal to the first size, the first end position of the last data fragment in the target compressed data is determined according to the first arrangement position and the first size, and the first end position is determined as the interruption point; or, when the third size is less than the first size, the second end position of the decompressed compressed data in the target compressed data is determined according to the second arrangement position, the first size and the third size, and the second end position is determined as the interruption point, wherein the second arrangement position is the arrangement position preceding the first arrangement position.
4. The method according to claim 2, wherein the decompression interruption record further includes a decompression algorithm, and the step of obtaining the data to be decompressed located after the interruption point in the target compressed data includes: If the third size is equal to the first size, the data in the target data segment that meets the decompression conditions of the decompression algorithm is determined as the data to be decompressed after the interruption point, and the target data segment is the current data segment to be decompressed; or, if the third size is less than the first size, a partial data segment is obtained from the decompression interruption record, and the data in the partial data segment and the target data segment that meet the decompression conditions are determined as the data to be decompressed after the interruption point, wherein the partial data segment includes the undecompressed data in the last data segment.
5. The method according to any one of claims 2 to 4, wherein after determining the interruption point based on the decompression interruption record, it further comprises: Obtain first digest data from the decompression interruption record, wherein the first digest data is a digest of the received compressed data; Based on the first digest data and the second size, a first data transmission request is sent to the sender of the decompression instruction, wherein the first data transmission request is used to request the sender to transmit the data fragments of the target compressed data that are located after the second size when the first digest data is verified to be valid.
6. The method according to claim 2, further comprising: If the decompression interruption record is not obtained, the initial values of the second size and the third size are saved to the first storage area; The acquired data to be decompressed is decompressed to obtain the corresponding decompressed data.
7. The method according to claim 2 or 6, further comprising, after obtaining the corresponding decompression data: Update the second size in the first storage area according to the currently received data fragments; Update the third size in the first storage area based on the size of the compressed data that has been decompressed in the last decompressed data segment. In the case where the decompression interruption record is obtained in response to the decompression command, the second size and the third size in the first storage area are copied from the decompression interruption record into the first storage area.
8. The method according to claim 7, further comprising: If the currently received data fragment does not contain a transmission end identifier and no new data fragment is received within a preset time period, a new decompression interruption record is generated for the target compressed data based on the second size and the third size in the first storage area and the undecompressed data in the last data fragment.
9. A method for decompressing compressed data, applied at the sender, comprising: In response to the decompression conditions of the target compressed data being met, a decompression command for the target compressed data is sent to the decompression device; Upon receiving a first data transmission request sent by the decompression device, the data to be transmitted in the target compressed data after the interruption point is determined according to the first data transmission request. The first data transmission request is generated based on the decompression interruption record of the target compressed data. The decompression interruption record is generated when a decompression interruption occurs during any historical decompression of the target compressed data. The data to be transmitted is transmitted to the decompression device.
10. A decompression system for compressed data, comprising: The client is used to send decompression commands for the target compressed data; A decompression device for receiving the decompression command and implementing the method according to any one of claims 1 to 8.
11. A decompression system for compressed data, comprising: The client is used to transmit the target compressed data to the server; The server is used to receive the target compressed data and send decompression instructions for the target compressed data; A decompression device for receiving the decompression command and implementing the method according to any one of claims 1 to 8.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1 to 9.
13. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any one of claims 1 to 9.
14. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 9.