Data update method, apparatus and device, and computer-readable storage medium
By using the data update process, the non -complete decompression technology is used to calculate the differential data, which solves the problem of low data update efficiency in the existing technology and redundant data redundancy, and achieve efficient and accurate data updates.
Patent Information
- Application Number
- PCT/CN2024/078674
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-14
- Filing Date
- 2024-02-27
- Publication Date
- 2025-01-23
AI Technical Summary
In the prior art, it is difficult to efficiently and accurately determine differential data during the data update process, resulting in low data update efficiency and redundant differential data.
By obtaining the first data and the second data, the first compression method and the second compression method are compressed to compress the third and fourth data. Intermediate data, calculate the differential data between them, and send the differential data to update.
It improves the efficiency and accuracy of data update, reduces the size and calculation time of differential data, avoids dependence on non-universal compression tools, and ensures the stability and versatility of data update.
Smart Images

Figure CN2024078674_23012025_PF_FP_ABST
Abstract
Description
Data updating method, device, equipment and computer-readable storage medium
[0001] This application claims priority to Chinese patent application No. 202310875613.9 filed on July 14, 2023, entitled “Data updating method, device, apparatus and computer-readable storage medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a method, apparatus, device, and computer-readable storage medium for updating data. Background Art
[0003] The operation and maintenance of various functions of various devices in the communication system need to rely on data. Moreover, with the development of communication technology and the continuous changes in user needs, data needs to be continuously updated to realize the update of various functions in the communication system, so that the continuously updated functions can meet the real-time needs of users.
[0004] Summary of the Invention
[0005] This application provides a data update method, apparatus, device, and computer-readable storage medium to improve the accuracy and efficiency of data updates. The technical solution is as follows:
[0006] In a first aspect, a method for updating data is provided, which is applied to a first device, and the method includes: acquiring first data and second data, the first data including data obtained by compressing third data using at least a first compression method and a second compression method in sequence, the second data including data obtained by compressing fourth data using at least the first compression method and the second compression method in sequence, and the fourth data is updated based on the third data; decompressing the first data and the second data respectively based on a first decompression method corresponding to the second compression method to obtain a first decompression result and a second decompression result, the first decompression result including first intermediate data obtained based on the first data, and the second decompression result including second intermediate data obtained based on the second data; determining first differential data between the second intermediate data and the first intermediate data; and sending the first differential data, the first differential data being used to update the first data in the second device.
[0007] In this application, first and second intermediate data are obtained by partially decompressing first and second data. The first intermediate data is obtained by compressing third data using a first compression method, and the second intermediate data is obtained by compressing fourth data using the first compression method. The similarity between the first and second intermediate data can reflect the similarity between the third and fourth data. Therefore, first differential data can be accurately and efficiently determined based on the first and second intermediate data. The first data can be updated based on the first differential data and the first intermediate data, thereby improving the efficiency of data updating.
[0008] In one possible implementation, the first decompression result also includes first reference data corresponding to the first data, the first reference data being data referenced when compressing the first intermediate data using the second compression method to obtain the first data. The second decompression result also includes second reference data corresponding to the second data, the second reference data being data referenced when compressing the second intermediate data using the second compression method to obtain the second data. After determining the first differential data between the second intermediate data and the first intermediate data, the method further includes: determining reference data corresponding to the first differential data based on the first differential data, the first reference data, and the second reference data; and sending the reference data, where the reference data is used to update the first data in the second device. Determining the reference data corresponding to the first differential data based on the first reference data and the second reference data, and sending the determined reference data, enables more accurate updating of the first data based on the first differential data and the reference data.
[0009] In one possible implementation, the method further includes: obtaining a first data packet including at least one first compressed data and a second data packet including at least one second compressed data, wherein the first data is first compressed data in the first data packet that is different from the at least one second compressed data, and the second data is second compressed data in the second data packet that is different from the at least one first compressed data. The data in the first data packet that is different from the second data packet is determined as the first data and the second data that require incomplete decompression, eliminating the need to decompress the identical data, thereby further improving the efficiency of determining the first differential data.
[0010] In one possible implementation, after sending the first differential data, the method further includes: obtaining fifth data and sixth data, where the fifth data is of a different type from the first data, and the sixth data is of a different type from the second data; determining second differential data between the fifth data and the sixth data; and sending the second differential data, where the second differential data is used to update the fifth data in the second device. Determining the second differential data based on the fifth and sixth data enables updating the fifth data in the first data packet based on the second differential data, thereby making the data packet update more complete.
[0011] In a second aspect, a data update method is provided, which is applied to a second device and includes: receiving first differential data corresponding to first data; obtaining the first data in the second device, the first data in the second device including data obtained by compressing third data using at least a first compression method and a second compression method in sequence; decompressing the first data in the second device based on a first decompression method corresponding to the second compression method to obtain a first decompression result, the first decompression result including first intermediate data obtained based on the first data; and updating the first data in the second device based on the first intermediate data and the first differential data. Because the first data does not need to be fully decompressed, the first data in the second device can be updated based on the first differential data and the first intermediate data, thereby improving data update efficiency.
[0012] In one possible implementation, updating first data in a second device based on first intermediate data and first differential data includes: updating the first intermediate data based on the first differential data to obtain third intermediate data; compressing the third intermediate data based on a second compression method to obtain seventh data; and updating the first data in the second device to the seventh data. This application only requires partially recompressing the updated third intermediate data to update the first data, thereby improving the efficiency of updating the first data.
[0013] In one possible implementation, updating the first data in the second device based on the first intermediate data and the first differential data includes: updating the first intermediate data based on the first differential data to obtain third intermediate data; compressing the third intermediate data based on a second compression method based on reference data corresponding to the first differential data to obtain seventh data; and updating the first data in the second device to the seventh data. Partially recompressing the third intermediate data based on both the first differential data and the reference data can further ensure the accuracy of the updated first data while maintaining the efficiency of updating the first data.
[0014] In one possible implementation, before compressing the third intermediate data using the second compression method based on the reference data to obtain the seventh data, the method further includes: receiving the reference data, and partially re-compressing the third intermediate data using the first differential data and the reference data to further ensure successful updating of the first data.
[0015] In one possible implementation, after updating the first data in the second device to the seventh data, the method further includes: updating the fifth data in the second device based on the second differential data corresponding to the fifth data to obtain eighth data, where the fifth data is of a different type from the first data; and updating the fifth data in the second device to the eighth data. Updating the fifth data in the first data packet based on the second differential data makes the data packet update more complete.
[0016] In a possible implementation, before the fifth data is updated according to the second differential data to obtain the eighth data, the method further includes: receiving the second differential data. By receiving the second differential data, it is possible to ensure that the fifth data is successfully updated according to the second differential data.
[0017] According to a third aspect, a data updating apparatus is provided, which is applied to a first device, and includes: an acquisition module for acquiring first data and second data, the first data including data obtained by compressing third data using at least a first compression method and a second compression method in sequence, the second data including data obtained by compressing fourth data using at least the first compression method and the second compression method in sequence, and the fourth data is updated based on the third data; a decompression module for decompressing the first data and the second data respectively based on a first decompression method corresponding to the second compression method, to obtain a first decompression result and a second decompression result, the first decompression result including first intermediate data obtained based on the first data, and the second decompression result including second intermediate data obtained based on the second data; a determination module for determining first differential data between the second intermediate data and the first intermediate data; a sending module for sending the first differential data, and the first differential data is used to update the first data in the second device.
[0018] In one possible implementation, the first decompression result also includes first reference data corresponding to the first data, where the first reference data is the data referenced in the process of compressing the first intermediate data using the second compression method to obtain the first data; the second decompression result also includes second reference data corresponding to the second data, where the second reference data is the data referenced in the process of compressing the second intermediate data using the second compression method to obtain the second data; the determination module is also used to determine the reference data corresponding to the first differential data based on the first differential data, the first reference data, and the second reference data; the sending module is also used to send the reference data, where the reference data is used to update the first data in the second device.
[0019] In one possible implementation, the acquisition module is also used to acquire a first data packet including at least one first compressed data and a second data packet including at least one second compressed data, where the first data is the first compressed data in the first data packet that is different from the at least one second compressed data, and the second data is the second compressed data in the second data packet that is different from the at least one first compressed data.
[0020] In one possible implementation, the acquisition module is also used to acquire fifth data and sixth data, where the fifth data is of a different type from the first data, and the sixth data is of a different type from the second data; the determination module is also used to determine the second differential data between the fifth data and the sixth data; and the sending module is also used to send the second differential data, where the second differential data is used to update the fifth data in the second device.
[0021] In a fourth aspect, a data updating device is provided, which is applied to a second device and includes: a receiving module for receiving first differential data corresponding to the first data; an acquisition module for acquiring the first data in the second device, the first data in the second device including data obtained by compressing the third data using at least the first compression method and the second compression method in sequence; a decompression module for decompressing the first data in the second device based on a first decompression method corresponding to the second compression method to obtain a first decompression result, the first decompression result including first intermediate data obtained based on the first data; an update module for updating the first data in the second device based on the first intermediate data and the first differential data.
[0022] In one possible implementation, the update module is configured to update the first intermediate data according to the first differential data to obtain third intermediate data; compress the third intermediate data based on the second compression method to obtain seventh data; and update the first data in the second device to the seventh data.
[0023] In one possible implementation, the update module is used to update the first intermediate data according to the first differential data to obtain third intermediate data; compress the third intermediate data based on the second compression method according to the reference data corresponding to the first differential data to obtain seventh data; and update the first data in the second device to the seventh data.
[0024] In a possible implementation, the receiving module is further configured to receive reference data.
[0025] In one possible implementation, the update module is further used to update the fifth data in the second device according to the second differential data corresponding to the fifth data to obtain eighth data, where the fifth data is of a different type from the first data; and update the fifth data in the second device to the eighth data.
[0026] In a possible implementation, the receiving module is further configured to receive second differential data.
[0027] In a fifth aspect, another communication device is provided, comprising: a network interface, a memory, and a processor. The network interface, the memory, and the processor communicate with each other via an internal connection path; the memory is configured to store instructions; and the processor is configured to execute the instructions stored in the memory to control the network interface to receive signals and to control the network interface to send signals. When the processor executes the instructions stored in the memory, the processor performs the method of the first aspect and any possible implementation thereof, or the second aspect and any possible implementation thereof.
[0028] Optionally, there are one or more processors and one or more memories.
[0029] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0030] In a sixth aspect, a communication system is provided, which includes the device in the third aspect and any possible implementation thereof and the device in the fourth aspect and any possible implementation thereof.
[0031] In the seventh aspect, a computer program (product) is provided, which includes: computer program code, which, when run by a computer, enables the computer to execute the method in the first aspect and any possible implementation thereof or the second aspect and any possible implementation thereof.
[0032] In an eighth aspect, a computer-readable storage medium is provided, which stores a program or instruction. When the program or instruction runs on a computer, the method in the above-mentioned first aspect and any possible implementation thereof or the second aspect and any possible implementation thereof is executed.
[0033] In the ninth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from a memory, so that a computer equipped with the chip executes the method of the first aspect and any possible implementation thereof or the second aspect and any possible implementation thereof.
[0034] In the tenth aspect, another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, a computer equipped with the chip executes the method of the above-mentioned first aspect and any possible implementation thereof or the second aspect and any possible implementation thereof.
[0035] It should be understood that the beneficial effects achieved by the technical solutions of the third to tenth aspects of this application and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first and second aspects and their corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] FIG1 is a schematic diagram of differential updating in a related technology 1 provided in an embodiment of the present application;
[0037] FIG2 is a schematic diagram of differential updating in a related technology 2 provided in an embodiment of the present application;
[0038] FIG3 is a diagram of an implementation scenario provided by an embodiment of the present application;
[0039] FIG4 is a flow chart of a data updating method provided in an embodiment of the present application;
[0040] FIG5 is a schematic diagram of a data update process provided in an embodiment of the present application;
[0041] FIG6 is a schematic diagram of the file composition of a data packet provided in an embodiment of the present application;
[0042] FIG7 is a schematic structural diagram of a data updating device provided in an embodiment of the present application;
[0043] FIG8 is a schematic structural diagram of another data updating device provided in an embodiment of the present application;
[0044] FIG9 is a schematic structural diagram of a data updating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0046] In communication systems, the operation and maintenance of various functions of various devices rely on data. Furthermore, with the advancement of communication technologies and the evolving needs of users, this data needs to be constantly updated to enable the updating of various functions, ensuring that these functions meet real-time user needs. For example, various applications deployed on terminals in a communication system rely on the application-related data stored on these terminals to operate. Similarly, the various functions of IoT devices also rely on relevant data to operate.
[0047] For example, if an application deployed on a terminal needs to be updated, the terminal can update the application by receiving updated data from a server and running based on the updated data. The data that the application relies on can be contained in a data package, which can be an application package (APK). However, as the types, number, and size of applications continue to grow, the amount of data required for application updates is large, requiring greater bandwidth consumption, resulting in increasingly high costs for application markets that provide application update services. In this context, differential update technology has emerged.
[0048] The following is an explanation of the differential update process. The server of the application market determines the new version of the data packet and the old version of the data packet on the terminal, compares the data in the two versions of the data packet, and determines the differential data for the terminal update data packet based on the different data in the two versions of the data packet. The differential data includes the updated part of the new version of the data packet relative to the old version of the data packet. The server sends the differential data to the terminal. The terminal updates the data in the old version of the data packet stored on the terminal based on the differential data, and synthesizes the new version of the data packet, so that the application deployed on the terminal runs on the basis of the new version of the data, thereby realizing the update of the application. Since the differential data includes the updated part of the new version of the data relative to the old version of the data, the volume of the differential data is smaller than the volume of all the data of the new version. Therefore, the differential update technology reduces the bandwidth consumption required for application updates and reduces the application market's expenses for application updates.
[0049] For example, referring to FIG1 , a schematic diagram of differential updating in a related technique 1 is shown. Related technique 1 may be, for example, bsdiff (a binary delta encoding algorithm). The old version of the data packet stored in the server and the terminal includes data 1 to data n, and the new version of the data packet stored in the server also includes data 1 to data n. The data packet can save data in different ways. For example, the old version of the data packet directly saves data 1, saving the original data 1 of data 1. The old version of the data packet saves data 2 in a compressed manner, that is, compresses the original data 2 corresponding to data 2 to obtain compressed data 2, and saves the compressed data 2.
[0050] The new version of the data package stored in the server is updated based on the old version of the data package according to the update requirements. Therefore, data 1 through data n in the old version of the data package can correspond one-to-one with data 1 through data n in the new version of the data package. For the corresponding data in the old version of the data package and the new version of the data package, not only are the data themselves identical or similar, but the data storage method is also the same. For example, if the old version of the data package directly stores data 1 as the original data 1, the new version of the data package will also directly store data 1 as the original data 1.
[0051] When determining differential data based on old and new versions of data, Related Art 1 compares the corresponding data in the old and new versions of the data packet to determine the differential data between the two corresponding data, without considering the data type. That is, regardless of whether the data in the data packet is raw data or compressed data, Related Art 1 directly performs a differential calculation to determine the differential data between the two corresponding data. For example, referring to FIG1 , Related Art 1 does not decompress the two compressed data 2 when determining the differential data between them. Instead, it directly compares the two compressed data 2 and determines the differential data between them based on the difference between them.
[0052] However, compression can destroy the similarity between data. That is, after compressing two highly similar data sets, the similarity between the two compressed data sets may decrease, or even become completely dissimilar. Therefore, if the compressed data is not decompressed, the differential data determined from the two compressed data sets will be inaccurate and may even change the size of the differential data.
[0053] For example, the new version of the original data 2 is 1234123123, and the old version of the original data 2 is 123123123. The new version of the original data 2 only has one more character 4 than the old version of the original data 2. If the two original data 2 are directly differentially calculated, the differential data between the two original data 2 can only include the character 4. For example, if the data is divided into multiple data segments and each data segment is compressed accordingly, and each data segment is composed of three characters, since the three data segments of the old version of the original data 2 are the same, each of the three data segments 123 can be compressed into A, and the compressed data 2 of the old version is AAA. When compressing the new version of the original data 2, the first data segment 123 is compressed into A, the second data segment 412 is compressed into B, the third data segment 312 is compressed into C, and the fourth data segment 3 is compressed into D. The compressed data 2 of the new version is ABCD. The only common data between the new version of the compressed data 2 and the old version of the compressed data 2 is the character A, and all other characters are determined as differential data. It can be seen from this that the similarity between the two data is destroyed after compression, the performance of the differential algorithm is affected, and the size of the differential data is increased, resulting in redundancy of the differential data.
[0054] In addition, when the terminal synthesizes a new version of the data packet based on the differential data sent by the server and the old version of the data packet stored in the terminal, the time required to synthesize the new version of the data packet is long and the synthesis efficiency is low due to the large volume of the differential data.
[0055] To address the issues of Related Art 1, Related Art 2 has emerged. Related Art 2, for example, can be archive-patcher technology, also known as archive file patching technology. It is a differential algorithm based on the Zip (a compression algorithm) file format. Archive-patcher technology uses the zlib library (a library for compression and decompression) to decompress compressed data, then applies the bsdiff algorithm to the decompressed raw data to generate differential data.
[0056] For example, referring to FIG2 , a schematic diagram illustrating differential updating in related technology 2 is shown. For compressed data, the server in related technology 2 can first fully decompress the compressed data to obtain the original data before compression. For example, the server fully decompresses the compressed data 2 in the old version of the data packet to obtain the old version of the original data 2, and fully decompresses the compressed data 2 in the new version of the data packet to obtain the new version of the original data 2. The server then performs a differential calculation on the corresponding original data in the new and old versions to determine the differential data between the two corresponding original data, thereby obtaining the differential data between the old and new versions of the data packet. The terminal can also fully decompress the compressed data in the old version of the data packet stored in the terminal to obtain the corresponding original data, synthesize the new version of the original data based on the decompressed original data and the differential data sent by the server, and then fully recompress the original data in the new version that needs to be compressed to obtain the compressed data of the new version, completing the update of the old version of the data packet and obtaining the new version of the data packet.
[0057] Since different terminals may use different methods for data compression and decompression, and the compression and decompression tools that different compression and decompression methods rely on may also be different, the server in the second related technology needs to use the same compression and decompression method as the terminal for the different compression and decompression methods of different terminals, and completely decompress the data in the old version data packet and the new version data packet to obtain differential data, so as to ensure that the terminal can correctly identify the differential data, completely decompress the old version data packet in the terminal based on the differential data, and update the data in the old version data packet based on the original data and differential data obtained by the complete decompression. In other words, only when the compression and decompression methods used by the server and the terminal are the same can the content and bytes of the data in the new version data packet of the server and the new version data packet synthesized by the terminal through differential data be consistent, and the signature used to identify the version be consistent.
[0058] However, the full decompression and compression technology used by archive-patcher technology relies on the zlib library. In other words, archive-patcher technology is limited by the compression method and can only fully decompress compressed data in the data packet compressed using the zlib library. If the old version of the data packet stored in the terminal contains compressed data compressed using other methods, the server cannot fully decompress the old version of the data packet through archive-patcher technology, nor can it obtain differential data that the terminal can recognize.
[0059] Therefore, if the compression and decompression method used by the server is not universally applicable to all terminals, the differential data sent by the server to the terminal will not be recognized by the terminal, and the terminal will not be able to complete the data update based on the differential data. If the server needs to ensure that the differential data can be recognized by different terminals, the server needs to have multiple different compression and decompression methods and the compression and decompression tools that these different compression and decompression methods rely on, which increases the burden on the server. In addition, while fully decompressing the compressed data can ensure the accuracy of the differential data determined by the server, the full decompression time required is long, and the time required for full decompression varies depending on the decompression method. This makes it difficult to ensure the efficiency of the server in determining the differential data. The terminal also needs to fully decompress the data to be updated and, after updating the original data based on the differential data, fully recompress the new version of the original data. This makes the data update time longer and less efficient, affecting the user experience.
[0060] An embodiment of the present application provides a method for updating data, which can improve the efficiency of determining differential data and ensure the accuracy of the determined differential data, thereby ensuring that the data update is completed accurately and efficiently. For example, referring to Figure 3, an implementation scenario diagram of this method is shown. The implementation scenario includes a first device 31 and a second device 32. The first device 31 includes a non-complete decompression module 311, a differential module 312 and a sending module 313, and the second device 32 includes a non-complete recompression module 321, a synthesis module 322 and a receiving module 323. The first device 31 and the second device 32 are connected in communication through the sending module 313 and the receiving module 323. The first device 31 can be a device for data updating in the application market, such as a server or service end, and the second device 32 can be a client or an Internet of Things terminal, such as a smart device such as a mobile phone, a tablet computer, or a personal computer.
[0061] The non-complete decompression module 311 is used to perform non-complete decompression on the compressed data. That is, the non-complete decompression module 311 does not completely decompress the compressed data into the original data, but instead decompresses the compressed data into intermediate data. Correspondingly, the non-complete recompression module 321 is used to perform non-complete recompression on the intermediate data. That is, the non-complete recompression module 321 does not completely compress the original data into compressed data, but instead further compresses the already compressed intermediate data to obtain compressed data.
[0062] 4 , which shows a flow chart of a method for updating data provided in an embodiment of the present application. The method can be applied to the implementation scenario shown in FIG. 3 , and includes but is not limited to the following S401 to S408 .
[0063] S401: A first device obtains first data and second data. The first data includes data obtained by compressing third data using at least a first compression method and a second compression method in sequence. The second data includes data obtained by compressing fourth data using at least the first compression method and the second compression method in sequence. The fourth data is updated based on the third data. The first data may also be referred to as a first file and includes at least one data segment. Correspondingly, the second data may also be referred to as a second file and includes at least one data segment.
[0064] In one possible implementation, the first data and the second data can be acquired by acquiring a first data packet including at least one first compressed data and a second data packet including at least one second compressed data. The first data may be first compressed data in the first data packet that is different from the at least one second compressed data, and the second data may be second compressed data in the second data packet that is different from the at least one first compressed data.
[0065] Optionally, the first data packet may be an old version data packet of the second device, and the second data packet may be a new version data packet. The embodiment of the present application does not limit the method for the first device to obtain the first data packet and the second data packet. For example, the first device may receive an update request sent by the second device, and the update request carries the version number of the old version data packet on the second device. The first device determines the old version data packet of the second device from the multiple versions of the data packets stored in the first device based on the version number of the old version data packet on the second device, and determines the new version data packet, and determines the old version data packet of the second device as the first data packet and the new version data packet as the second data packet.
[0066] The first data packet includes at least one first compressed data item, and the second data packet includes at least one second compressed data item. The first device can compare the first compressed data item and the second compressed data item to determine that the first compressed data item in the first data packet that is different from the second compressed data item is the first data item, and determine that the second compressed data item in the second data packet that is different from the first compressed data item is the second data item. For first compressed data items that are identical to second compressed data items, it can be considered that the first compressed data item does not need to be updated when the data item is updated, and therefore, the first compressed data item may not be determined as the first data item.
[0067] The determined first data may be data obtained by compressing the third data using the first compression method and the second compression method in sequence. The embodiment of the present application does not limit the first compression method and the second compression method. The first compression method and the second compression method may also include one or more compression methods respectively. Compressing the data using the first compression method may be compressing the data once or multiple times using the first compression method, and compressing the data using the second compression method may be compressing the data once or multiple times using the second compression method. Optionally, before or after the third data and the fourth data are compressed using the first compression method and the second compression method in sequence, the third data and the fourth data may also be compressed using other compression methods other than the first compression method and the second compression method.
[0068] The following describes a process for obtaining first data using deflate compression as an example. Deflate compression can be a lossless data compression method that uses both LZ77 (a compression method that uses a dictionary for data compression) and Huffman compression based on a Huffman coding tree. The compressed data obtained using deflate compression can be referred to as a deflate compressed stream, deflate compressed data, or a deflate file. The LZ77 compression method is the first compression method, and the Huffman compression method is the second compression method.
[0069] After obtaining the third data, the first device performs LZ77 compression on the third data, i.e., compresses the third data using the first compression method, to obtain first intermediate data. The first device can then perform Huffman compression on the first intermediate data, i.e., compress the first intermediate data using the second compression method, to obtain first data. The process of sequentially compressing the fourth data using the first and second compression methods by the first device is the same as the process of compressing the third data using the first and second compression methods at once by the first device, and is not further described here.
[0070] The process of compressing the third data to obtain the first data and the process of compressing the fourth data to obtain the second data both occur before the first device obtains the first and second data packets. Therefore, the first and second data obtained by the first device via the first and second data packets are compressed data. In other words, the process of the first device obtaining the first and second data does not involve the process of compressing the third data to obtain the first data and the process of compressing the fourth data to obtain the second data.
[0071] S402, the first device decompresses the first data and the second data respectively based on the first decompression method corresponding to the second compression method to obtain a first decompression result and a second decompression result, the first decompression result includes first intermediate data obtained based on the first data, and the second decompression result includes second intermediate data obtained based on the second data.
[0072] After determining the first data that needs to be updated and the second data corresponding to the first data, the first device may decompress the first data and the second data respectively according to the first decompression method to obtain a first decompression result including first intermediate data and a second decompression result including second intermediate data. The first intermediate data is data obtained by compressing the third data according to the first compression method, and correspondingly, the second intermediate data is data obtained by compressing the fourth data according to the first compression method.
[0073] Continuing with the example of the first and second data being deflate compressed data, the first decompression method is the decompression method corresponding to the second compression method, that is, the first decompression method is the Huffman decompression method corresponding to the Huffman compression method. The Huffman decompression method can also be called Huffman decoding. After decompressing the first data according to the Huffman decompression method, a first decompression result is obtained. The first decompression result includes first intermediate data. The first intermediate data is the data obtained by compressing the third data according to the LZ77 compression method. After decompressing the second data according to the Huffman decompression method, a second decompression result is obtained. The second decompression result includes second intermediate data. The second intermediate data is the data obtained by compressing the fourth data according to the LZ77 compression method. The first intermediate data and the second intermediate data can include a list (LIST) bit segment and an offset (DIST) bit segment.
[0074] For example, referring to FIG5 , a flowchart of a data update process is shown. The first data packet obtained by the first device includes the first data 11, the first data 12, and other first data not shown in FIG5 , and the second data packet obtained includes the second data 21, the second data 22, and other second data not shown in FIG5 . The non-complete decompression module in the first device performs non-complete decompression on the first data 11 in the first data packet, that is, decompresses the first data 11 according to the first decompression method, and can obtain the first intermediate data 11. The non-complete decompression module performs non-complete decompression on the first data 12 to obtain the first intermediate data 12. The non-complete decompression module in the first device performs non-complete decompression on the second data 21 in the second data packet, that is, decompresses the second data 21 according to the first decompression method, and can obtain the second intermediate data 21. The non-complete decompression module performs non-complete decompression on the second data 22 to obtain the second intermediate data 22.
[0075] S403: The first device determines first differential data between the second intermediate data and the first intermediate data.
[0076] Because the first data and the second data have a corresponding relationship, that is, the second data is updated based on the corresponding first data, the first data and the second data have some identical and some different data. The first device can determine the different partial data between the first data and the second data as the first differential data for the second device to perform a differential update on the first data, or can also determine the offset corresponding to the different partial data between the first data and the second data as the first differential data. The differential update can also be called an incremental update.
[0077] Exemplarily, referring to FIG. 5 , the differential module in the first device may perform a differential on the first data 11 and the second data 21 corresponding to the first data 11 to determine first differential data between the first data 11 and the second data 21 .
[0078] In one possible implementation, the first decompression result also includes first reference data corresponding to the first data, where the first reference data is referenced when compressing the first intermediate data using the second compression method to obtain the first data. The second decompression result also includes second reference data corresponding to the second data, where the second reference data is referenced when compressing the second intermediate data using the second compression method to obtain the second data. Exemplarily, the first reference data may include data indicating a correspondence between each data segment in the first intermediate data and each data segment in the first data, and the second reference data may include data indicating a correspondence between each data segment in the second intermediate data and each data segment in the second data.
[0079] In this case, the first device may also determine the reference data corresponding to the first differential data based on the first differential data, the first reference data, and the second reference data after determining the first differential data between the second intermediate data and the first intermediate data. Exemplarily, the first decompression result obtained after the first device performs incomplete decompression on the first data includes the first intermediate data and the first reference data, and the second decompression result obtained after the first device performs incomplete decompression on the second data includes the second intermediate data and the second reference data. The first intermediate data has a corresponding relationship with the first reference data, and the second intermediate data has a corresponding relationship with the second reference data. After determining the first differential data between the first intermediate data and the second intermediate data, the first device may determine the reference data corresponding to the first differential data from the first reference data and the second reference data based on the first differential data.
[0080] Taking the first data and the second data as data obtained by deflate compression as an example, in the process of Huffman decompression of the first data, the first device can not only obtain the first intermediate data, but also obtain the first reference data corresponding to the first intermediate data. The first reference data may include the Huffman code table referenced when the third data is Huffman compressed. The Huffman code table includes the bit segments referenced when Huffman compression is performed on each data segment in the first intermediate data. For example, the Huffman code table may include a header (HEADER) bit segment, a code length (code-code lengths, CCL) bit segment, a sequence (sequence, SQ) 1 bit segment and an SQ2 bit segment. Correspondingly, the Huffman code table included in the second reference data may also include the bit segments referenced when Huffman compression is performed on each data segment in the second intermediate data. The first reference data and the second reference data may be the same or different, and this embodiment of the present application does not limit this.
[0081] The first device can determine the bit segments corresponding to the data segments included in the first differential data in the first reference data and the second reference data based on the data segments included in the first differential data. The bit segments corresponding to the data segments included in the first differential data are the reference data corresponding to the first differential data.
[0082] S404: The first device sends first differential data, where the first differential data is used to update the first data in the second device.
[0083] The first device can send the first differential data to the second device via the sending module. For example, the first device can encapsulate the first differential data corresponding to the plurality of first intermediate data and the plurality of second intermediate data into the same differential packet and send it to the second device. For example, referring to FIG5 , the first device can encapsulate the first differential data 1 between the first intermediate data 11 and the second intermediate data 21 and the first differential data 2 between the first intermediate data 12 and the second intermediate data 22 into the same differential packet and send it to the second device via the sending module.
[0084] Optionally, the first device may also send reference data to the second device, where the reference data is used to update the first data in the second device. For example, the first device may send the reference data to the second device alone, or may encapsulate the reference data and the first differential data into the same differential packet and send it to the second device.
[0085] In one possible implementation, the first device may further obtain fifth data and sixth data, where the fifth data is of a different type from the first data, and the sixth data is of a different type from the second data; and determine second differential data between the fifth data and the sixth data. The fifth data and the first data may belong to the same first data packet, and the sixth data and the second data may belong to the same second data packet. The fifth data and the sixth data may be uncompressed raw data, that is, the fifth data and the sixth data are directly stored in the first data packet and the second data packet. Since the sixth data may be data updated based on the fifth data, the first device may also perform a differential operation on the fifth data and the sixth data to obtain second differential data between the fifth data and the sixth data.
[0086] For example, referring to FIG5 , the first data packet includes fifth data 11 to fifth data 1n in addition to first data 11 and first data 12, and the second data packet includes sixth data 21 to sixth data 2n in addition to second data 21 and second data 22. The first device can compare the fifth data 11 and the sixth data 21 and determine the portion of data that differs between the fifth data 11 and the sixth data 21 as the second differential data between the fifth data 11 and the sixth data 21.
[0087] Optionally, after determining the second differential data, the first device may send the second differential data to the second device, where the second differential data is used to update the fifth data in the second device. Furthermore, the first device may send the second differential data to the second device alone, or may encapsulate the second differential data and the first differential data into the same differential packet and send the packet to the second device.
[0088] S405: The second device receives first differential data corresponding to the first data.
[0089] After the first device sends the first differential data to the second device through the sending module, the second device can receive the first differential data through the receiving module. For example, the second device can receive the differential packet including the first differential data sent by the first device to achieve reception of the first differential data.
[0090] S406: The second device obtains the first data in the second device, where the first data in the second device includes data obtained by compressing the third data using at least the first compression method and the second compression method in sequence.
[0091] The embodiments of the present application do not limit the method by which the second device obtains the first data. For example, the second device may determine, from among multiple stored data packets, a first data packet that needs to be updated, and at least one first compressed data item in the first data packet. The second device may then determine, from among the at least one first compressed data item, the first data item that needs to be updated, corresponding to the first differential data item, based on the first differential data item.
[0092] S407: The second device decompresses the first data in the second device based on the first decompression method corresponding to the second compression method to obtain a first decompression result, where the first decompression result includes first intermediate data obtained based on the first data.
[0093] For example, referring to FIG5 , the second device may perform incomplete decompression on the first data 11 in the first data packet, that is, decompress the first data 11 according to the first decompression method to obtain first intermediate data 11, and perform incomplete decompression on the first data 12 to obtain first intermediate data 12. The first intermediate data 11 and the first intermediate data 12 may be included in the same first decompression result, or may be included in two separate first decompression results, which is not limited in this embodiment of the present application.
[0094] S408: The second device updates the first data in the second device according to the first intermediate data and the first differential data.
[0095] The embodiment of the present application does not limit the process of the second device updating the first data based on the first intermediate data and the first differential data. By way of example, the embodiment of the present application takes the following two different cases, Case A1 and Case A2, as examples to illustrate the process of updating the first data.
[0096] Case A1: the first intermediate data is updated according to the first differential data to obtain third intermediate data; the third intermediate data is compressed based on the second compression method to obtain seventh data; and the first data in the second device is updated to the seventh data.
[0097] The embodiments of the present application do not limit the method for updating the first intermediate data based on the first differential data. For example, data in the first differential data that needs to be added to the first intermediate data can be added to the first intermediate data, or partial data in the first differential data can be used to replace partial data in the first intermediate data. The third intermediate data synthesized by updating the first intermediate data based on the first differential data is the same as the second intermediate data.
[0098] After obtaining the third intermediate data, the non-complete re-compression module of the second device can perform non-complete re-compression on the third intermediate data, that is, compress the third intermediate data based on the second compression method, to obtain seventh data. For example, if the third intermediate data is LZ77 compressed data and the second compression method is Huffman compression, the non-complete re-compression module can perform Huffman compression on the third intermediate data to obtain seventh data. The seventh data is the updated first data, which is identical to the second data in the second data packet in the first device. The second device can update the first data in the first data packet with the seventh data, thereby updating the first data packet.
[0099] For example, referring to FIG5 , the non-complete re-compression module of the second device may perform non-complete re-compression on the synthesized third intermediate data 21 to obtain seventh data 21, which is identical to the second data 21. The non-complete re-compression module of the second device may perform non-complete re-compression on the third intermediate data 22 to obtain seventh data 22, which is identical to the second data 22.
[0100] Case A2: The first intermediate data is updated according to the first differential data to obtain third intermediate data; the third intermediate data is compressed based on the second compression method according to the reference data corresponding to the first differential data to obtain seventh data; the first data in the second device is updated to the seventh data.
[0101] In case A2, the process of obtaining the third intermediate data based on the first differential data and the first intermediate data may be the same as the process of obtaining the third intermediate data based on the first differential data and the first intermediate data in case A1, and will not be repeated here.
[0102] When the second device performs incomplete recompression on the third intermediate data, it may refer to the reference data corresponding to the first differential data to further ensure that the seventh data obtained by the incomplete recompression is identical to the second data. The reference data may, for example, be a Huffman code table corresponding to the first differential data. Therefore, before compressing the third intermediate data based on the second compression method according to the reference data to obtain the seventh data, the second device may also receive the reference data. For example, the second device may receive the reference data separately sent by the first device, or may receive the reference data by receiving a differential packet including the reference data sent by the first device.
[0103] The seventh data is the updated first data, and the seventh data is the same as the second data in the second data packet in the first device. The second device can update the first data in the first data packet to the seventh data to implement the update of the first data packet.
[0104] In one possible implementation, the second device may also update the fifth data in the second device based on the second differential data corresponding to the fifth data to obtain eighth data, where the fifth data and the first data belong to the same first data packet, and the fifth data in the second device is of a different type than the first data in the second device; and replace the fifth data in the second device with the eighth data. The process of obtaining the eighth data based on the second differential data and the fifth data may be the same as the process of obtaining the third intermediate data based on the first differential data and the first intermediate data in scenario A1, and is not further described here.
[0105] Optionally, before updating the fifth data based on the second differential data to obtain the eighth data, the second device may further receive the second differential data corresponding to the fifth data. For example, the second device may receive the second differential data sent separately by the first device, or may receive the second differential data by receiving a differential packet including the second differential data sent by the first device.
[0106] For example, referring to FIG5 , the second device can synthesize the fifth data 11 and the second differential data to obtain the eighth data 21, and synthesize the fifth data 1n and the second differential data to obtain the eighth data 2n. The eighth data is the updated fifth data, and the eighth data is the same as the sixth data in the second data packet in the first device. The second device can update the fifth data in the first data packet with the eighth data to implement the update of the first data packet.
[0107] Referring to Figure 6, a schematic diagram of the file composition of a data packet is shown, which is obtained by analyzing the composition of multiple different data packets. .dex files account for 33.94% of the total size of the data packet, and the deflate compressed data in the .dex files accounts for 33.94% of the total size of the data packet, that is, the data in the .dex files is stored entirely as deflate compressed data in the data packet. .so files account for 38.64% of the total size of the data packet, and the deflate compressed data in the .so files accounts for 38.63% of the total size of the data packet, that is, almost all the data in the .so files is stored entirely as deflate compressed data in the data packet, with only 0.01% of the data in the .so files being stored in the data packet as other types of data. Other files account for 27.42% of the total size of the data packet, and the deflate compressed data in other files accounts for 11.43% of the total size of the data packet, with 15.99% of the data in other files being stored in the data packet as other types of data. Analysis shows that an average of 84% of the data in a data packet is stored as deflate compressed data, while an average of only 16% of the data is stored as other types of data. In other words, updating the data in a data packet using the method provided in the embodiments of this application can improve the update efficiency and accuracy of the majority of the data in the data packet, thereby improving the efficiency and accuracy of data packet updates.
[0108] In addition, the data updating method provided in the embodiment of the present application can also effectively reduce the compression rate of differential data. Among them, the compression rate of differential data can be the ratio of the size of the differential data to the size of the data packet of the new version. Through statistical analysis, the average compression rate of differential data obtained without using the data updating method provided in the embodiment of the present application is 66.80%, and the average compression rate of differential data obtained using the data updating method provided in the embodiment of the present application is 51.79%. It can be seen that when using the data updating method provided in the embodiment of the present application, the size of the differential data can be reduced by an average of 22.47% relative to the case where it is not used.
[0109] Related technology 1 generates differential data by comparing the new and old versions of data. The compressed data is not decompressed, resulting in inaccurate differential data determined based on the two compressed data, and increases the size of the differential data, resulting in redundancy of the differential data.
[0110] Related technology 2 takes a long time to determine differential data, and the time required for complete decompression using different compression methods or tools is different, which makes it difficult to ensure the efficiency of the first device in determining differential data. The second device also needs to completely decompress the data that needs to be updated, and after updating the original data based on the differential data, the new version of the original data must be completely re-compressed, which makes the time required for data update longer and the efficiency lower, affecting the user experience.
[0111] The embodiment of the present application can accurately and efficiently determine the first differential data based on the similarity between the first intermediate data and the second intermediate data obtained by non-complete decompression. There is no need to fully decompress the first data. The first data can be updated based on the first differential data and the first intermediate data, thereby improving the efficiency and stability of data updating.
[0112] Because the similarity between the first intermediate file and the second intermediate file is relatively close to the similarity between the first data and the second data before compression, the present application can ensure the accuracy of the determined differential data, fully utilizing the capabilities of the differential algorithm, reducing the size of the differential data and the time and space consumed in calculating the differential data. The data determination method provided in the embodiments of the present application avoids reliance on non-universal compression tools and solves the problem of being unable to update due to different compression methods and tools.
[0113] In addition, the first compression method and the second compression method adopted in the embodiment of the present application can be compression methods that can be used by different second devices, without relying on additional compression tools or compression databases. Therefore, the data update method provided in the embodiment of the present application has good versatility and can ensure that the content and bytes of the data in the new version of the data packet of the first device and the new version of the data packet obtained by differential data synthesis of the second device are consistent, as well as the signature used to identify the version is consistent.
[0114] The above describes the data update method provided by the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides a data update apparatus. The apparatus is applied to a first device. The apparatus is configured to execute the data update method performed by the first device in FIG. 4 above through the various modules shown in FIG. As shown in FIG. 7 , the data update apparatus provided by the embodiment of the present application includes the following modules.
[0115] An acquisition module 701 is used to acquire first data and second data, where the first data includes data obtained by compressing third data using at least a first compression method and a second compression method in sequence, and the second data includes data obtained by compressing fourth data using at least a first compression method and a second compression method in sequence, and the fourth data is updated based on the third data; a decompression module 702 is used to decompress the first data and the second data respectively based on a first decompression method corresponding to the second compression method, to obtain a first decompression result and a second decompression result, the first decompression result includes first intermediate data obtained based on the first data, and the second decompression result includes second intermediate data obtained based on the second data; a determination module 703 is used to determine first differential data between the second intermediate data and the first intermediate data; a sending module 704 is used to send the first differential data, and the first differential data is used to update the first data in the second device.
[0116] In one possible implementation, the first decompression result also includes first reference data corresponding to the first data, where the first reference data is the data referenced in the process of compressing the first intermediate data using the second compression method to obtain the first data; the second decompression result also includes second reference data corresponding to the second data, where the second reference data is the data referenced in the process of compressing the second intermediate data using the second compression method to obtain the second data; the determination module 703 is also used to determine the reference data corresponding to the first differential data based on the first differential data, the first reference data, and the second reference data; the sending module 704 is also used to send reference data, where the reference data is used to update the first data in the second device.
[0117] In one possible implementation, the acquisition module 701 is also used to acquire a first data packet including at least one first compressed data and a second data packet including at least one second compressed data, where the first data is the first compressed data in the first data packet that is different from the at least one second compressed data, and the second data is the second compressed data in the second data packet that is different from the at least one first compressed data.
[0118] In one possible implementation, the acquisition module 701 is further used to acquire fifth data and sixth data, where the fifth data is of a different type from the first data, and the sixth data is of a different type from the second data; the determination module 703 is further used to determine second differential data between the fifth data and the sixth data; and the sending module 704 is further used to send the second differential data, where the second differential data is used to update the fifth data in the second device.
[0119] The present application also provides a data update apparatus. The apparatus is applied to a second device. The apparatus is configured to execute the data update method performed by the second device in FIG. 4 above through the modules shown in FIG. As shown in FIG. 8 , the data update apparatus provided in the present application includes the following modules.
[0120] A receiving module 801 is used to receive first differential data corresponding to first data; an acquiring module 802 is used to acquire the first data in a second device, where the first data in the second device includes data obtained by compressing third data using at least a first compression method and a second compression method in sequence; a decompression module 803 is used to decompress the first data based on a first decompression method corresponding to the second compression method to obtain a first decompression result, where the first decompression result includes first intermediate data obtained based on the first data; an updating module 804 is used to update the first data in the second device based on the first intermediate data and the first differential data.
[0121] In one possible implementation, the update module 804 is configured to update the first intermediate data according to the first differential data to obtain third intermediate data; compress the third intermediate data based on the second compression method to obtain seventh data; and update the first data in the second device to the seventh data.
[0122] In one possible implementation, the update module 804 is used to update the first intermediate data according to the first differential data to obtain third intermediate data; compress the third intermediate data based on the second compression method according to the reference data corresponding to the first differential data to obtain seventh data; and update the first data in the second device to the seventh data.
[0123] In a possible implementation, the receiving module 801 is further configured to receive reference data.
[0124] In one possible implementation, the update module 804 is further used to update the fifth data in the second device according to the second differential data corresponding to the fifth data to obtain eighth data, where the fifth data is of a different type from the first data; and update the fifth data in the second device to the eighth data.
[0125] In a possible implementation, the receiving module 801 is further configured to receive second differential data.
[0126] It should be understood that the beneficial effects of the device provided in Figure 7 or Figure 8 when implementing its function are the same as the beneficial effects of the data update method provided in Figure 4, and will not be repeated here. In addition, when implementing its function, the device provided in Figure 7 or Figure 8 is only illustrated by the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept. The specific implementation process is detailed in the method embodiment, and will not be repeated here.
[0127] 9 , which shows a schematic structural diagram of an exemplary data updating device 900 of the present application. The data updating device 900 includes at least one processor 901 , a memory 903 , and at least one network interface 904 .
[0128] The processor 901 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits or application-specific integrated circuits (ASICs) for implementing the solution of the present application, a programmable logic device (PLD), other general-purpose processors or other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor can be a processor that supports the advanced reduced instruction set machine (ARM) architecture. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
[0129] Optionally, data update device 900 further includes a bus 902. Bus 902 is used to transmit information between the various components of data update device 900. Bus 902 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Bus 902 may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, FIG9 shows only one line, but this does not imply that there is only one bus or only one type of bus.
[0130] The memory 903 may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache.
[0131] By way of example and not limitation, many forms of ROM and RAM are available. For example, ROM is a compact disc read-only memory (CD-ROM). RAM includes, but is not limited to, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0132] The memory 903 may also be other types of storage devices that can store static information and instructions. Alternatively, it may be other types of dynamic storage devices that can store information and instructions. Alternatively, it may be other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 903 is, for example, independently existing and connected to the processor 901 via the bus 902. The memory 903 may also be integrated with the processor 901.
[0133] The network interface 904 uses any transceiver-like device for communicating with other devices or communication networks. The communication network can be Ethernet, a radio access network (RAN), or a wireless local area network (WLAN). The network interface 904 can include a wired network interface or a wireless network interface. Specifically, the network interface 904 can be an Ethernet interface, such as a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, an Asynchronous Transfer Mode (ATM) interface, a WLAN interface, a cellular network interface, or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface, or a combination thereof. In some embodiments of the present application, the network interface 904 can be used for the data updating device 900 to communicate with other devices.
[0134] In a specific implementation, as some embodiments, the processor 901 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG9 . Each of these processors may be a single-core processor or a multi-core processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0135] In a specific implementation, as some embodiments, the data update device 900 may include multiple processors, such as processor 901 and processor 905 shown in Figure 9. Each of these processors can be a single-core processor or a multi-core processor. The processor here can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0136] In some embodiments, the memory 903 is used to store program instructions 910 for executing the solution of the present application, and the processor 901 can execute the program instructions 910 stored in the memory 903. That is, the data update device 900 can implement the method provided in the method embodiment, i.e., the method shown in Figure 4, through the processor 901 and the program instructions 910 in the memory 903. The program instructions 910 may include one or more software modules. Optionally, the processor 901 itself may also store program instructions for executing the solution of the present application.
[0137] During the specific implementation process, the data updating device 900 of the present application may correspond to a first network element device for executing the above method. The processor 901 in the data updating device 900 reads the instructions in the memory 903, so that the data updating device 900 shown in Figure 9 can execute all or part of the steps in the method embodiment.
[0138] The data updating device 900 may also correspond to the apparatus shown in FIG. 7 or FIG. 8 , and each functional module in the apparatus shown in FIG. 7 or FIG. 8 is implemented using the software of the data updating device 900. In other words, the functional modules included in the apparatus shown in FIG. 7 or FIG. 8 are generated by the processor 901 of the data updating device 900 after reading the program instructions 910 stored in the memory 903.
[0139] Among them, each step of the method shown in Figure 4 is completed by the hardware integrated logic circuit or software instructions in the processor of the data update device 900. The steps of the method embodiment disclosed in this application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method embodiment in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0140] In an exemplary embodiment, a data update system is provided. The system includes a first device and a second device. The first device is configured to execute the method executed by the first device in FIG. 4 , and the second device is configured to execute the method executed by the second device in FIG. 4 .
[0141] In an exemplary embodiment, a computer program (product) is provided. The computer program (product) includes: computer program code. When the computer program code is executed by a computer, the computer is caused to perform the method shown in FIG. 4 .
[0142] In an exemplary embodiment, a computer-readable storage medium is provided. The computer-readable storage medium stores a program or instruction. When the program or instruction runs on a computer, the computer executes the method shown in FIG. 4 .
[0143] In an exemplary embodiment, a chip is provided, including a processor for calling and executing instructions stored in a memory, so that a computer equipped with the chip executes the method shown in FIG. 4 .
[0144] In an exemplary embodiment, another chip is provided, including: an input interface, an output interface, a processor and a memory. The input interface, the output interface, the processor and the memory are connected through an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the computer equipped with the chip executes the method shown in Figure 4.
[0145] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).
[0146] In this application, the terms "first," "second," and the like are used to distinguish between identical or similar items having substantially the same function or effect. It should be understood that "first," "second," and "nth" do not have a logical or temporal dependency, nor do they limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," and the like to describe various elements, these elements should not be limited by these terms. These terms are simply used to distinguish one element from another.
[0147] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0148] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, "plurality of second devices" means two or more second devices. The terms "system" and "network" are often used interchangeably herein.
[0149] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0150] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the listed items. The term "and / or" describes an association between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this application generally indicates that the associated objects are in an "or" relationship.
[0151] It should also be understood that the terms “if” and “if” may be interpreted to mean “when” or “upon” or “in response to determining” or “in response to detecting.” Similarly, the phrases “if it is determined that ” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining ” or “in response to determining ” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event],” depending on the context.
[0152] The above description is merely an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for updating data, characterized in that: The method is applied to a first device, and the method includes: Acquire first data and second data, the first data comprising data obtained by compressing third data by at least a first compression method and a second compression method in sequence, the second data comprising data obtained by compressing fourth data by at least the first compression method and the second compression method in sequence, the fourth data being updated based on the third data; Decompress the first data and the second data respectively based on a first decompression method corresponding to the second compression method to obtain a first decompression result and a second decompression result, wherein the first decompression result includes first intermediate data obtained based on the first data, and the second decompression result includes second intermediate data obtained based on the second data; determining first differential data between the second intermediate data and the first intermediate data; The first differential data is sent, where the first differential data is used to update the first data in the second device.
2. The method according to claim 1, characterized in that The first decompression result also includes first reference data corresponding to the first data, the first reference data being data referenced in a process of compressing the first intermediate data using the second compression method to obtain the first data, and the second decompression result also includes second reference data corresponding to the second data, the second reference data being data referenced in a process of compressing the second intermediate data using the second compression method to obtain the second data; After determining the first difference data between the second intermediate data and the first intermediate data, the method further includes: Determining reference data corresponding to the first differential data according to the first differential data, the first reference data, and the second reference data; The reference data is sent, where the reference data is used to update the first data in the second device.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Obtain a first data packet including at least one first compressed data and a second data packet including at least one second compressed data, wherein the first data is first compressed data in the first data packet that is different from the at least one second compressed data, and the second data is second compressed data in the second data packet that is different from the at least one first compressed data.
4. The method according to any one of claims 1 to 3, characterized in that: After sending the first differential data, the method further includes: Acquire fifth data and sixth data, wherein the fifth data is of a different type from the first data, and the sixth data is of a different type from the second data; determining second differential data between the fifth data and the sixth data; The second differential data is sent, where the second differential data is used to update fifth data in the second device.
5. A method for updating data, characterized in that: The method is applied to a second device, and the method includes: receiving first differential data corresponding to the first data; Acquire first data in the second device, where the first data in the second device includes data obtained by compressing third data by at least sequentially using a first compression method and a second compression method; decompressing the first data in the second device based on a first decompression method corresponding to the second compression method to obtain a first decompression result, wherein the first decompression result includes first intermediate data obtained based on the first data in the second device; The first data in the second device is updated according to the first intermediate data and the first differential data.
6. The method according to claim 5, characterized in that The updating of the first data in the second device according to the first intermediate data and the first differential data includes: updating the first intermediate data according to the first differential data to obtain third intermediate data; compressing the third intermediate data based on the second compression method to obtain seventh data; The first data in the second device is updated to the seventh data.
7. The method according to claim 5, characterized in that The updating of the first data in the second device according to the first intermediate data and the first differential data includes: updating the first intermediate data according to the first differential data to obtain third intermediate data; According to the reference data corresponding to the first differential data, the third intermediate data is compressed based on the second compression method to obtain seventh data; The first data in the second device is updated to the seventh data.
8. The method according to claim 6 or 7, characterized in that: After the first data in the second device is updated to the seventh data, the method further includes: updating the fifth data in the second device according to the second differential data corresponding to the fifth data to obtain the eighth data, wherein the fifth data in the second device is of a different type from the first data in the second device; The fifth data in the second device is updated to the eighth data.
9. A data updating device, characterized in that: The device is applied to a first device, and includes: an acquisition module, configured to acquire first data and second data, wherein the first data includes data obtained by compressing third data by at least a first compression method and a second compression method in sequence, and the second data includes data obtained by compressing fourth data by at least the first compression method and the second compression method in sequence, and the fourth data is updated based on the third data; a decompression module, configured to decompress the first data and the second data respectively based on a first decompression method corresponding to the second compression method, to obtain a first decompression result and a second decompression result, wherein the first decompression result includes first intermediate data obtained based on the first data, and the second decompression result includes second intermediate data obtained based on the second data; A determination module, configured to determine first differential data between the second intermediate data and the first intermediate data; The sending module is used to send the first differential data, where the first differential data is used to update the first data in the second device.
10. A data updating device, characterized in that: The device is applied to a second device, and includes: A receiving module, used for receiving first differential data corresponding to the first data; an acquisition module, configured to acquire first data in the second device, wherein the first data in the second device includes data obtained by compressing third data by at least sequentially using a first compression method and a second compression method; a decompression module, configured to decompress the first data in the second device based on a first decompression method corresponding to the second compression method to obtain a first decompression result, wherein the first decompression result includes first intermediate data obtained based on the first data in the second device; An updating module is used to update the first data in the second device according to the first intermediate data and the first differential data.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the instruction is loaded and executed by the processor to implement the data updating method described in any one of claims 1-8.
12. A computer program product, characterized in that The computer program product includes a computer program or instructions, and the computer program or instructions are executed by a processor to enable a computer to implement the data updating method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data updating method, device and equipment and computer readable storage medium
CN119311701A
Incremental file generating method, and application program installing file updating method and device
CN103713928A
Update package generation method and mobile terminal
CN108491225A
Updating method, fusion method, and related devices of application program installation packages
CN108519884A
Application program updating method and device, equipment and storage medium
CN113031988A