Differential File Generation Method, Incremental Update Method, Computing Device, and Storage Medium
By dividing files into blocks and merging blocks with the same characteristics, differential files are generated, and the problem of low file differential processing efficiency in existing incremental update technology is solved, efficient incremental update is achieved, and data processing volume and traffic are reduced.
Patent Information
- Application Number
- CN201980100485.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2039-12-28
AI Technical Summary
The existing incremental update technology is difficult to efficiently process file differences during the update process, resulting in large data processing volume and slow speed. When performing incremental updates, you need to download larger new files or new compressed packages, which increases data traffic and calculation time.
Generate differential files by dividing old and new files into several blocks and merging blocks with the same characteristics. The computing device that receives the differential file divides the old file into blocks, merges blocks with the same characteristics, and performs synthesis operations with the differential file to obtain new files, and realizes incremental updates to the old file.
It reduces data processing volume and processing time, reduces memory usage time, improves data processing speed, and effectively reduces data traffic and calculation time during incremental updates.
Smart Images

Figure CN114424165B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the technical field of incremental updates, and in particular, relate to a differential file generation method, an incremental update method, a computing device, and a storage medium. Background Art
[0002] Incremental update means that when performing an update operation, only the places that need to be changed are updated, and the places that do not need to be updated and the places that have already been updated will not be updated repeatedly. Incremental update is relative to full update. Incremental update technology is widely used in various places where data needs to be updated, such as software update, database update, virus library update, Content Management System (CMS) update, and routing table update, etc. Summary of the Invention
[0003] In a first aspect of the embodiments of the present application, a differential file generation method is provided, which is applied to a first computing device. The differential file generation method includes:
[0004] Dividing an old file into several blocks, and dividing a new file into several blocks;
[0005] Merging the blocks with the same features in the old file into one block, and merging the blocks with the same features in the new file into one block;
[0006] Obtaining a differential file according to the blocks with the same features in the old file and the new file.
[0007] In a second aspect of the embodiments of the present application, an incremental update method is provided, which is applied to a second computing device. The incremental update method includes:
[0008] Receiving a differential file sent by the first computing device; wherein, the differential file includes differential data corresponding to each group of blocks with the same features in the old file and the new file;
[0009] Dividing the old file into several blocks;
[0010] Merging the blocks with the same features in the old file into one block;
[0011] Performing a synthesis operation on the corresponding blocks and differential data in the old file and the differential file according to the features of the blocks to obtain a new file.
[0012] In a third aspect of the embodiments of the present application, a computing device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the differential file generation method described in the first aspect of the embodiments of the present application or the steps of the incremental update method described in the second aspect are implemented.
[0013] In the fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the steps of the differential file generation method described in the first aspect of the embodiments of the present application or the steps of the incremental update method described in the second aspect. Description of the Drawings
[0014] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0015] Figure 1 It is a schematic flowchart of the implementation of the differential file generation method provided by the embodiments of the present application;
[0016] Figure 2 It is a schematic diagram of the file composition of the compressed package provided by the embodiments of the present application;
[0017] Figure 3 It is a schematic diagram of an example of file merging provided by the embodiments of the present application;
[0018] Figure 4 It is a schematic flowchart of the implementation of the incremental update method provided by the embodiments of the present application;
[0019] Figure 5 It is a schematic diagram of the structure of the first computing device provided by the embodiments of the present application;
[0020] Figure 6 It is a schematic diagram of the structure of the second computing device provided by the embodiments of the present application. Detailed Embodiments
[0021] To enable those skilled in the art to better understand the present application, the following will clearly describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0022] The terms "including" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusion. In addition, terms such as "first" and "second" are used to distinguish different objects, rather than to describe a specific order.
[0023] Such as Figure 1As shown in the figure, an embodiment of the present application provides a differential file generation method, which is applied to a first computing device and can be implemented by a processor of the first computing device when running a computer program. The first computing device may be a computing device such as a desktop computer, a laptop computer, a handheld computer, a cloud server, a running device of a Content Delivery platform, etc. The differential file generation method is used to compare or calculate the difference between an old file and a new file, obtain a differential file and send it to a second computing device, and the second computing device is used to synthesize a new file according to the old file and the differential file to realize incremental update of the old file. The second computing device may be a computing device such as a desktop computer, a laptop computer, a handheld computer, a cloud server, etc., or may also be a mobile terminal such as a mobile phone, a tablet computer, a smart bracelet, a Head Mounted Display (HMD), etc., or may also be a self-service terminal, a robot, a smart home appliance, etc. The differential file generation method includes:
[0024] Step S101: Divide the old file into several blocks and divide the new file into several blocks.
[0025] In the application, the new file and the old file are existing files in the first computing device. The old file refers to the file before the update, and the new file refers to the file after the update. The old file and the new file may be at least one of an audio file, a video file, a document file, an image file, a Web Archive file (WAR file), a Java Archive file (JAR file), an Enterprise ARchive file (EAR file), etc., or may also be a compressed package compressed by a compression software such as WinRar, WinAce, WinZip or 7-Zip. For example, an application package, specifically an Android application package (APK).
[0026] In the application, a block may be a data segment or an independent file. For example, a block may be an independent file in a compressed package, specifically a dex file (an executable file on the Android platform), a manifest file, a resource file, etc. in an Android application package.
[0027] In one embodiment, both the old file and the new file are compressed packages, and step S101 includes:
[0028] Divide each blank area in the old file and the file before each blank area into a first block, divide each of the remaining files into a first block, and divide the central directory and the central directory end into a second block;
[0029] Divide each blank area in the new file and the file before each blank area into a first block, divide each of the remaining files into a first block, and divide the central directory and the end of the central directory into a second block.
[0030] In an application, according to the components of the old file and the new file, the old file and the new file can be divided into several independent blocks. For example, a Zip-format compressed package contains at least one file, a central directory, and an end of the central directory. There may be a blank area after each file for inserting identification information of the file. When there is a blank area in the compressed package, the decompression speed of the compressed package can be accelerated. Each file in the Zip-format compressed package and the blank area existing after the file can be divided into a first block, each of the remaining files without a blank area after it can be divided into a first block, and the central directory and the end of the central directory can be divided into a second block. There may or may not be a blank area after each file in the compressed package.
[0031] As Figure 2 shown, the file composition of a Zip-format compressed package is exemplarily shown, including: File 1, File 2, the blank area after File 2, File 3, …, File n, the central directory, and the end of the central directory; among them, File 2 and the blank area after it are divided into a first block, File 1, File 3, …, File n are each divided into a separate first block, and the central directory and the end of the central directory are divided into a second block, where n≥1 and n is an integer.
[0032] Step S102: Merge the blocks with the same features in the old file into one block, and merge the blocks with the same features in the new file into one block.
[0033] In an application, a feature is a characteristic related to the file itself that can be used to distinguish different types of files. For example, file name, MD5 value, basic data type, etc. The file name includes a prefix name, a suffix name, a main name, or an extension. Assume that the components of a Zip-format compressed package include File 1, File 2, a blank area after File 2, a central directory, and an end of the central directory; among them, the file name of File 1 is assets / file1.jpg, the file name of File 2 is res / a.xml, and the file name of File 3 is assets / file2.png. Then, in the file name of File 1, assets / file1 is the main name, assets is the prefix name, and jpg is the suffix name; in the file name of File 2, res / a is the main name, res is the prefix name, and xml is the suffix name; in the file name of File 3, assets is the prefix name, assets / file2 is the main name, and png is the suffix name. According to the different basic data types of the old file and the new file, for example, the C language includes six basic data types: short, int, long, char, float, and double, and the Java language includes eight data types: byte, short, int, long, float, double, char, and boolean.
[0034] In one embodiment, the feature includes at least one of a file name and a basic data type.
[0035] In one embodiment, the file name includes at least one of a main name, a prefix name, and a suffix name.
[0036] In one embodiment, step S102 includes:
[0037] Merging at least two first blocks with the same features in the old file into one third block respectively;
[0038] Merging at least two first blocks with the same features in the new file into one third block respectively.
[0039] In an application, the number of third blocks is greater than or equal to 0, that is, there may not be two first blocks with the same features. Assume that a Zip-format compressed package includes File 1, File 2, a blank area after File 2, File 3, File 4, File 5, a central directory, and an end of the central directory. Among them, File 2 and the blank area after File 2 are divided into a first block A, File 1, File 3, File 4, and File 5 are divided into four independent first blocks B, C, D, and E, and the central directory and the end of the central directory are divided into a second block; among them, the first block A with the same features and the first block C with the same features are merged into a third block, the first block B with the same features and the first block E are merged into another third block, and no block with the same features as the first block D is found. Therefore, the first block D is not merged.
[0040] As Figure 3 shown, it exemplarily shows that the old file is a compressed package, including File 1, File 2, a blank area after File 2, File 3, File 4, File 5, a central directory, and an end of the central directory. Among them, File 2 and the blank area after File 2 are divided into a first block A, File 1, File 3, File 4, and File 5 are divided into four independent first blocks B, C, D, and E, and the central directory and the end of the central directory are divided into a second block 31. The first block B with the same features and the first block E are merged into another third block 32, and the first block A with the same features and the first block C with the same features are merged into a third block 33. When no block with the same features as the first block D is found, the merging situation of the blocks in the compressed package.
[0041] Step S103: Obtain a differential file according to the blocks with the same features in the old file and the new file.
[0042] In an application, the differences between each group of blocks with the same features in the old file and the new file can be compared to obtain the differential data between each group of blocks with the same features, and then a differential file including the differential data corresponding to each group of blocks with the same features is generated; alternatively, differential operations can be performed on each group of blocks with the same features in the old file and the new file to obtain the differential data between each group of blocks with the same features, and then a differential file including the differential data corresponding to each group of blocks with the same features is generated.
[0043] In an application, differential algorithms such as JSDiff, HdiffPatch, Exediff, BSDiff, RTPatch, XDelta, and bzip2 can be used to perform differential operations on the blocks with the same features in the old file and the new file. For example, differential operations are performed on the second blocks with the same features in the old file and the new file and on each group of third blocks with the same features in the old file and the new file. When performing differential operations, parallel calculations can be performed on multiple groups of blocks with the same features.
[0044] In one embodiment, step S103 includes:
[0045] Compare the differences between the blocks with the same features in the old file and the new file respectively, and generate a differential file according to the comparison results;
[0046] Alternatively, perform differential operations on the blocks with the same features in the old file and the new file to obtain a differential file;
[0047] Wherein, the differential file includes differential data corresponding to the blocks with the same features in the old file and the new file.
[0048] In one embodiment, after step S103, it further includes:
[0049] Send the differential file to the second computing device for incremental update.
[0050] In an application, the first computing device partitions its existing old file and new file, calculates the differences between the partitions with the same features in the old file and the new file to obtain a differential file, and then sends the differential file to the second computing device. The second computing device can partition its existing old file and then perform a combined calculation with the received differential file to restore the new file. The existing old file of the second computing device is the same as the existing old file of the first computing device, and the restored new file of the second computing device is the same as the existing new file of the first computing device. The first computing device includes a communication module, and the step of sending the differential file to the second computing device for incremental update is controlled by the processor of the first computing device to execute the communication module. The communication module can be implemented based on at least one of wireless communication technologies such as Wireless Fidelity (WIFI), UltraWide Band (UWB), Bluetooth, ZigBee, Near Field Communication (NFC), Low-Power Wide-Area Network (LPWAN), Global Navigation Satellite System (GNSS), Cellular network, Wireless Local Area Networks (WLAN), Local Area Network (LAN), Wide Area Network (WAN), or wired communication technologies.
[0051] Figure 1In the above corresponding embodiments, by dividing the old file into several blocks and dividing the new file into several blocks; merging the blocks with the same features in the old file into one block and merging the blocks with the same features in the new file into one block; obtaining the differential file according to the blocks with the same features in the old file and the new file, the data processing amount can be reduced, the data processing speed can be increased, and thus the time for occupying memory can be reduced; the blocks with the same features can be processed in parallel at the same time, further increasing the data processing speed and further reducing the time for occupying memory, and reducing the requirement for the hardware performance of the first computing device; by sending the differential file to the second computing device for incremental update, the second computing device does not need to download a new file or a new compressed package with a large data volume for incremental update, but only needs to download a differential file with a small data volume for incremental update, which can effectively reduce the data traffic consumed when the second computing device performs incremental update, so that the second computing device does not need to obtain the differential file of the old file and the new file any more, and reduces the data calculation amount and calculation time when the second computing device performs incremental update.
[0052] As Figure 4 shown, an embodiment of the present application provides an incremental update method, which is applied to a second computing device and can be implemented by a processor of the second computing device when running a computer program. The second computing device may be a computing device such as a desktop computer, a laptop computer, a palm computer, and a cloud server, or may be a mobile terminal such as a mobile phone, a tablet computer, a smart bracelet, and a head-mounted display (HMD), or may be a self-service terminal, a robot, a smart home appliance, etc. The incremental update method is used to perform a synthesis operation on an existing old file and a differential file sent by a first computing device to obtain a new file, so as to realize the incremental update of the old file. The method for obtaining the differential file by the first computing device can be seen in the incremental update method provided in the above embodiments, and will not be elaborated in this embodiment. The incremental update method includes:
[0053] Step S401: Receive the differential file sent by the first computing device. The differential file includes differential data corresponding to each group of blocks with the same features in the old file and the new file.
[0054] In an application, after the second computing device receives the differential file, it performs a synthesis operation on the existing old file and the differential file to obtain a new file, thereby realizing an incremental update of the old file. The second computing device includes a communication module, and step S401 is controlled by the processor of the second computing device to execute the communication module. The communication module can be implemented based on at least one of wireless communication technologies or wired communication technologies such as Wireless Fidelity (WIFI), Ultra Wide Band (UWB), Bluetooth, ZigBee, Near Field Communication (NFC), Low-Power Wide-Area Network (LPWAN), Global Navigation Satellite System (GNSS), Cellular network, Wireless Local Area Networks (WLAN), Local Area Network (LAN), Wide Area Network (WAN), etc.
[0055] Step S402: Divide the old file into several blocks.
[0056] In an application, the old file is the same file existing in the second computing device as the old file in the first computing device. The old file can be at least one of an audio file, a video file, a document file, an image file, a Web Archive file (WAR file), a Java Archive file (JAR file), an Enterprise ARchive file (EAR file), etc., or can also be a compressed package compressed by compression software such as WinRar, WinAce, WinZip, or 7-Zip. For example, an application package, specifically, an Android application package (APK).
[0057] In one embodiment, the old file is a compressed package, and step S402 includes:
[0058] Divide each blank area in the old file and the file before each blank area into a first block, divide each of the remaining files into a first block, and divide the central directory and the end of the central directory into a second block.
[0059] In an application, the old file can be divided into several independent blocks according to the components of the old file. For example,
[0060] For example, a Zip - formatted compressed package contains at least one file, a Central Directory, and an End of Central Directory. There may be a blank area for inserting identification information of the file after each file. When there is a blank area in the compressed package, the decompression speed of the compressed package can be accelerated. Each file in the Zip - formatted compressed package and the blank area existing after the file can be divided into a first block, and each of the remaining files without a blank area after them can be divided into a first block. The Central Directory and the End of Central Directory are divided into a second block. There may or may not be a blank area after each file in the compressed package.
[0061] Step S403: Merge the blocks with the same features in the old file into one block.
[0062] In an application, a feature is a characteristic related to the file itself that can be used to distinguish different types of files. For example, file name, MD5 value, basic data type, etc. The file name includes a prefix name, a suffix name, a main name, or an extension name. For example, assume that the components of a Zip - formatted compressed package include File 1, File 2, the blank area after File 2, the Central Directory, and the End of Central Directory; among them, the file name of File 1 is assets / file1.jpg, the file name of File 2 is res / a.xml, and the file name of File 3 is assets / file2.png. Then, in the file name of File 1, assets / file1 is the main name, assets is the prefix name, and jpg is the suffix name; in the file name of File 2, res / a is the main name, res is the prefix name, and xml is the suffix name; in the file name of File 3, assets is the prefix name, assets / file2 is the main name, and png is the suffix name. According to the different writing languages of the old file and the new file, the basic data types are also different. For example, the C language includes six basic data types: short, int, long, char, float, and double, and the Java language includes eight data types: byte, short, int, long, float, double, char, and boolean.
[0063] In one embodiment, the feature includes at least one of a file name and a basic data type.
[0064] In one embodiment, the file name includes at least one of a main name, a prefix name, and a suffix name.
[0065] In one embodiment, step S403 includes:
[0066] Respectively merge at least two first blocks with the same features in the old file into one third block.
[0067] In an application, the number of third blocks is greater than or equal to 0, that is, there may not be two first blocks with the same features. Assume that a Zip format compressed package includes File 1, File 2, a blank area after File 2, File 3, File 4, File 5, a central directory, and an end of the central directory. Among them, File 2 and the blank area after File 2 are divided into a first block A, File 1, File 3, File 4, and File 5 are divided into four independent first blocks B, C, D, and E, and the central directory and the end of the central directory are divided into a second block; among them, the first block A with the same features and the first block C with the same features are merged into a third block, the first block B with the same features and the first block E are merged into another third block, and no block with the same features as the first block D is found. Therefore, the first block D is not merged.
[0068] Step S404: According to the features of the blocks, perform a synthesis operation on the corresponding blocks and differential data in the old file and the differential file to obtain a new file.
[0069] In an application, the BSPatch algorithm can be used to perform a synthesis operation on the corresponding blocks and differential data in the old file and the differential file. For example, perform a synthesis operation on the second block and the corresponding differential data in the old file and the differential file, and perform a synthesis operation on each third block and the corresponding differential file in the old file and the differential file. When performing the synthesis operation, parallel computing can be performed on multiple groups of corresponding blocks and differential data.
[0070] In one embodiment, step S404 includes:
[0071] According to the features of the second block and the third block, perform a synthesis operation on the corresponding second block and differential data in the old file and the differential file, and each group of corresponding third blocks and differential data to obtain a new file.
[0072] In one embodiment, after step S404 includes:
[0073] Split the blocks with the same features in the new file and reorder them according to the components of the old file before the synthesis operation.
[0074] In an application, since the blocks with the same features in the old file are merged before the synthesis operation, the blocks with the same features in the new file are merged together. Therefore, it is necessary to perform differencing on the blocks with the same features in the new file and then reorder them according to the components of the old file before the synthesis operation, so that the order of the components in the new file is the same as that in the old file.
[0075] Figure 4In the corresponding above embodiments, by receiving the differential file sent by the first computing device; dividing the old file into several blocks; merging the blocks with the same features in the old file into one block; then, according to the features of the blocks, performing a synthesis operation on the corresponding blocks and differential data in the old file and the differential file to obtain a new file, which can reduce the size of the file for the synthesis operation, improve the synthesis operation speed, thereby reducing the time of occupying memory; and can also perform parallel computing on multiple groups of corresponding blocks and differential data simultaneously, further improving the synthesis operation speed and further reducing the time of occupying memory, and reducing the requirements for the hardware performance of the second computing device; by downloading the differential file with a smaller data volume for incremental update, the second computing device does not need to download the new file or new compressed package with a larger data volume for incremental update, which can effectively reduce the data traffic consumed by the second computing device during incremental update, and the second computing device does not need to perform differential operation on the old file and the new file anymore, reducing the data calculation amount and calculation time of the second computing device during incremental update.
[0076] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0077] As Figure 5 shown, an embodiment of the present application provides a first computing device 5, which includes: a communication module 50, a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and executable on the processor 51, such as a differential file generation program. When the processor 51 executes the computer program 53, it implements Figure 1 the steps in the corresponding embodiments, such as steps S101 to S104.
[0078] Exemplarily, the computer program 53 can be divided into one or more units. One or more units are stored in the memory 52 and executed by the processor 51 to complete the present invention. One or more units can be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 53 in the first computing device 5. For example, as Figure 5 shown, the computer program 53 can be divided into a partitioning unit 531, a merging unit 532, and a differential file generation unit 533. The specific functions of each unit are as follows:
[0079] The partitioning unit 531 is used to divide the old file into several blocks and divide the new file into several blocks;
[0080] The merging unit 532 is used to merge the blocks with the same features in the old file into one block and merge the blocks with the same features in the new file into one block;
[0081] The differential file generation unit 533 is configured to obtain a differential file based on the blocks with the same features in the old file and the new file.
[0082] In one embodiment, the computer program 53 may be divided into a sending unit configured to send the differential file to a second computing device for incremental update. In applications, the first computing device 5 may be a computing device such as a desktop computer, a laptop computer, a handheld computer, a cloud server, an operating device of a content distribution platform, etc. The first computing device 5 may include, but is not limited to, a communication module 50, a processor 51, and a memory 52. Those skilled in the art can understand that Figure 5 merely examples of the first computing device 5 do not constitute a limitation on the first computing device 5, and it may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the first computing device may further include an input / output device, a network access device, a bus, etc.
[0083] In applications, the processor 51 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0084] In applications, the memory 52 may be an internal storage unit of the first computing device 5, such as the hard disk or memory of the first computing device 5. The memory 52 may also be an external storage device of the first computing device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the first computing device 5. Further, the memory may also include both the internal storage unit and the external storage device of the first computing device 5. The memory 52 is used to store the computer program and other programs and data required by the first computing device 5. The memory 52 may also be used to temporarily store the data that has been output or will be output.
[0085] Such as Figure 6As shown in the figure, an embodiment of the present application provides a second computing device 6, which includes: a communication module 60, a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61, such as an incremental update program. When the processor 61 executes the computer program 63, the steps in the Figure 4 corresponding embodiment are implemented, such as steps S401 to S404.
[0086] Exemplarily, the computer program 63 can be divided into one or more units. One or more units are stored in the memory 62 and executed by the processor 61 to complete the present invention. One or more units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 63 in the second computing device 6. For example, as Figure 6 shown in the figure, the computer program 63 can be divided into a receiving unit 631, a partitioning unit 632, a merging unit 633, and a synthesis operation unit 634. The specific functions of each unit are as follows:
[0087] The receiving unit 631 is configured to receive the differential file sent by the first computing device; wherein, the differential file includes differential data corresponding to the blocks with the same features in the old file and the new file.
[0088] The partitioning unit 632 is configured to divide the old file into several blocks.
[0089] The merging unit 633 is configured to merge the blocks with the same features in the old file into one block.
[0090] The synthesis operation unit 634 is configured to perform a synthesis operation on the corresponding blocks and differential data in the old file and the differential file according to the features of the blocks to obtain the new file.
[0091] In one embodiment, the computer program 63 can also be divided into a splitting unit, which is configured to split the blocks with the same features in the new file and reorder them according to the components of the old file before the synthesis operation.
[0092] In application, the second computing device 6 can be a computing device such as a desktop computer, a laptop computer, a handheld computer, and a cloud server. The second computing device 6 may include, but is not limited to, the communication module 60, the processor 61, and the memory 62. Those skilled in the art can understand that Figure 6 these are only examples of the second computing device 6 and do not constitute a limitation on the second computing device 6. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the second computing device may also include input / output devices, network access devices, buses, etc.
[0093] In an application, the processor 61 may be a central processing unit, or may also be other general-purpose processors, digital signal processors, application-specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0094] In an application, the memory 62 may be an internal storage unit of the second computing device 6, such as a hard disk or memory of the second computing device 6. The memory 62 may also be an external storage device of the second computing device 6, such as a plug-in hard disk, smart memory card, secure digital card, flash card, etc. equipped on the second computing device 6. Further, the memory may also include both the internal storage unit and the external storage device of the second computing device 6. The memory 62 is used to store computer programs and other programs and data required by the second computing device. The memory 62 may also be used to temporarily store data that has been output or is to be output.
[0095] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above division of each functional unit is used as an example for illustration. In actual applications, the above functions can be allocated to different functional units according to needs, that is, the internal structure of the terminal is divided into different functional units to complete all or part of the functions described above. Each functional unit in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units in the above system can refer to the corresponding process in the foregoing method embodiment and will not be elaborated here.
[0096] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0097] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0098] In the embodiments provided by the present invention, it should be understood that the disclosed terminals and methods can be implemented in other ways. For example, the terminal embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of terminals or units can be in electrical, mechanical or other forms.
[0099] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0100] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0101] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above method embodiments of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or terminal that can carry computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0102] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A differential file generation method, characterized in that, applied to a first computing device, the differential file generation method includes: Dividing an old file into several blocks and dividing a new file into several blocks; Merging blocks with the same characteristics in the old file into one block and merging blocks with the same characteristics in the new file into one block; Obtaining a differential file according to the blocks with the same characteristics in the old file and the new file; Merging blocks with the same characteristics in the old file into one block and merging blocks with the same characteristics in the new file into one block, including: Respectively merging at least two first blocks with the same characteristics in the old file into one third block; Respectively merging at least two first blocks with the same characteristics in the new file into one third block; Obtaining a differential file according to the blocks with the same characteristics in the old file and the new file, including: Obtaining a differential file according to the second blocks and each group of third blocks with the same characteristics in the old file and the new file; Both the old file and the new file are compressed packages; dividing the old file into several blocks and dividing the new file into several blocks, including: Dividing each blank area and the file before each blank area in the old file into one first block, dividing each remaining file into one first block, and dividing the central directory and the end of the central directory into one second block; Dividing each blank area and the file before each blank area in the new file into one first block, dividing each remaining file into one first block, and dividing the central directory and the end of the central directory into one second block.
2. The differential file generation method according to claim 1, characterized in that, Obtaining a differential file according to the blocks with the same characteristics in the old file and the new file, including: Respectively comparing the differences between each group of blocks with the same characteristics in the old file and the new file, and generating a differential file according to the comparison results; Or, performing differential operations on each group of blocks with the same characteristics in the old file and the new file to obtain a differential file; Wherein, the differential file includes differential data corresponding to each group of blocks with the same characteristics in the old file and the new file.
3. The differential file generation method according to claim 1 or 2, characterized in that, The characteristics include at least one of a file name and a basic data type.
4. The differential file generation method according to claim 3, characterized in that, The file name includes at least one of a main name, a prefix name, and a suffix name.
5. The differential file generation method according to claim 1 or 2, characterized in that, After obtaining a differential file according to the blocks with the same characteristics in the old file and the new file, it further includes: Sending the differential file to a second computing device for incremental update.
6. An incremental update method, characterized in that, applied to a second computing device, the incremental update method includes: Receiving a differential file sent by a first computing device; wherein, the differential file includes differential data corresponding to each group of blocks with the same characteristics in the old file and the new file, and the first computing device is used to execute the differential file generation method according to any one of claims 1-5; Dividing the old file into several blocks; Merging blocks with the same characteristics in the old file into one block; According to the characteristics of the blocks, perform a synthesis operation on the corresponding blocks and differential data in the old file and the differential file to obtain a new file.
7. The incremental update method according to claim 6, wherein, the old file is a compressed package; The old file is divided into several blocks, including: Each blank area in the old file and the file before each blank area are divided into a first block, each of the remaining files is divided into a first block, the central directory and the end of the central directory are divided into a second block.
8. The incremental update method according to claim 7, wherein, Merging the blocks with the same characteristics in the old file, including: Respectively merging at least two first blocks with the same characteristics in the old file into a third block; According to the characteristics of the blocks, perform a synthesis operation on the corresponding blocks and differential data in the old file and the differential file to obtain a new file, including: According to the characteristics of the second block and the third block, respectively perform a synthesis operation on the corresponding second block and differential data in the old file and the differential file and each group of corresponding third blocks and differential data to obtain a new file.
9. The incremental update method according to claim 8, wherein, The characteristics include at least one of the file name and the basic data type.
10. The incremental update method according to claim 9, wherein, The file name includes at least one of the main name, the prefix name, and the suffix name.
11. A computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, when the processor executes the computer program, it implements the steps of the differential file generation method according to any one of claims 1 to 5 or the steps of the incremental update method according to any one of claims 6 to 10.
12. A computer-readable storage medium, the computer-readable storage medium stores a computer program, wherein, when the computer program is executed by the processor, it implements the steps of the differential file generation method according to any one of claims 1 to 5 or the steps of the incremental update method according to any one of claims 6 to 10.
Citation Information
Patent Citations
Software upgrading method and electronic equipment
CN105930197A