An OTA differential method based on size matrix cutting
By optimizing the OTA differential method through large and small matrix cutting and compression algorithms, the problems of inaccurate data and diverse packet formats in OTA differential upgrades are solved, and efficient and accurate differential upgrades are achieved.
Patent Information
- Application Number
- CN202211007831.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-22
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-08-22
AI Technical Summary
Existing OTA differential upgrade methods suffer from insufficient accuracy in differential data, resulting in excessive invalid upgrade data, and are difficult to adapt to diverse upgrade package formats.
The source and target files are split using a large and small matrix splitting method. The small matrix is used to calculate feature values to filter out identical data, while the large matrix is used for difference. The difference results are optimized by combining compression algorithms to adapt to diverse upgrade package formats.
It improves the accuracy of differential data, reduces the amount of upgrade data, adapts to diverse upgrade package formats, and enhances upgrade efficiency and the cost-effectiveness of data transmission.
Smart Images

Figure CN115454481B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of differential upgrading, and more particularly to an OTA differential method and system based on size matrix cutting and a computer readable storage medium. BACKGROUND
[0002] With the rapid development of computer hardware and software technology today, computer hardware resources also become larger with the support of software requirements. It can also be said that the richness of hardware resources makes the expansion of software data free. However, network speed is still a bottleneck for cloud devices to customer terminal devices. Often, a software upgrade is as large as several G of updates, and the waiting time for downloading and upgrading is too long. This makes users headache and helpless. Since network transmission is limited by the bandwidth of today's network, it cannot be better solved. How to reduce the amount of data transmission and the amount of invalid upgrade data installation can be tried. Especially in common vehicle terminal devices, the single use time is not long, which leads to a large upgrade package that cannot be downloaded in a short time, and also leads to excessive consumption of data traffic of the vehicle-mounted device. At the same time, the large data package and long upgrade time are also a big pain point of vehicle upgrade, which greatly increases the probability of vehicle upgrade failure. There are some binary data differential response methods in the market at present, but they cannot completely solve the current difficulties.
[0003] The current OTA differential upgrade has the following defects: 1. The differential data is not accurate enough, resulting in too much invalid upgrade data in the data package and an ideal data package size. 2. Upgrade data package diversification: various types of devices and various upgrade methods, resulting in possible forms of upgrade package including folders, partition images, single files, multiple files, bin file upgrades to executable partitions, etc., making it difficult for a single differential tool in the current application to cope.
[0004] The prior art discloses a method and system for realizing compressed version upgrade by version segmentation, which comprises the following steps: segmenting the original version file into old small version files; individually compressing the old small version files and continuously storing and building BIN files, and burning to the device storage area; segmenting the new version file into new small version files; performing differential on the new and old small version files to obtain a differential upgrade package; sequentially decompressing, differential upgrading, compressing and updating and replacing the old small version files. Although the prior art cuts the target file and then performs differential, it does not solve the problem of inaccurate differential data and the inability of differential tools to meet the diversification of upgrade data packages. SUMMARY
[0005] The application provides an OTA differential method and system based on size matrix cutting and a computer readable storage medium, improves differential data accuracy, and can adapt to diversified upgrade data packets.
[0006] The primary object of the application is to solve the above technical problems, and the technical scheme of the application is as follows:
[0007] The first aspect of the application provides an OTA differential method based on size matrix cutting, comprising the following steps:
[0008] S1: cutting the source file and the target file by using a small matrix to obtain corresponding matrix data blocks, and the file data reading window size of the small matrix is a first window value;
[0009] S2: calculating the eigenvalues of the matrix data blocks of the source file and the target file respectively, constructing a source data feature table and a target data feature table, and filtering out the same small matrix blocks in the target file and the source file by comparing the two feature tables;
[0010] S3: marking the positions of the blank matrix in the target file and the small matrix blocks respectively;
[0011] S4: rearranging the marked target file and the source file, and performing data difference on the differential data by using a large matrix, and the file data reading window size of the large matrix is a second window value.
[0012] Further, the second window value is greater than the first window value.
[0013] Further, if the target file is a non-standard aligned file, the remaining non-complete blocks after cutting the target file by using the small matrix are marked, the non-complete blocks are marked as non-complete matrix blocks, the non-complete matrix blocks are put into the differential upgrade package in a high compression mode, and are written into the end position of the target file during upgrading, and the non-standard aligned file refers to a file whose size is a non-integer multiple of the size of the small matrix.
[0014] Further, if the target file is a mirror file, the data in the mirror file is arranged according to the matrix data block size of the file system, and the starting position is an integer multiple of the matrix data block size.
[0015] Further, when performing data difference on the differential data by using the large matrix, a compression algorithm is added to the Bsdiff algorithm to compress the differential result and reduce the size of the differential data result; at the same time, the target data in the target file is highly compressed, and the differential data result is compared with the data compression result, if the data compression result is smaller than the differential data result, the corresponding data segment is marked as a compression state, otherwise the corresponding data segment is marked as a differential state.
[0016] Further, the folder is also subjected to difference, and the specific steps are as follows:
[0017] The source file directory and the target file directory are subjected to tree structure scanning, and then the tree structures of the two directories are compared, the tree directory is converted into flat data, in the flat directory tree comparison structure, the first object of each comparison data group is used as the file information record in the source file directory, and the second object is used as the file information record in the target file directory.
[0018] A. When the first object is empty and the second object is not empty, it indicates that new content is added, if the added content is a normal file, a high compression algorithm is used to collect the file pointed to by the second object into the upgrade package, if the added content is a folder or a soft connection file, the attribute and the responding permission are recorded;
[0019] B. When the first object is not empty and the second object is empty, it indicates that the content needs to be deleted;
[0020] C. When the first object and the second object are not empty, it indicates that the content needs to be subjected to difference, if the target is a folder or a soft connection, it is marked (in the flat structure, the rechecking logic caused by folder recursion can be avoided;
[0021] If the target is a normal file, the data difference is carried out by using steps S1-S4, and the user attribute and the read-write permission of the file are recorded.
[0022] The second aspect of the present application provides an OTA difference system based on size matrix cutting, comprising:
[0023] A target file cutting module is used for cutting the source file and the target file by using a small matrix to obtain corresponding matrix data blocks, and the file data reading window size of the small matrix is a first window value;
[0024] A difference filtering module is used for calculating the eigenvalues of the matrix data blocks of the source file and the target file respectively, constructing a source data eigenvalue table and a target data eigenvalue table, filtering out the same matrix small blocks in the target file and the source file by comparing the two eigenvalue tables;
[0025] A marking module is used for marking the positions of the blank matrices in the target file and the matrix small blocks;
[0026] A data difference processing module is used for rearranging the target file and the source file after marking, and carrying out data difference on the difference data by using a large matrix, and the file data reading window size of the large matrix is a second window value.
[0027] Further, if the target file is a non-standard alignment file, mark the non-complete block left after cutting the target file by a small matrix, mark the non-complete block as a non-complete matrix block, put the non-complete matrix block into a differential upgrade package in a highly compressed manner, and decompress and write into the end position of the target file during upgrade, the non-standard alignment file is a non-integer multiple of the size of the small matrix.
[0028] Further, if the target file is a mirror file, the data in the mirror is arranged according to the matrix data block size of the file system, and the starting position is an integer multiple of the matrix data block size.
[0029] The third aspect of the present application provides a computer readable storage medium, the computer readable storage medium comprises an OTA differential method based on size matrix cutting program, the OTA differential method based on size matrix cutting program is executed by the processor, the steps of the OTA differential method based on size matrix cutting are realized.
[0030] Compared with the prior art, the beneficial effects of the technical scheme of the present application are:
[0031] The present application cuts the source file and the target file by a small matrix, and establishes a data feature table to complete data screening by calculating the characteristics of each cutting block, and filters out the differential data that needs to be differentiated. Then cut by a large matrix, and perform differential operation on the cutting result. The precision of the differential operation is improved, and it is suitable for all ordinary file types at present, and a differential application mode suitable for diversified upgrade data packets is derived. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 It is a kind of OTA differential method based on size matrix cutting of the present application.
[0033] Figure 2 It is the OTA differential algorithm principle diagram in prior art.
[0034] Figure 3 It is the file data structure analysis diagram obtained by small matrix abstract calculation of the source file and the target file of the present application.
[0035] Figure 4 It is the schematic diagram of the differential data, the same data, the blank data and the non-complete data block rearranged after small matrix cutting screening of the present application.
[0036] Figure 5 It is the schematic diagram of large matrix cutting differential of the present application.
[0037] Figure 6 It is the folder differential flow chart of the present application.
[0038] Figure 7 This is a block diagram of the OTA differential system based on large and small matrix cutting according to the present invention. Detailed Implementation
[0039] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0040] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0041] Example 1
[0042] like Figure 1 As shown, the first aspect of the present invention provides an OTA difference method based on large and small matrix cutting, comprising the following steps:
[0043] S1: Use a small matrix to cut the source file and the target file to obtain matrix data blocks, wherein the file data reading window size of the small matrix is the first window value;
[0044] It should be noted that, as Figure 2 As shown, common single-function OTA differential algorithms in existing technologies typically perform simple segmentation on a single file and then use the Bsdiff algorithm to differentially divide the different segments. While this approach produces some invalid data when processing small upgrade files, the amount of invalid data is small, thus having minimal impact on performance, efficiency, and upgrade packages. However, when processing large partition image files (such as ext4 or qnx6, or zip packages compressed in storage mode; note that the differential algorithm's handling of compressed files is related to the compression ratio—the higher the compression ratio, the higher the file obfuscation level, and the lower the differential efficiency), it results in a large number of segments and the inability to identify aligned data, leading to low differential efficiency. Furthermore, a large amount of blank data is differentially divided.
[0045] In this invention, both the small matrix and the large matrix represent sliding windows for reading file data. The difference between the small matrix and the large matrix is that the small matrix is suitable for detailed reading and analysis, while the large matrix is suitable for differential comparison of filtered differential data.
[0046] This invention first uses a small matrix to segment the target file to obtain matrix data blocks. The file data reading window size of the small matrix is a first window value, which has no specific size limit and is an adjustable variable. It is usually an integer multiple of 4 bytes, and commonly used values are 1K, 4K, etc.
[0047] S2: respectively calculate eigenvalues of the source file and the target file matrix data block, build a source data feature table and a target data feature table, filter out the same matrix small block in the target file by comparing the two feature tables;
[0048] It should be noted that after obtaining the matrix data block, the eigenvalues are calculated by calculating the matrix data block, for example, md5 value calculation and sha256 value calculation of the data, both of which can express the characteristics of the corresponding data block. In the present application, the characteristics of the data read each time are calculated, and the source data feature table and the target data feature table are established. Then, by comparing the two feature tables, the corresponding relationship of the same data in the source file and the target file is obtained, and the same matrix small block in the target file is filtered out.
[0049] As shown in Figure 3 The file data structure analysis diagram obtained by small matrix digest calculation of the source file and the target file is shown.
[0050] S3: mark the position of the blank matrix in the target file and the matrix small block;
[0051] It should be noted that the position of the blank matrix in the target file and the matrix small block are marked, and the corresponding position in the source file can be directly obtained from the marked position during restoration. In this way, only the marked position needs to be recorded in the target file (i.e. the upgrade file) without recording the specific data content, which greatly reduces the size of the upgrade file. Similarly, the blank matrix only needs to record the marked position without writing "0" data into the upgrade file. During upgrading, only the marked blank block position needs to be filled with "0" value.
[0052] If the target file is a non-standard alignment file, the remaining non-complete block after cutting the target file by the small matrix is marked, and the non-complete block is recorded as a non-complete matrix block. The non-complete matrix block is put into the differential upgrade package in a highly compressed manner, and is decompressed and written into the end position of the target file during upgrading. The non-standard alignment file refers to a file whose size is not an integer multiple of the size of the small matrix.
[0053] If the target file is an image file, the data in the image is arranged according to the matrix data block size of the file system, and the starting position is an integer multiple of the matrix data block size. Therefore, the small matrix size is set to the block size when processing the partition image file, which has very high differential efficiency.
[0054] As shown in Figure 4 The diagram of the differential data, the same data, the blank data, and the non-complete data block after the small matrix cutting and screening is shown.
[0055] S4: Rearranging the marked target file and the source file, and performing data difference on the difference data using a large matrix with a file data reading window size of a second window value.
[0056] It should be noted that the second window value size of the large matrix is not particularly limited, and is a variable that can be adjusted, and is usually a multiple of 4 bytes and larger than the small matrix window. Commonly used are 10M, 50M, 100M, 200M, etc. The second window value is larger than the first window value. When the large matrix is used to perform data difference on the difference data, a compression algorithm is added in the Bsdiff algorithm to compress the difference result and reduce the size of the difference data result. At the same time, the target data in the target file is highly compressed, and the difference data result is compared with the data compression result. If the data compression result is smaller than the difference data result, the corresponding data segment is marked as a compression state, otherwise the corresponding data segment is marked as a difference state. As shown in the figure of large matrix cutting difference. Figure 5
[0057] It should be noted that the conventional OTA difference algorithm is usually difficult to reuse in response to various complex situations. It is necessary to write a specific corresponding processing method in the corresponding application scene: for example, 1. When multiple files are differentiated, a file difference list needs to be written, and the files are restored one by one in the order of the list. However, when facing multiple files that change at any time, the maintenance difficulty of this control list will quickly increase. 2. In the case of mixed upgrade of partition image and folder difference, the conventional OTA difference algorithm upgrade cannot well handle the image file and maintain the folder level relationship.
[0058] In the present application, the cutting difference of large and small matrices is adopted, and the non-complete blocks are specially marked, so that the present application can process the block-aligned file system image (partition image, the size of the source file and the target file is usually consistent, and must be an integer multiple of the block size) with high performance, and can also process ordinary files with different file sizes. On this basis, the present application can realize the difference restoration logic for ordinary files (including binary executable Bin files) to a specified partition. Therefore, the present application can support three kinds of conventional difference restoration scenes: restoring a partition image file to a device partition, restoring an ordinary file to an ordinary file, and restoring an ordinary file to a device partition.
[0059] It should be noted that the above difference method can be used for the difference of image files, ordinary files, and multiple files. The present application also proposes a specific method for differentiating folders. It should be noted that when differentiating and restoring a folder, most of the time, the folder level relationship, the properties of the internal files, and the corresponding read and write permissions, etc. (for example: when differentiating and upgrading two different versions of software) need to be absolutely preserved. As shown in Figure 6 The specific process is shown as follows:
[0060] The tree structure of the source file directory and the target file directory is scanned, and then the tree structures of the two directories are compared to complete the conversion of the tree directory to the flat data, in the flat directory tree comparison structure, the first object of each set of comparison data is used as the file information record in the source file directory, and the second object is used as the file information record in the target file directory;
[0061] A. When the first object is empty and the second object is not empty, it indicates that new content is added, if the new content is a normal file, the height compression algorithm is used to include the file pointed to by the second object into the upgrade package, if the new content is a folder or a soft connection file, the attribute and the responding permission are recorded;
[0062] B. When the first object is not empty and the second object is empty, it indicates that the content needs to be deleted;
[0063] C. When the first and second objects are not empty, it indicates that the content needs to be processed differently, if the target is a folder or a soft connection, the mark is made (in the flat structure, the recheck logic caused by the folder recursion can be avoided;
[0064] If the target is a normal file, the data difference is performed by using steps S1-S4, and the user attribute and the read-write permission of the file are recorded.
[0065] As shown in the figure, Figure 7 The second aspect of the present application provides an OTA difference system based on size matrix cutting, which comprises:
[0066] The target file cutting module 701 is used for cutting the source file and the target file by using a small matrix to obtain corresponding matrix data blocks, and the file data reading window size of the small matrix is a first window value;
[0067] It should be noted that, Figure 2 As shown in the figure, the common OTA difference algorithm in the prior art has a single function, which is usually used for simple segmented cutting of a single file, and then the bsdiff algorithm is used for segment-by-segment difference of different segments. This way, when processing small upgrade files, although there is some invalid data, the amount of invalid data is small, so the performance and efficiency and the upgrade package are less affected. However, when processing large partition image files (such as ext4 or qnx6, zip package compressed in storage mode, note: the processing of the difference algorithm for compressed files is related to the compression ratio, the higher the compression ratio, the higher the confusion degree of the file, and the lower the difference efficiency), the number of segments will be large, and the aligned data cannot be identified, resulting in low difference efficiency, and a large amount of blank data will be differentiated.
[0068] The small matrix and the large matrix in the application both represent a sliding window for file data reading, and the difference between the small matrix and the large matrix is that the small matrix is suitable for detailed reading and analysis, and the large matrix is suitable for differential comparison of differential data after screening.
[0069] The application cuts the target file to obtain a matrix data block by using a small matrix, wherein the file data reading window size of the small matrix is a first window value, and the first window value is not limited in size and is a variable. Usually, the first window value is an integer multiple of 4 bytes, and is commonly 1K, 4K, etc.
[0070] The differential filtering module 702 is configured to calculate feature values of the matrix data blocks of the source file and the target file respectively, construct a source data feature table and a target data feature table, and filter out the same matrix small blocks in the target file and the source file by comparing the two feature tables.
[0071] It should be noted that, after obtaining the matrix data block, the feature value of the matrix data block is calculated, for example, the md5 value calculation and the sha256 value calculation of the data, both of which can express the features of the corresponding data block. In the application, the feature of the data read by the small matrix each time is calculated, and the source data feature table and the target data feature table are constructed. Then, the corresponding relationship of the same data in the source file and the target file is obtained by comparing the two feature tables, and the same matrix small blocks in the target file and the source file are filtered out.
[0072] As shown in FIG. 1, the application comprises a file reading module 701, a differential filtering module 702, a marking module 703, and a file restoring module 704. Figure 3 As shown in FIG. 2, it is a file data structure analysis diagram obtained by performing small matrix summary calculation on the source file and the target file.
[0073] The marking module 703 is configured to mark the position of the blank matrix in the target file and the matrix small block.
[0074] It should be noted that, the position of the blank matrix in the target file and the matrix small block are marked, and the corresponding position in the source file can be directly obtained from the marked position during restoration. In this way, only the marked position needs to be recorded in the target file (i.e., the upgrade file) instead of the specific data content, so that the size of the upgrade file is greatly reduced. Similarly, the blank matrix only needs to record the marked position instead of writing “0” data into the upgrade file, and only the marked blank block position needs to be filled with “0” value during upgrading.
[0075] If the target file is a non-standard alignment file, a small matrix is used to mark the remaining non-complete block after cutting the target file, and the non-complete block is marked as a non-complete matrix block. The non-complete matrix block is placed in a differential upgrade package using a high compression method, and is decompressed and written to the end of the target file during upgrading. The non-standard alignment file refers to a file size that is a non-integer multiple of the size of a small matrix.
[0076] If the target file is a mirror file, the data in the mirror is arranged according to the matrix data block size of the file system, and the starting position is an integer multiple of the matrix data block size. Therefore, when processing a partition mirror file, the small matrix size is set to the block size, and the differential efficiency is very high.
[0077] As shown in Figure 4 FIG. 1 shows the differential data, identical data, blank data, and non-complete data block after rearrangement after cutting and screening of a small matrix.
[0078] The data difference processing module 704 is configured to rearrange the marked target file and the source file, and perform data difference on the differential data using a large matrix. The file data reading window size of the large matrix is a second window value.
[0079] It should be noted that the second window value is greater than the first window value. When performing data difference on the differential data using a large matrix, a compression algorithm is added to the Bsdiff algorithm to compress the differential result and reduce the size of the differential data result. At the same time, the target data in the target file is highly compressed. Compared with the differential data result, if the data compression result is smaller than the differential data result, the corresponding data segment is marked as a compression state, otherwise the corresponding data segment is marked as a differential state. As shown in Figure 5 FIG. 2 shows a large matrix cutting and differential diagram.
[0080] It should be noted that the conventional OTA differential algorithm is usually difficult to reuse when dealing with various complex situations. It is necessary to write a specific corresponding processing method in the corresponding application scenario: for example, 1. When multiple files are differentiated, a file difference list needs to be written, and the files are restored one by one in the order of the list. However, when facing multiple file differences that change at any time, the maintenance difficulty of this control list method will quickly increase. 2. In the case of mixed upgrading of partition images and folders, the conventional OTA differential algorithm upgrade cannot well handle image files and maintain folder hierarchy.
[0081] The cutting difference of the size matrix is adopted in the application, and the non-complete block is specially marked, so that the application can process the file system image (partition image) aligned with the block with high performance (the size of the source file and the target file is usually consistent, and is an integer multiple of the block size), and can also process the ordinary file with size difference. On this basis, the application can realize the differential restoration logic of the ordinary file (including binary executable Bin file) to the specified partition. Therefore, the application can support three kinds of conventional differential restoration scenes: partition image file restoration to device partition, ordinary file restoration to ordinary file, and ordinary file restoration to device partition.
[0082] It should be noted that the above differential method can be used for differential of image files, ordinary files, and multiple files. The application also proposes a specific method for differential of folders. It should be noted that when restoring the differential of the folder, most of the time, the folder hierarchy relationship, the internal file attributes, and the corresponding read-write permissions, etc. need to be absolutely reserved (for example, when differentiating and upgrading two different versions of software). The specific process is as follows:
[0083] The source file directory and the target file directory are scanned in a tree structure, and then the tree structures of the two directories are compared to complete the conversion of the tree directory to the flat data. In the flat directory tree comparison structure, the first object of each comparison data group is used as the file information record in the source file directory, and the second object is used as the file information record in the target file directory.
[0084] A. When the first object is empty and the second object is not empty, it indicates that new content is added. If the new content is an ordinary file, the height compression algorithm is used to include the file pointed to by the second object into the upgrade package. If the new content is a folder or a soft link file, the attributes and the corresponding permissions are recorded.
[0085] B. When the first object is not empty and the second object is empty, it indicates that the content needs to be deleted.
[0086] C. When the first and second objects are not empty, it indicates that the content needs to be processed differently. If the target is a folder or a soft link, it is marked (in this flat structure, the recheck logic caused by folder recursion can be avoided.
[0087] If the target is an ordinary file, the data difference is performed by using steps S1-S4, and the user attributes and read-write permissions of the file are recorded.
[0088] The third aspect of the present application provides a computer readable storage medium, wherein the computer readable storage medium comprises a program of OTA differential method based on size matrix cutting, and the program of OTA differential method based on size matrix cutting is executed by a processor to implement the steps of the OTA differential method based on size matrix cutting.
[0089] Obviously, the above embodiments of the present application are only examples for clearly illustrating the present application, and are not intended to limit the implementation modes of the present application. Based on the above description, other different forms of changes or variations can be made by those skilled in the art. Here, all the implementation modes are not required or can not be exhausted. Any modification, equivalent replacement and improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the claims of the present application.
Claims
1. An OTA differential method based on size matrix cutting, characterized in that, The method comprises the following steps: S1: cutting the source file and the target file by using a small matrix to obtain corresponding matrix data blocks, wherein a file data reading window size of the small matrix is a first window value; S2: calculating eigenvalues of the source file and the target file matrix data blocks respectively, constructing a source data feature table and a target data feature table, and filtering out the same small matrix blocks in the target file and the source file by comparing the two feature tables; S3: marking the positions of the blank matrix and the small matrix blocks in the target file, so that the corresponding positions in the source file can be directly obtained from the marked positions during restoration; S4: rearranging the marked target file and the source file to place the blank matrix at the end of the file, and performing data difference on the differential data by using a large matrix, wherein a file data reading window size of the large matrix is a second window value; The second window value is greater than the first window value, and the small matrix and the large matrix both represent a sliding window for file data reading.
2. The method of claim 1, wherein, If the target file is a non-standard aligned file, the remaining non-complete blocks after cutting the target file by using the small matrix are marked as non-complete matrix blocks, the non-complete matrix blocks are placed in a differential upgrade package in a highly compressed manner, and are decompressed and written into the end position of the target file during upgrading, wherein the non-standard aligned file refers to a file whose size is not an integer multiple of the size of the small matrix.
3. The method of claim 1, wherein the size matrix is cut into a plurality of sub-matrices. If the target file is an image file, the data in the image is arranged according to the matrix data block size of the file system, and the starting position is an integer multiple of the matrix data block size.
4. The method of claim 1, wherein the size matrix is cut into a plurality of sub-matrices. When the large matrix is used to perform data difference on the differential data, a compression algorithm is added to the Bsdiff algorithm to compress the difference result and reduce the size of the difference data result; meanwhile, the target data in the target file is highly compressed, and the difference data result is compared with the data compression result; if the data compression result is smaller than the difference data result, the corresponding data segment is marked as a compression state, otherwise, the corresponding data segment is marked as a difference state.
5. The method of claim 1, wherein the method is based on size matrix cut OTA differential method. The method also comprises performing difference on a folder, and the specific steps are as follows: Scanning the source file directory and the target file directory in a tree structure, then comparing the tree structures of the two directories, and completing the conversion of the tree directory into flat data, wherein the first object of each group of comparison data in the flat directory comparison structure is used as the file information record in the source file directory, and the second object is used as the file information record in the target file directory; A. When the first object is empty and the second object is not empty, it indicates that new content is added, if the new content is a normal file, the second object pointed to by the file is included into the upgrade package by using a highly compressed algorithm, if the new content is a folder or a soft connection file, the attribute and the corresponding permission are recorded; B. When the first object is not empty and the second object is empty, it indicates that the content needs to be deleted; C. When the first object and the second object are both not empty, it indicates that the content needs to be processed differently, if the target is a folder or a soft connection, the folder is marked, and in the flat structure, the rechecking logic caused by folder recursion can be avoided. If the target file is a normal file, data difference is performed by steps S1-S4, and the user attributes and read-write permissions of the file are recorded.
6. An OTA differential system based on size matrix cutting, said system being used to implement the method according to any one of claims 1 to 5, characterized in that, Comprise: The target file cutting module is used for cutting the source file and the target file by using a small matrix to obtain corresponding matrix data blocks, and a file data reading window size of the small matrix is a first window value; The difference filtering module is used for calculating eigenvalues of the matrix data blocks of the source file and the target file respectively, constructing a source data eigenvalue table and a target data eigenvalue table, filtering out the same matrix small blocks in the target file and the source file by comparing the two eigenvalue tables; The marking module is used for marking the positions of the blank matrices in the target file and the matrix small blocks respectively; The data difference processing module is used for rearranging the target file and the source file after marking, and performing data difference on the differential data by using a large matrix, and a file data reading window size of the large matrix is a second window value; The second window value is greater than the first window value.
7. The OTA differential system based on size matrix cutting according to claim 6, characterized in that, If the target file is a non-standard alignment file, the non-complete blocks remaining after the target file is cut by the small matrix are marked, the non-complete blocks are recorded as non-complete matrix blocks, the non-complete matrix blocks are put into the upgrade file in a highly compressed manner, and are written into the end position of the target file during the upgrade, and the non-standard alignment file is a file whose size is a non-integer multiple of the size of the small matrix.
8. The OTA differential system based on size matrix cutting according to claim 6, wherein, If the target file is a mirror file, the data in the mirror is arranged according to the matrix data block size of the file system, and the starting position is an integer multiple of the matrix data block size.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises an OTA difference method program based on size matrix cutting, and when the OTA difference method program based on size matrix cutting is executed by the processor, the steps of the OTA difference method based on size matrix cutting in any one of claims 1 to 5 are realized.
Citation Information
Patent Citations
Differential packet generation method, differential packet generation equipment and upgrading method
CN113721967A
Method and Device for Making Differential Upgrade Package, and Method and Device for System Differential Upgrading
US20160321063A1