CN114424165A - Differential file generation method, incremental update method, computing device and storage medium - Google Patents

Differential file generation method, incremental update method, computing device and storage medium Download PDF

Info

Publication number
CN114424165A
CN114424165A CN201980100485.2A CN201980100485A CN114424165A CN 114424165 A CN114424165 A CN 114424165A CN 201980100485 A CN201980100485 A CN 201980100485A CN 114424165 A CN114424165 A CN 114424165A
Authority
CN
China
Prior art keywords
file
blocks
differential
old
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201980100485.2A
Other languages
Chinese (zh)
Inventor
赵杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN114424165A publication Critical patent/CN114424165A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A differential file generation method, an incremental update method, a computing device, and a storage medium. The scheme divides an old file into a plurality of blocks, and divides a new file into a plurality of blocks (S101); combining the blocks with the same characteristics in the old file into a block, and combining the blocks with the same characteristics in the new file into a block (S102); and then obtaining a difference file according to the blocks with the same characteristics in the old file and the new file (S103), so that the data processing amount can be reduced, the data processing speed is improved, and the time of occupying the memory is reduced.

Description

Differential file generation method, incremental update method, computing device and storage medium Technical Field
The embodiment of the application belongs to the technical field of incremental updating, and particularly relates to a differential file generation method, an incremental updating method, computing equipment and a storage medium.
Background
Incremental updating refers to updating only the place which needs to be changed, and the place which does not need to be updated and the place which has been updated do not need to be updated repeatedly, and the incremental updating is opposite to the complete updating. The incremental update technology is widely applied to various places where data update is required, such as software update, database update, virus library update, Content Management System (CMS) update, routing table update, and the like.
Disclosure of Invention
A first aspect of an embodiment of the present application provides a differential file generation method, which is applied to a first computing device, and the differential file generation method includes:
dividing the old file into a plurality of blocks, and dividing the new file into a plurality of blocks;
combining the blocks with the same characteristics in the old file into a block, and combining the blocks with the same characteristics in the new file into a block;
and obtaining the differential file according to the blocks with the same characteristics in the old file and the new file.
A second aspect of the embodiments of the present application provides an incremental update method, which is applied to a second computing device, where the incremental update method includes:
receiving a differential file sent by first computing equipment; the differential file comprises differential data corresponding to blocks with the same characteristics in each group of the old file and the new file;
dividing an old file into a plurality of blocks;
combining the blocks with the same characteristics in the old files into one block;
and according to the characteristics of the blocks, carrying out synthesis operation on the corresponding blocks and differential data in the old file and the differential file to obtain a new file.
A third aspect of the embodiments of the present application provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements, when executing the computer program, the steps of the differential file generation method according to the first aspect or the steps of the incremental update method according to the second aspect of the embodiments of the present application.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the differential file generation method according to the first aspect or the steps of the incremental update method according to the second aspect of the embodiments of the present application.
Drawings
In order to more clearly explain the technical application in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without inventive labor.
Fig. 1 is a schematic flow chart of an implementation of a differential file generation method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a file composition of a compressed package provided by an embodiment of the present application;
FIG. 3 is a diagram illustrating an example of merging documents provided by an embodiment of the present application;
fig. 4 is a schematic flowchart of an implementation flow of an incremental update method provided in an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a first computing device provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a second computing device provided in an embodiment of the present application.
Detailed Description
For a better understanding of the present application by those skilled in the art, the technical application in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "comprises" and "comprising," and any variations thereof, in the description and claims of this application and the drawings described above, are intended to cover non-exclusive inclusions. Furthermore, the terms "first" and "second," etc. are used to distinguish between different objects and are not used to describe a particular order.
As shown in fig. 1, 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 desktop computer, a notebook computer, a palm top computer, a cloud server, a Content Delivery (Content Delivery) platform operating device, or the like. The differential file generation method is used for comparing or calculating the difference between the old file and the new file, obtaining the differential file and sending the differential file to the second computing device, and the second computing device is used for synthesizing the new file according to the old file and the differential file to realize incremental updating of the old file. The second computing device may be a desktop computer, a notebook computer, a palm computer, a cloud server, or other computing devices, or may be a mobile terminal such as a mobile phone, a tablet computer, an intelligent bracelet, a Head Mounted Display (HMD), or other mobile terminal, or may be a self-service terminal, a robot, an intelligent appliance, or other mobile terminal. The differential file generation method comprises the following steps:
step S101, dividing the old file into a plurality of blocks, and dividing the new file into a plurality of blocks.
In the application, the new file and the old file are files already 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 application file (war (web Archive file) file), a Java Archive file (JAR file), an enterprise JAR file (EAR file), and the like, or may be a compressed package compressed by compression software such as WinRar, WinAce, WinZip, or 7-Zip, for example, the application package may be an Android Application Package (APK).
In an application, a chunk may be a data segment or a separate file. For example, the tiles may be mutually independent files in the compressed package, and specifically may be dex files (executable files on an android platform), manifest files, resource files, and the like in the android application package.
In one embodiment, the old file and the new file are both compressed packages, and step S101 includes:
dividing each blank area in the old file and the file before each blank area into a first block, dividing each residual file into a first block, and dividing the end of the central directory and the central directory into a second block;
dividing each blank area in the new file and the file before each blank area into a first block, dividing each remaining file into a first block, and dividing the central directory and the end of the central directory into a second block.
In an application, the old file and the new file may be divided into several independent blocks according to their components. For example, a Zip-format compressed packet includes at least one file, a Central Directory (Central Directory) and a Central Directory End (End of Central Directory), where there may be a blank area for inserting the identification information of the file after each file, and when there is a blank area in the compressed packet, the decompression speed of the compressed packet may be increased. Each file in the Zip-format compressed packet and the blank space existing after the file can be divided into a first block, each remaining file without blank space thereafter 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 space after each file in the compressed package.
As shown in fig. 2, an exemplary file composition of a Zip-format compressed package is shown, which includes: file1, file2, blank space following file2, file 3, …, file n, central directory, and central directory end; wherein, the file2 and the blank area behind the file are divided into a first block, the file1, the file 3, the file … and the file n are divided into a single first block, the central directory and the end of the central directory are divided into a second block, n is more than or equal to 1 and n is an integer.
Step S102, merging the blocks with the same characteristics in the old file into a block, and merging the blocks with the same characteristics in the new file into a block.
In an application, a feature is a property associated with a file itself that can be used to distinguish between different types of files. Such as 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. Assuming the components of the compressed package in Zip format, including file1, file2, a blank space located after file2, a central directory and a central directory end; wherein, the file name of file1 is assets/file1.JPG, the file name of file2 is res/a. xml, the file name of file 3 is assets/file2.png, then assets/file1 in the file name of file1 is the main name, assets is the prefix name, jpg is the suffix name, res/a in the file name of file2 is the main name, res is the prefix name, xml is the suffix name, assets in the file name of file 3 is the prefix name, assets/file2 is the main name, png is the suffix name. The different basic data types according to the writing languages of the old file and the new file are different, for example, the C language comprises six basic data types of short, int, long, char, float and double, and the Java language comprises eight data types of byte, short, int, long, float, double, char and borolan.
In one embodiment, the characteristic includes at least one of a file name and a basic data type.
In one embodiment, the file name includes at least one of a primary name, a prefix name, and a suffix name.
In one embodiment, step S102 includes:
respectively merging at least two first blocks with the same characteristics in the old files into a third block;
and respectively merging at least two first blocks with the same characteristics in the new file into a third block.
In application, the number of the third blocks is greater than or equal to 0, that is, there may not be two first blocks with the same characteristics. Suppose that the Zip-format compressed package includes file1, file2, a blank space located after file2, file 3, file 4, file 5, a central directory and a central directory end, wherein the blank space after file2 and file2 is divided into a first block a, file1, file 3, file 4 and file 5 are divided into four mutually independent first blocks B, C, D, E, and the central directory end are divided into a second block; the first block A with the same characteristics and the first block C with the same characteristics are merged into a third block, the first block B with the same characteristics and the first block E with the same characteristics are merged into another third block, and a block with the same characteristics as the first block D is not found, so that the first block D is not merged.
As shown in fig. 3, the old file is exemplarily shown as a compressed package, and includes file1, file2, a blank space located after file2, file 3, file 4, file 5, a central directory and a central directory end, where the blank space after file2 and file2 is divided into a first block a, file1, file 3, file 4 and file 5 are divided into four mutually independent first blocks B, C, D, E, the central directory and the central directory end are divided into a second block 31, a first block B and a first block E with the same characteristics are merged into another third block 32, a first block a with the same characteristics and a first block C with the same characteristics are merged into a third block 33, and when no block with the same characteristics as the first block D is found, the merging of blocks in the compressed package is performed.
Step S103, obtaining a difference file according to the blocks with the same characteristics in the old file and the new file.
In application, the differences between the blocks with the same characteristics in each group in the old file and the new file can be compared to obtain the differential data between the blocks with the same characteristics in each group, and then the differential file comprising the differential data corresponding to the blocks with the same characteristics in each group is generated; or performing differential operation on blocks with the same characteristics in each group in the old file and the new file to obtain differential data between the blocks with the same characteristics in each group, and then generating a differential file including the differential data corresponding to the blocks with the same characteristics in each group.
In application, the difference operation may be performed on the blocks with the same features in the old document and the new document through a difference algorithm such as JSDiff, HdiffPatch, Exediff, BSDiff, RTPatch, XDelta, bzip2, for example, the difference operation may be performed on the second blocks with the same features in the old document and the new document, and the difference operation may be performed on the third blocks with the same features in each group in the old document and the new document. When the difference operation is carried out, a plurality of groups of blocks with the same characteristics can be subjected to parallel computation.
In one embodiment, step S103 includes:
respectively comparing the difference between blocks with the same characteristics in each group of the old file and the new file, and generating a difference file according to the comparison result;
or carrying out differential operation on each group of blocks with the same characteristics in the old file and the new file to obtain a differential file;
the differential file comprises differential data corresponding to blocks with the same characteristics in each group of the old file and the new file.
In one embodiment, after step S103, the method further includes:
and sending the difference file to the second computing device for incremental updating.
In application, the first computing device partitions an existing old file and an existing new file, calculates the difference between partitions with the same characteristics in the old file and the new file, obtains a differential file, and then sends the differential file to the second computing device, and the second computing device can perform merging calculation on the received differential file and the existing old file after partitioning, so that the new file is restored. The old files already existing on the second computing device are the same as the old files already existing on the first computing device, and the new files restored by the second computing device are the same as the new files already existing on the first computing device. The first computing device includes a communication module, and the step of sending the difference file to the second computing device for incremental updating is performed by the communication module controlled by the processor of the first computing device. The Communication module may be implemented based on at least one of Wireless Communication technologies such as Wireless Fidelity (WIFI), Ultra Wide Band (UWB), Bluetooth (Bluetooth), ZigBee (ZigBee), Near Field Communication (Near Field Communication, NFC), Low Power Wide Area Network (LPWAN), Global Navigation Satellite System (GNSS), Cellular Network (Cellular Network), Wireless Local Area Network (WLAN), Local Area Network (LAN), Wide Area Network (WAN), and wired Communication technologies.
In the above embodiment corresponding to fig. 1, the old file is divided into blocks, and the new file is divided into blocks; combining the blocks with the same characteristics in the old file into a block, and combining the blocks with the same characteristics in the new file into a block; the difference file is obtained according to the blocks with the same characteristics in the old file and the new file, so that the data processing amount can be reduced, the data processing speed is improved, and the time for occupying the memory is reduced; the blocks with the same characteristics can be processed in parallel, so that the data processing speed is further improved, the time for occupying the memory is further reduced, and the requirement on the hardware performance of the first computing device is reduced; the differential file is sent to the second computing device for incremental updating, so that the second computing device does not need to download a new file with a large data volume or a new compressed packet for incremental updating, and only needs to download the differential file with a small data volume for incremental updating, the data flow consumed by the second computing device for incremental updating can be effectively reduced, the second computing device does not need to acquire the differential file of the old file and the new file, and the data calculation amount and the calculation time of the second computing device for incremental updating are reduced.
As shown in fig. 4, 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 desktop computer, a notebook computer, a palm computer, a cloud server, or other computing devices, or may be a mobile terminal such as a mobile phone, a tablet computer, an intelligent bracelet, a Head Mounted Display (HMD), or other mobile terminal, or may be a self-service terminal, a robot, an intelligent appliance, or other mobile terminal. The incremental updating method is used for carrying out synthesis operation on the existing old file and the differential file sent by the first computing device to obtain the new file, so that incremental updating of the old file is achieved. The method for obtaining the difference file through the first computing device is detailed in the incremental updating method provided in the foregoing embodiment, and is not described in detail in this embodiment. The incremental updating method comprises the following steps:
step S401, receiving a differential file sent by a first computing device, where the differential file includes differential data corresponding to blocks with the same characteristics in each group of the old file and the new file.
In application, after the second computing device receives the differential file, the existing old file and the differential file are subjected to synthesis operation to obtain a new file, so that incremental updating of the old file is achieved. The second computing device comprises a communication module, and step S401 is performed by the processor of the second computing device controlling the communication module. The Communication module may be implemented based on at least one of Wireless Communication technologies such as Wireless Fidelity (WIFI), Ultra Wide Band (UWB), Bluetooth (Bluetooth), ZigBee (ZigBee), Near Field Communication (Near Field Communication, NFC), Low Power Wide Area Network (LPWAN), Global Navigation Satellite System (GNSS), Cellular Network (Cellular Network), Wireless Local Area Network (WLAN), Local Area Network (LAN), Wide Area Network (WAN), and wired Communication technologies.
Step S402, dividing the old file into a plurality of blocks.
In an application, the old file is the same file already in the second computing device as the old file in the first computing device. The old file may be at least one of an audio file, a video file, a document file, an image file, a web application file (war (web Archive file)) file, a Java Archive file (JAR file), an enterprise JAR file (EAR file), and the like, or may be a compressed packet compressed by compression software such as WinRar, WinAce, WinZip, or 7-Zip, for example, an application package, and specifically may be an Android Application Package (APK).
In one embodiment, the old file is a compressed package, and step S402 includes:
dividing each blank area in the old file and the file before each blank area into a first block, dividing each remaining file into a first block, and dividing the central directory and the end of the central directory into a second block.
In an application, the old file may be divided into several independent blocks according to the old file components. For example,
for example, a Zip-format compressed packet includes at least one file, a Central Directory (Central Directory) and a Central Directory End (End of Central Directory), where there may be a blank area for inserting the identification information of the file after each file, and when there is a blank area in the compressed packet, the decompression speed of the compressed packet may be increased. Each file in the Zip-format compressed packet and the blank space existing after the file can be divided into a first block, each remaining file without blank space thereafter 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 space after each file in the compressed package.
Step S403, merging the blocks with the same characteristics in the old file into one block.
In an application, a feature is a property associated with a file itself that can be used to distinguish between different types of files. Such as 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 file1, file2, a blank space following file2, a central directory, and a central directory trailer; wherein, the file name of file1 is assets/file1.JPG, the file name of file2 is res/a. xml, the file name of file 3 is assets/file2.png, then assets/file1 in the file name of file1 is the main name, assets is the prefix name, jpg is the suffix name, res/a in the file name of file2 is the main name, res is the prefix name, xml is the suffix name, assets in the file name of file 3 is the prefix name, assets/file2 is the main name, png is the suffix name. The different basic data types according to the writing languages of the old file and the new file are different, for example, the C language comprises six basic data types of short, int, long, char, float and double, and the Java language comprises eight data types of byte, short, int, long, float, double, char and borolan.
In one embodiment, the characteristic includes at least one of a file name and a basic data type.
In one embodiment, the file name includes at least one of a primary name, a prefix name, and a suffix name.
In one embodiment, step S403 includes:
at least two first blocks with the same characteristics in the old files are respectively merged into a third block.
In application, the number of the third blocks is greater than or equal to 0, that is, there may not be two first blocks with the same characteristics. Suppose that the Zip-format compressed package includes file1, file2, a blank space located after file2, file 3, file 4, file 5, a central directory and a central directory end, wherein the blank space after file2 and file2 is divided into a first block a, file1, file 3, file 4 and file 5 are divided into four mutually independent first blocks B, C, D, E, and the central directory end are divided into a second block; the first block A with the same characteristics and the first block C with the same characteristics are merged into a third block, the first block B with the same characteristics and the first block E with the same characteristics are merged into another third block, and a block with the same characteristics as the first block D is not found, so that the first block D is not merged.
Step S404, according to the characteristics of the blocks, the corresponding blocks and differential data in the old file and the differential file are subjected to synthesis operation to obtain a new file.
In application, the corresponding blocks and difference data in the old file and the difference file can be synthesized by the BSPatch algorithm, for example, the second blocks and corresponding difference data in the old file and the difference file, and each third block and corresponding difference file in the old file and the difference file. When the synthesis operation is performed, a plurality of groups of corresponding blocks and differential data can be calculated in parallel.
In one embodiment, step S404 includes:
and respectively carrying out synthesis operation on the corresponding second blocks and differential data in the old file and the differential file and the corresponding third blocks and differential data in each group according to the characteristics of the second blocks and the characteristics of the third blocks to obtain a new file.
In one embodiment, step S404 is followed by:
the blocks with the same characteristics in the new file are split and reordered according to the components of the old file before the composition operation.
In application, since the merging process is performed on the blocks with the same characteristics in the old file before the composition operation is performed, so that the blocks with the same characteristics in the new file are merged together, it is necessary to differentiate the blocks with the same characteristics in the new file, and then reorder the components of the old file before the composition operation is performed, so that the sequences of the components in the new file and the components in the old file are the same.
FIG. 4 corresponds to the above embodiment where the differential file is sent by the first computing device; dividing an old file into a plurality of blocks; combining the blocks with the same characteristics in the old files into one block; then according to the characteristics of the blocks, the corresponding blocks and differential data in the old file and the differential file are subjected to synthesis operation to obtain a new file, so that the size of the file subjected to the synthesis operation can be reduced, the synthesis operation speed is increased, and the time of occupying a memory is reduced; the parallel computation can be simultaneously carried out on a plurality of groups of corresponding blocks and differential data, the synthesis operation speed is further improved, the time for occupying the memory is further reduced, and the requirement on the hardware performance of second computing equipment is lowered; by downloading the differential file with smaller data volume for incremental updating, the second computing device does not need to download a new file with larger data volume or a new compressed packet for incremental updating, the data flow consumed by the second computing device during incremental updating can be effectively reduced, the second computing device does not need to perform differential operation on the old file and the new file, and the data calculation amount and the calculation time of the second computing device during incremental updating are reduced.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
As shown in fig. 5, one embodiment of the present application provides a first computing device 5 comprising: a communication module 50, a processor 51, a memory 52, and a computer program 53, such as a differential file generation program, stored in the memory 52 and operable on the processor 51. The processor 51, when executing the computer program 53, implements the steps in the corresponding embodiment of fig. 1, e.g. steps S101 to S104.
Illustratively, the computer program 53 may be divided into one or more units, which are stored in the memory 52 and executed by the processor 51 to carry out the invention. One or more of the elements may be a series of computer program instruction segments capable of performing certain functions, which are used to describe the execution of the computer program 53 in the first computing device 5. For example, as shown in fig. 5, the computer program 53 may be divided into a partition unit 531, a merge unit 532, and a differential file generation unit 533, and the specific functions of each unit are as follows:
a partition unit 531 for dividing the old file into a plurality of blocks and the new file into a plurality of blocks;
a merging unit 532, configured to merge blocks with the same characteristics in the old file into one block, and merge blocks with the same characteristics in the new file into one block;
the differential file generating unit 533 is configured to obtain the differential file according to the blocks with the same characteristics in the old file and the new file.
In one embodiment, the computer program 53 may be partitioned into a sending unit for sending the difference file to a second computing device for incremental updating. In application, the first computing device 5 may be a desktop computer, a notebook computer, a palm computer, a cloud server, an operating device of a content distribution platform, or other computing devices. 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 will appreciate that fig. 5 is merely an example of the first computing device 5 and does not constitute a limitation of the first computing device 5 and may include more or fewer components than shown, or combine certain components, or different components, e.g., the first computing device may also include an input-output device, a network access device, a bus, etc.
In Application, the Processor 51 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In an application, the storage 52 may be an internal storage unit of the first computing device 5, such as a hard disk or a memory of the first computing device 5. Memory 52 may also be an external storage device of first computing device 5, such as a plug-in hard disk provided on first computing device 5, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and so forth. Further, the memory may also include both an internal storage unit of the first computing device 5 and an external storage device. The memory 52 is used to store computer programs and other programs and data required by the first computing device. The memory 52 may also be used to temporarily store data that has been output or is to be output.
As shown in fig. 6, one embodiment of the present application provides a second computing device 6 comprising: a communication module 60, a processor 61, a memory 62 and a computer program 63, such as an incremental update program, stored in the memory 62 and executable on the processor 61. The processor 61, when executing the computer program 63, implements the steps in the corresponding embodiment of fig. 4, such as steps S401 to S404.
Illustratively, the computer program 63 may be divided into one or more units, which are stored in the memory 62 and executed by the processor 61 to carry out the invention. One or more elements may be a series of computer program instruction segments capable of performing certain functions that are used to describe the execution of computer program 63 in second computing device 6. For example, as shown in fig. 6, the computer program 63 may be divided into a receiving unit 631, a partitioning unit 632, a combining unit 633, and a synthesizing operation unit 634, and the specific functions of each unit are as follows:
a receiving unit 631 for receiving the differential file transmitted by the first computing device; the differential file comprises differential data corresponding to blocks with the same characteristics in each group of the old file and the new file;
a partition unit 632 for dividing the old file into a plurality of blocks;
a merging unit 633 for merging blocks with the same characteristics in the old file into one block;
and a combining operation unit 634, configured to perform a combining operation on the corresponding blocks and difference data in the old file and the difference file according to the characteristics of the blocks, so as to obtain a new file.
In one embodiment, the computer program 63 may also be divided into a splitting unit for splitting blocks of the new file that have the same characteristics and reordering the components of the old file before the composition operation is performed.
In application, the second computing device 6 may be a desktop computer, a notebook computer, a palm computer, a cloud server, or other computing devices. Second computing device 6 may include, but is not limited to, a communication module 60, a processor 61, and a memory 62. Those skilled in the art will appreciate that fig. 6 is merely an example of the second computing device 6 and does not constitute a limitation of the second computing device 6 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the second computing device may also include input output devices, network access devices, buses, etc.
In applications, the processor 61 may be a central processing unit, but 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, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In application, memory 62 may be an internal storage unit of second computing device 6, such as a hard disk or a memory of second computing device 6. Memory 62 may also be an external storage device of second computing device 6, such as a plug-in hard drive, smart memory card, secure digital card, flash memory card, etc. provided on second computing device 6. Further, the memory may also include both an internal storage unit of the second computing device 6 and an external storage device. 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.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units is merely illustrated, and in practical applications, the above function distribution may be performed by different functional units according to needs, that is, the internal structure of the terminal is divided into different functional units to perform all or part of the above described functions. Each functional unit in the embodiments may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the application. The specific working process of the units in the system may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed terminal and method can be implemented in other manners. For example, the above-described terminal embodiments are merely illustrative, and for example, the division of a unit is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, terminals or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method according to the embodiments of the present invention may also be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of the embodiments of the method. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or terminal capable of carrying computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (14)

  1. A differential file generation method applied to a first computing device comprises the following steps:
    dividing the old file into a plurality of blocks, and dividing the new file into a plurality of blocks;
    combining the blocks with the same characteristics in the old file into a block, and combining the blocks with the same characteristics in the new file into a block;
    and obtaining the differential file according to the blocks with the same characteristics in the old file and the new file.
  2. The differential file generation method of claim 1, wherein obtaining the differential file from the blocks with the same characteristics in the old file and the new file comprises:
    respectively comparing the difference between blocks with the same characteristics in each group of the old file and the new file, and generating a difference file according to the comparison result;
    or carrying out differential operation on each group of blocks with the same characteristics in the old file and the new file to obtain a differential file;
    the differential file comprises differential data corresponding to blocks with the same characteristics in each group of the old file and the new file.
  3. The differential file generation method of claim 1, wherein the old file and the new file are both compressed packets;
    dividing the old file into blocks and the new file into blocks, comprising:
    dividing each blank area in the old file and the file before each blank area into a first block, dividing each residual file into a first block, and dividing the end of the central directory and the central directory into a second block;
    dividing each blank area in the new file and the file before each blank area into a first block, dividing each remaining file into a first block, and dividing the central directory and the end of the central directory into a second block.
  4. The differential file generation method of claim 2, wherein 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 comprises:
    respectively merging at least two first blocks with the same characteristics in the old files into a third block;
    respectively merging at least two first blocks with the same characteristics in the new file into a third block;
    obtaining a differential file according to blocks with the same characteristics in the old file and the new file, wherein the differential file comprises the following steps:
    and obtaining a differential file according to the second blocks in the old file and the new file and the third blocks with the same characteristics in each group.
  5. The differential file generation method according to any one of claims 2 to 4, wherein the characteristic includes at least one of a file name and a basic data type.
  6. The differential file generation method according to claim 5, wherein the file name includes at least one of a primary name, a prefix name, and a suffix name.
  7. The differential file generation method according to any one of claims 2 to 4, wherein after obtaining the differential file from the blocks having the same characteristics in the old file and the new file, the method further comprises:
    and sending the difference file to the second computing device for incremental updating.
  8. An incremental update method applied to a second computing device, the incremental update method comprising:
    receiving a differential file sent by first computing equipment; the differential file comprises differential data corresponding to blocks with the same characteristics in each group of the old file and the new file;
    dividing an old file into a plurality of blocks;
    combining the blocks with the same characteristics in the old files into one block;
    and according to the characteristics of the blocks, carrying out synthesis operation on the corresponding blocks and differential data in the old file and the differential file to obtain a new file.
  9. The incremental update method of claim 8, wherein the old file is a compressed package;
    dividing the old file into blocks, including:
    dividing each blank area in the old file and the file before each blank area into a first block, dividing each remaining file into a first block, and dividing the central directory and the end of the central directory into a second block.
  10. The incremental update method of claim 9, wherein merging blocks in the old file that have the same characteristics into one block comprises:
    respectively merging at least two first blocks with the same characteristics in the old files into a third block;
    according to the characteristics of the blocks, carrying out synthesis operation on the corresponding blocks and differential data in the old file and the differential file to obtain a new file, wherein the synthesis operation comprises the following steps:
    and respectively carrying out synthesis operation on the corresponding second blocks and differential data in the old file and the differential file and the corresponding third blocks and differential data in each group according to the characteristics of the second blocks and the characteristics of the third blocks to obtain a new file.
  11. The incremental update method of claim 10, wherein the characteristic comprises at least one of a file name and a basic data type.
  12. The incremental update method of claim 11, wherein the file name comprises at least one of a primary name, a prefix name, and a suffix name.
  13. A computing device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of the differential file generation method of any of claims 1 to 7 or the steps of the incremental update method of any of claims 8 to 12.
  14. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the differential file generation method according to any one of claims 1 to 7 or the steps of the incremental update method according to any one of claims 8 to 12.
CN201980100485.2A 2019-12-28 2019-12-28 Differential file generation method, incremental update method, computing device and storage medium Pending CN114424165A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/129574 WO2021128371A1 (en) 2019-12-28 2019-12-28 Differential file generation method, incremental updating method, computing device, and storage medium

Publications (1)

Publication Number Publication Date
CN114424165A true CN114424165A (en) 2022-04-29

Family

ID=76573583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980100485.2A Pending CN114424165A (en) 2019-12-28 2019-12-28 Differential file generation method, incremental update method, computing device and storage medium

Country Status (2)

Country Link
CN (1) CN114424165A (en)
WO (1) WO2021128371A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016053B (en) * 2017-03-02 2020-05-22 中国科学院信息工程研究所 Parallel data difference method
CN108804130B (en) * 2017-05-03 2020-12-01 腾讯科技(深圳)有限公司 Program installation package generation method and device
CN109697071B (en) * 2017-10-24 2022-02-08 腾讯科技(深圳)有限公司 Installation package synthesis method, device, terminal and storage medium
US10452375B1 (en) * 2018-06-21 2019-10-22 Microsoft Technology Licensing, Llc Memory-efficient upgrade staging

Also Published As

Publication number Publication date
WO2021128371A1 (en) 2021-07-01

Similar Documents

Publication Publication Date Title
US20220214871A1 (en) Method of updating firmware and device for using the method
CN110633284B (en) Method and device for changing table in database
CN107087038A (en) A kind of method of data syn-chronization, synchronizer, device and storage medium
US20140089252A1 (en) Enhancing performance of extract, transform, and load (etl) jobs
CN111694589B (en) Upgrade package generation method, device, server and computer readable storage medium
CN111857550A (en) Method, apparatus and computer readable medium for data deduplication
WO2021174836A1 (en) Differential package generation method and apparatus, computer device, and storage medium
CN109376126B (en) File or folder processing method, mobile terminal and storage medium
CN111723053A (en) Data compression method and device and data decompression method and device
CN105491132A (en) File server, terminal and file subpackage transmission method
CN114424165A (en) Differential file generation method, incremental update method, computing device and storage medium
CN110019040B (en) Folder processing method, mobile terminal and storage medium
CN111343220B (en) Repeater, distributed file transmission method, distributed file transmission system, medium and electronic equipment
CN116074308A (en) Method, system, equipment and readable storage medium for downloading vehicle-end upgrade package
CN116049142A (en) Data processing method, device, electronic equipment and storage medium
CN114610366A (en) Difference package upgrading method and system, intelligent electronic equipment and storage medium
CN114303131B (en) File processing method, file processing device and terminal equipment
CN109857719B (en) Distributed file processing method, device, computer equipment and storage medium
CN114365081A (en) Incremental package generation method, incremental package generation device and server
CN116057925A (en) Data transmission method, data downloading method and terminal
CN110545107A (en) data processing method and device, electronic equipment and computer readable storage medium
CN110460659A (en) Data push method and device, storage medium, computer equipment
CN111125258B (en) Data synchronization method, client, server and system
CN113111086B (en) Data storage and query response method and block execution method
US20240020201A1 (en) Generating diffs between archives using a generic grammar

Legal Events

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